diff options
Diffstat (limited to 'archaeological_operations/templates')
-rw-r--r-- | archaeological_operations/templates/ishtar/sheet_operation.html | 83 |
1 files changed, 73 insertions, 10 deletions
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index babcc9ce0..811997515 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -21,9 +21,10 @@ {% with display_data=item.data %} {% with display_relations=item|safe_or:"right_relations.count|left_relations.count" %} -{% with display_sites=item|safe_or:"archaeological_sites.count|grouped_parcels|administrative_act.count" %} +{% with display_sites=item|safe_or:"archaeological_sites.count|grouped_parcels|administrative_act.count|archaeological_sites_list" %} {% with perm_documents=permission_view_own_document|or_:permission_view_document %} -{% with display_documents=perm_documents|and_:item.documents.count %} +{% with has_documents=item|safe_or:"documents.count|documents_list" %} +{% with display_documents=perm_documents|and_:has_documents %} {% with perm_context_records=permission_view_own_contextrecord|or_:permission_view_contextrecord %} {% with has_context_records=item|safe_or:"context_record.count" %} {% with display_context_records=perm_context_records|and_:has_context_records %} @@ -31,7 +32,7 @@ {% with has_finds=item|safe_or:"has_finds" %} {% with display_finds=perm_find|and_:has_finds %} -{% if output != "ODT" and output != "PDF"%} +{% 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" @@ -94,6 +95,7 @@ </a> </li> {% endif %} + {% if not is_external %} <li class="nav-item"> <a class="nav-link" id="{{window_id}}-statistics-tab" data-toggle="tab" href="#{{window_id}}-statistics" role="tab" @@ -101,6 +103,7 @@ {% trans "Statistics" %} </a> </li> + {% endif %} </ul> {% endif %} @@ -131,7 +134,7 @@ {% if next %} {{ item|m2m_listing:'towns'|join:" ; "|default:'' }} {% else %} - {{ item.towns_codes|join:" ; "|default:'' }} + {{ item.cached_towns_label }} {% endif %} </p> <p class='window-refs' title="{% trans 'Name' %}">{{item.common_name|default:''}}</p> @@ -141,13 +144,19 @@ <div class="row"> {% trans "Excavation dates (start/end)" as date_label %} + {% if not is_external %} {% with start_date=item.start_date|date:"DATE_FORMAT"|default:"-" %} {% with end_date=item.excavation_end_date|date:"DATE_FORMAT"|default:"-" %} {% with dates=start_date|add:" / "|add:end_date %} {% field_flex_2 date_label dates %} - {% endwith %} - {% endwith %} - {% endwith %} + {% endwith %}{% endwith %}{% endwith %} + {% else %} + {% with start_date=item.start_date|default:"-" %} + {% with end_date=item.excavation_end_date|default:"-" %} + {% with dates=start_date|add:" / "|add:end_date %} + {% field_flex_2 date_label dates %} + {% endwith %}{% endwith %}{% endwith %} + {% endif %} <dl class="col-12 col-md-6 col-lg-3 flex-wrap"> <dt> {% trans "State" %} @@ -243,10 +252,12 @@ {% field_flex_full "Comment about scientific documentation" item.scientific_documentation_comment "<pre>" "</pre>" %} </div> + {% if not is_external %} <h3>{% trans "Sheet"%}</h3> <div class="row"> {% include "ishtar/blocks/sheet_creation_section.html" %} </div> + {% endif %} {% if item.virtual_operation %} <div class="alert alert-warning" role="alert"> @@ -282,7 +293,7 @@ {% if next %} {% field_flex_full "Towns" item|m2m_listing:'towns'|join:" ; " %} {% else %} - {% field_flex_full "Towns" item.towns_codes|join:" ; " %} + {{ item.cached_towns_label }} {% endif %} {% field_flex "Address" item.address %} {% if not item.address %} @@ -301,9 +312,24 @@ {% if display_sites %} <div class="tab-pane fade" id="{{window_id}}-sites" role="tabpanel" aria-labelledby="{{window_id}}-sites-tab"> - {% if item.archaeological_sites.count %} {% trans "Archaeological sites" as archaeologicalsites_label %} + {% if item.archaeological_sites.count %} {% dynamic_table_document archaeologicalsites_label 'sites' 'operations' item.pk '' output %} + {% elif item.archaeological_sites_list %} + <h3>{{archaeologicalsites_label}}</h3> + <table class='table table-striped datatables' + id="{{window_id}}-sites-table"> + {% for values in item.archaeological_sites_list %}{% if not forloop.counter0 %} + <thead> + {% for value in values %}<th class="text-center">{{value}}</th>{% endfor %} + </thead> + {% else %} + <tr> + {% for value in values %}<td>{{value}}</td>{% endfor %} + </tr> + {% endif %} + {% endfor %} + </table> {% endif %} {% if item.parcels.count %} @@ -322,7 +348,24 @@ <div class="tab-pane fade" id="{{window_id}}-documents" role="tabpanel" aria-labelledby="{{window_id}}-documents-tab"> {% trans "Document from this operation" as operation_docs %} + {% if item.documents.count %} {% dynamic_table_document operation_docs 'documents' 'operations' item.pk '' output %} + {% elif item.documents_list %} + <h3>{{operation_docs}}</h3> + <table class='table table-striped datatables' + id="{{window_id}}-docs-table"> + {% for values in item.documents_list %}{% if not forloop.counter0 %} + <thead> + {% for value in values %}<th class="text-center">{{value}}</th>{% endfor %} + </thead> + {% else %} + <tr> + {% for value in values %}<td>{{value}}</td>{% endfor %} + </tr> + {% endif %} + {% endfor %} + </table> + {% endif %} </div> {% endif %} @@ -414,6 +457,7 @@ {% include "ishtar/blocks/sheet_json.html" %} </div> {% endif %} + {% if not is_external %} <div class="tab-pane fade" id="{{window_id}}-statistics" role="tabpanel" aria-labelledby="{{window_id}}-statistics-tab"> <h3>{% trans "Statistics" %}</h3> @@ -538,8 +582,27 @@ </div> {% endif %} </div> + {% endif %} </div> -{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} + +<script type="text/javascript"> +$(document).ready( function () { + datatable_options = { + "dom": 'ltip', + }; + $.extend(datatable_options, datatables_static_default); + if (datatables_i18n) datatable_options['language'] = datatables_i18n; + $('.datatables').each( + function(){ + var dt_id = "#" + $(this).attr('id'); + if (! $.fn.DataTable.isDataTable(dt_id) ) { + $(dt_id).DataTable(datatable_options); + } + }); +} ); +</script> + +{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endblock %}
\ No newline at end of file |