From a5ad3fdd370654680a2b7356cb82950a69a1c24e Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Tue, 8 Oct 2024 15:22:31 +0200 Subject: [PATCH 1/2] feat(relations): new template to list relations Displays the relations in a tabbed view with ALL tab appearing in the beginning, followed by the other target groups. closes #489 --- .../list_relations_include_tabs.html | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 apis_core/relations/templates/relations/list_relations_include_tabs.html diff --git a/apis_core/relations/templates/relations/list_relations_include_tabs.html b/apis_core/relations/templates/relations/list_relations_include_tabs.html new file mode 100644 index 000000000..9b12f9692 --- /dev/null +++ b/apis_core/relations/templates/relations/list_relations_include_tabs.html @@ -0,0 +1,28 @@ +{% load relations %} +{% relations_from from_obj=object as relations %} +{% possible_relation_types_from object as possible_relations %} +{% get_relation_targets_from object as possible_targets %} + +
+
{% include "relations/list_relations.html" %}
+ {% for target in possible_targets %} +
{% include "relations/list_relations.html" %}
+ {% endfor %} +
From 42c2e7db47d80adfe58b4f5e8ef64f3ed0ae8876 Mon Sep 17 00:00:00 2001 From: Saranya Balasubramanian Date: Tue, 15 Oct 2024 15:14:23 +0200 Subject: [PATCH 2/2] feat(sample_project): tabbed relations for person Person - view and edit pages list relations in a tabbed format by overriding relations-include block in col-one --- sample_project/templates/sample_project/person_detail.html | 5 +++++ sample_project/templates/sample_project/person_form.html | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 sample_project/templates/sample_project/person_detail.html create mode 100644 sample_project/templates/sample_project/person_form.html diff --git a/sample_project/templates/sample_project/person_detail.html b/sample_project/templates/sample_project/person_detail.html new file mode 100644 index 000000000..5c47d2888 --- /dev/null +++ b/sample_project/templates/sample_project/person_detail.html @@ -0,0 +1,5 @@ +{% extends "apis_core/apis_entities/abstractentity_detail.html" %} + +{% block relations-include %} + {% include "relations/list_relations_include_tabs.html" %} +{% endblock relations-include %} diff --git a/sample_project/templates/sample_project/person_form.html b/sample_project/templates/sample_project/person_form.html new file mode 100644 index 000000000..84569dd6c --- /dev/null +++ b/sample_project/templates/sample_project/person_form.html @@ -0,0 +1,5 @@ +{% extends "apis_core/apis_entities/abstractentity_form.html" %} + +{% block relations-include %} + {% include "relations/list_relations_include_tabs.html" with edit=True %} +{% endblock relations-include %}