Separate bricktracker sets from rebrickable sets (dedup), introduce custom checkboxes
This commit is contained in:
+19
-21
@@ -3,18 +3,20 @@
|
||||
{% import 'macro/card.html' as card %}
|
||||
{% import 'macro/form.html' as form %}
|
||||
|
||||
<div {% if not solo %}id="set-{{ item.fields.u_id }}"{% endif %} class="card mb-3 flex-fill {% if solo %}card-solo{% endif %}"
|
||||
{% if not solo %}data-index="{{ index }}" data-number="{{ item.fields.set_number }}" data-name="{{ item.fields.name | lower }}" data-parts="{{ item.fields.num_parts }}"
|
||||
data-year="{{ item.fields.year }}" data-theme="{{ item.theme_name | lower }}" data-minifigures-collected="{{ item.fields.mini_col }}" data-set-collected="{{ item.fields.set_col }}"
|
||||
data-set-checked="{{ item.fields.set_check }}" data-has-missing="{{ (item.fields.total_missing > 0) | int }}" data-has-minifigures="{{ (item.fields.total_minifigures > 0) | int }}"
|
||||
data-has-missing-instructions="{{ (not (item.instructions | length)) | int }}" data-minifigures="{{ item.fields.total_minifigures }}" data-missing="{{ item.fields.total_missing }}"{% endif %}
|
||||
<div {% if not solo %}id="set-{{ item.fields.id }}"{% endif %} class="card mb-3 flex-fill {% if solo %}card-solo{% endif %}"
|
||||
{% if not solo %}
|
||||
data-index="{{ index }}" data-number="{{ item.fields.set }}" data-name="{{ item.fields.name | lower }}" data-parts="{{ item.fields.number_of_parts }}"
|
||||
data-year="{{ item.fields.year }}" data-theme="{{ item.theme.name | lower }}" data-minifigures="{{ item.fields.total_minifigures }}" data-has-minifigures="{{ (item.fields.total_minifigures > 0) | int }}"
|
||||
data-has-missing="{{ (item.fields.total_missing > 0) | int }}" data-has-missing-instructions="{{ (not (item.instructions | length)) | int }}" data-missing="{{ item.fields.total_missing }}"
|
||||
{% for checkbox in brickset_checkboxes %}data-{{ checkbox.as_dataset() }}="{{ item.fields[checkbox.as_column()] }}" {% endfor %}
|
||||
{% endif %}
|
||||
>
|
||||
{{ card.header(item, item.fields.name, solo=solo, number=item.fields.set_num) }}
|
||||
{{ card.image(item, solo=solo, last=last, caption=item.fields.name, alt=item.fields.set_num) }}
|
||||
<div class="card-body {% if not solo %}p-1{% endif %}">
|
||||
{{ badge.theme(item.theme_name, solo=solo, last=last) }}
|
||||
{{ card.header(item, item.fields.name, solo=solo, number=item.fields.number) }}
|
||||
{{ card.image(item, solo=solo, last=last, caption=item.fields.name, alt=item.fields.number) }}
|
||||
<div class="card-body {% if solo %}border-bottom{% else %}p-1{% endif %}">
|
||||
{{ badge.theme(item.theme.name, solo=solo, last=last) }}
|
||||
{{ badge.year(item.fields.year, solo=solo, last=last) }}
|
||||
{{ badge.parts(item.fields.num_parts, solo=solo, last=last) }}
|
||||
{{ badge.parts(item.fields.number_of_parts, solo=solo, last=last) }}
|
||||
{{ badge.total_minifigures(item.fields.total_minifigures, solo=solo, last=last) }}
|
||||
{{ badge.total_missing(item.fields.total_missing, solo=solo, last=last) }}
|
||||
{% if not last %}
|
||||
@@ -24,17 +26,13 @@
|
||||
{{ badge.rebrickable(item, solo=solo, last=last) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not tiny %}
|
||||
<ul class="list-group list-group-flush card-check">
|
||||
<li class="list-group-item {% if not solo %}p-1{% endif %}">
|
||||
{{ form.checkbox('minifigures-collected', item.fields.u_id, 'Minifigures are collected', item.url_for_minifigures_collected(), item.fields.mini_col, delete=delete) }}
|
||||
</li>
|
||||
<li class="list-group-item {% if not solo %}p-1{% endif %}">
|
||||
{{ form.checkbox('set-checked', item.fields.u_id, 'Set is checked', item.url_for_set_checked(), item.fields.set_check, delete=delete) }}
|
||||
</li>
|
||||
<li class="list-group-item {% if not solo %}p-1{% endif %}">
|
||||
{{ form.checkbox('set-collected', item.fields.u_id, 'Set is collected and boxed', item.url_for_set_collected(), item.fields.set_col, delete=delete) }}
|
||||
</li>
|
||||
{% if not tiny and brickset_checkboxes | length %}
|
||||
<ul class="list-group list-group-flush card-check border-top-0 {% if not solo %}border-bottom-0{% endif %}">
|
||||
{% for checkbox in brickset_checkboxes %}
|
||||
<li class="list-group-item {% if not solo %}p-1{% endif %}">
|
||||
{{ form.checkbox(checkbox.as_dataset(), item.fields.id, checkbox.fields.name, checkbox.status_url(item.fields.id), item.fields[checkbox.as_column()], delete=delete) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if solo %}
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
{% import 'macro/card.html' as card %}
|
||||
|
||||
<div class="card mb-3">
|
||||
{{ card.header(item, item.fields.name, solo=true, number=item.fields.set_num) }}
|
||||
{{ card.image(item, solo=true, last=false, caption=item.fields.name, alt=item.fields.set_num) }}
|
||||
{{ card.header(item, item.fields.name, solo=true, number=item.fields.set) }}
|
||||
{{ card.image(item, solo=true, last=false, caption=item.fields.name, alt=item.fields.set) }}
|
||||
<div class="card-body p-1">
|
||||
{{ badge.theme(item.theme_name) }}
|
||||
{{ badge.theme(item.theme.name) }}
|
||||
{{ badge.year(item.fields.year) }}
|
||||
{{ badge.parts(item.fields.num_parts) }}
|
||||
{{ badge.parts(item.fields.number_of_parts) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user