diff options
| -rw-r--r-- | archaeological_warehouse/templates/ishtar/sheet_container.html | 177 | 
1 files changed, 103 insertions, 74 deletions
diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index 0087eeaf6..a7aa3a512 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -10,89 +10,118 @@  {% endblock %}  {% block content %} -<div class="clearfix"> -    {% if item.main_image %} -    <div class="card float-left col-12 col-md-4"> -        {% include "ishtar/blocks/window_image.html" %} -    </div> -    {% endif %} -    {% if item.main_image %} -    <div class="float-left col-12 col-md-6 col-lg-8 text-center">{# </div>> #} -    {% else %} -    <div class="float-left col-6 col-md-3 text-center"> -    {% endif %} -        <p class="window-refs">{{ item.container_type|default:"" }} {{ item.reference|default:"" }}</p> -        <p class="window-refs">{{ item.location.name }} - {{ item.index }}</p> -        {% include "ishtar/blocks/sheet_external_id.html" %} -    </div> -    {% if item.main_image %} -    <div class="row float-left col-12 col-md-6 col-lg-8 text-center">{# </div>> #} -    {% else %} -    <div class="float-left row col-6 col-md-8"> -    {% endif %} -        <dl class="col-12 flex-wrap"> -            <dt>{% trans "Location" %}</dt> -            <dd> -                <nav aria-label="breadcrumb"> -                    <ol class="breadcrumb"> -                    {% for loca in item.get_localisations %} -                        <li class="breadcrumb-item"> -                            {{loca.short_label}} {{loca|simple_link_to_window}} -                        </li> -                    {% endfor %} -                    </ol> -                </nav> -            </dd> -        </dl> -        {% include "ishtar/blocks/sheet_creation_section.html" %} -        {% field_flex "Old reference" item.old_reference %} -        {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} -        {% include "ishtar/blocks/sheet_json.html" %} -    </div> -</div> - -{% with item.container_type as container_type %} -{% if container_type.length or container_type.width or container_type.height or container_type.volume or container_type.reference %} -<h4>{% trans "Container type" %}</h4> -<div class='row'> -    {% field_flex "Length (mm)" container_type.length %} -    {% field_flex "Width (mm)" container_type.width %} -    {% field_flex "Height (mm)" container_type.height %} -    {% field_flex "Volume (l)" container_type.volume %} -    {% field_flex "Reference" container_type.reference %} -</div> +{% if output != "ODT" and output != "PDF"%} +<ul class="nav nav-tabs" id="{{window_id}}-tabs" role="tablist"> +    <li class="nav-item"> +        <a class="nav-link active" id="{{window_id}}-general-tab" +           data-toggle="tab" href="#{{window_id}}-general" role="tab" +           aria-controls="{{window_id}}-general" aria-selected="true"> +            {% trans "General" %} +        </a> +    </li> +    <li class="nav-item"> +        <a class="nav-link" id="{{window_id}}-content-tab" +           data-toggle="tab" href="#{{window_id}}-content" role="tab" +           aria-controls="{{window_id}}-content" aria-selected="true"> +            {% trans "Content" %} +        </a> +    </li> +</ul>  {% endif %} -{% endwith %} +<div class="tab-content" id="{{window_id}}-tab-content"> -{% if item.container_content.count or item.children.count %} -<h4>{% trans "Content" %}</h4> +    <div class="tab-pane fade show active" id="{{window_id}}-general" +         role="tabpanel" aria-labelledby="{{window_id}}-general-tab"> -{% if item.children.count %} -{% trans "Containers" as container_lbl %} -{% dynamic_table_document container_lbl 'containers' 'parent' item.pk 'TABLE_COLS' output 'large' %} -{% endif %} +        <div class="clearfix"> +            {% if item.main_image %} +            <div class="card float-left col-12 col-md-4"> +                {% include "ishtar/blocks/window_image.html" %} +            </div> +            {% endif %} +            {% if item.main_image %} +            <div class="float-left col-12 col-md-6 col-lg-8 text-center">{# </div>> #} +            {% else %} +            <div class="float-left col-6 col-md-3 text-center"> +            {% endif %} +                <p class="window-refs">{{ item.container_type|default:"" }} {{ item.reference|default:"" }}</p> +                <p class="window-refs">{{ item.location.name }} - {{ item.index }}</p> +                {% include "ishtar/blocks/sheet_external_id.html" %} +            </div> +            {% if item.main_image %} +            <div class="row float-left col-12 col-md-6 col-lg-8 text-center">{# </div>> #} +            {% else %} +            <div class="float-left row col-6 col-md-8"> +            {% endif %} +                <dl class="col-12 flex-wrap"> +                    <dt>{% trans "Location" %}</dt> +                    <dd> +                        <nav aria-label="breadcrumb"> +                            <ol class="breadcrumb"> +                            {% for loca in item.get_localisations %} +                                <li class="breadcrumb-item"> +                                    {{loca.short_label}} {{loca|simple_link_to_window}} +                                </li> +                            {% endfor %} +                            </ol> +                        </nav> +                    </dd> +                </dl> +                {% include "ishtar/blocks/sheet_creation_section.html" %} +                {% field_flex "Old reference" item.old_reference %} +                {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} +                {% include "ishtar/blocks/sheet_json.html" %} +            </div> +        </div> +        {% with item.container_type as container_type %} +        {% if container_type.length or container_type.width or container_type.height or container_type.volume or container_type.reference %} +        <h4>{% trans "Container type" %}</h4> +        <div class='row'> +            {% field_flex "Length (mm)" container_type.length %} +            {% field_flex "Width (mm)" container_type.width %} +            {% field_flex "Height (mm)" container_type.height %} +            {% field_flex "Volume (l)" container_type.volume %} +            {% field_flex "Reference" container_type.reference %} +        </div> +        {% endif %} +        {% endwith %} +        {% if PROFILE.locate_warehouses %} +        {% if item.point_2d or item.multi_polygon %} +        <h3>{% trans "Localisation"%}</h3> +        <div class='row'> +            {% with geo_item=item %} +            {% include "ishtar/blocks/sheet_simple_map.html" %} +            <div class="col-12 col-lg-6 flex-wrap"> +                {% include "ishtar/blocks/sheet_coordinates.html" %} +            </div> +            {% endwith %} +        </div> +        {% endif %} +        {% endif %} +    </div> -{% if item.container_content.count %} -{% trans "Finds" as finds_lbl %} -{% dynamic_table_document finds_lbl 'finds_inside_container' 'container' item.pk 'TABLE_COLS' output 'large' %} -{% endif %} +    <div class="tab-pane fade" id="{{window_id}}-content" +         role="tabpanel" aria-labelledby="{{window_id}}-content-tab"> +        {% if item.container_content.count or item.children.count %} -{% endif %} +        {% if item.children.count %} +        {% trans "Containers" as container_lbl %} +        {% dynamic_table_document container_lbl 'containers' 'parent' item.pk 'TABLE_COLS' output 'large' %} +        {% endif %} + +        {% if item.container_content.count %} +        {% trans "Finds" as finds_lbl %} +        {% dynamic_table_document finds_lbl 'finds_inside_container' 'container' item.pk 'TABLE_COLS' output 'large' %} +        {% endif %} + +        {% else %} +        <em>{% trans "Empty" %}</em> +        {% endif %} -{% if PROFILE.locate_warehouses %} -{% if item.point_2d or item.multi_polygon %} -<h3>{% trans "Localisation"%}</h3> -<div class='row'> -    {% with geo_item=item %} -    {% include "ishtar/blocks/sheet_simple_map.html" %} -    <div class="col-12 col-lg-6 flex-wrap"> -        {% include "ishtar/blocks/sheet_coordinates.html" %}      </div> -    {% endwith %}  </div> -{% endif %} -{% endif %} +  {% endblock %}  | 
