-
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.
refactor(relations): inherit tabbed relations from the default template
list_relations_include_tabs is refactored to inherit from list_relations_include template, overrides display-relations block.
- Loading branch information
Showing
1 changed file
with
25 additions
and
25 deletions.
There are no files selected for viewing
50 changes: 25 additions & 25 deletions
50
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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
{% 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 %} | ||
<div class="card mb-2"> | ||
<div class="card-header pb-0 border-bottom-0"> | ||
<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 %} | ||
{% extends "relations/list_relations_include.html" %} | ||
|
||
{% block display-relations %} | ||
<div class="card mb-2"> | ||
<div class="card-header pb-0 border-bottom-0"> | ||
<ul class="nav nav-tabs"> | ||
<li class="nav-item"> | ||
<a class="nav-link" | ||
<a class="nav-link active" | ||
data-toggle="tab" | ||
href="#reltab_{{ object.id }}_{{ target.name }}">{{ target.name | title }}</a> | ||
href="#reltab_{{ object.id }}_ALL">All</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
<div class="card-body"> | ||
<div class="tab-content"> | ||
<div class="tab-pane active" id="reltab_{{ object.id }}_ALL">{% include "relations/list_relations.html" %}</div> | ||
{% for target in possible_targets %} | ||
<div class="tab-pane" id="reltab_{{ object.id }}_{{ target.name }}">{% include "relations/list_relations.html" %}</div> | ||
{% endfor %} | ||
{% 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> | ||
<div class="card-body"> | ||
<div class="tab-content"> | ||
<div class="tab-pane active" id="reltab_{{ object.id }}_ALL">{% include "relations/list_relations.html" %}</div> | ||
{% for target in possible_targets %} | ||
<div class="tab-pane" id="reltab_{{ object.id }}_{{ target.name }}">{% include "relations/list_relations.html" %}</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock display-relations %} |