Added set numbers to page (Fixed #28).

This commit is contained in:
FrederikBaerentsen 2024-12-29 09:00:54 +01:00
parent 0a40d42b6c
commit 9411e18a81
3 changed files with 5 additions and 5 deletions

4
app.py
View File

@ -493,7 +493,7 @@ def config():
def missing():
conn = sqlite3.connect('app.db')
cursor = conn.cursor()
cursor.execute('SELECT part_num, color_id, element_id, part_img_url_id, SUM(quantity) AS total_quantity FROM missing GROUP BY part_num, color_id, element_id;')
cursor.execute("SELECT part_num, color_id, element_id, part_img_url_id, SUM(quantity) AS total_quantity, GROUP_CONCAT(set_num, ', ') AS set_number FROM missing GROUP BY part_num, color_id, element_id;")
results = cursor.fetchall()
missing_list = [list(i) for i in results]
@ -691,7 +691,7 @@ def index():
files = [f for f in os.listdir(DIRECTORY) if f.endswith('.pdf')]
#files = [re.match(r'^([\w]+-[\w]+)', f).group() for f in os.listdir(DIRECTORY) if f.endswith('.pdf')]
print(files.sort())
files.sort()
return render_template('index.html',set_list=set_list,themes_list=theme_file,missing_list=missing_list,files=files,minifigs=minifigs,links=LINKS)

View File

@ -208,7 +208,6 @@ display: none !important;
</div>
</div>
</nav>
<div class="search-container">
<input class="input my-input" type="text" id="searchInput" onkeyup="searchFunction()" placeholder="Search title, set number, theme or parts...">
<!-- <center hidden="true">
@ -324,7 +323,6 @@ display: none !important;
</p>
{% set ns = namespace(found=false) %}
{% for file in files %}
{% if ns.found is sameas false and file.startswith(i[0]) %}

View File

@ -174,6 +174,7 @@ table.sortable tbody tr:nth-child(2n+1) td {
<th >Color</th>
<th >Element ID</th>
<th >Qty</th>
<th class="sorttable_nosort">Sets</th>
</tr>
</thead>
<tbody>
@ -187,7 +188,8 @@ table.sortable tbody tr:nth-child(2n+1) td {
<td><a target="_blank" href="https://www.bricklink.com/v2/catalog/catalogitem.page?P={{ brick[0] }}">{{ brick[0] }}</a></td>
<td>{{ brick[1] }}</td>
<td><a target="_blank" href="https://www.rebrickable.com/elements/{{ brick[2] }}">{{ brick[2] }}</a></td>
<td>{{ brick[4] }}</td>
<td>{{ brick[4] }}</td>
<td>{{ brick[5] }}</td>
</tr>
{% endfor %}
</tbody>