Skip to content

Commit

Permalink
feat(apis_entities): enclose the relations listing in a relations block
Browse files Browse the repository at this point in the history
This makes it easier to override the relations forms. The same approach
is also used in the `detail_generic.html` template.
  • Loading branch information
b1rger committed Sep 13, 2023
1 parent b5a9f7a commit f052035
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions apis_core/apis_entities/templates/apis_entities/edit_generic.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,25 +197,28 @@ <h4 class="panel-title">
<hr />
{% endblock additional_accordion %}

{% for obj in right_card %}
<div class="card card-default">
<div class="card-header" role="tab" id="heading{{ forloop.counter }}">
<h4 class="card-title">
<a role="button"
data-toggle="collapse"
data-parent="#accordion"
href="#collapse{{ forloop.counter }}"
aria-expanded="true"
aria-controls="collapse{{ forloop.counter }}">{{ obj.0 }}</a>
</h4>
</div>
<div id="collapse{{ forloop.counter }}" class="card-collapse collapse
{% if obj.3 %}in{% endif %}
" role="tabcard" aria-labelledby="heading{{ forloop.counter }}">
<div id="tab_{{ obj.2 }}" class="card-body">{% render_table obj.1 %}</div>
{% block relations %}
{% for obj in right_card %}
<div class="card card-default">
<div class="card-header" role="tab" id="heading{{ forloop.counter }}">
<h4 class="card-title">
<a role="button"
data-toggle="collapse"
data-parent="#accordion"
href="#collapse{{ forloop.counter }}"
aria-expanded="true"
aria-controls="collapse{{ forloop.counter }}">{{ obj.0 }}</a>
</h4>
</div>
<div id="collapse{{ forloop.counter }}" class="card-collapse collapse
{% if obj.3 %}in{% endif %}
" role="tabcard" aria-labelledby="heading{{ forloop.counter }}">
<div id="tab_{{ obj.2 }}" class="card-body">{% render_table obj.1 %}</div>
</div>
</div>
</div>
{% endfor %}
{% endfor %}
{% endblock relations %}

</div>
</div>
</div>
Expand Down

0 comments on commit f052035

Please sign in to comment.