-
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(generic): introduce generic menu entry
This commit introduces a template tag in the generic module that lists all content types that inherit from the Generic Model but are not Collections, Entities, Relations or History models. This templatetag is then used to create a menu entry to manage those types. Closes: #1582
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% extends "base.html" %} | ||
{% load generic %} | ||
|
||
{% block main-menu %} | ||
{{ block.super }} | ||
<li class="nav-item dropdown"> | ||
<a href="#" | ||
class="nav-link dropdown-toggle" | ||
data-bs-toggle="dropdown" | ||
role="button" | ||
aria-haspopup="true" | ||
aria-expanded="false"> | ||
Other | ||
<span class="caret" /> | ||
</a> | ||
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> | ||
{% pure_genericmodel_content_types as content_types %} | ||
{% for content_type in content_types %} | ||
<a class="dropdown-item" | ||
href="{{ content_type.model_class.get_listview_url }}">{{ content_type.name }}</a> | ||
{% endfor %} | ||
</div> | ||
</li> | ||
{% endblock main-menu %} |
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