summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-04-17 13:20:42 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:20 +0100
commit52257bb404da82db28d497c3ece6de4b959e1fb9 (patch)
treeebd3f208b1d812a068939cc6ee0b6d4a376316b2 /archaeological_warehouse/templates
parentbc3b4054f96072443871553cfeed49a81d469cd8 (diff)
downloadIshtar-52257bb404da82db28d497c3ece6de4b959e1fb9.tar.bz2
Ishtar-52257bb404da82db28d497c3ece6de4b959e1fb9.zip
Fix statistics for warehouse
Diffstat (limited to 'archaeological_warehouse/templates')
-rw-r--r--archaeological_warehouse/templates/ishtar/sheet_warehouse.html251
-rw-r--r--archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html2
2 files changed, 148 insertions, 105 deletions
diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html
index feb8b786a..1307425ff 100644
--- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html
+++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html
@@ -8,124 +8,167 @@
{% block content %}
-<div class="row">
- <div class="offset-lg-4 col-lg-4 offset-md-3 col-md-6 offset-sm-1 col-sm-10 col-12">
- <div class="card">
- {% include "ishtar/blocks/window_image.html" %}
- <div class="card-body">
- <p class="card-text">
- <p class="window-refs">
- <strong>{{ item.name|default:"" }}</strong>
- </p>
- <p class="window-refs">
- {{ item.warehouse_type|default:"" }}
- </p>
- {% include "ishtar/blocks/sheet_external_id.html" %}
- </p>
+
+{% 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>
+ <li class="nav-item">
+ <a class="nav-link" id="{{window_id}}-stats-tab"
+ data-toggle="tab" href="#{{window_id}}-stats" role="tab"
+ aria-controls="{{window_id}}-stats" aria-selected="false">
+ {% trans "Statistics" %}
+ </a>
+ </li>
+</ul>
+{% endif %}
+
+<div class="tab-content" id="{{window_id}}-tab-content">
+
+ <div class="tab-pane fade show active" id="{{window_id}}-general"
+ role="tabpanel" aria-labelledby="{{window_id}}-general-tab">
+ <div class="row">
+ <div class="offset-lg-4 col-lg-4 offset-md-3 col-md-6 offset-sm-1 col-sm-10 col-12">
+ <div class="card">
+ {% include "ishtar/blocks/window_image.html" %}
+ <div class="card-body">
+ <div class="card-text">
+ <p class="window-refs">
+ <strong>{{ item.name|default:"" }}</strong>
+ </p>
+ <p class="window-refs">
+ {{ item.warehouse_type|default:"" }}
+ </p>
+ {% include "ishtar/blocks/sheet_external_id.html" %}
+ </div>
+ </div>
+ </div>
</div>
</div>
- </div>
-</div>
-<div class='row'>
- {% include "ishtar/blocks/sheet_creation_section.html" %}
- {% field_flex_detail "Person in charge" item.person_in_charge %}
- {% field_flex_detail "Organization" item.organization %}
- {% trans "Default divisions" as def_div_label %}
- {% field_flex def_div_label item.location_types|join:", " %}
- {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %}
- {% include "ishtar/blocks/sheet_json.html" %}
-</div>
+ <div class='row'>
+ {% include "ishtar/blocks/sheet_creation_section.html" %}
+ {% field_flex_detail "Person in charge" item.person_in_charge %}
+ {% field_flex_detail "Organization" item.organization %}
+ {% trans "Default divisions" as def_div_label %}
+ {% field_flex def_div_label item.location_types|join:", " %}
+ {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %}
+ {% include "ishtar/blocks/sheet_json.html" %}
+ </div>
-{% if item.point_2d or item.multi_polygon or item.get_address or item.get_address_complement or item.get_postal_code or item.get_town %}
-<h3>{% trans "Localisation"%}</h3>
-<div class='row'>
- {% with geo_item=item %}
- {% if PROFILE.locate_warehouses %}{% include "ishtar/blocks/sheet_simple_map.html"%}{% endif %}
- <div class="col-12 col-lg-6 flex-wrap">
- {% if PROFILE.locate_warehouses %}{% include "ishtar/blocks/sheet_coordinates.html"%}{% endif %}
- {% with full=True %}{% include "ishtar/blocks/sheet_address_section.html" %}{% endwith %}
+ {% if item.point_2d or item.multi_polygon or item.get_address or item.get_address_complement or item.get_postal_code or item.get_town %}
+ <h3>{% trans "Localisation"%}</h3>
+ <div class='row'>
+ {% with geo_item=item %}
+ {% if PROFILE.locate_warehouses %}{% include "ishtar/blocks/sheet_simple_map.html"%}{% endif %}
+ <div class="col-12 col-lg-6 flex-wrap">
+ {% if PROFILE.locate_warehouses %}{% include "ishtar/blocks/sheet_coordinates.html"%}{% endif %}
+ {% with full=True %}{% include "ishtar/blocks/sheet_address_section.html" %}{% endwith %}
+ </div>
+ {% endwith %}
+ </div>
+ {% endif %}
</div>
- {% endwith %}
-</div>
-{% endif %}
-
-{% if item.containers.count %}
-<h4>{% trans "Containers" %}</h4>
-{% dynamic_table_document '' 'containers' 'location_id' item.pk 'TABLE_COLS' output %}
-{% endif %}
+ <div class="tab-pane fade" id="{{window_id}}-content"
+ role="tabpanel" aria-labelledby="{{window_id}}-content-tab">
+ {% if item.containers.count %}
+ <h4>{% trans "Containers" %}</h4>
+ {% dynamic_table_document '' 'containers' 'location_id' item.pk 'TABLE_COLS' output %}
+ {% else %}
+ <div class="alert alert-info">
+ <i class="fa fa-exclamation-triangle"></i>
+ {% trans "No container inside this warehouse" %}
+ </div>
+ {% endif %}
+ </div>
-<h3>{% trans "Statistics" %}</h3>
-<small class="centered"><em>{% trans "These numbers are updated hourly" %}</em></small>
-
-<h4>{% trans "Finds" %}</h4>
-<div class='row'>
- {% trans "Number of attached finds" as number_of_attached_finds_label %}
- {% field_flex_2 number_of_attached_finds_label item.number_of_finds %}
- {% trans "Number of hosted finds" as number_of_hosted_finds_label %}
- {% field_flex_2 number_of_hosted_finds_label item.number_of_finds_hosted %}
-</div>
+ <div class="tab-pane fade" id="{{window_id}}-stats"
+ role="tabpanel" aria-labelledby="{{window_id}}-stats-tab">
+ <h3>{% trans "Statistics" %}</h3>
+ <small class="centered"><em>{% trans "These numbers are updated hourly" %}</em></small>
+
+ <h4>{% trans "Finds" %}</h4>
+ <div class='row'>
+ {% trans "Number of attached finds" as number_of_attached_finds_label %}
+ {% field_flex_2 number_of_attached_finds_label item.number_of_finds %}
+ {% trans "Number of hosted finds" as number_of_hosted_finds_label %}
+ {% field_flex_2 number_of_hosted_finds_label item.number_of_finds_hosted %}
+ </div>
-{% if item.number_of_finds_by_place %}
-<h4>{% trans "Finds by location in the warehouse" %}</h4>
-{% for items in item.number_of_finds_by_place %}
-{% if items %}
-<table class='table table-striped datatables'
- id="{{window_id}}-find-by-loca-{{forloop.counter}}">
- <thead>
- <tr>{% for location_type in item.location_types %}
- <th class="text-center">{{location_type|title}}</th>{% endfor %}
- <th class="text-center">{% trans "Total" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for item in items %}
- <tr>
- {% for local in item.0 %}<td>{{local}}</td>{% endfor %}
- <td class="text-right">{{item.1}}</td>
- </tr>
- {% endfor %}
- </tbody>
-</table>
-{% endif %}
-{% endfor %}
-{% endif %}
+ {% if item.number_of_finds_by_place %}
+ <h4>{% trans "Finds by location in the warehouse" %}</h4>
+ {% for items in item.number_of_finds_by_place %}
+ {% if items %}
+ <table class='table table-striped datatables'
+ id="{{window_id}}-find-by-loca-{{forloop.counter}}">
+ <thead>
+ <tr>{% for location_type in item.location_types %}
+ <th class="text-center">{{location_type|title}}</th>{% endfor %}
+ <th class="text-center">{% trans "Total" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for item in items %}
+ <tr>
+ {% for local in item.0 %}<td>{{local}}</td>{% endfor %}
+ <td class="text-right">{{item.1}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+
+ <h4>{% trans "Containers" %}</h4>
+ <div class='row'>
+ {% trans "Number of containers" as number_of_containers_label %}
+ {% field_flex_2 number_of_containers_label item.number_of_containers %}
+ </div>
-<h4>{% trans "Containers" %}</h4>
-<div class='row'>
- {% trans "Number of containers" as number_of_containers_label %}
- {% field_flex_2 number_of_containers_label item.number_of_containers %}
+ {% if item.number_of_containers_by_place %}
+ <h4>{% trans "Containers by location in the warehouse" %}</h4>
+ {% for items in item.number_of_containers_by_place %}
+ {% if items %}
+ <table class='table table-striped datatables'
+ id="{{window_id}}-container-by-loca-{{forloop.counter}}">
+ <thead>
+ <tr>{% for location_type in item.location_types %}
+ <th class="text-center">{{location_type|title}}</th>{% endfor %}
+ <th class="text-center">{% trans "Total" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for item in items %}
+ <tr>
+ {% for local in item.0 %}<td class="text-center">{{local}}</td>{% endfor %}
+ <td class="text-center">{{item.1}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+ </div>
</div>
-{% if item.number_of_containers_by_place %}
-<h4>{% trans "Containers by location in the warehouse" %}</h4>
-{% for items in item.number_of_containers_by_place %}
-{% if items %}
-<table class='table table-striped datatables'
- id="{{window_id}}-container-by-loca-{{forloop.counter}}">
- <thead>
- <tr>{% for location_type in item.location_types %}
- <th class="text-center">{{location_type|title}}</th>{% endfor %}
- <th class="text-center">{% trans "Total" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for item in items %}
- <tr>
- {% for local in item.0 %}<td class="text-center">{{local}}</td>{% endfor %}
- <td class="text-center">{{item.1}}</td>
- </tr>
- {% endfor %}
- </tbody>
-</table>
-{% endif %}
-{% endfor %}
-{% endif %}
-
<script type="text/javascript">
$(document).ready( function () {
datatable_options = {
diff --git a/archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html b/archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html
index dff23bc6c..2b11e9235 100644
--- a/archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html
+++ b/archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html
@@ -3,6 +3,6 @@
{% block form_head %}
<div class="alert alert-info">
<i class="fa fa-exclamation-triangle"></i>
- {% trans "Default division for this warehouse. Theses divisions are only used for imports." %}<br/>
+ {% trans "Default division for this warehouse. Theses divisions are only used for imports and statistics." %}<br/>
</div>
{% endblock %}