Skip to content

Commit

Permalink
Uncrispify AlertProfilesForm in alert profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Oct 4, 2024
1 parent 6feade9 commit faef7aa
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions python/nav/web/alertprofiles/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,29 @@ def __init__(self, *args, **kwargs):

self.fields['daily_dispatch_time'].widget = forms.TimeInput(format='%H:%M')
self.fields['weekly_dispatch_time'].widget = forms.TimeInput(format='%H:%M')
self.helper = FormHelper()
self.helper.form_tag = False
self.helper.layout = Layout(
'id',
'name',
Row(
Column('daily_dispatch_time', css_class='medium-4'),
Column('weekly_dispatch_time', css_class='medium-4'),
Column(
Field('weekly_dispatch_day', css_class='select2'),
css_class='medium-4',
self.fields['weekly_dispatch_day'].widget.attrs.update({'class': 'select2'})

self.attrs = set_flat_form_attributes(
form_fields=[
self["id"],
self["name"],
FormRow(
fields=[
FormColumn(
fields=[self["daily_dispatch_time"]],
css_classes="medium-4",
),
FormColumn(
fields=[self["weekly_dispatch_time"]],
css_classes="medium-4",
),
FormColumn(
fields=[self["weekly_dispatch_day"]],
css_classes="medium-4",
),
]
),
),
]
)

class Meta(object):
Expand Down

0 comments on commit faef7aa

Please sign in to comment.