From ca4551ee27cdb760544419924e2aab0851936bef Mon Sep 17 00:00:00 2001 From: Davide Bongiovanni Date: Fri, 9 Nov 2018 22:04:13 +0100 Subject: [PATCH 1/4] Removed unnecessary pprint --- parts/server.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/parts/server.py b/parts/server.py index cd60df4..ef1fea6 100644 --- a/parts/server.py +++ b/parts/server.py @@ -11,9 +11,6 @@ from PIL import Image, ImageDraw from io import BytesIO from werkzeug.utils import secure_filename -import pprint -pp = pprint.PrettyPrinter(indent=4) - app = Flask(__name__) db_engine = {} From aca3f205b84fa82648f763eb0e8283a2095e8719 Mon Sep 17 00:00:00 2001 From: Davide Bongiovanni Date: Fri, 9 Nov 2018 22:05:13 +0100 Subject: [PATCH 2/4] Adjusted image height params --- parts/static/style.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parts/static/style.css b/parts/static/style.css index ca3fa2e..7600153 100644 --- a/parts/static/style.css +++ b/parts/static/style.css @@ -370,6 +370,7 @@ table#details #datasheet-head td { .overlay img#map { position: absolute; right: 5%; - top: 5%; - height: 90%; + bottom: 5%; + height: calc(90% - 42pt); + max-width: 50%; } \ No newline at end of file From 35d88de4e5ed06326fe628438cdaf4ce427306e3 Mon Sep 17 00:00:00 2001 From: Davide Bongiovanni Date: Fri, 9 Nov 2018 22:19:36 +0100 Subject: [PATCH 3/4] Removed unnecessary comments --- parts/templates/partsearch.html | 35 --------------------------------- 1 file changed, 35 deletions(-) diff --git a/parts/templates/partsearch.html b/parts/templates/partsearch.html index 00ae34a..f277d4d 100644 --- a/parts/templates/partsearch.html +++ b/parts/templates/partsearch.html @@ -51,41 +51,6 @@ DATASHEET: - -
From 43e7a00a587d50af98e9d1471facaf90eff6f670 Mon Sep 17 00:00:00 2001 From: Davide Bongiovanni Date: Fri, 9 Nov 2018 22:20:13 +0100 Subject: [PATCH 4/4] Added datasheet download button --- parts/static/script.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/parts/static/script.js b/parts/static/script.js index 94da536..89488ef 100644 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -203,19 +203,17 @@ function show_part_info(partID) { $('table#details tr#location td').text(text_filter(data.name)); // name is the location friendly name $('table#details tr#partno td').text(text_filter(data.partno)); $('table#details tr#description td').text(text_filter(data.description)); - // $('#description-info').text(text_filter(data.description)); - // $('#quantity-info').text(text_filter(data.quantity)); - // $('#notes-info').text(text_filter(data.notes)); - // if (data.datasheet != null) - // $('#datasheet-info').html($('')); - // else - // $('#datasheet-info').text(' '); - // $('#edit-button').click(function() { - // init_edit(partID); - // }); - // $('#delete-button').click(function() { - // delete_entry(partID); - // }); + $('img#map').attr('src', 'parts/map/' + data.map); + if (data.datasheet != null) + $('tr#datasheet-head').html($('DATASHEET: ')); + else + $('tr#datasheet-head td').text('DATASHEET: '); + $('#edit-button').click(function() { + init_edit(partID); + }); + $('#delete-button').click(function() { + delete_entry(partID); + }); overlay_in(); }).fail(function() { console.log( "Fetching part info failed" );