diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-09-30 17:16:37 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-02 23:15:26 +0200 |
commit | b4ebf75f816a2da61fab8e6275964b5d4858a64c (patch) | |
tree | b29ae98f80b632aec9d191976b8bdd82badf2c95 | |
parent | 93ece4d67007e86066726d9b724a7fefa86db68f (diff) | |
download | Ishtar-b4ebf75f816a2da61fab8e6275964b5d4858a64c.tar.bz2 Ishtar-b4ebf75f816a2da61fab8e6275964b5d4858a64c.zip |
♻️ sheet find refactoring: add a sheet_find_containers sub template
-rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find_containers.html | 59 | ||||
-rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find_treatments.html | 61 |
2 files changed, 61 insertions, 59 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_find_containers.html b/archaeological_finds/templates/ishtar/sheet_find_containers.html new file mode 100644 index 000000000..f7eaa845e --- /dev/null +++ b/archaeological_finds/templates/ishtar/sheet_find_containers.html @@ -0,0 +1,59 @@ +{% load i18n l10n window_field link_to_window %} + {% if item.container_ref != item.container and item.container_ref %} + <dl class="col-12 flex-wrap"> + <dt>{% trans "Reference container" %}</dt> + <dd> + <nav aria-label="breadcrumb"> + <ol class="breadcrumb"> + {% if not is_external %} + {% for loca in item.container_ref.get_localisations %} + <li class="breadcrumb-item"> + {{loca.short_label}} {{loca|simple_link_to_window}} + </li> + {% endfor %} + <li class="breadcrumb-item"> + {{item.container_ref.short_label}} {{item.container_ref|simple_link_to_window}} + </li> + {% else %} + {{item.container_ref}} + {% endif %} + </ol> + </nav> + </dd> + </dl> + {% endif %} + {% if item.container %} + <dl class="col-12 flex-wrap"> + <dt> + {% if item.container_ref != item.container %} + {% trans "Current container" %}{% else %} + {% trans "Reference container / current container" %} + {% endif %} + </dt> + <dd> + <nav aria-label="breadcrumb"> + <ol class="breadcrumb"> + {% if not is_external %} + {% for loca in item.container.get_localisations %} + <li class="breadcrumb-item"> + {{loca.short_label}} {{loca|simple_link_to_window}} + </li> + {% endfor %} + <li class="breadcrumb-item"> + {{item.container.short_label}} {{item.container|simple_link_to_window}} + </li> + {% else %} + {% for loca in item.container.localisation_list %} + <li class="breadcrumb-item"> + {{loca}} + </li> + {% endfor %} + <li class="breadcrumb-item"> + {{item.container.short_label}} + </li> + {% endif %} + </ol> + </nav> + </dd> + </dl> + {% endif %} diff --git a/archaeological_finds/templates/ishtar/sheet_find_treatments.html b/archaeological_finds/templates/ishtar/sheet_find_treatments.html index 961134691..b024f3f47 100644 --- a/archaeological_finds/templates/ishtar/sheet_find_treatments.html +++ b/archaeological_finds/templates/ishtar/sheet_find_treatments.html @@ -29,64 +29,8 @@ {% if can_view_container %} <h3>{% trans "Warehouse - container" %}</h3> <div class='row'> - {% if item.container_ref != item.container and item.container_ref %} - <dl class="col-12 flex-wrap"> - <dt>{% trans "Reference container" %}</dt> - <dd> - <nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - {% if not is_external %} - {% for loca in item.container_ref.get_localisations %} - <li class="breadcrumb-item"> - {{loca.short_label}} {{loca|simple_link_to_window}} - </li> - {% endfor %} - <li class="breadcrumb-item"> - {{item.container_ref.short_label}} {{item.container_ref|simple_link_to_window}} - </li> - {% else %} - {{item.container_ref}} - {% endif %} - </ol> - </nav> - </dd> - </dl> - {% endif %} - {% if item.container %} - <dl class="col-12 flex-wrap"> - <dt> - {% if item.container_ref != item.container %} - {% trans "Current container" %}{% else %} - {% trans "Reference container / current container" %} - {% endif %} - </dt> - <dd> - <nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - {% if not is_external %} - {% for loca in item.container.get_localisations %} - <li class="breadcrumb-item"> - {{loca.short_label}} {{loca|simple_link_to_window}} - </li> - {% endfor %} - <li class="breadcrumb-item"> - {{item.container.short_label}} {{item.container|simple_link_to_window}} - </li> - {% else %} - {% for loca in item.container.localisation_list %} - <li class="breadcrumb-item"> - {{loca}} - </li> - {% endfor %} - <li class="breadcrumb-item"> - {{item.container.short_label}} - </li> - {% endif %} - </ol> - </nav> - </dd> - </dl> - {% if item.container.index %} + {% include "ishtar/sheet_find_containers.html" %} + {% if item.container and item.container.index %} <div class='row'> <dl class="col-12 flex-wrap"> <dt>{% trans "Index" %}</dt> @@ -96,7 +40,6 @@ </dl> </div> {% endif %} - {% endif %} </div> {% else %} <div class="alert alert-info" role="alert"> |