summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-09-09 14:53:28 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:21 +0100
commit687e26b039b3bce76f56ca3067b01895951edb53 (patch)
treeb6a9fed5f935dfa49ddc192ad5269a7545f01408 /ishtar_common
parentde0dff09b8dff23dd50922ba5afe61abcefe5557 (diff)
downloadIshtar-687e26b039b3bce76f56ca3067b01895951edb53.tar.bz2
Ishtar-687e26b039b3bce76f56ca3067b01895951edb53.zip
Sheet organization: show publication
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py6
-rw-r--r--ishtar_common/templates/ishtar/sheet_document.html3
-rw-r--r--ishtar_common/templates/ishtar/sheet_organization.html5
3 files changed, 10 insertions, 4 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index df9fe0c20..001c1894f 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -5423,6 +5423,7 @@ class Document(BaseHistorizedItem, QRCodeItem, OwnPerms, ImageModel,
'authors__cached_label': 'authors__cached_label',
'authors__person__pk': 'authors__person__pk',
"container_id": "container_id",
+ 'publisher__pk': 'publisher__pk'
}
# alternative names of fields for searches
@@ -5663,8 +5664,9 @@ class Document(BaseHistorizedItem, QRCodeItem, OwnPerms, ImageModel,
source_type = models.ForeignKey(SourceType, verbose_name=_("Type"),
on_delete=models.SET_NULL,
null=True, blank=True)
- publisher = models.ForeignKey(Organization, verbose_name=_("Publisher"),
- blank=True, null=True)
+ publisher = models.ForeignKey(
+ Organization, verbose_name=_("Publisher"), blank=True, null=True,
+ related_name='publish')
licenses = models.ManyToManyField(LicenseType, verbose_name=_("License"),
blank=True)
tags = models.ManyToManyField(DocumentTag, verbose_name=_("Tags"),
diff --git a/ishtar_common/templates/ishtar/sheet_document.html b/ishtar_common/templates/ishtar/sheet_document.html
index 292c964aa..a9c6f807e 100644
--- a/ishtar_common/templates/ishtar/sheet_document.html
+++ b/ishtar_common/templates/ishtar/sheet_document.html
@@ -114,8 +114,7 @@
{% field_flex_full "Warehouses" item.warehouses|add_links %}
{% field_flex_full "Containers" item.containers|add_links %}
{% endif %}
-
-{{ item.coins_tag|safe }}
+{{ item.coins_tag|default:""|safe }}
{% endblock %}
{% endblock %}
diff --git a/ishtar_common/templates/ishtar/sheet_organization.html b/ishtar_common/templates/ishtar/sheet_organization.html
index 5229d934c..f3761a514 100644
--- a/ishtar_common/templates/ishtar/sheet_organization.html
+++ b/ishtar_common/templates/ishtar/sheet_organization.html
@@ -68,4 +68,9 @@
{% dynamic_table_document af 'files' 'planning_service' item.pk '' output %}
{% endif %}
+{% if item.publish.count %}
+{% trans "Publications" as publications %}
+{% dynamic_table_document publications 'documents' 'publisher__pk' item.pk '' output %}
+{% endif %}
+
{% endblock %}