Skip to content

Commit

Permalink
Revert "WIP uncrispify LoggerGroupSearchForm"
Browse files Browse the repository at this point in the history
This reverts commit e233a42.
  • Loading branch information
stveit committed Oct 8, 2024
1 parent fa7e77a commit 94633a6
Showing 1 changed file with 38 additions and 65 deletions.
103 changes: 38 additions & 65 deletions python/nav/web/syslogger/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
"""

from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms_foundation.layout import Layout, Fieldset, Row, Column, Field
from nav.models.logger import Priority, LoggerCategory, Origin, LogMessageType
from nav.web.crispyforms import (
FlatFieldset,
set_flat_form_attributes,
FormRow,
FormColumn,
)

DATEFORMAT = ("%Y-%m-%d %H:%M",)

Expand Down Expand Up @@ -52,63 +48,40 @@ def __init__(self, *args, **kwargs):
self.fields['timestamp_from'].widget.format = DATEFORMAT[0]
self.fields['timestamp_to'].widget.format = DATEFORMAT[0]

self.fields['facility'].widget.attrs.update({"class": "select2 medium-12"})
self.fields['priority'].widget.attrs.update({"class": "select2"})
self.fields['mnemonic'].widget.attrs.update({"class": "select2"})
self.fields['origin'].widget.attrs.update({"class": "select2"})
self.fields['category'].widget.attrs.update({"class": "select2"})

self.attrs = set_flat_form_attributes(
form_fields=[
FormRow(
fields=[
FormColumn(
fields=[
FlatFieldset(
legend='Filter <a href="http://www.cisco.com/en/US/docs/ios/system/messages/guide/sm_cnovr.html"><i class="fa fa-info-circle"></i></a>',
fields=[
FormRow(
fields=[
FormColumn(
fields=[self['facility']],
css_classes='medium-12',
),
FormColumn(
fields=[self['priority']],
css_classes='medium-12',
),
FormColumn(
fields=[self['mnemonic']],
css_classes='medium-12',
),
FormColumn(
fields=[self['origin']],
css_classes='medium-12',
),
FormColumn(
fields=[self['category']],
css_classes='medium-12',
),
FormColumn(
fields=[self['timestamp_from']],
css_classes='medium-12',
),
FormColumn(
fields=[self['timestamp_to']],
css_classes='medium-12',
),
FormColumn(
fields=[self['show_log']],
css_classes='medium-12',
),
]
)
],
)
],
css_classes='medium-12',
)
]
)
]
self.helper = FormHelper()
self.helper.form_tag = False
self.helper.layout = Layout(
Row(
Column(
Fieldset(
'Filter <a href="http://www.cisco.com/en/US/docs/ios/system/messages/guide/sm_cnovr.html"><i class="fa fa-info-circle"></i></a>',
Row(
Column(
Field('facility', css_class='select2 medium-12'),
css_class='medium-12',
),
Column(
Field('priority', css_class='select2'),
css_class='medium-12',
),
Column(
Field('mnemonic', css_class='select2'),
css_class='medium-12',
),
Column(
Field('origin', css_class='select2'),
css_class='medium-12',
),
Column(
Field('category', css_class='select2'),
css_class='medium-12',
),
Column('timestamp_from', css_class='medium-12'),
Column('timestamp_to', css_class='medium-12'),
Column('show_log', css_class='medium-12'),
),
),
css_class='medium-12',
),
),
)

0 comments on commit 94633a6

Please sign in to comment.