Skip to content

Commit

Permalink
feat(apis_relations): use the base template to override relations menu
Browse files Browse the repository at this point in the history
Instead of hardcoding the relations menu entries in the base template,
use template inheritance to add to the menu entry if the app is enabled.

Closes: #1144
  • Loading branch information
b1rger committed Sep 9, 2024
1 parent eed28c0 commit 5f27f04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 10 additions & 0 deletions apis_core/apis_relations/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "base.html" %}
{% load relations %}

{% block relations-menu-items %}
{{ block.super }}
<a class="dropdown-item"
href="{% url 'apis_core:apis_relations:generic_relations_list' "property" %}">Properties</a>
<a class="dropdown-item"
href="{% url 'apis_core:apis_relations:generic_relations_list' "triple" %}">Triples</a>
{% endblock relations-menu-items %}
4 changes: 0 additions & 4 deletions apis_core/core/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@
<div class="dropdown-menu" aria-labelledby="navbarDropdown">

{% block relations-menu-items %}
<a class="dropdown-item"
href="{% url 'apis_core:apis_relations:generic_relations_list' "property" %}">Properties</a>
<a class="dropdown-item"
href="{% url 'apis_core:apis_relations:generic_relations_list' "triple" %}">Triples</a>
{% endblock relations-menu-items %}

</div>
Expand Down

0 comments on commit 5f27f04

Please sign in to comment.