diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-19 17:33:37 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-19 17:33:37 +0100 | 
| commit | 33876e5250b1883dd2f8bee9cf19762d283e9cde (patch) | |
| tree | 656e6b4f57ae2386987a06dab0006b1a3c966b85 | |
| parent | 448e8ba14d698fe49b52e258fef1b99d675a7c5c (diff) | |
| download | Ishtar-33876e5250b1883dd2f8bee9cf19762d283e9cde.tar.bz2 Ishtar-33876e5250b1883dd2f8bee9cf19762d283e9cde.zip  | |
Treatments/Treatment files sheets: add source list (refs #3402)
4 files changed, 19 insertions, 2 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 2efedbc22..4a453f538 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -567,6 +567,7 @@ class TreatmentSource(Source):          Treatment, verbose_name=_(u"Treatment"), related_name="source")      BOOL_FIELDS = ['duplicate']      TABLE_COLS = ['treatment__cached_label'] + Source.TABLE_COLS +    COL_LABELS = {'treatment__cached_label': _(u"Treatment")}      SHOW_URL = 'show-treatmentsource'      class Meta: @@ -584,6 +585,7 @@ class TreatmentFileSource(Source):          related_name="source")      BOOL_FIELDS = ['duplicate']      TABLE_COLS = ['treatment_file__cached_label'] + Source.TABLE_COLS +    COL_LABELS = {'treatment_file__cached_label': _(u"Treatment file")}      SHOW_URL = 'show-treatmentfilesource'      class Meta: diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html index eeaa95dff..37688b267 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatment.html +++ b/archaeological_finds/templates/ishtar/sheet_treatment.html @@ -56,6 +56,11 @@  {% trans "Related operations" as related_operations %}  {% dynamic_table_document related_operations 'operations' 'related_treatment' item.pk 'TABLE_COLS' output %} +{% if item.source.count %} +{% trans "Associated documents" as associated_docs %} +{% dynamic_table_document associated_docs 'treatments_docs' 'treatment' item.pk '' output %} +{% endif %} +  {% if item.administrative_act.count %}  {% trans "Administrative acts" as admact_lbl %}  {% table_administrativact admact_lbl item.administrative_act.all %} diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html index 4b7405192..81311deb8 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html +++ b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html @@ -42,11 +42,16 @@  {% field "Contact" item.applicant.address_lbl %}  {% endif %} -{% trans "Treatments" as treatments %}  {% if item.treatments.count %} +{% trans "Treatments" as treatments %}  {% dynamic_table_document treatments 'treatments' 'file' item.pk '' output '' 'treatment' %}  {% endif %} +{% if item.source.count %} +{% trans "Associated documents" as associated_docs %} +{% dynamic_table_document associated_docs 'treatmentfiles_docs' 'treatment_file' item.pk '' output %} +{% endif %} +  {% if item.administrative_act.count %}  {% trans "Administrative acts" as admact_lbl %}  {% table_administrativact admact_lbl item.administrative_act.all %} diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py index 05592557a..960bc7184 100644 --- a/ishtar_common/templatetags/window_tables.py +++ b/ishtar_common/templatetags/window_tables.py @@ -18,7 +18,8 @@ from archaeological_context_records.models import ContextRecord, \      ContextRecordSource, RecordRelationView, \      RecordRelations as CRRecordRelations  from archaeological_finds.models import Find, FindSource, \ -    FindUpstreamTreatments, FindDownstreamTreatments, FindTreatments +    FindUpstreamTreatments, FindDownstreamTreatments, FindTreatments, \ +    TreatmentSource, TreatmentFileSource  from archaeological_warehouse.models import Container  register = template.Library() @@ -59,6 +60,10 @@ ASSOCIATED_MODELS['finds_downstreamtreatments'] = (      FindDownstreamTreatments, 'get-downstreamtreatment', '')  ASSOCIATED_MODELS['treatments'] = (      FindTreatments, 'get-treatment', '') +ASSOCIATED_MODELS['treatments_docs'] = ( +    TreatmentSource, 'get-treatmentsource', '') +ASSOCIATED_MODELS['treatmentfiles_docs'] = ( +    TreatmentFileSource, 'get-treatmentfilesource', '')  ASSOCIATED_MODELS['containers'] = (      Container, 'get-container', '')  | 
