diff --git a/bricktracker/views/admin/admin.py b/bricktracker/views/admin/admin.py index 749b3df..9835548 100644 --- a/bricktracker/views/admin/admin.py +++ b/bricktracker/views/admin/admin.py @@ -84,6 +84,7 @@ def admin() -> str: open_image = request.args.get('open_image', None) open_instructions = request.args.get('open_instructions', None) open_logout = request.args.get('open_logout', None) + open_metadata = request.args.get('open_metadata', None) open_owner = request.args.get('open_owner', None) open_purchase_location = request.args.get('open_purchase_location', None) open_retired = request.args.get('open_retired', None) @@ -93,6 +94,7 @@ def admin() -> str: open_theme = request.args.get('open_theme', None) open_metadata = ( + open_metadata or open_owner or open_purchase_location or open_status or diff --git a/templates/add.html b/templates/add.html index d9a9462..368424e 100644 --- a/templates/add.html +++ b/templates/add.html @@ -37,59 +37,66 @@
Metadata
- {% if brickset_owners | length %} - {{ accordion.header('Owners', 'owners', 'metadata', icon='user-line') }} -
- {% for owner in brickset_owners %} - {% with id=owner.as_dataset() %} -
- - -
- {% endwith %} - {% endfor %} + {% if not (brickset_owners | length) and not (brickset_purchase_locations | length) and not (brickset_storages | length) and not (brickset_tags | length) %} + - {{ accordion.footer() }} - {% endif %} - {% if brickset_purchase_locations | length %} - {{ accordion.header('Purchase location', 'purchase-location', 'metadata', icon='building-line') }} - -
- -
- {{ accordion.footer() }} - {% endif %} - {% if brickset_storages | length %} - {{ accordion.header('Storage', 'storage', 'metadata', icon='archive-2-line') }} - -
- -
- {{ accordion.footer() }} - {% endif %} - {% if brickset_tags | length %} - {{ accordion.header('Tags', 'tags', 'metadata', icon='price-tag-2-line') }} -
- {% for tag in brickset_tags %} - {% with id=tag.as_dataset() %} -
- - -
- {% endwith %} - {% endfor %} -
- {{ accordion.footer() }} + {% else %} + {% if brickset_owners | length %} + {{ accordion.header('Owners', 'owners', 'metadata', icon='user-line') }} +
+ {% for owner in brickset_owners %} + {% with id=owner.as_dataset() %} +
+ + +
+ {% endwith %} + {% endfor %} +
+ {{ accordion.footer() }} + {% endif %} + {% if brickset_purchase_locations | length %} + {{ accordion.header('Purchase location', 'purchase-location', 'metadata', icon='building-line') }} + +
+ +
+ {{ accordion.footer() }} + {% endif %} + {% if brickset_storages | length %} + {{ accordion.header('Storage', 'storage', 'metadata', icon='archive-2-line') }} + +
+ +
+ {{ accordion.footer() }} + {% endif %} + {% if brickset_tags | length %} + {{ accordion.header('Tags', 'tags', 'metadata', icon='price-tag-2-line') }} +
+ {% for tag in brickset_tags %} + {% with id=tag.as_dataset() %} +
+ + +
+ {% endwith %} + {% endfor %} +
+ {{ accordion.footer() }} + {% endif %} {% endif %}