From 301154e0a48ea2e2966afa92912317367dfcbe1b Mon Sep 17 00:00:00 2001 From: MR Lemon Date: Fri, 24 Apr 2020 17:46:33 +0100 Subject: much nicer create organisation form --- ctrack/organisations/forms.py | 12 +++++++++--- .../organisations/organisation_create.html | 21 ++++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ctrack/organisations/forms.py b/ctrack/organisations/forms.py index 63291a5..4234a07 100644 --- a/ctrack/organisations/forms.py +++ b/ctrack/organisations/forms.py @@ -1,5 +1,5 @@ from crispy_forms.helper import FormHelper -from crispy_forms.layout import Layout, Fieldset, ButtonHolder, Submit, Button +from crispy_forms.layout import Layout, Fieldset, ButtonHolder, Submit, Button, Field from django import forms from django.urls import reverse @@ -13,8 +13,8 @@ class OrganisationCreateForm(forms.ModelForm): self.helper = FormHelper(self) self.helper.layout = Layout( Fieldset( - f"Create a new Organisation", - "name", + "", + Field("name", css_class="form-control-lg"), "submode", "oes", "designation_type", @@ -38,3 +38,9 @@ class OrganisationCreateForm(forms.ModelForm): labels = { "oes": "OES" } + help_texts = { + "submode": "e.g. Rail Maintenance, TOC, etc...", + "updated_by": "Name of staff member/inspector creating this record", + "active": "Is this company an active participant in the NIS compliance regime?", + "designation_type": "This is probably defined in the Reguation", + } diff --git a/ctrack/organisations/templates/organisations/organisation_create.html b/ctrack/organisations/templates/organisations/organisation_create.html index 27e2cf4..4ee2801 100644 --- a/ctrack/organisations/templates/organisations/organisation_create.html +++ b/ctrack/organisations/templates/organisations/organisation_create.html @@ -7,10 +7,25 @@ {% load crispy_forms_tags %} {% block content %} -
+
-
- {% crispy form %} +
+

Create a new Organisation

+
+
+
+
+ {% crispy form %} +
+
+
+
+
Help on Organisations
+

An organisation is the parent/operating company. There is probably advice and + proper definitions for this somewhere. Maybe if you click the link below, it will take you there?

+ Go somewhere +
+
-- cgit v1.2.3