From d32e6430e41bb319d44dba3a6ac9208801f6f55a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 29 Jun 2018 11:06:38 +0200 Subject: Sheet: complete images informations --- ishtar_common/models.py | 8 +- .../ishtar/blocks/window_image_detail.html | 260 +++++++++++++++------ 2 files changed, 195 insertions(+), 73 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 2c8595a99..13e91a680 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3178,7 +3178,7 @@ class Document(OwnPerms, ImageModel, FullSearch): receipt_date_in_documentation = models.DateField( blank=True, null=True, verbose_name=_(u"Receipt date in documentation")) - item_number = models.IntegerField(_(u"Item number"), default=1) + item_number = models.IntegerField(_(u"Number of items"), default=1) description = models.TextField(_(u"Description"), blank=True, null=True) comment = models.TextField(_(u"Comment"), blank=True, null=True) additional_information = models.TextField(_(u"Additional information"), @@ -3219,6 +3219,12 @@ class Document(OwnPerms, ImageModel, FullSearch): self.index) """ + @property + def associated_file_name(self): + if not self.associated_file: + return "" + return os.path.basename(self.associated_file.name) + @property def images(self): # mimic a queryset pointing to himself diff --git a/ishtar_common/templates/ishtar/blocks/window_image_detail.html b/ishtar_common/templates/ishtar/blocks/window_image_detail.html index c64d72ac2..b095c8b04 100644 --- a/ishtar_common/templates/ishtar/blocks/window_image_detail.html +++ b/ishtar_common/templates/ishtar/blocks/window_image_detail.html @@ -1,74 +1,190 @@ {% load i18n %} - {% if image.title %}

{{image.title}}

{% endif %} - {% if image.description %}

- {{image.description}} -

{% endif %} - {% if image.licences.count %} -
-
- {% trans "Licenses" %} -
-
- {% for license in image.licenses.all %} - {% if not forloop.first %} ; {% endif %}{% if license.url %}{% endif %} - {{license}} - {% if license.url %}{% endif %} - {% endfor %} -
-
- {% endif %} - {% if image.authors.count or image.authors_raw %} -
-
- {% trans "Authors" %} -
-
- {% for author in image.authors.all %} - {% if not forloop.first %} ; {% endif %}{{author}}{% endfor %} - {% if image.authors_raw %} - {% if image.authors.count %} ; {% endif %} - {{image.authors_raw}} - {% endif %} -
-
- {% endif %} - {% if image.image_type %} -
-
- {% trans "Type" %} -
-
- {{image.image_type}} -
-
- {% endif %} - {% if image.reference %} -
-
- {% trans "Ref." %} -
-
- {{image.reference}} -
-
- {% endif %} - {% if image.internal_reference %} -
-
- {% trans "Internal ref." %} -
-
- {{image.internal_reference}} -
-
- {% endif %} - {% if image.creation_date %} -
-
- {% trans "Creation date" %} -
-
- {{image.creation_date}} -
-
+{% if image.title %}

{{image.title}}

{% endif %} +{% if image.description %}

+{{image.description}} +

{% endif %} +{% if image.authors.count or image.authors_raw %} +
+
+ {% trans "Authors" %} +
+
+ {% for author in image.authors.all %} + {% if not forloop.first %}
{% endif %}{{author}}{% endfor %} + {% if image.authors_raw %} + {% if image.authors.count %}
{% endif %} + {{image.authors_raw}} {% endif %} +
+
+{% endif %} +{% if image.source_type %} +
+
+ {% trans "Type" %} +
+
+ {{image.source_type}} +
+
+{% endif %} +{% if image.reference %} +
+
+ {% trans "Ref." %} +
+
+ {{image.reference}} +
+
+{% endif %} +{% if image.internal_reference %} +
+
+ {% trans "Internal ref." %} +
+
+ {{image.internal_reference}} +
+
+{% endif %} +{% if image.creation_date %} +
+
+ {% trans "Creation date" %} +
+
+ {{image.creation_date}} +
+
+{% endif %} +{% if image.licences.count %} +
+
+ {% trans "Licenses" %} +
+
+ {% for license in image.licenses.all %} + {% if not forloop.first %} ; {% endif %}{% if license.url %}{% endif %} + {{license}} + {% if license.url %}{% endif %} + {% endfor %} +
+
+{% endif %} +{% if image.support_type %} +
+
+ {% trans "Support" %} +
+
+ {{image.support_type}} +
+
+{% endif %} +{% if image.format_type %} +
+
+ {% trans "Format" %} +
+
+ {{image.format_type}} +
+
+{% endif %} +{% if image.scale %} +
+
+ {% trans "Scale" %} +
+
+ {{image.scale}} +
+
+{% endif %} +{% if image.duplicate %} +
+
+ {% trans "Has a duplicate" %} +
+
+ {% trans "Yes" %} +
+
+{% endif %} +{% if image.item_number %} +
+
+ {% trans "Number of items" %} +
+
+ {{image.item_number}} +
+
+{% endif %} +{% if image.associated_file %} +
+
+ {% trans "File" context "not directory" %} +
+ +
+{% endif %} +{% if image.associated_url %} +
+
+ {% trans "Web" %} +
+ +
+{% endif %} +{% if image.receipt_date %} +
+
+ {% trans "Receipt date" %} +
+
+ {{image.receipt_date}} +
+
+{% endif %} +{% if image.receipt_date_in_documentation %} +
+
+ {% trans "Receipt date in documentation" %} +
+
+ {{image.receipt_date_in_documentation}} +
+
+{% endif %} +{% if image.comment %} +
+
+ {% trans "Comment" %} +
+
+

+ {{image.comment}} +

+
+
+{% endif %} +{% if image.additional_information %} +
+
+ {% trans "Additional information" %} +
+
+

+ {{image.additional_information}} +

+
+
+{% endif %} -- cgit v1.2.3