summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/templates/ishtar/sheet_warehouse.html
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/templates/ishtar/sheet_warehouse.html')
-rw-r--r--archaeological_warehouse/templates/ishtar/sheet_warehouse.html27
1 files changed, 25 insertions, 2 deletions
diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html
index b4786de5b..7c279fe69 100644
--- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html
+++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html
@@ -1,5 +1,5 @@
{% extends "ishtar/sheet.html" %}
-{% load i18n window_header window_field window_tables %}
+{% load i18n ishtar_helpers window_header window_field window_tables %}
{% block head_title %}<strong>{% trans "Warehouse" %}</strong> - {{item.name}} ({{item.warehouse_type}}){% endblock %}
{% block toolbar %}
@@ -7,7 +7,9 @@
{% endblock %}
{% block content %}
-
+{% with can_view_documents=permission_view_own_document|or_:permission_view_document %}
+{% with has_documents=item.documents.count %}
+{% with display_documents=can_view_documents|and_:has_documents %}
{% if output != "ODT" and output != "PDF"%}
<ul class="nav nav-tabs" id="{{window_id}}-tabs" role="tablist">
@@ -32,6 +34,15 @@
{% trans "Statistics" %}
</a>
</li>
+ {% if display_documents %}
+ <li class="nav-item">
+ <a class="nav-link" id="{{window_id}}-documents-tab"
+ data-toggle="tab" href="#{{window_id}}-documents" role="tab"
+ aria-controls="{{window_id}}-documents" aria-selected="false">
+ {% trans "Documents" %}
+ </a>
+ </li>
+ {% endif %}
</ul>
{% endif %}
@@ -214,6 +225,17 @@
{% endif %}
</div>
+ {% if display_documents %}
+ <div class="tab-pane fade" id="{{window_id}}-documents"
+ role="tabpanel" aria-labelledby="{{window_id}}-documents-tab">
+ {% trans "Document for this warehouse" as w_docs %}
+ {% if permission_view_own_document or permission_view_document %}
+ {% if item.documents.count %}
+ {% dynamic_table_document w_docs 'documents' 'warehouses' item.pk '' output %}
+ {% endif %}
+ {% endif %}
+ </div>
+ {% endif %}
</div>
<script type="text/javascript">
@@ -233,4 +255,5 @@ $(document).ready( function () {
} );
</script>
+{% endwith %} {% endwith %} {% endwith %}
{% endblock %}