mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-09 13:22:18 -06:00
#9072: Implement a mechanism for dynamically registering model detail views
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
{% load helpers %}
|
||||
{% load perms %}
|
||||
{% load plugins %}
|
||||
{% load tabs %}
|
||||
|
||||
{% comment %}
|
||||
Blocks:
|
||||
@@ -83,34 +84,11 @@ Context:
|
||||
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
|
||||
</li>
|
||||
|
||||
{# Include any additional tabs #}
|
||||
{# Include any extra tabs passed by the view #}
|
||||
{% block extra_tabs %}{% endblock %}
|
||||
|
||||
{# Object journal #}
|
||||
{% if perms.extras.view_journalentry %}
|
||||
{% with journal_viewname=object|viewname:'journal' %}
|
||||
{% url journal_viewname pk=object.pk as journal_url %}
|
||||
{% if journal_url %}
|
||||
<li role="presentation" class="nav-item">
|
||||
<a href="{{ journal_url }}" class="nav-link{% if active_tab == 'journal'%} active{% endif %}">
|
||||
Journal {% badge object.journal_entries.count %}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{# Object changelog #}
|
||||
{% if perms.extras.view_objectchange %}
|
||||
{% with changelog_viewname=object|viewname:'changelog' %}
|
||||
{% url changelog_viewname pk=object.pk as changelog_url %}
|
||||
{% if changelog_url %}
|
||||
<li role="presentation" class="nav-item">
|
||||
<a href="{{ changelog_url }}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{# Include tabs for registered model views #}
|
||||
{% model_view_tabs object %}
|
||||
</ul>
|
||||
{% endblock tabs %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user