From 3352f862195ca00494f2aed3ec7d548cb1dd1b5c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 28 Jun 2018 11:25:14 +0200 Subject: Migrate from xhtml2odt to pandoc for ODT generation (refs #4178) --- .../templates/ishtar/blocks/window_image.html | 84 +++------------------- .../ishtar/blocks/window_image_detail.html | 74 +++++++++++++++++++ .../templates/ishtar/blocks/window_image_odt.html | 9 +++ ishtar_common/templates/ishtar/sheet.html | 26 ++++--- 4 files changed, 107 insertions(+), 86 deletions(-) create mode 100644 ishtar_common/templates/ishtar/blocks/window_image_detail.html create mode 100644 ishtar_common/templates/ishtar/blocks/window_image_odt.html (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/blocks/window_image.html b/ishtar_common/templates/ishtar/blocks/window_image.html index aa43e1ca5..ab1013df9 100644 --- a/ishtar_common/templates/ishtar/blocks/window_image.html +++ b/ishtar_common/templates/ishtar/blocks/window_image.html @@ -1,81 +1,12 @@ {% load i18n %}{% if item.images.count %} +{% if output == "ODT" or output == "PDF"%} +{% include "ishtar/blocks/window_image_odt.html" %} +{% else %}
{% for image in item.images.all %}
× - {% 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}} -
-
- {% endif %} + {% include "ishtar/blocks/window_image_detail.html" %} {% trans "Modify" %}   @@ -84,10 +15,11 @@
{% for image in item.images.all %} - {% if output != "ODT" %}{% endif %} + - {% if output != "ODT" %}{% endif %} + {% endfor %}
{% endif%} +{% endif%} diff --git a/ishtar_common/templates/ishtar/blocks/window_image_detail.html b/ishtar_common/templates/ishtar/blocks/window_image_detail.html new file mode 100644 index 000000000..c64d72ac2 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_image_detail.html @@ -0,0 +1,74 @@ +{% 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}} +
+
+ {% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_image_odt.html b/ishtar_common/templates/ishtar/blocks/window_image_odt.html new file mode 100644 index 000000000..9c9383cdd --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_image_odt.html @@ -0,0 +1,9 @@ +{% load i18n %} +
+ {% for image in item.images.all %} +
+ + {% include "ishtar/blocks/window_image_detail.html" %} +
+ {% endfor %} +
diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html index 54a2f767d..e937f1474 100644 --- a/ishtar_common/templates/ishtar/sheet.html +++ b/ishtar_common/templates/ishtar/sheet.html @@ -13,13 +13,23 @@
+ {% if output != "ODT" and output != "PDF"%} {% block toolbar %}{% endblock %} + {% endif %}
+ {% if output != "ODT" and output != "PDF"%} {% block head_sheet %} {% endblock %} + {% endif %}
{% block content %} {% endblock %} -- cgit v1.2.3