From dd9b59226238ed98235d1edaa1fbd65f825a5a77 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Thu, 16 Nov 2023 16:23:08 +0100 Subject: [PATCH 01/15] Template formatting --- openatlas/templates/entity/update.html | 6 +- .../templates/forms/reference_field.html | 16 +- .../templates/forms/table_multi_select.html | 20 +-- openatlas/templates/forms/table_select.html | 28 ++-- .../templates/forms/tree_multi_select.html | 146 +++++++++--------- 5 files changed, 109 insertions(+), 107 deletions(-) diff --git a/openatlas/templates/entity/update.html b/openatlas/templates/entity/update.html index fceef0126..56e0edb88 100644 --- a/openatlas/templates/entity/update.html +++ b/openatlas/templates/entity/update.html @@ -2,8 +2,8 @@ {% block content %} {% if entity.class_.view not in ['artifact', 'place'] %}
- {{ form|display_form(manual_page='entity/' + entity.class_.view)|safe }} - {{ entity.class_.view|display_citation_example|safe }} + {{ form|display_form(manual_page='entity/' + entity.class_.view)|safe }} + {{ entity.class_.view|display_citation_example|safe }}
{% else %}
@@ -20,7 +20,7 @@
- + diff --git a/openatlas/templates/forms/reference_field.html b/openatlas/templates/forms/reference_field.html index c85e39ea0..f506e188b 100644 --- a/openatlas/templates/forms/reference_field.html +++ b/openatlas/templates/forms/reference_field.html @@ -9,18 +9,18 @@ name="reference_system_id_{{ field.reference_system_id }}" type="text" class="{{ config.CSS.string_field }}" - data-reference-system="{{ field.label.text.replace(' ','-') }}"/> - + data-reference-system="{{ field.label.text.replace(' ','-') }}">
- - +
diff --git a/openatlas/templates/forms/table_multi_select.html b/openatlas/templates/forms/table_multi_select.html index 85d9e192f..6b957251e 100644 --- a/openatlas/templates/forms/table_multi_select.html +++ b/openatlas/templates/forms/table_multi_select.html @@ -25,8 +25,7 @@ id="{{ field.id }}-button" class="{{ config.CSS.button.secondary }}" onclick="$('#{{ field.id }}-modal').modal('show')" - tabindex="0" - > + tabindex="0"> {{ _('change')|uc_first }} @@ -59,13 +58,14 @@ diff --git a/openatlas/templates/forms/table_select.html b/openatlas/templates/forms/table_select.html index f72e47d1e..ac9eb6f8e 100644 --- a/openatlas/templates/forms/table_select.html +++ b/openatlas/templates/forms/table_select.html @@ -9,8 +9,7 @@ readonly="readonly" value="{{ selection }}" onclick="$('#{{ field.id }}-modal').modal('show')" - tabindex="0" - > + tabindex="0">
+ {{ _(add_dynamical)|uc_first }}
{% endif %} + From 05c5ea61026574e4cd6a09cf7c9b29c22dae4581 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Thu, 16 Nov 2023 16:27:23 +0100 Subject: [PATCH 02/15] Fix for reference system label --- openatlas/static/js/forms.js | 2 +- openatlas/templates/forms/reference_field.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openatlas/static/js/forms.js b/openatlas/static/js/forms.js index f72c2a4ca..f33f6b3ea 100644 --- a/openatlas/static/js/forms.js +++ b/openatlas/static/js/forms.js @@ -188,7 +188,7 @@ $(document).ready(function () { // Add required to reference precision if reference is set ['keyup', 'change'].forEach((listener) => { - $("[id^=reference_system_value]").on(listener, function () { + $("[id^=reference_system_id]").on(listener, function () { const select = $(`#reference_system_precision_${this.id.split('_').pop()}`); if (!this.value?.length) select.removeClass('required'); diff --git a/openatlas/templates/forms/reference_field.html b/openatlas/templates/forms/reference_field.html index f506e188b..4538c0dc7 100644 --- a/openatlas/templates/forms/reference_field.html +++ b/openatlas/templates/forms/reference_field.html @@ -4,9 +4,9 @@ autocomplete="off" style="position: relative" value="{{ field.data['value'] or '' }}" - id="reference_system_value_{{ field.reference_system_id }}" - placeholder="{{ field.placeholder }}" + id="reference_system_id_{{ field.reference_system_id }}" name="reference_system_id_{{ field.reference_system_id }}" + placeholder="{{ field.placeholder }}" type="text" class="{{ config.CSS.string_field }}" data-reference-system="{{ field.label.text.replace(' ','-') }}"> From d73ef59256580e68dd971727de2ea70791e40a39 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Thu, 16 Nov 2023 16:44:18 +0100 Subject: [PATCH 03/15] Added a no cover for one missing IIIF line --- openatlas/display/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openatlas/display/util.py b/openatlas/display/util.py index bed9d9b9f..e76f50de2 100644 --- a/openatlas/display/util.py +++ b/openatlas/display/util.py @@ -802,4 +802,4 @@ def convert_image_to_iiif(id_: int) -> None: if process.returncode == 0: flash(_('IIIF converted'), 'info') else: - flash(f"{_('failed to convert image')}", 'error') + flash(f"{_('failed to convert image')}", 'error') # pragma: no cover From 49fd7a3d62998ff381407f5bb372c3d23cc6f7b3 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Fri, 17 Nov 2023 13:30:38 +0100 Subject: [PATCH 04/15] Fix for #2124: No modifications at preceding event --- openatlas/display/table.py | 9 ++++----- openatlas/forms/field.py | 8 ++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/openatlas/display/table.py b/openatlas/display/table.py index 5d56ed10f..0df875738 100644 --- a/openatlas/display/table.py +++ b/openatlas/display/table.py @@ -35,14 +35,13 @@ def display(self, name: str = 'default') -> str: data = { 'data': self.rows, 'stateSave': 'true', - 'columns': - [{ + 'columns': [{ 'title': uc_first(_(name)) if name else '', 'className': 'dt-body-right' if name in ['count', 'size'] else ''} - for name in self.header] + - [{'title': '', 'className': ''} - for _item in range(len(self.rows[0]) - len(self.header))], + for name in self.header] + [ + {'title': '', 'className': ''} + for _item in range(len(self.rows[0]) - len(self.header))], 'paging': self.paging, 'pageLength': current_user.settings['table_rows'], 'autoWidth': 'false'} diff --git a/openatlas/forms/field.py b/openatlas/forms/field.py index 68bfec08d..8c047189a 100644 --- a/openatlas/forms/field.py +++ b/openatlas/forms/field.py @@ -436,8 +436,12 @@ def get_table_content( entities = Entity.get_by_view('place', types=True, aliases=aliases) elif class_name == 'event_preceding': class_ = 'event' - entities = Entity.get_by_class( - ['activity', 'acquisition', 'move', 'production'], + entities = Entity.get_by_class([ + 'activity', + 'acquisition', + 'modification', + 'move', + 'production'], types=True, aliases=aliases) elif class_name == 'feature_super': From 13d6e48b7857ccda45ef107eb06752b7444e3899 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Fri, 17 Nov 2023 13:35:17 +0100 Subject: [PATCH 05/15] Update version, changelog and upgrade notes --- config/default.py | 2 +- install/upgrade/upgrade.md | 2 +- openatlas/views/changelog.py | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/default.py b/config/default.py index fc1f5bf6f..3a2d17336 100644 --- a/config/default.py +++ b/config/default.py @@ -3,7 +3,7 @@ from config.database_versions import DATABASE_VERSIONS -VERSION = '7.17.3' +VERSION = '7.17.4' DATABASE_VERSION = DATABASE_VERSIONS[0] DEMO_MODE = False # If activated some options are disabled, login is prefilled DEBUG = False diff --git a/install/upgrade/upgrade.md b/install/upgrade/upgrade.md index 8236be2cd..98b6de546 100644 --- a/install/upgrade/upgrade.md +++ b/install/upgrade/upgrade.md @@ -18,7 +18,7 @@ then run the database upgrade script, then restart Apache: sudo python3 install/upgrade/database_upgrade.py sudo service apache2 restart -### 7.17.x to 7.17.3 +### 7.17.x to 7.17.4 A code base update (e.g. with git pull) and a webserver restart is sufficient. ### 7.16.x to 7.17.0 diff --git a/openatlas/views/changelog.py b/openatlas/views/changelog.py index 7504e52a5..c6022b908 100644 --- a/openatlas/views/changelog.py +++ b/openatlas/views/changelog.py @@ -15,6 +15,9 @@ def index_changelog() -> str: versions = { + '7.17.4': ['2023-11-17', { + 'fix': { + '2124': 'No modifications at preceding event'}}], '7.17.3': ['2023-11-13', { 'fix': { '2117': 'Modification events not showing at artifact view', From 199da2e75b708d0b6744946a7de33f38fe6d25c3 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Mon, 20 Nov 2023 14:28:10 +0100 Subject: [PATCH 06/15] JavaScript: formattting and removing (hopefully) unneeded functions --- .../templates/forms/table_multi_select.html | 37 ++++++++----------- openatlas/templates/forms/table_select.html | 7 ---- .../templates/forms/tree_multi_select.html | 15 +++----- openatlas/templates/forms/tree_select.html | 26 ++++++------- 4 files changed, 33 insertions(+), 52 deletions(-) diff --git a/openatlas/templates/forms/table_multi_select.html b/openatlas/templates/forms/table_multi_select.html index 6b957251e..ccd4bfea1 100644 --- a/openatlas/templates/forms/table_multi_select.html +++ b/openatlas/templates/forms/table_multi_select.html @@ -3,21 +3,20 @@
- {% for s in selection %} -
-
- {{ s.name }} - -
-
- {% endfor %} + onclick="$('#{{ field.id }}-modal').modal('show')"> + {% for s in selection %} +
+
+ {{ s.name }} + +
+
+ {% endfor %}
@@ -57,14 +56,8 @@
- {% endif %} +