Saving missing files
This commit is contained in:
parent
afe52011e4
commit
ff1c7e2ca1
4
app.py
4
app.py
@ -1,6 +1,6 @@
|
|||||||
from flask import Flask, request, jsonify, render_template
|
from flask import Flask, request, jsonify, render_template
|
||||||
import json
|
import json
|
||||||
|
from pprint import pprint as pp
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
tmp = '71386-10'
|
tmp = '71386-10'
|
||||||
@ -13,7 +13,7 @@ def index():
|
|||||||
inventory_file = json.loads(inventory.read())
|
inventory_file = json.loads(inventory.read())
|
||||||
with open('./info/'+tmp+'.json') as info:
|
with open('./info/'+tmp+'.json') as info:
|
||||||
json_file = json.loads(info.read())
|
json_file = json.loads(info.read())
|
||||||
|
pp(json_file['unit'][0]['bricks']['missing'])
|
||||||
return render_template('bootstrap_table.html', title=info_file['set_num']+" - "+info_file['name'],
|
return render_template('bootstrap_table.html', title=info_file['set_num']+" - "+info_file['name'],
|
||||||
info_file=info_file,inventory_file=inventory_file,json_file=json_file)
|
info_file=info_file,inventory_file=inventory_file,json_file=json_file)
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -26,15 +26,22 @@
|
|||||||
<td>{{ brick.color.name }}</td>
|
<td>{{ brick.color.name }}</td>
|
||||||
<td>{{ brick.quantity }}</td>
|
<td>{{ brick.quantity }}</td>
|
||||||
<td>{{ brick.is_spare }}</td>
|
<td>{{ brick.is_spare }}</td>
|
||||||
<td>
|
{% for i in json_file['unit'] %}
|
||||||
<form action="/saveNumber" method="post">
|
<td>
|
||||||
<input type="hidden" name="brick.part.part_num" value="{{ brick.part.part_num }}">
|
{% set ns = namespace(count='') %}
|
||||||
<input type="hidden" name="brick.color.name" value="{{ brick.color.name }}">
|
<form action="/saveNumber" method="post">
|
||||||
<label for="numberInput">Number:</label>
|
<input type="hidden" name="brick.part.part_num" value="{{ brick.part.part_num }}">
|
||||||
<input type="text" id="numberInput" name="numberInput">
|
<input type="hidden" name="count" value="{{ i }}">
|
||||||
<button type="submit">Save Number</button>
|
<input type="hidden" name="brick.color.name" value="{{ brick.color.name }}">
|
||||||
</form>
|
{% for j in i['bricks']['missing'] %}
|
||||||
</td>
|
{% if j['brick']['ID'] == brick.part.part_num and j['brick']['color_name'] == brick.color.name %}
|
||||||
|
{% set ns.count = j['brick']['amount'] %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
<input type="text" style="height:auto;width:20px" id="numberInput" name="numberInput" value={{ ns.count }}><button type="submit"><i class="fa fa-save"></i></button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
Loading…
Reference in New Issue
Block a user