summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-02-18 11:24:25 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-02-18 11:24:25 +0100
commit22b0813edb80f378bf4906ab3157c26b0ea73457 (patch)
tree92adea84e14590d18bf3caaa996f893a8f9cd3fd /ishtar_common
parent38d8bed945ddd40df006ca8032b57489fed38015 (diff)
downloadIshtar-22b0813edb80f378bf4906ab3157c26b0ea73457.tar.bz2
Ishtar-22b0813edb80f378bf4906ab3157c26b0ea73457.zip
Sheet person: add related items tables
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/templates/ishtar/sheet_person.html47
-rw-r--r--ishtar_common/templatetags/window_tables.py16
2 files changed, 58 insertions, 5 deletions
diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html
index 308739619..a32229814 100644
--- a/ishtar_common/templates/ishtar/sheet_person.html
+++ b/ishtar_common/templates/ishtar/sheet_person.html
@@ -94,6 +94,16 @@
{% dynamic_table_document colla 'operations' 'collaborators__pk' item.pk '' output %}
{% endif %}
+{% trans "Operations associées en tant que rapporteur CIRA" as cira %}
+{% if item.cira_rapporteur.count %}
+{% dynamic_table_document cira 'operations' 'cira_rapporteur__pk' item.pk '' output %}
+{% endif %}
+
+{% trans "Associated archaeological sites as collaborator" as colla %}
+{% if item.site_collaborator.count %}
+{% dynamic_table_document colla 'sites' 'collaborators__pk' item.pk '' output %}
+{% endif %}
+
{% trans "In charge of archaeological files" as af %}
{% if item.file_responsability.count %}
{% dynamic_table_document af 'files' 'in_charge__pk' item.pk '' output %}
@@ -109,6 +119,43 @@
{% dynamic_table_document af 'files' 'responsible_town_planning_service__pk' item.pk '' output %}
{% endif %}
+{% comment %} to be tested.........
+{% trans "In charge of administrative acts" as admin_act %}
+{% if item.adminact_operation_in_charge.count %}
+{% dynamic_table_document admin_act 'admin_acts' 'in_charge__pk' item.pk '' output %}
+{% endif %}
+
+{% trans "Scientist of administrative acts" as admin_act %}
+{% if item.adminact_scientist.count %}
+{% dynamic_table_document admin_act 'admin_acts' 'scientist__pk' item.pk '' output %}
+{% endif %}
+
+{% trans "Signatory of administrative acts" as admin_act %}
+{% if item.signatory.count %}
+{% dynamic_table_document admin_act 'admin_acts' 'signatory__pk' item.pk '' output %}
+{% endif %}
+{% endcomment %}
+
+{% trans "In charge of treatments" as tr %}
+{% if item.treatments.count %}
+{% dynamic_table_document tr 'base_treatments' 'person__pk' item.pk '' output %}
+{% endif %}
+
+{% trans "In charge of treatment files" as tr %}
+{% if item.treatmentfile_responsability.count %}
+{% dynamic_table_document tr 'treatment_files' 'in_charge__pk' item.pk '' output %}
+{% endif %}
+
+{% trans "Applicant of treatment files" as tr %}
+{% if item.treatmentfile_applicant.count %}
+{% dynamic_table_document tr 'treatment_files' 'applicant__pk' item.pk '' output %}
+{% endif %}
+
+{% trans "In charge of warehouses" as wh %}
+{% if item.warehouse_in_charge.count %}
+{% dynamic_table_document wh 'warehouses' 'person_in_charge__pk' item.pk '' output %}
+{% endif %}
+
{% if item.docs_q.count %}
{% trans "Documents" as docs %}
{% dynamic_table_document docs 'documents' 'authors__person__pk' item.pk '' output %}
diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py
index ce767e1ac..879349d02 100644
--- a/ishtar_common/templatetags/window_tables.py
+++ b/ishtar_common/templatetags/window_tables.py
@@ -14,12 +14,13 @@ from ishtar_common.widgets import DataTable
from ishtar_common.models import Document
from archaeological_files.models import File
-from archaeological_operations.models import Operation, ArchaeologicalSite
+from archaeological_operations.models import Operation, ArchaeologicalSite, \
+ AdministrativeAct
from archaeological_context_records.models import ContextRecord, \
RecordRelationView, RecordRelations as CRRecordRelations
from archaeological_finds.models import Find, FindUpstreamTreatments, \
- FindDownstreamTreatments, FindTreatments
-from archaeological_warehouse.models import Container
+ FindDownstreamTreatments, FindTreatments, TreatmentFile, Treatment
+from archaeological_warehouse.models import Container, Warehouse
register = template.Library()
@@ -32,6 +33,8 @@ def table_document(caption, data):
ASSOCIATED_MODELS = {}
ASSOCIATED_MODELS['files'] = (File, 'get-file', '')
ASSOCIATED_MODELS['operations'] = (Operation, 'get-operation', '')
+ASSOCIATED_MODELS['admin_acts'] = (AdministrativeAct,
+ 'get-administrativeact', '')
ASSOCIATED_MODELS['context_records'] = (ContextRecord, 'get-contextrecord',
'get-contextrecord-full')
ASSOCIATED_MODELS['context_records_for_ope'] = (
@@ -54,8 +57,11 @@ ASSOCIATED_MODELS['finds_downstreamtreatments'] = (
FindDownstreamTreatments, 'get-downstreamtreatment', '')
ASSOCIATED_MODELS['treatments'] = (
FindTreatments, 'get-treatment', '')
-ASSOCIATED_MODELS['containers'] = (
- Container, 'get-container', '')
+ASSOCIATED_MODELS['base_treatments'] = (
+ Treatment, 'get-treatment', '')
+ASSOCIATED_MODELS['treatment_files'] = (TreatmentFile, 'get-treatmentfile', '')
+ASSOCIATED_MODELS['containers'] = (Container, 'get-container', '')
+ASSOCIATED_MODELS['warehouses'] = (Warehouse, 'get-warehouse', '')
ASSOCIATED_MODELS['documents'] = (Document, 'get-document', '')