From dc9d77a2c32be8d0e53fdf39f9b13616e8adad53 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 11 Jun 2020 17:57:00 +0200 Subject: Documents sheet: new fields - better layout --- .../ishtar/blocks/sheet_creation_section.html | 24 ++--- ishtar_common/templates/ishtar/sheet_document.html | 103 +++++++++++++++------ 2 files changed, 89 insertions(+), 38 deletions(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html b/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html index 6d0baa2de..a848dad5d 100644 --- a/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html +++ b/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html @@ -1,19 +1,19 @@ {% load i18n link_to_window %} {% if item.history_creator.ishtaruser.person %} -
-
{% trans "Creation" context "Sheet" %}{{item.history_creator.ishtaruser.person|link_to_window:request}}
-
- {{item.history_creator.ishtaruser.person}}
- {{item.history_creation_date|date:"DATETIME_FORMAT"}} -
+
+ + {{item.history_creator.ishtaruser.person}} + {{item.history_creator.ishtaruser.person|link_to_window:request}}
+ {{item.history_creation_date|date:"DATETIME_FORMAT"}}
{% endif %} {% if not item.last_edition_date or item.history_creation_date != item.last_edition_date %} -
-
{% trans "Modification" context "Sheet" %}{{item.history_modifier.ishtaruser.person|link_to_window:request}}
-
- {{item.history_modifier.ishtaruser.person}}
- {% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %} -
+
+ + {{item.history_modifier.ishtaruser.person}} + {{item.history_modifier.ishtaruser.person|link_to_window:request}}
+ {% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %}
{% endif %} diff --git a/ishtar_common/templates/ishtar/sheet_document.html b/ishtar_common/templates/ishtar/sheet_document.html index 321125edd..0212b1695 100644 --- a/ishtar_common/templates/ishtar/sheet_document.html +++ b/ishtar_common/templates/ishtar/sheet_document.html @@ -11,42 +11,93 @@ {% block general %} -{% if item.images.count %} -
-
-
- {% include "ishtar/blocks/window_image.html" %} +{% if item.main_image %} +
+
+ {% include "ishtar/blocks/window_image.html" %} +
+
+{% else %} +
+{% endif %} + +

{% trans "Identification" %}

+
+

{{ item.reference|default:"" }}

+

{{ item.internal_reference|default:"" }}

+ {% include "ishtar/blocks/sheet_external_id.html" %}
+ {% field_flex "Title" item.title %} + {% field_flex "Type" item.source_type_html "" "" 1 %} + {% include "ishtar/blocks/sheet_creation_section.html" %} + + {% if item.format_type or item.support_type or item.scale %} +

{% trans "Format" %}

+ {% field_flex "Format" item.format_type %} + {% field_flex "Support" item.support_type %} + {% field_flex "Scale" item.scale %} + {% endif %} + + {% if item.associated_file or item.associated_url or item.tags.count %} +

{% trans "Content" %}

+ {% trans "File" context "Not directory" as file_label %} + {% field_flex_file file_label item.associated_file %} + {% trans "Web link" as weblink_label %} + {% field_flex_url weblink_label item.associated_url %} + {% field_flex_multiple_obj "Tags" item 'tags' %} + {% endif %} + + {% if item.authors.count %} +

{% trans "Authors" %}

+ {% field_flex_full "" item.authors|add_links:'person' %} + {% endif %}
+{% if item.main_image %}
{% endif %} -
- {% field_flex "Title" item.title %} - {% field_flex "Index" item.index %} - {% field_flex "Source type" item.source_type_html "" "" 1 %} - {% trans "File" context "Not directory" as file_label %} - {% field_flex_file file_label item.associated_file %} - {% field_flex "Format" item.format_type %} - {% field_flex "Scale" item.scale %} - {% trans "Web link" as weblink_label %} - {% field_flex_url weblink_label item.associated_url %} - {% if item.item_number != 1 %}{% field_flex "Item number" item.item_number %}{% endif %} - {% field_flex "Ref." item.reference %} - {% field_flex "Internal ref." item.internal_reference %} + + {% if item.creation_date or item.receipt_date or item.receipt_date_in_documentation %} +

{% trans "Dates" %}

+ {% field_flex "Creation date" item.creation_date|date:"DATE_FORMAT" %} + {% field_flex "Receipt date" item.receipt_date|date:"DATE_FORMAT" %} + {% field_flex "Receipt date in documentation" item.receipt_date_in_documentation|date:"DATE_FORMAT" %} + {% endif %} + + {% if item.publisher or item.language or item.isbn or item.issn or item.licenses.count %} +

{% trans "Publishing" %}

+ {% field_flex_detail "Publisher" item.publisher %} + {% field_flex "Language" item.language %} + {% field_flex "ISBN" item.isbn %} + {% field_flex "ISSN" item.issn %} + {% field_flex_multiple_obj "Licenses" item 'licenses' %} + {% endif %} + + {% if item.source or item.source_free_input %} +

{% trans "Source" %}

+ {% field_flex_detail "Source" item.source %} + {% field_flex "" item.source_free_input %} + {% endif %} + + {% if item.container or item.container_ref or item.item_number != 1 or item.duplicate %} +

{% trans "Container" %}

{% field_flex_detail "Container" item.container %} {% field_flex_detail "Reference container" item.container_ref %} - {% field_flex "Creation date" item.creation_date %} - {% field_flex "Receipt date" item.receipt_date %} - {% field_flex "Receipt date in documentation" item.receipt_date_in_documentation %} + {% if item.item_number != 1 %}{% field_flex "Item number" item.item_number %}{% endif %} {% if item.duplicate %}{% field_flex "Has a duplicate" item.duplicate %}{% endif %} - {% field_flex "Description" item.description %} - {% field_flex "Comment" item.comment %} - {% field_flex "Additional information" item.additional_information %} - {% field_flex_full "Authors" item.authors|add_links:'person' %} + {% endif %} + + {% if item.description or item.comment or item.additional_information %} +

{% trans "Other" %}

+ {% field_flex_full "Description" item.description %} + {% field_flex_full "Comment" item.comment %} + {% field_flex_full "Additional information" item.additional_information %} + {% endif %} +
- {% include "ishtar/blocks/sheet_creation_section.html" %}
{% include "ishtar/blocks/sheet_json.html" %} -- cgit v1.2.3