Modified a bunch of stuff I don't remember man come on

master
Davide Bongiovanni 6 years ago
parent 64a28c050a
commit 7ee2470d87

@ -44,7 +44,7 @@ def index():
@app.route('/parts/getpartinfo/<partID>') @app.route('/parts/getpartinfo/<partID>')
def get_part_info(partID): def get_part_info(partID):
s = 'select * from parts where id = :id;' s = 'select * from parts as p inner join locations as l on p.location_id=l.id where p.id = :id;'
r = db_engine.execute(text(s), id=partID) r = db_engine.execute(text(s), id=partID)
l = [] l = []
for row in r: for row in r:

@ -200,22 +200,22 @@ function delete_entry(partID) {
function show_part_info(partID) { function show_part_info(partID) {
$.getJSON('http://127.0.0.1:5000/parts/getpartinfo/' + partID, function(data) { $.getJSON('http://127.0.0.1:5000/parts/getpartinfo/' + partID, function(data) {
$('#block-info').text(text_filter(data.block)); $('table#details tr#location td').text(text_filter(data.name)); // name is the location friendly name
$('#type-info').text(text_filter(data.type)); $('table#details tr#partno td').text(text_filter(data.partno));
$('#partno-info').text(text_filter(data.partno) + ' ' + text_filter(data.partnoalt) + ' ' + text_filter(data.partnoalt2)); $('table#details tr#description td').text(text_filter(data.description));
$('#description-info').text(text_filter(data.description)); // $('#description-info').text(text_filter(data.description));
$('#quantity-info').text(text_filter(data.quantity)); // $('#quantity-info').text(text_filter(data.quantity));
$('#notes-info').text(text_filter(data.notes)); // $('#notes-info').text(text_filter(data.notes));
if (data.datasheet != null) // if (data.datasheet != null)
$('#datasheet-info').html($('<a href="http://127.0.0.1:5000/parts/getfile/' + data.datasheet.substring(0, data.datasheet.length - 4) + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>')); // $('#datasheet-info').html($('<a href="http://127.0.0.1:5000/parts/getfile/' + data.datasheet.substring(0, data.datasheet.length - 4) + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>'));
else // else
$('#datasheet-info').text(' '); // $('#datasheet-info').text(' ');
$('#edit-button').click(function() { // $('#edit-button').click(function() {
init_edit(partID); // init_edit(partID);
}); // });
$('#delete-button').click(function() { // $('#delete-button').click(function() {
delete_entry(partID); // delete_entry(partID);
}); // });
overlay_in(); overlay_in();
}).fail(function() { }).fail(function() {
console.log( "Fetching part info failed" ); console.log( "Fetching part info failed" );
@ -261,7 +261,7 @@ $(document).ready(function() {
perform_query(); perform_query();
}); });
$('.checkbox').change( function() { $('.checkbox').change( function() {
if ( !$('#type').is(':checked') if ( !$('#location').is(':checked')
&& !$('#partno').is(':checked') && !$('#partno').is(':checked')
&& !$('#description').is(':checked') && !$('#description').is(':checked')
&& !$('#notes').is(':checked')) && !$('#notes').is(':checked'))

@ -101,80 +101,10 @@ input[type=checkbox]:checked + label.toggle-btn {
color: #000F0F; color: #000F0F;
} }
.results {
margin-top: 5pt;
margin-left: 2pt;
margin-right: 2pt;
}
.results-row {
padding: 5pt;
font-size: 16pt;
}
.results-row:nth-child(2n+1) {
background-color: #5E9292;
}
.results-row div {
display: inline-block;
width: 16.7%;
margin-left: 6pt;
margin-right: 6pt;
}
.results-row .results-datasheet {
width: 5%;
text-align: center;
}
.results-row .results-notes {
width: 5%;
text-align: center;
}
.results-row .results-block {
width: 5%;
text-align: center;
}
.results-row .results-description {
width: 43.5%;
}
div label input { div label input {
margin-right:100px; margin-right:100px;
} }
.res-header, .res-header-3, .res-header-small {
display: inline-block;
/* Firefox */
margin-left: -moz-calc(0.2% - 4px);
/* WebKit */
margin-left: -webkit-calc(0.2% - 4px);
/* Opera */
margin-left: -o-calc(0.2% - 4px);
/* Standard */
margin-left: calc(0.2% - 4px);
background-color: #226666;
color: #D7E2E2;
padding: 0.6%;
border-radius: 2pt;
text-align: center;
}
.res-header {
width: 16.7%;
}
.res-header-small {
width: 5%;
}
.res-header-3 {
width: 43.5%;
}
.tooltip { .tooltip {
position: relative; position: relative;
display: inline-block; display: inline-block;
@ -232,23 +162,18 @@ div label input {
background-color: #226666; background-color: #226666;
color: #D7E2E2; color: #D7E2E2;
display: none; display: none;
height: 70%; height: 90%;
left: 20%; left: 20%;
padding: 0; padding: 0;
position: fixed; position: fixed;
top:5%; top:5% !important;
width: 60%; width: 60%;
z-index: 201; z-index: 201;
border-radius: 2pt; border-radius: 2pt;
text-align: center; text-align: center;
opacity: 0.0; opacity: 0.0;
} }
/*.details-row {
padding-top: 10pt;
padding-bottom: 10pt;
}*/
.details-item { .details-item {
display: inline-block; display: inline-block;
width: 25%; width: 25%;
@ -271,7 +196,7 @@ div label input {
.round-button { .round-button {
position: absolute; position: absolute;
bottom: 15pt; bottom: 15pt;
right: 15pt; left: calc(15% - 20pt);
width: 40pt; width: 40pt;
height: 32pt; height: 32pt;
border-radius: 20pt; border-radius: 20pt;
@ -284,7 +209,7 @@ div label input {
.round-button-left { .round-button-left {
position: absolute; position: absolute;
bottom: 15pt; bottom: 15pt;
right: 70pt; left: calc(30% - 20pt);
width: 40pt; width: 40pt;
height: 32pt; height: 32pt;
border-radius: 20pt; border-radius: 20pt;
@ -362,18 +287,89 @@ table#results td {
cursor: pointer; cursor: pointer;
} }
#location { table#results #location {
width: 15%; width: 15%;
} }
#partno { table#results #partno {
/*width: 20%;*/ /*width: 20%;*/
} }
#description { table#results #description {
width: 65%; width: 65%;
} }
#docs { table#results #docs {
width: 5%; width: 5%;
}
table#details {
position: absolute;
left: 0;
width: 45%;
margin-top: 4%;
}
table#details #location-head {
height: 10%;
color: #013A3A;
}
table#details #location {
height: 10%;
}
table#details #location td{
height: 10%;
}
table#details #partno-head {
height: 10%;
color: #013A3A;
}
table#details #partno-head td{
padding-top: 16pt;
}
table#details #partno{
height: 10%;
}
table#details #partno td{
height: 10%;
}
table#details #description-head {
height: 10%;
color: #013A3A;
}
table#details #description-head td {
padding-top: 16pt;
}
table#details #description {
height: 20%;
}
table#details #description td {
padding-left: 5%;
padding-right: 5%;
}
table#details #datasheet-head {
height: 10%;
color: #013A3A;
}
table#details #datasheet-head td {
padding-top: 16pt;
}
.overlay img#map {
position: absolute;
right: 5%;
top: 5%;
height: 90%;
} }

@ -21,7 +21,7 @@
<div class="filter-concontainertainer"> <div class="filter-concontainertainer">
<div class="filter-container"> <div class="filter-container">
<p>Search in:</p> <p>Search in:</p>
<input type="checkbox" class="checkbox" id="location"></input><label class="toggle-btn" for="type">Locations</label> <input type="checkbox" class="checkbox" id="location"></input><label class="toggle-btn" for="location">Locations</label>
<input type="checkbox" class="checkbox" id="partno" checked></input><label class="toggle-btn" for="partno">Part Number</label> <input type="checkbox" class="checkbox" id="partno" checked></input><label class="toggle-btn" for="partno">Part Number</label>
<input type="checkbox" class="checkbox" id="description" checked></input><label class="toggle-btn" for="description">Description</label> <input type="checkbox" class="checkbox" id="description" checked></input><label class="toggle-btn" for="description">Description</label>
<input type="checkbox" class="checkbox" id="notes" checked></input><label class="toggle-btn" for="notes">Notes</label> <input type="checkbox" class="checkbox" id="notes" checked></input><label class="toggle-btn" for="notes">Notes</label>
@ -41,8 +41,17 @@
<div class="shadow" onclick="overlay_out()"></div> <div class="shadow" onclick="overlay_out()"></div>
<div class="overlay"> <div class="overlay">
<h2>Part Details</h2> <h2>Part Details</h2>
<table id="details">
<div class="details-row"> <tr id="location-head"><td>LOCATION</td></tr>
<tr id="location"><td></td></tr>
<tr id="partno-head"><td>PART NUMBER</td></tr>
<tr id="partno"><td></td></tr>
<tr id="description-head"><td>DESCRIPTION</td></tr>
<tr id="description"><td></td></tr>
<tr id="datasheet-head"><td>DATASHEET: </td></tr>
</table>
<img src="" id="map"/>
<!-- <div class="details-row">
<div class="details-item">Location: block</div> <div class="details-item">Location: block</div>
<div class="details-content"><p id="block-info"></p></div> <div class="details-content"><p id="block-info"></p></div>
</div> </div>
@ -75,10 +84,10 @@
<div class="details-row"> <div class="details-row">
<div class="details-item">Datasheet</div> <div class="details-item">Datasheet</div>
<div class="details-content"><p id="datasheet-info"></p></div> <div class="details-content"><p id="datasheet-info"></p></div>
</div> </div> -->
<div class="round-button"><a href="#" id="edit-button"><i class="fa fa-pencil" aria-hidden="true"></i></a></div> <div class="round-button-left"><a href="#" id="edit-button"><i class="fa fa-pencil" aria-hidden="true"></i></a></div>
<div class="round-button-left"><a href="#" id="delete-button"><i class="fa fa-trash" aria-hidden="true"></i></a></div> <div class="round-button"><a href="#" id="delete-button"><i class="fa fa-trash" aria-hidden="true"></i></a></div>
<div class="small-square-button"><a href="#" onclick="overlay_out()"><i class="fa fa-times" aria-hidden="true"></i></a></div> <div class="small-square-button"><a href="#" onclick="overlay_out()"><i class="fa fa-times" aria-hidden="true"></i></a></div>
</div> </div>
<div class="round-floating-button"><a href="#" onclick="new_entry()"><i class="fa fa-plus" aria-hidden="true"></i></a></div> <div class="round-floating-button"><a href="#" onclick="new_entry()"><i class="fa fa-plus" aria-hidden="true"></i></a></div>

Loading…
Cancel
Save