Fixed formatting and added title image on inventory page

This commit is contained in:
FrederikBaerentsen 2024-03-04 14:00:57 -05:00
parent 172e371656
commit 52eeab7042
3 changed files with 15 additions and 6 deletions

4
app.py
View File

@ -17,7 +17,6 @@ def index():
with open('./static/sets/'+set_num+'/info.json') as info:
info_file = json.loads(info.read())
set_list.append(info_file)
print(set_list)
return render_template('frontpage.html',set_list=set_list)
@app.route('/<tmp>')
@ -28,8 +27,7 @@ def sets(tmp):
inventory_file = json.loads(inventory.read())
with open('./info/'+tmp+'.json') as info:
json_file = json.loads(info.read())
pp(json_file['unit'][0]['bricks']['missing'])
return render_template('bootstrap_table.html', tmp=tmp,title=info_file['set_num']+" - "+info_file['name'],
return render_template('bootstrap_table.html', tmp=tmp,title=info_file['name'],
info_file=info_file,inventory_file=inventory_file,json_file=json_file)

View File

@ -33,6 +33,14 @@ table {
text-overflow: ellipsis;
}
#data th:nth-child(4),
#data td:nth-child(4) {
max-width: 100px; /* Adjust as needed */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.center-table {
}
@ -211,8 +219,11 @@ input[type=number] {
<body>
<button style="background-color: white;color: black;border: 1px dotted black;width: 98%;margin: 1%;" onclick="goToPage('/')">Home</button>
<div class="container">
<h2 style="margin: 20px 0px 0px 0px;">{{ title }}</h2>
<hr>
<center>
<h2 style="margin: 0px 0px 0px 0px;"> {{ tmp }}</h2>
<img style='height: 100px; width: auto; object-fit: contain' src="/static/sets/{{ tmp }}/cover.jpg" alt="Image">
<h2 style="margin: 0px 0px 0px 0px;">{{ title }}</h2></center>
{% block content %}{% endblock %}
</div>
{% block scripts %}{% endblock %}

View File

@ -9,7 +9,7 @@
<th></th>
<th style="text-align:center;margin:0px;" class="fixed-width hidden-mobile">ID</th>
<th class="fixed-width hidden-mobile">Name</th>
<th>Color</th>
<th class="fixed-width">Color</th>
<th style="text-align: center;" class="fixed-width">Qty</th>
{% for i in json_file['unit'] %}
<th style="text-align: center;" class="fixed-width">Missing ({{ loop.index }})</th>