1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Expose regsitry in templates using existing context processor for settings

This commit is contained in:
Jeremy Stretch
2020-03-27 13:18:51 -04:00
parent fd6739f0cc
commit dd9fc4173d
5 changed files with 8 additions and 16 deletions

View File

@@ -504,7 +504,7 @@
</li>
</ul>
</li>
{% if plugin_menu_items %}
{% if registry.plugin_menu_items %}
{% include 'inc/plugin_menu_items.html' %}
{% endif %}
</ul>

View File

@@ -2,7 +2,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Plugins <span class="caret"></span></a>
<ul class="dropdown-menu">
{% for section_name, menu_items in plugin_menu_items.items %}
{% for section_name, menu_items in registry.plugin_menu_items.items %}
<li class="dropdown-header">{{ section_name }}</li>
{% for menu_item in menu_items %}
<li{% if menu_item.permissions and not request.user|has_perms:menu_item.permissions %} class="disabled"{% endif %}>