Skip to content

Commit

Permalink
Merge pull request Uninett#3162 from Uninett/uncrispify/AccountCharts…
Browse files Browse the repository at this point in the history
…Form

Uncrispify AccountChartsForm
  • Loading branch information
stveit authored Nov 8, 2024
2 parents c28ae78 + bb9af5b commit b8fec64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 4 additions & 7 deletions python/nav/web/radius/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
from django.core.validators import validate_ipv4_address
from django.core.validators import validate_integer as django_validate_integer

from crispy_forms.helper import FormHelper
from crispy_forms_foundation.layout import Layout, Submit
from nav.web.crispyforms import (
set_flat_form_attributes,
FormColumn,
Expand Down Expand Up @@ -255,9 +253,8 @@ class AccountChartsForm(forms.Form):

def __init__(self, *args, **kwargs):
super(AccountChartsForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_action = ''
self.helper.form_method = 'GET'
self.helper.layout = Layout(
'days', 'charts', Submit('send', 'Show me', css_class='small')
self.attrs = set_flat_form_attributes(
form_method='get',
form_fields=[self['days'], self['charts']],
submit_field=SubmitField('send', 'Show me', css_classes='small'),
)
3 changes: 1 addition & 2 deletions python/nav/web/templates/radius/account_charts.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% extends "radius/base.html" %}
{% load crispy_forms_tags %}
{% load radius %}

{% block content %}
Expand All @@ -16,7 +15,7 @@ <h4 class="subheader">Show top 6 talkers</h4>

<div id="form" class="row">
<div class="medium-6 columns">
{% crispy form %}
{% include 'custom_crispy_templates/flat_form.html' %}
</div>
</div>

Expand Down

0 comments on commit b8fec64

Please sign in to comment.