diff options
| -rw-r--r-- | archaeological_warehouse/templates/ishtar/sheet_container.html | 7 | ||||
| -rw-r--r-- | ishtar_common/models.py | 1 | ||||
| -rw-r--r-- | ishtar_common/templatetags/window_tables.py | 1 | 
3 files changed, 8 insertions, 1 deletions
diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index 238ab1e0c..4ea1d36c5 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -139,7 +139,7 @@      <div class="tab-pane fade" id="{{window_id}}-content"           role="tabpanel" aria-labelledby="{{window_id}}-content-tab"> -        {% if item.container_content.count or item.children.count %} +        {% if item.container_content.count or item.children.count or item.contained_documents.count %}          {% if item.children.count %}          <h4>{% trans "Divisions" %}</h4> @@ -153,6 +153,11 @@          {% dynamic_table_document '' 'finds_inside_container' 'container' item.pk 'TABLE_COLS' output 'large' %}          {% endif %} +        {% if item.contained_documents.count %} +        {% trans "Documents" as document_lbl %} +        {% dynamic_table_document document_lbl 'documents' 'container_id' item.pk 'TABLE_COLS' output 'large' %} +        {% endif %} +          {% else %}          <div class="alert alert-info">              <i class="fa fa-exclamation-triangle"></i> diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 42b4c479a..a5e8e6341 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -5416,6 +5416,7 @@ class Document(BaseHistorizedItem, QRCodeItem, OwnPerms, ImageModel,              "finds__base_finds__context_record__operation__pk",          'authors__cached_label': 'authors__cached_label',          'authors__person__pk': 'authors__person__pk', +        "container_id": "container_id",      }      # alternative names of fields for searches diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py index 8193f1061..a96460869 100644 --- a/ishtar_common/templatetags/window_tables.py +++ b/ishtar_common/templatetags/window_tables.py @@ -71,6 +71,7 @@ ASSOCIATED_MODELS['non-divisions'] = (  ASSOCIATED_MODELS['warehouses'] = (Warehouse, 'get-warehouse', '')  ASSOCIATED_MODELS['documents'] = (Document, 'get-document', '') +ASSOCIATED_MODELS['documents_inside_container'] = (Document, 'get-document', '')  @register.simple_tag(takes_context=True)  | 
