Skip to content

Commit

Permalink
Use helper function to set management profile filter layout
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Oct 11, 2024
1 parent cc77c82 commit 81689b3
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions python/nav/web/seeddb/page/management_profile/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@
from django import forms

from nav.models.manage import ManagementProfile
from nav.web.crispyforms import (
FlatFieldset,
FormColumn,
FormRow,
SubmitField,
set_flat_form_attributes,
)
from nav.web.seeddb.forms import get_single_layout

PROTOCOL_CHOICES = dict(ManagementProfile.PROTOCOL_CHOICES)

Expand All @@ -37,33 +31,8 @@ class ManagementProfileFilterForm(forms.Form):
def __init__(self, *args, **kwargs):
super(ManagementProfileFilterForm, self).__init__(*args, **kwargs)

self.attrs = set_flat_form_attributes(
form_class="custom",
form_method="get",
form_fields=[
FlatFieldset(
legend="Filter connection profiles",
fields=[
FormRow(
fields=[
FormColumn(
fields=[self["protocol"]], css_classes="medium-8"
),
FormColumn(
fields=[
SubmitField(
value="Filter",
css_classes="postfix",
has_empty_label=True,
)
],
css_classes="medium-4",
),
]
)
],
)
],
self.attrs = get_single_layout(
heading="Filter connection profiles", row=self["protocol"]
)


Expand Down

0 comments on commit 81689b3

Please sign in to comment.