summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-20 17:08:54 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-20 17:08:54 +0100
commit5d303aa0a3ca38a0b059cccdccf54c150c73e568 (patch)
tree506ba84eae7db7612285aad8d50118aba0d15bb1
parent2590d0cf37e3a158a5a1889a1c4c3c8bb4ba4bcc (diff)
downloadIshtar-5d303aa0a3ca38a0b059cccdccf54c150c73e568.tar.bz2
Ishtar-5d303aa0a3ca38a0b059cccdccf54c150c73e568.zip
PDF export: fix new line on <pre> blocks
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html3
-rw-r--r--ishtar_common/templates/ishtar/blocks/sheet_geographic.html4
-rw-r--r--ishtar_common/views_item.py3
3 files changed, 7 insertions, 3 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index b4954b7e6..d72d26b12 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -543,10 +543,11 @@
{% if not is_external and display_geo %}
<div class="tab-pane fade" id="{{window_id}}-geodata"
role="tabpanel" aria-labelledby="{{window_id}}-geodata-tab">
+ <h3>{% trans "Geographic data" %}</h3>
{% for base_find in item.base_finds.all %}
{% with geo_item=base_find %}
- <h3>{% if base_find.complete_identifier %}{{ base_find.complete_identifier }}{% else %}{{base_find.short_id}}{% endif %}</h3>
+ <h4>{% if base_find.complete_identifier %}{{ base_find.complete_identifier }}{% else %}{{base_find.short_id}}{% endif %}</h4>
{% with current_geolabel=base_find %}
{% include "ishtar/blocks/sheet_geographic.html" %}
{% endwith %} {% endwith %}
diff --git a/ishtar_common/templates/ishtar/blocks/sheet_geographic.html b/ishtar_common/templates/ishtar/blocks/sheet_geographic.html
index 8b6255f26..bad399ef2 100644
--- a/ishtar_common/templates/ishtar/blocks/sheet_geographic.html
+++ b/ishtar_common/templates/ishtar/blocks/sheet_geographic.html
@@ -26,7 +26,7 @@
<td>{% if geo.origin %}{{ geo.origin }}{% else %}-{% endif %}</td>
<td>{% if geo.provider %}{{ geo.provider }}{% else %}-{% endif %}</td>
<td>{% if geo.comment %}{{ geo.comment }}{% else %}-{% endif %}</td>
- {% if permission_change_geo %}<td>
+ {% if permission_change_geo and output != "ODT" and output != "PDF" %}<td>
<a title="{% trans 'Delete' %}"
href="{% url 'delete-geo' geo.pk %}{% if search_url %}?back_url={{search_url}}%3Fopen_item={{geo_item.pk}}{% endif %}">
{% if geo|can_edit_item:request %}<i class="fa fa-trash text-danger"></i></a>{% else %}&ndash;{% endif %}
@@ -34,7 +34,7 @@
</tr>
{% endfor %}
</table>
-{% if permission_change_geo %}
+{% if permission_change_geo and output != "ODT" and output != "PDF" %}
<div class="text-center">
<a class="btn btn-success" href="{% url 'create-pre-geo' item.app_label item.model_name item.pk %}{% if search_url %}?back_url={{search_url}}%3Fopen_item={{geo_item.pk}}{% endif %}"><i class="fa fa-plus"></i> &nbsp;{% trans "geo item" %}</a>
</div>
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py
index f905d677c..531eef995 100644
--- a/ishtar_common/views_item.py
+++ b/ishtar_common/views_item.py
@@ -492,6 +492,9 @@ def show_item(model, name, extra_dct=None, model_for_perms=None):
body{
font-family: Gentium
}
+ pre {
+ white-space: pre-wrap;
+ }
"""
% (base_url + static("gentium/GentiumPlus-R.ttf"))
)