mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Tweak PluginMenuButton icon_class to require additional "fa" class
This commit is contained in:
parent
19a10cee82
commit
5de085d83d
@ -304,8 +304,8 @@ menu_items = (
|
|||||||
link='plugins:netbox_animal_sounds:random_animal',
|
link='plugins:netbox_animal_sounds:random_animal',
|
||||||
link_text='Random sound',
|
link_text='Random sound',
|
||||||
buttons=(
|
buttons=(
|
||||||
PluginMenuButton('home', 'Button A', 'fa-info', ButtonColorChoices.BLUE),
|
PluginMenuButton('home', 'Button A', 'fa fa-info', ButtonColorChoices.BLUE),
|
||||||
PluginMenuButton('home', 'Button B', 'fa-warning', ButtonColorChoices.GREEN),
|
PluginMenuButton('home', 'Button B', 'fa fa-warning', ButtonColorChoices.GREEN),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -322,7 +322,7 @@ A `PluginMenuButton` has the following attributes:
|
|||||||
|
|
||||||
* `link` - The name of the URL path to which this button links
|
* `link` - The name of the URL path to which this button links
|
||||||
* `title` - The tooltip text (displayed when the mouse hovers over the button)
|
* `title` - The tooltip text (displayed when the mouse hovers over the button)
|
||||||
* `icon_class` - Button icon CSS class
|
* `icon_class` - Button icon CSS class (NetBox currently supports [Font Awesome 4.7](https://fontawesome.com/v4.7.0/icons/))
|
||||||
* `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)
|
||||||
|
|
||||||
|
@ -9,12 +9,12 @@ menu_items = (
|
|||||||
PluginMenuButton(
|
PluginMenuButton(
|
||||||
link='admin:dummy_plugin_dummymodel_add',
|
link='admin:dummy_plugin_dummymodel_add',
|
||||||
title='Add a new dummy model',
|
title='Add a new dummy model',
|
||||||
icon_class='fa-plus',
|
icon_class='fa fa-plus',
|
||||||
),
|
),
|
||||||
PluginMenuButton(
|
PluginMenuButton(
|
||||||
link='admin:dummy_plugin_dummymodel_add',
|
link='admin:dummy_plugin_dummymodel_add',
|
||||||
title='Add a new dummy model',
|
title='Add a new dummy model',
|
||||||
icon_class='fa-plus',
|
icon_class='fa fa-plus',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<div class="buttons pull-right">
|
<div class="buttons pull-right">
|
||||||
{% for button in menu_item.buttons %}
|
{% for button in menu_item.buttons %}
|
||||||
{% if not button.permissions or request.user|has_perms:button.permissions %}
|
{% if not button.permissions or request.user|has_perms:button.permissions %}
|
||||||
<a href="{% url button.link %}" class="btn btn-xs btn-{{ button.color }}" title="{{ button.title }}"><i class="fa {{ button.icon_class }}"></i></a>
|
<a href="{% url button.link %}" class="btn btn-xs btn-{{ button.color }}" title="{{ button.title }}"><i class="{{ button.icon_class }}"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user