diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-28 11:25:14 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-28 11:25:14 +0200 |
commit | 3352f862195ca00494f2aed3ec7d548cb1dd1b5c (patch) | |
tree | 9c76d7cc39a0919e3a3a172157a555817bd62f4b /ishtar_common/templates | |
parent | 51517b852e4548257525462b6c5184c6e006d3a4 (diff) | |
download | Ishtar-3352f862195ca00494f2aed3ec7d548cb1dd1b5c.tar.bz2 Ishtar-3352f862195ca00494f2aed3ec7d548cb1dd1b5c.zip |
Migrate from xhtml2odt to pandoc for ODT generation (refs #4178)
Diffstat (limited to 'ishtar_common/templates')
4 files changed, 107 insertions, 86 deletions
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 %} <div class="lightgallery-captions"> {% for image in item.images.all %} <div id="lightgallery-{{window_id}}-caption-{{forloop.counter0}}"> <span class="close">×</span> - {% if image.title %}<h3>{{image.title}}</h3>{% endif %} - {% if image.description %}<p class="raw-description"> - {{image.description}} - </p>{% endif %} - {% if image.licences.count %} - <div class="row"> - <div class="col-2"> - <strong>{% trans "Licenses" %}</strong> - </div> - <div class="col-10"> - {% for license in image.licenses.all %} - {% if not forloop.first %} ; {% endif %}{% if license.url %}<a href="{{license.url}}">{% endif %} - {{license}} - {% if license.url %}</a>{% endif %} - {% endfor %} - </div> - </div> - {% endif %} - {% if image.authors.count or image.authors_raw %} - <div class="row"> - <div class="col-2"> - <strong>{% trans "Authors" %}</strong> - </div> - <div class="col-10"> - {% 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 %} - </div> - </div> - {% endif %} - {% if image.image_type %} - <div class="row"> - <div class="col-2"> - <strong>{% trans "Type" %}</strong> - </div> - <div class="col-10"> - {{image.image_type}} - </div> - </div> - {% endif %} - {% if image.reference %} - <div class="row"> - <div class="col-2"> - <strong>{% trans "Ref." %}</strong> - </div> - <div class="col-10"> - {{image.reference}} - </div> - </div> - {% endif %} - {% if image.internal_reference %} - <div class="row"> - <div class="col-2"> - <strong>{% trans "Internal ref." %}</strong> - </div> - <div class="col-10"> - {{image.internal_reference}} - </div> - </div> - {% endif %} - {% if image.creation_date %} - <div class="row"> - <div class="col-2"> - <strong>{% trans "Creation date" %}</strong> - </div> - <div class="col-10"> - {{image.creation_date}} - </div> - </div> - {% endif %} + {% include "ishtar/blocks/window_image_detail.html" %} <a href="{% url 'edit-document' image.pk %}"> {% trans "Modify" %} <i class="fa fa-pencil"></i> </a> @@ -84,10 +15,11 @@ </div> <div id="lightgallery-{{window_id}}"> {% for image in item.images.all %} - {% if output != "ODT" %}<a data-sub-html="#lightgallery-{{window_id}}-caption-{{forloop.counter0}}" href="{{image.image.url}}"{% if not forloop.first %} - class="lightgallery-subimage"{% endif %}>{% endif %} + <a data-sub-html="#lightgallery-{{window_id}}-caption-{{forloop.counter0}}" href="{{image.image.url}}"{% if not forloop.first %} + class="lightgallery-subimage"{% endif %}> <img{% if forloop.first %} class='card-img-top'{% endif %} src="{{BASE_URL}}{{image.thumbnail.url}}"> - {% if output != "ODT" %}</a>{% endif %} + </a> {% endfor %} </div> {% 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 %}<h3>{{image.title}}</h3>{% endif %} + {% if image.description %}<p class="raw-description"> + {{image.description}} + </p>{% endif %} + {% if image.licences.count %} + <div class="row"> + <div class="col-2"> + <strong>{% trans "Licenses" %}</strong> + </div> + <div class="col-10"> + {% for license in image.licenses.all %} + {% if not forloop.first %} ; {% endif %}{% if license.url %}<a href="{{license.url}}">{% endif %} + {{license}} + {% if license.url %}</a>{% endif %} + {% endfor %} + </div> + </div> + {% endif %} + {% if image.authors.count or image.authors_raw %} + <div class="row"> + <div class="col-2"> + <strong>{% trans "Authors" %}</strong> + </div> + <div class="col-10"> + {% 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 %} + </div> + </div> + {% endif %} + {% if image.image_type %} + <div class="row"> + <div class="col-2"> + <strong>{% trans "Type" %}</strong> + </div> + <div class="col-10"> + {{image.image_type}} + </div> + </div> + {% endif %} + {% if image.reference %} + <div class="row"> + <div class="col-2"> + <strong>{% trans "Ref." %}</strong> + </div> + <div class="col-10"> + {{image.reference}} + </div> + </div> + {% endif %} + {% if image.internal_reference %} + <div class="row"> + <div class="col-2"> + <strong>{% trans "Internal ref." %}</strong> + </div> + <div class="col-10"> + {{image.internal_reference}} + </div> + </div> + {% endif %} + {% if image.creation_date %} + <div class="row"> + <div class="col-2"> + <strong>{% trans "Creation date" %}</strong> + </div> + <div class="col-10"> + {{image.creation_date}} + </div> + </div> + {% 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 %} +<div class="lightgallery-captions"> + {% for image in item.images.all %} + <div id="lightgallery-{{window_id}}-caption-{{forloop.counter0}}"> + <img src="{{BASE_URL}}{{image.thumbnail.url}}"> + {% include "ishtar/blocks/window_image_detail.html" %} + </div> + {% endfor %} +</div> 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 @@ <div class="card-header" data-sheet-id="{{sheet_id}}" role="tab" id='head-{{window_id}}'> <div class="row"> <div class="col-9"> + {% if output != "ODT" and output != "PDF"%} <h5 class="mb-0"> - <a class="card-label" data-toggle="collapse" href="#collapse-{{window_id}}" aria-expanded="true" + <a class="card-label" data-toggle="collapse" + href="#collapse-{{window_id}}" aria-expanded="true" aria-controls="collapse-{{window_id}}"> + {% else %} + <h2> + {% endif %} {% block head_title %}{% endblock %} + {% if output == "ODT" or output == "PDF"%} + </h2> + {% else %} </a> </h5> + {% endif %} </div> + {% if output != "ODT" and output != "PDF"%} <div class='col-2 text-center'> <a href='#' class='previous_page'> <span class="fa-stack"> @@ -42,24 +52,19 @@ <i class="fa fa-times fa-stack-1x fa-inverse"></i> </span> </a> - {% comment %} - <a href='#' onclick='closeAllWindows();' title="{% trans "Close all windows" %}"> - <span class="fa-stack"> - <i class="fa fa-files-o fa-stack-2x"></i> - <i class="fa fa-circle fa-stack-15x"></i> - <i class="fa fa-times fa-stack-1x fa-inverse"></i> - </span> - </a> - {% endcomment %} </div> + {% endif %} </div> {% block header_title %}{% endblock %} </div> <div id="collapse-{{window_id}}" class="collapse show" role="tabpanel" aria-labelledby="heading-{{window_id}}" data-parent="#window"> + {% if output != "ODT" and output != "PDF"%} {% block toolbar %}{% endblock %} + {% endif %} <div class="card-body"> + {% if output != "ODT" and output != "PDF"%} {% block head_sheet %} <script type="text/javascript"> var last_window='{{window_id}}'; @@ -97,6 +102,7 @@ }); </script> {% endblock %} + {% endif %} <div class="body"> {% block content %} {% endblock %} |