From 65b264854a8d3c19aa536ecfb3d06df01459f58a Mon Sep 17 00:00:00 2001 From: csae8092 Date: Tue, 23 Jan 2024 09:21:38 +0100 Subject: [PATCH 1/6] minor [skip ci] --- set_env_variables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/set_env_variables.sh b/set_env_variables.sh index 77758e8..e0a3156 100644 --- a/set_env_variables.sh +++ b/set_env_variables.sh @@ -1 +1 @@ -export $(grep -v '^#' .secret | xargs) \ No newline at end of file +export $(grep -v '^#' .env | xargs) \ No newline at end of file From 4ab4530813ccfd4e0fb2eb8c05068f59a53b0090 Mon Sep 17 00:00:00 2001 From: csae8092 Date: Wed, 24 Jan 2024 10:03:56 +0100 Subject: [PATCH 2/6] bugfix for json+net renderer --- apis_core/api_renderers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis_core/api_renderers.py b/apis_core/api_renderers.py index 75b42fb..62f7ae1 100644 --- a/apis_core/api_renderers.py +++ b/apis_core/api_renderers.py @@ -23,9 +23,9 @@ def render(self, data, media_type=None, renderer_context=None): rel2 = re.match("^{}[a-z]*".format(r2), rel) if rel2: source = r - elif r.endswith("A"): + elif r.endswith("a"): source = r - elif r.endswith("B"): + elif r.endswith("b"): target = r rel2 = re.match("^[a-z]*?{}$".format(r2), rel) if rel2: From ba52c39e80d3fa340eaa20cdb75a231c7bc2cd22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Anton=20M=C3=BCller?= Date: Wed, 24 Jan 2024 09:52:35 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=C3=9Cbersetzungen,=20Abst=C3=A4nde=20nach?= =?UTF-8?q?=20Beziehungstypen,=20linke=20Spalte=20eine=20Breite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail_views/entity_detail_generic.html | 20 +++++++++---------- .../detail_views/person_detail.html | 8 ++++---- apis_core/apis_relations/forms2.py | 2 +- apis_core/entity_detail_generic.html | 8 ++++---- static/css/style.css | 4 ++++ 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html b/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html index e481a2f..1aaa0ff 100644 --- a/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html +++ b/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html @@ -53,7 +53,7 @@

-

+

@@ -115,7 +115,7 @@

{% if object.start_date or object.end_date %} - Date + Datum {% if object.start_date_written %} @@ -130,7 +130,7 @@

{% if object.lat %} - Lat/Lng + Länge/Breite {{ object.lat }} / {{ object.lng }} @@ -142,8 +142,8 @@

{% block info-metadata %} -
- Uri(s) + + URI {% for x in object.uri_set.all %} @@ -158,7 +158,7 @@

{% if object.collection.all %}

- Collection(s) + Sammlungen {% for x in object.collection.all %} @@ -172,7 +172,7 @@

{% if object.notes %}

- Notes + Anmerkungen {{ object.notes }} @@ -182,7 +182,7 @@

{% if object.references %}

- References + Belege {{ object.references }} @@ -195,13 +195,13 @@

{% endblock left-pane-additional %}
-

Relations

+

Beziehungen

{% block relations %} {% for obj in right_card %} {% if obj.1.data|length > 0 %}

{{ obj.0 }}

-
+
{% render_table obj.1 %}
{% endif %} diff --git a/apis_core/apis_entities/templates/apis_entities/detail_views/person_detail.html b/apis_core/apis_entities/templates/apis_entities/detail_views/person_detail.html index c311261..63deb42 100644 --- a/apis_core/apis_entities/templates/apis_entities/detail_views/person_detail.html +++ b/apis_core/apis_entities/templates/apis_entities/detail_views/person_detail.html @@ -3,7 +3,7 @@ {% block info-table %} - {% endif %} From 4927b2d401b3d389e70eda7dbb40cfe75a613d10 Mon Sep 17 00:00:00 2001 From: csae8092 Date: Wed, 24 Jan 2024 10:16:49 +0100 Subject: [PATCH 6/6] tests for net json render should not fail any more --- apis_core/apis_entities/tests.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apis_core/apis_entities/tests.py b/apis_core/apis_entities/tests.py index f326fa9..cc1a1ac 100644 --- a/apis_core/apis_entities/tests.py +++ b/apis_core/apis_entities/tests.py @@ -290,12 +290,8 @@ def test_020_api_list_view(self): r = client.get(value) self.assertTrue(r.status_code, 200) if key.startswith("relation"): - try: - r = client.get(f"{value}?format=json%2Bnet") - self.assertTrue(r.status_code, 200) - except Exception as e: - print(value, e) - continue + r = client.get(f"{value}?format=json%2Bnet") + self.assertTrue(r.status_code, 200) def test_021_api_detail_view(self): item = Person.objects.last()
+ Name @@ -13,7 +13,7 @@ {% if no_merge_labels %}
- Alternative Namen + anderer Name {% for x in no_merge_labels %} @@ -44,7 +44,7 @@ {% if object.start_date or object.end_date %}
- Lifespan + Lebensspanne {% if object.start_date %} @@ -59,7 +59,7 @@ {% if object.profession.all %}
- Professions + Berufe {% for prof in object.profession.all %} diff --git a/apis_core/apis_relations/forms2.py b/apis_core/apis_relations/forms2.py index c5d099c..87353c1 100644 --- a/apis_core/apis_relations/forms2.py +++ b/apis_core/apis_relations/forms2.py @@ -110,7 +110,7 @@ def get_html_table(self, entity_type, request, site_instance, form_match): table_html = table(data=objects, prefix=prefix) else: tab_query = {"related_" + entity_type.lower(): site_instance} - ttab = self.relation_form.objects.filter(**tab_query) + ttab = self.relation_form.objects.filter(**ttoquery) table_html = table(data=ttab, prefix=prefix) return table_html diff --git a/apis_core/entity_detail_generic.html b/apis_core/entity_detail_generic.html index 31162c6..601fc7d 100644 --- a/apis_core/entity_detail_generic.html +++ b/apis_core/entity_detail_generic.html @@ -64,7 +64,7 @@

-

General Info

+

Allgemein

{% block info-table %} @@ -88,7 +88,7 @@

General Info

{% if object.start_date or object.end_date %}

- Date + Datum {% if object.start_date %} @@ -143,7 +143,7 @@

Texts

{% if object.text.all %}
- Texts + Texte {% for x in object.text.all %}
@@ -160,7 +160,7 @@

{{ x.kind }}

{% else %}
- No text provided for this {{entity}} + Kein Text verfügbar für {{entity}}
{% endif %}
diff --git a/static/css/style.css b/static/css/style.css index 9e24c22..ddf0e49 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -100,3 +100,7 @@ main { margin-right: .75rem; margin-left: .75rem; } + +.left-width { + width: 100px; +} From e3eb3223b264d95adb2fdd5551e98abd28123604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Anton=20M=C3=BCller?= Date: Wed, 24 Jan 2024 10:01:37 +0100 Subject: [PATCH 4/6] =?UTF-8?q?r=C3=BCckg=C3=A4ngig=20die=20=C3=A4nderung?= =?UTF-8?q?=20an=20forms2.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis_core/apis_relations/forms2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis_core/apis_relations/forms2.py b/apis_core/apis_relations/forms2.py index 87353c1..c5d099c 100644 --- a/apis_core/apis_relations/forms2.py +++ b/apis_core/apis_relations/forms2.py @@ -110,7 +110,7 @@ def get_html_table(self, entity_type, request, site_instance, form_match): table_html = table(data=objects, prefix=prefix) else: tab_query = {"related_" + entity_type.lower(): site_instance} - ttab = self.relation_form.objects.filter(**ttoquery) + ttab = self.relation_form.objects.filter(**tab_query) table_html = table(data=ttab, prefix=prefix) return table_html From b9551878969c8c22e8beece9d0cd8c9d92e09b72 Mon Sep 17 00:00:00 2001 From: csae8092 Date: Wed, 24 Jan 2024 10:10:38 +0100 Subject: [PATCH 5/6] removed li from collections in detail view --- .../apis_entities/detail_views/entity_detail_generic.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html b/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html index 1aaa0ff..d2e5a1b 100644 --- a/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html +++ b/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html @@ -162,10 +162,9 @@

{% for x in object.collection.all %} -
  • - {{ x }} -
  • + {{ x }}
    {% endfor %} +