File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -244,3 +244,39 @@ class ChangeActionChoices(ChoiceSet):
244244 (ACTION_UPDATE , _ ('Update' ), 'blue' ),
245245 (ACTION_DELETE , _ ('Delete' ), 'red' ),
246246 )
247+
248+
249+ #
250+ # Dashboard widgets
251+ #
252+
253+ class DashboardWidgetColorChoices (ChoiceSet ):
254+ BLUE = 'blue'
255+ INDIGO = 'indigo'
256+ PURPLE = 'purple'
257+ PINK = 'pink'
258+ RED = 'red'
259+ ORANGE = 'orange'
260+ YELLOW = 'yellow'
261+ GREEN = 'green'
262+ TEAL = 'teal'
263+ CYAN = 'cyan'
264+ GRAY = 'gray'
265+ BLACK = 'black'
266+ WHITE = 'white'
267+
268+ CHOICES = (
269+ (BLUE , _ ('Blue' )),
270+ (INDIGO , _ ('Indigo' )),
271+ (PURPLE , _ ('Purple' )),
272+ (PINK , _ ('Pink' )),
273+ (RED , _ ('Red' )),
274+ (ORANGE , _ ('Orange' )),
275+ (YELLOW , _ ('Yellow' )),
276+ (GREEN , _ ('Green' )),
277+ (TEAL , _ ('Teal' )),
278+ (CYAN , _ ('Cyan' )),
279+ (GRAY , _ ('Gray' )),
280+ (BLACK , _ ('Black' )),
281+ (WHITE , _ ('White' )),
282+ )
Original file line number Diff line number Diff line change 22from django .urls import reverse_lazy
33from django .utils .translation import gettext as _
44
5+ from extras .choices import DashboardWidgetColorChoices
56from netbox .registry import registry
67from utilities .forms import BootstrapMixin , add_blank_choice
7- from utilities .choices import ButtonColorChoices
88
99__all__ = (
1010 'DashboardWidgetAddForm' ,
@@ -21,7 +21,7 @@ class DashboardWidgetForm(BootstrapMixin, forms.Form):
2121 required = False
2222 )
2323 color = forms .ChoiceField (
24- choices = add_blank_choice (ButtonColorChoices ),
24+ choices = add_blank_choice (DashboardWidgetColorChoices ),
2525 required = False ,
2626 )
2727
You can’t perform that action at this time.
0 commit comments