Changed the look of consolidated cards when multiple statuses are used.

This commit is contained in:
2025-09-28 08:42:33 +02:00
parent bc3cc176ef
commit 3f6af51a43
4 changed files with 52 additions and 1 deletions
+1
View File
@@ -40,6 +40,7 @@
- Backwards compatible - when disabled, behaves exactly like original individual view
- Improved theme filtering: handles duplicate theme names correctly
- Fixed set number sorting: proper numeric sorting in both ascending and descending order
- Mixed status indicators for consolidated sets: three-state checkboxes (unchecked/partial/checked) with count badges
### 1.2.4
@@ -37,6 +37,7 @@ SELECT
{% if statuses_dict %}
{% for column, uuid in statuses_dict.items() %}
, MAX("bricktracker_set_statuses"."{{ column }}") AS "{{ column }}"
, IFNULL(SUM("bricktracker_set_statuses"."{{ column }}"), 0) AS "{{ column }}_count"
{% endfor %}
{% endif %}
{% endblock %}
+18
View File
@@ -161,3 +161,21 @@
text-overflow: ellipsis;
min-width: 0;
}
/* Partial Status Checkbox Styling */
.partial-status {
position: relative;
}
.partial-status::after {
content: '';
position: absolute;
top: 2px;
left: 2px;
right: 2px;
bottom: 2px;
background: #6f42c1;
border-radius: 2px;
opacity: 0.8;
pointer-events: none;
}
+32 -1
View File
@@ -88,7 +88,38 @@
{% if not tiny and brickset_statuses | length %}
<ul class="list-group list-group-flush card-check border-bottom-0"{% if current_viewing %} style="border-color: var(--bs-border-color) !important; border-width: 1px !important;"{% endif %}>
{% for status in brickset_statuses %}
<li class="d-flex list-group-item {% if not solo %}p-1{% endif %} text-nowrap">{{ form.checkbox(status.fields.name, item.fields.id, status.as_dataset(), status.url_for_set_state(item.fields.id), item.fields[status.as_column()], parent='set', delete=delete) }}</li>
<li class="d-flex list-group-item {% if not solo %}p-1{% endif %} text-nowrap">
{% if item.fields.instance_count is defined and item.fields.instance_count > 1 %}
{# Consolidated set - show mixed status indicator #}
{% set status_count = item.fields[status.as_column() + '_count'] %}
{% set total_count = item.fields.instance_count %}
{% if status_count == 0 %}
{# None checked #}
<input class="form-check-input px-1" type="checkbox" disabled>
<label class="form-check-label">
{{ status.fields.name }}
<small class="text-muted ms-1">(0/{{ total_count }})</small>
</label>
{% elif status_count == total_count %}
{# All checked #}
<input class="form-check-input px-1" type="checkbox" checked disabled>
<label class="form-check-label">
{{ status.fields.name }}
<small class="text-muted ms-1">({{ total_count }}/{{ total_count }})</small>
</label>
{% else %}
{# Partial - some checked #}
<input class="form-check-input px-1 partial-status" type="checkbox" disabled>
<label class="form-check-label">
{{ status.fields.name }}
<small class="text-muted ms-1">({{ status_count }}/{{ total_count }})</small>
</label>
{% endif %}
{% else %}
{# Individual set - use normal checkbox #}
{{ form.checkbox(status.fields.name, item.fields.id, status.as_dataset(), status.url_for_set_state(item.fields.id), item.fields[status.as_column()], parent='set', delete=delete) }}
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}