diff --git a/templates/macro/form.html b/templates/macro/form.html index 9564f35..72af87f 100644 --- a/templates/macro/form.html +++ b/templates/macro/form.html @@ -43,26 +43,25 @@ {% endif %} {% endmacro %} -{% macro select(name, item, field, metadata_list, nullable=true, icon=none, delete=false) %} +{% macro select(name, id, prefix, url, value, metadata_list, nullable=true, icon=none, delete=false) %} {% if g.login.is_authenticated() %} - {% set prefix=metadata_list.as_prefix() %} - +
{% if icon %} {{ name }}{% endif %} - - - + +
{% endif %} {% endmacro %} diff --git a/templates/set/management.html b/templates/set/management.html index 744c961..ade6729 100644 --- a/templates/set/management.html +++ b/templates/set/management.html @@ -25,7 +25,7 @@
{% if brickset_purchase_locations | length %} - {{ form.select('Location', item, 'purchase_location', brickset_purchase_locations, icon='building-line', delete=delete) }} + {{ form.select('Location', item.fields.id, brickset_purchase_locations.as_prefix(), brickset_purchase_locations.url_for_set_value(item.fields.id), item.fields.purchase_location, brickset_purchase_locations, icon='building-line', delete=delete) }} {% else %} No purchase location found. {% endif %} @@ -36,7 +36,7 @@ {{ accordion.footer() }} {{ accordion.header('Storage', 'storage', 'set-management', icon='archive-2-line') }} {% if brickset_storages | length %} - {{ form.select('Storage', item, 'storage', brickset_storages, delete=delete) }} + {{ form.select('Storage', item.fields.id, brickset_storages.as_prefix(), brickset_storages.url_for_set_value(item.fields.id), item.fields.storage, brickset_storages, icon='building-line', delete=delete) }} {% else %}

No storage found.

{% endif %}