forked from FrederikBaerentsen/BrickTracker
Set storage details
This commit is contained in:
@@ -26,10 +26,10 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro cards(card_collection, title, id, parent, target, icon=none) %}
|
||||
{% macro cards(card_collection, title, id, parent, target, expanded=false, icon=none) %}
|
||||
{% set size=card_collection | length %}
|
||||
{% if size %}
|
||||
{{ header(title, id, parent, icon=icon) }}
|
||||
{{ header(title, id, parent, expanded=expanded, icon=icon) }}
|
||||
<div class="row">
|
||||
{% for item in card_collection %}
|
||||
<div class="col-md-6 col-xl-3 d-flex align-items-stretch">
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
{% else %}
|
||||
{% set text=storage.fields.name %}
|
||||
{% endif %}
|
||||
{{ badge(check=storage, solo=solo, last=last, color='light text-warning-emphasis bg-warning-subtle border border-warning-subtle', icon='archive-2-line', text=text, alt='Storage', tooltip=tooltip) }}
|
||||
{{ badge(url=item.url_for_storage(), solo=solo, last=last, color='light text-warning-emphasis bg-warning-subtle border border-warning-subtle', icon='archive-2-line', text=text, alt='Storage', tooltip=tooltip) }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{% macro header(color=false, parts=false, quantity=false, missing_parts=false, damaged_parts=false, sets=false, minifigures=false) %}
|
||||
{% macro header(image=true, color=false, parts=false, quantity=false, missing=true, missing_parts=false, damaged=true, damaged_parts=false, sets=false, minifigures=false) %}
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-table-no-sort="true" class="no-sort" scope="col"><i class="ri-image-line fw-normal"></i> Image</th>
|
||||
{% if image %}
|
||||
<th data-table-no-sort="true" class="no-sort" scope="col"><i class="ri-image-line fw-normal"></i> Image</th>
|
||||
{% endif %}
|
||||
<th scope="col"><i class="ri-pencil-line fw-normal"></i> Name</th>
|
||||
{% if color %}
|
||||
<th scope="col"><i class="ri-palette-line fw-normal"></i> Color</th>
|
||||
@@ -12,10 +14,10 @@
|
||||
{% if quantity %}
|
||||
<th data-table-number="true" scope="col"><i class="ri-functions fw-normal"></i> Quantity</th>
|
||||
{% endif %}
|
||||
{% if not config['HIDE_TABLE_MISSING_PARTS'] %}
|
||||
{% if missing and not config['HIDE_TABLE_MISSING_PARTS'] %}
|
||||
<th data-table-number="true" scope="col"><i class="ri-question-line fw-normal"></i> Missing{% if missing_parts %} parts{% endif %}</th>
|
||||
{% endif %}
|
||||
{% if not config['HIDE_TABLE_DAMAGED_PARTS'] %}
|
||||
{% if damaged and not config['HIDE_TABLE_DAMAGED_PARTS'] %}
|
||||
<th data-table-number="true" scope="col"><i class="ri-error-warning-line fw-normal"></i> Damaged{% if damaged_parts %} parts{% endif %}</th>
|
||||
{% endif %}
|
||||
{% if sets %}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %} - Storage {{ item.fields.name}}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
{% with solo=true %}
|
||||
{% include 'storage/card.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,16 @@
|
||||
{% import 'macro/accordion.html' as accordion with context %}
|
||||
{% import 'macro/badge.html' as badge %}
|
||||
{% import 'macro/card.html' as card %}
|
||||
|
||||
<div class="card mb-3 flex-fill {% if solo %}card-solo{% endif %}">
|
||||
{{ card.header(item, item.fields.name, solo=solo, icon='archive-2-line') }}
|
||||
<div class="card-body border-bottom-0 {% if not solo %}p-1{% endif %}">
|
||||
{{ badge.total_sets(sets | length, solo=solo, last=last) }}
|
||||
</div>
|
||||
{% if solo %}
|
||||
<div class="accordion accordion-flush border-top" id="storage-details">
|
||||
{{ accordion.cards(sets, 'Sets', 'sets-stored', 'storage-details', 'set/card.html', expanded=true, icon='hashtag') }}
|
||||
</div>
|
||||
<div class="card-footer"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
{% import 'macro/form.html' as form %}
|
||||
{% import 'macro/table.html' as table %}
|
||||
|
||||
<div class="table-responsive-sm">
|
||||
<table data-table="true" class="table table-striped align-middle" id="storage">
|
||||
{{ table.header(image=false, missing=false, damaged=false, sets=true) }}
|
||||
<tbody>
|
||||
{% for item in table_collection %}
|
||||
<tr>
|
||||
<td data-sort="{{ item.fields.name }}"><a class="text-reset" href="{{ item.url() }}">{{ item.fields.name }}</a></td>
|
||||
<td>{{ item.fields.total_sets }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %} - All storages{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div class="container-fluid px-0">
|
||||
{% with all=true %}
|
||||
{% include 'storage/table.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user