diff --git a/app.py b/app.py
index 980cae2..fd73ff5 100644
--- a/app.py
+++ b/app.py
@@ -24,18 +24,20 @@ def save_number(tmp):
data2 = request.form.get('brick.color.name')
data3 = request.form.get('index')
number = request.form.get('numberInput')
+ is_spare = request.form.get('is_spare')
if number is not None:
print(data1)
print(data2)
print(number)
+ print(is_spare)
with open('./info/'+tmp+'.json') as info:
json_file = json.loads(info.read())
print(json_file['count'])
- data = '{"brick" : {"ID":"' + data1 + '","color_name": "' + data2 + '","amount":"' + number + '"}}'
+ data = '{"brick" : {"ID":"' + data1 + '","is_spare": "' + is_spare + '","color_name": "' + data2 + '","amount":"' + number + '"}}'
json_file['unit'][int(data3)]['bricks']['missing'].append(json.loads(data))
diff --git a/lego.py b/lego.py
index d039b30..24c3cc1 100644
--- a/lego.py
+++ b/lego.py
@@ -70,7 +70,7 @@ else:
logging.error('set_img_url: ' + set_num)
# set inventory
-response = json.loads(rebrick.lego.get_set_elements(set_num).read())
+response = json.loads(rebrick.lego.get_set_elements(set_num,page_size=20000).read())
with open(set_path+'inventory.json', 'w', encoding='utf-8') as f:
json.dump(response, f, ensure_ascii=False, indent=4)
diff --git a/templates/bootstrap_table.html b/templates/bootstrap_table.html
index b5512a8..269d879 100644
--- a/templates/bootstrap_table.html
+++ b/templates/bootstrap_table.html
@@ -1,7 +1,8 @@
{% extends "base.html" %}
{% block content %}
-
+Inventory
+
+
+ Spares
+
+
+
+ img |
+ element_id |
+ part_num |
+ name |
+ color |
+ qty |
+ {% for i in json_file['unit'] %}
+ Missing ({{ loop.index }}) |
+ {% endfor %}
+
+
+
+ {% for brick in inventory_file.results %}
+ {% if brick.is_spare == True %}
+
+ |
+ {{ brick.element_id }} |
+ {{ brick.part.part_num }} |
+ {{ brick.part.name }} |
+ {{ brick.color.name }} |
+ {{ brick.quantity }} |
+ {% for i in json_file['unit'] %}
+
+
+ {% set ns = namespace(count='') %}
+ |
{% endfor %}
+ {% endif %}
{% endfor %}
-
{% endblock %}