diff options
author | MR Lemon <matt@matthewlemon> | 2020-04-17 22:44:27 +0100 |
---|---|---|
committer | MR Lemon <matt@matthewlemon> | 2020-04-17 22:44:27 +0100 |
commit | 5e8475a02053f1df18d08d3c45afdf687b664fa4 (patch) | |
tree | 1d05b8bab8b7fcf11783033d10e8213791f9aae0 /ctrack/caf | |
parent | 51149b561a44e5ecfbca90dfb9989985ccf2c122 (diff) |
making the form slightly better
Diffstat (limited to 'ctrack/caf')
-rw-r--r-- | ctrack/caf/forms.py | 13 | ||||
-rw-r--r-- | ctrack/caf/views.py | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/ctrack/caf/forms.py b/ctrack/caf/forms.py index 5903a2c..1d07249 100644 --- a/ctrack/caf/forms.py +++ b/ctrack/caf/forms.py @@ -1,5 +1,5 @@ from crispy_forms.helper import FormHelper -from crispy_forms.layout import Button +from crispy_forms.layout import Button, Field from crispy_forms.layout import ButtonHolder from crispy_forms.layout import Fieldset from crispy_forms.layout import Layout @@ -28,13 +28,14 @@ class ApplicableSystemCreateForm(forms.ModelForm): self.helper.layout = Layout( Fieldset( "Create a new System", - "name", - "description", - "organisation", - "caf", + Field("name", css_class="form-control form-control-sm"), + Field("description", css_class="form-control form-control-sm"), + Field("organisation", css_class="form-control form-control-sm"), + Field("caf", css_class="form-control form-control-sm") ), ButtonHolder( - Submit("submit", "Submit", css_class="btn-primary") + Submit("submit", "Submit", css_class="btn-primary"), + Button("cancel", "Cancel", css_class="btn-danger") ) ) diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index 9a5cb64..a0fc17b 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -1,5 +1,6 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import render +from django.urls import reverse_lazy from django.views.generic import ListView, DetailView, CreateView from ctrack.assessments.models import CAFAssessmentOutcomeScore @@ -56,3 +57,5 @@ class ApplicableSystemCreate(LoginRequiredMixin, CreateView): form_class = ApplicableSystemCreateForm model = ApplicableSystem template_name = "caf/applicablesystem_create.html" + success_url = reverse_lazy("caf:es_list") + |