Skip to content

Commit

Permalink
feat: put main-menu submenu items in separate blocks
Browse files Browse the repository at this point in the history
This allows projects to add their own items to predefined submenus

Closes: #306
  • Loading branch information
b1rger committed Oct 3, 2023
1 parent d43446f commit 45e031e
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions apis_core/apis_metainfo/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@
<span class="caret" />
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{% for ent in entities_links %}

{% block entities-menu-items %}
{% for ent in entities_links %}
<a class="dropdown-item"
href="{% url 'apis:apis_entities:generic_entities_list' ent.0 %}">{{ ent.1 }}</a>
{% endfor %}
<a class="dropdown-item"
href="{% url 'apis:apis_entities:generic_entities_list' ent.0 %}">{{ ent.1 }}</a>
{% endfor %}
<a class="dropdown-item"
href="{% url 'apis:apis_metainfo:uri_browse' %}">URIs</a>
href="{% url 'apis:apis_metainfo:uri_browse' %}">URIs</a>
{% endblock entities-menu-items %}

</div>
</li>
<li class="nav-item dropdown">
Expand All @@ -119,10 +123,14 @@
<span class="caret" />
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{% for ent in relations_list %}
<a class="dropdown-item"
href="{% url 'apis:apis_relations:generic_relations_list' ent %}">{{ ent|title }}</a>
{% endfor %}

{% block relations-menu-items %}
{% for ent in relations_list %}
<a class="dropdown-item"
href="{% url 'apis:apis_relations:generic_relations_list' ent %}">{{ ent|title }}</a>
{% endfor %}
{% endblock relations-menu-items %}

</div>
</li>
{% endblock main-menu %}
Expand Down

0 comments on commit 45e031e

Please sign in to comment.