From 6aeb8bf4e982c55841634ca5473201df28967190 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 8 Oct 2024 12:29:02 +0200 Subject: [PATCH] Remove LabelSubmit This has been replaced by SubmitField setting has_empty_label to True --- python/nav/web/crispyforms.py | 8 +------- python/nav/web/sortedstats/forms.py | 3 --- .../nav/web/templates/custom_crispy_templates/submit.html | 2 -- .../templates/custom_crispy_templates/submit_field.html | 2 +- 4 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 python/nav/web/templates/custom_crispy_templates/submit.html diff --git a/python/nav/web/crispyforms.py b/python/nav/web/crispyforms.py index b3e46cd33d..cd5101712d 100644 --- a/python/nav/web/crispyforms.py +++ b/python/nav/web/crispyforms.py @@ -18,13 +18,7 @@ from typing import Optional from django import forms -from crispy_forms_foundation.layout import Field, Submit - - -class LabelSubmit(Submit): - """Submitbutton with a label above it to align within a row""" - - template = 'custom_crispy_templates/submit.html' +from crispy_forms_foundation.layout import Field class CheckBox(Field): diff --git a/python/nav/web/sortedstats/forms.py b/python/nav/web/sortedstats/forms.py index 287a958d80..e7daab8e9d 100644 --- a/python/nav/web/sortedstats/forms.py +++ b/python/nav/web/sortedstats/forms.py @@ -19,13 +19,10 @@ from django import forms -from crispy_forms_foundation.layout import Layout, Fieldset, Row, Column - from nav.web.crispyforms import ( FlatFieldset, FormColumn, FormRow, - LabelSubmit, SubmitField, set_flat_form_attributes, ) diff --git a/python/nav/web/templates/custom_crispy_templates/submit.html b/python/nav/web/templates/custom_crispy_templates/submit.html deleted file mode 100644 index da88456307..0000000000 --- a/python/nav/web/templates/custom_crispy_templates/submit.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/python/nav/web/templates/custom_crispy_templates/submit_field.html b/python/nav/web/templates/custom_crispy_templates/submit_field.html index 58c11bd831..6cd61eff8f 100644 --- a/python/nav/web/templates/custom_crispy_templates/submit_field.html +++ b/python/nav/web/templates/custom_crispy_templates/submit_field.html @@ -1,4 +1,4 @@ -{# NB! This field can be used as a replacement of crispy's Submit and our custom LabelSubmit #} +{# NB! This field can be used as a replacement of crispy's Submit #} {% if input.has_empty_label %} {% endif %}