-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apis_core/relations/templates/relations/list_relations_include_tabs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} | ||
<ul class="nav nav-tabs"> | ||
<li class="nav-item"> | ||
<a class="nav-link active" | ||
data-toggle="tab" | ||
href="#reltab_{{ object.id }}_ALL">All</a> | ||
</li> | ||
{% for target in possible_targets %} | ||
<li class="nav-item"> | ||
<a class="nav-link" | ||
data-toggle="tab" | ||
href="#reltab_{{ object.id }}_{{ target.name }}">{{ target.name | title }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
<div class="tab-content"> | ||
<div class="tab-pane container active" | ||
id="reltab_{{ object.id }}_ALL" | ||
hx-swap-oob="true">{% include "relations/list_relations.html" %}</div> | ||
{% for target in possible_targets %} | ||
<div class="tab-pane container" | ||
id="reltab_{{ object.id }}_{{ target.name }}" | ||
hx-swap-oob="true">{% include "relations/list_relations.html" %}</div> | ||
{% endfor %} | ||
</div> |