diff --git a/app.py b/app.py index ea2594f..eaac627 100644 --- a/app.py +++ b/app.py @@ -493,7 +493,9 @@ 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, GROUP_CONCAT(set_num, ', ') AS set_number 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;") + + cursor.execute("SELECT part_num, color_id, element_id, part_img_url_id, SUM(quantity) AS total_quantity, GROUP_CONCAT(set_num || ',' || u_id, ',') AS set_number FROM missing GROUP BY part_num, color_id, element_id, part_img_url_id ORDER BY part_num;") results = cursor.fetchall() missing_list = [list(i) for i in results] diff --git a/templates/missing.html b/templates/missing.html index eca1a53..85218e3 100644 --- a/templates/missing.html +++ b/templates/missing.html @@ -25,6 +25,17 @@ table.sortable tbody tr:nth-child(2n+1) td { background: #ecf0f1; } + table { + width: 100%; /* Ensure the table takes full width of its container */ + +} + +td { + overflow: hidden; + text-overflow: ellipsis; + word-wrap: break-word; +} + @media only screen and (max-width: 480px) { /* horizontal scrollbar for tables if mobile screen */ @@ -73,6 +84,9 @@ table.sortable tbody tr:nth-child(2n+1) td { text-overflow: ellipsis; } +.fixed-width { + max-width:100px; +} /* Modal Styles */ @@ -164,38 +178,46 @@ table.sortable tbody tr:nth-child(2n+1) td { +
-
- +

Missing Pieces

+
+
- - - - - - + + + + + + {% for brick in missing_list %} {% if brick[4] == 'nil' %} - + {% else %} - + {% endif %} - + {% endfor %}
Part NumColorElement IDQtySetsPart NumColorElement IDQtySets
{{ brick[3] }}{{ brick[3] }}{{ brick[3] }}{{ brick[3] }}{{ brick[0] }} {{ brick[1] }} {{ brick[2] }} {{ brick[4] }}{{ brick[5] }} + {% set set_numbers = brick[5].split(',') %} + {% for i in range(0, set_numbers|length, 2) %} + {{ set_numbers[i] }}{% if i != set_numbers|length - 2 %},{% endif %} + {% endfor %} +
+