Missing bricks on index

This commit is contained in:
FrederikBaerentsen 2024-04-19 08:37:17 +02:00
parent db032cd37f
commit 5e03013bef
2 changed files with 13 additions and 5 deletions

6
app.py
View File

@ -331,6 +331,10 @@ def index():
results = cursor.fetchall()
set_list = [list(i) for i in results]
cursor.execute('SELECT DISTINCT u_id from missing;')
results = cursor.fetchall()
missing_list = [list(i)[0] for i in results]
#print(set_list)
for i in set_list:
try:
@ -341,7 +345,7 @@ def index():
cursor.close()
conn.close()
return render_template('index.html',set_list=set_list,themes_list=theme_file)
return render_template('index.html',set_list=set_list,themes_list=theme_file,missing_list=missing_list)
if request.method == 'POST':
set_num = request.form.get('set_num')

View File

@ -162,7 +162,7 @@
</div>
</nav>
<div class="search-container">
<input class="input"type="text" id="searchInput" onkeyup="searchFunction()" placeholder="Search...">
<!-- <center hidden="true">
@ -250,11 +250,15 @@
Set is collected and boxed
</label>
<br>
<fieldset disabled>
<!-- <fieldset disabled> -->
<label class="checkbox" >
<input type="checkbox" class="s_com" onclick="return false;"/> Set is missing pieces
{% if i[11] in missing_list %}
<input type="checkbox" class="s_com" onclick="return false;" checked/> Set is missing pieces
{% else %}
<input type="checkbox" class="s_com" onclick="return false;"/> Set is missing pieces
{% endif %}
</label>
</fieldset>
<!-- </fieldset> -->
</div>
</div>
</div>