mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #5046: Disabled plugin menu items are no longer clickable
This commit is contained in:
parent
dd0185816c
commit
78d104e60c
@ -328,6 +328,9 @@ A `PluginMenuButton` has the following attributes:
|
|||||||
* `color` - One of the choices provided by `ButtonColorChoices` (optional)
|
* `color` - One of the choices provided by `ButtonColorChoices` (optional)
|
||||||
* `permissions` - A list of permissions required to display this button (optional)
|
* `permissions` - A list of permissions required to display this button (optional)
|
||||||
|
|
||||||
|
!!! note
|
||||||
|
Any buttons associated within a menu item will be shown only if the user has permission to view the link, regardless of what permissions are set on the buttons.
|
||||||
|
|
||||||
## Extending Core Templates
|
## Extending Core Templates
|
||||||
|
|
||||||
Plugins can inject custom content into certain areas of the detail views of applicable models. This is accomplished by subclassing `PluginTemplateExtension`, designating a particular NetBox model, and defining the desired methods to render custom content. Four methods are available:
|
Plugins can inject custom content into certain areas of the detail views of applicable models. This is accomplished by subclassing `PluginTemplateExtension`, designating a particular NetBox model, and defining the desired methods to render custom content. Four methods are available:
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
* [#5046](https://github.com/netbox-community/netbox/issues/5046) - Disabled plugin menu items are no longer clickable
|
||||||
* [#5063](https://github.com/netbox-community/netbox/issues/5063) - Fix "add device" link in rack elevations for opposite side of half-depth devices
|
* [#5063](https://github.com/netbox-community/netbox/issues/5063) - Fix "add device" link in rack elevations for opposite side of half-depth devices
|
||||||
* [#5074](https://github.com/netbox-community/netbox/issues/5074) - Fix inclusion of VC member interfaces when viewing VC master
|
* [#5074](https://github.com/netbox-community/netbox/issues/5074) - Fix inclusion of VC member interfaces when viewing VC master
|
||||||
* [#5078](https://github.com/netbox-community/netbox/issues/5078) - Fix assignment of existing IP addresses to interfaces via web UI
|
* [#5078](https://github.com/netbox-community/netbox/issues/5078) - Fix assignment of existing IP addresses to interfaces via web UI
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
{% for section_name, menu_items in registry.plugin_menu_items.items %}
|
{% for section_name, menu_items in registry.plugin_menu_items.items %}
|
||||||
<li class="dropdown-header">{{ section_name }}</li>
|
<li class="dropdown-header">{{ section_name }}</li>
|
||||||
{% for menu_item in menu_items %}
|
{% for menu_item in menu_items %}
|
||||||
<li{% if menu_item.permissions and not request.user|has_perms:menu_item.permissions %} class="disabled"{% endif %}>
|
{% if not menu_item.permissions or request.user|has_perms:menu_item.permissions %}
|
||||||
|
<li>
|
||||||
{% if menu_item.buttons %}
|
{% if menu_item.buttons %}
|
||||||
<div class="buttons pull-right">
|
<div class="buttons pull-right">
|
||||||
{% for button in menu_item.buttons %}
|
{% for button in menu_item.buttons %}
|
||||||
@ -17,6 +18,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{% url menu_item.link %}">{{ menu_item.link_text }}</a>
|
<a href="{% url menu_item.link %}">{{ menu_item.link_text }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="disabled"><a href="#">{{ menu_item.link_text }}</a></li>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if not forloop.last %}
|
{% if not forloop.last %}
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
|
Loading…
Reference in New Issue
Block a user