Put set metadata in nested accordion to reduce footprint
This commit is contained in:
parent
7f684c5f02
commit
e7bfa66512
@ -87,15 +87,19 @@ def admin() -> str:
|
|||||||
open_tag = request.args.get('open_tag', None)
|
open_tag = request.args.get('open_tag', None)
|
||||||
open_theme = request.args.get('open_theme', None)
|
open_theme = request.args.get('open_theme', None)
|
||||||
|
|
||||||
|
open_metadata = (
|
||||||
|
open_owner or
|
||||||
|
open_status or
|
||||||
|
open_storage or
|
||||||
|
open_tag
|
||||||
|
)
|
||||||
|
|
||||||
open_database = (
|
open_database = (
|
||||||
open_image is None and
|
open_image is None and
|
||||||
open_instructions is None and
|
open_instructions is None and
|
||||||
open_logout is None and
|
open_logout is None and
|
||||||
open_owner is None and
|
not open_metadata and
|
||||||
open_retired is None and
|
open_retired is None and
|
||||||
open_status is None and
|
|
||||||
open_storage is None and
|
|
||||||
open_tag is None and
|
|
||||||
open_theme is None
|
open_theme is None
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -120,6 +124,7 @@ def admin() -> str:
|
|||||||
open_image=open_image,
|
open_image=open_image,
|
||||||
open_instructions=open_instructions,
|
open_instructions=open_instructions,
|
||||||
open_logout=open_logout,
|
open_logout=open_logout,
|
||||||
|
open_metadata=open_metadata,
|
||||||
open_owner=open_owner,
|
open_owner=open_owner,
|
||||||
open_retired=open_retired,
|
open_retired=open_retired,
|
||||||
open_status=open_status,
|
open_status=open_status,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
{% import 'macro/accordion.html' as accordion %}
|
||||||
|
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %} - Administration{% endblock %}
|
{% block title %} - Administration{% endblock %}
|
||||||
@ -36,10 +38,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% include 'admin/theme.html' %}
|
{% include 'admin/theme.html' %}
|
||||||
{% include 'admin/retired.html' %}
|
{% include 'admin/retired.html' %}
|
||||||
|
{{ accordion.header('Set metadata', 'metadata', 'admin', expanded=open_metadata, icon='profile-line', class='p-0') }}
|
||||||
{% include 'admin/owner.html' %}
|
{% include 'admin/owner.html' %}
|
||||||
{% include 'admin/status.html' %}
|
{% include 'admin/status.html' %}
|
||||||
{% include 'admin/storage.html' %}
|
{% include 'admin/storage.html' %}
|
||||||
{% include 'admin/tag.html' %}
|
{% include 'admin/tag.html' %}
|
||||||
|
{{ accordion.footer() }}
|
||||||
{% include 'admin/database.html' %}
|
{% include 'admin/database.html' %}
|
||||||
{% include 'admin/configuration.html' %}
|
{% include 'admin/configuration.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% import 'macro/accordion.html' as accordion %}
|
{% import 'macro/accordion.html' as accordion %}
|
||||||
|
|
||||||
{{ accordion.header('Set owners', 'owner', 'admin', expanded=open_owner, icon='user-line', class='p-0') }}
|
{{ accordion.header('Set owners', 'owner', 'metadata', expanded=open_owner, icon='user-line', class='p-0') }}
|
||||||
{% if owner_error %}<div class="alert alert-danger m-2" role="alert"><strong>Error:</strong> {{ owner_error }}.</div>{% endif %}
|
{% if owner_error %}<div class="alert alert-danger m-2" role="alert"><strong>Error:</strong> {{ owner_error }}.</div>{% endif %}
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% if metadata_owners | length %}
|
{% if metadata_owners | length %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% import 'macro/accordion.html' as accordion %}
|
{% import 'macro/accordion.html' as accordion %}
|
||||||
|
|
||||||
{{ accordion.header('Set statuses', 'status', 'admin', expanded=open_status, icon='checkbox-line', class='p-0') }}
|
{{ accordion.header('Set statuses', 'status', 'metadata', expanded=open_status, icon='checkbox-line', class='p-0') }}
|
||||||
{% if status_error %}<div class="alert alert-danger m-2" role="alert"><strong>Error:</strong> {{ status_error }}.</div>{% endif %}
|
{% if status_error %}<div class="alert alert-danger m-2" role="alert"><strong>Error:</strong> {{ status_error }}.</div>{% endif %}
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% if metadata_statuses | length %}
|
{% if metadata_statuses | length %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% import 'macro/accordion.html' as accordion %}
|
{% import 'macro/accordion.html' as accordion %}
|
||||||
|
|
||||||
{{ accordion.header('Set storages', 'storage', 'admin', expanded=open_storage, icon='archive-2-line', class='p-0') }}
|
{{ accordion.header('Set storages', 'storage', 'metadata', expanded=open_storage, icon='archive-2-line', class='p-0') }}
|
||||||
{% if storage_error %}<div class="alert alert-danger m-2" role="alert"><strong>Error:</strong> {{ storage_error }}.</div>{% endif %}
|
{% if storage_error %}<div class="alert alert-danger m-2" role="alert"><strong>Error:</strong> {{ storage_error }}.</div>{% endif %}
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% if metadata_storages | length %}
|
{% if metadata_storages | length %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% import 'macro/accordion.html' as accordion %}
|
{% import 'macro/accordion.html' as accordion %}
|
||||||
|
|
||||||
{{ accordion.header('Set tags', 'tag', 'admin', expanded=open_tag, icon='price-tag-2-line', class='p-0') }}
|
{{ accordion.header('Set tags', 'tag', 'metadata', expanded=open_tag, icon='price-tag-2-line', class='p-0') }}
|
||||||
{% if tag_error %}<div class="alert alert-danger m-2" role="alert"><strong>Error:</strong> {{ tag_error }}.</div>{% endif %}
|
{% if tag_error %}<div class="alert alert-danger m-2" role="alert"><strong>Error:</strong> {{ tag_error }}.</div>{% endif %}
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% if metadata_tags | length %}
|
{% if metadata_tags | length %}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{% if g.login.is_authenticated() %}
|
{% if g.login.is_authenticated() %}
|
||||||
{{ accordion.header('Owners', 'owner', 'set-details', icon='group-line', class='p-0') }}
|
{{ accordion.header('Management', 'set-management', 'set-details', icon='settings-4-line', class='p-0') }}
|
||||||
|
{{ accordion.header('Owners', 'owner', 'set-management', icon='group-line', class='p-0') }}
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% if brickset_owners | length %}
|
{% if brickset_owners | length %}
|
||||||
{% for owner in brickset_owners %}
|
{% for owner in brickset_owners %}
|
||||||
@ -13,7 +14,7 @@
|
|||||||
<a class="list-group-item list-group-item-action" href="{{ url_for('admin.admin', open_owner=true) }}"><i class="ri-settings-4-line"></i> Manage the set owners</a>
|
<a class="list-group-item list-group-item-action" href="{{ url_for('admin.admin', open_owner=true) }}"><i class="ri-settings-4-line"></i> Manage the set owners</a>
|
||||||
</div>
|
</div>
|
||||||
{{ accordion.footer() }}
|
{{ accordion.footer() }}
|
||||||
{{ accordion.header('Storage', 'storage', 'set-details', icon='archive-2-line') }}
|
{{ accordion.header('Storage', 'storage', 'set-management', icon='archive-2-line') }}
|
||||||
{% if brickset_storages | length %}
|
{% if brickset_storages | length %}
|
||||||
{{ form.select('Storage', item, 'storage', brickset_storages, delete=delete) }}
|
{{ form.select('Storage', item, 'storage', brickset_storages, delete=delete) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
@ -22,7 +23,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<a href="{{ url_for('admin.admin', open_storage=true) }}" class="btn btn-primary" role="button"><i class="ri-settings-4-line"></i> Manage the set storages</a>
|
<a href="{{ url_for('admin.admin', open_storage=true) }}" class="btn btn-primary" role="button"><i class="ri-settings-4-line"></i> Manage the set storages</a>
|
||||||
{{ accordion.footer() }}
|
{{ accordion.footer() }}
|
||||||
{{ accordion.header('Tags', 'tag', 'set-details', icon='price-tag-2-line', class='p-0') }}
|
{{ accordion.header('Tags', 'tag', 'set-management', icon='price-tag-2-line', class='p-0') }}
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% if brickset_tags | length %}
|
{% if brickset_tags | length %}
|
||||||
{% for tag in brickset_tags %}
|
{% for tag in brickset_tags %}
|
||||||
@ -36,8 +37,8 @@
|
|||||||
<a class="list-group-item list-group-item-action" href="{{ url_for('admin.admin', open_tag=true) }}"><i class="ri-settings-4-line"></i> Manage the set tags</a>
|
<a class="list-group-item list-group-item-action" href="{{ url_for('admin.admin', open_tag=true) }}"><i class="ri-settings-4-line"></i> Manage the set tags</a>
|
||||||
</div>
|
</div>
|
||||||
{{ accordion.footer() }}
|
{{ accordion.footer() }}
|
||||||
{{ accordion.header('Management', 'management', 'set-details', icon='settings-4-line') }}
|
{{ accordion.header('Data', 'data', 'set-management', icon='database-2-line') }}
|
||||||
<h5 class="border-bottom">Data</h5>
|
|
||||||
<a href="{{ item.url_for_refresh() }}" class="btn btn-primary" role="button"><i class="ri-refresh-line"></i> Refresh the set data</a>
|
<a href="{{ item.url_for_refresh() }}" class="btn btn-primary" role="button"><i class="ri-refresh-line"></i> Refresh the set data</a>
|
||||||
{{ accordion.footer() }}
|
{{ accordion.footer() }}
|
||||||
|
{{ accordion.footer() }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user