aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/forms.py
diff options
context:
space:
mode:
authorMR Lemon <matt@matthewlemon>2020-05-01 15:51:59 +0100
committerMR Lemon <matt@matthewlemon>2020-05-01 15:51:59 +0100
commit089eb10d5023e92969b72561baca32a9d730f0c6 (patch)
treeef713fe89690129dfea07239be97634a6fcd062d /ctrack/organisations/forms.py
parent18a273f684946d2a6ad99ae579339f787bfaa0c2 (diff)
making progress with the form wizard
Diffstat (limited to 'ctrack/organisations/forms.py')
-rw-r--r--ctrack/organisations/forms.py26
1 files changed, 6 insertions, 20 deletions
diff --git a/ctrack/organisations/forms.py b/ctrack/organisations/forms.py
index ab92e64..0903649 100644
--- a/ctrack/organisations/forms.py
+++ b/ctrack/organisations/forms.py
@@ -9,26 +9,11 @@ from ctrack.organisations.models import Organisation, Address
class OrganisationCreateForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
- cancel_redirect = reverse("organisations:list")
- self.helper = FormHelper(self)
- self.helper.layout = Layout(
- Fieldset(
- "",
- Field("name", css_class="form-control"),
- "submode",
- "oes",
- "designation_type",
- "registered_company_name",
- "registered_company_number",
- "updated_by",
- "comments",
- "active"
- ),
- ButtonHolder(
- Submit("submit", "Submit", css_class="btn-primary"),
- Button("cancel", "Cancel", onclick=f"location.href='{cancel_redirect}';", css_class="btn-danger")
- )
- )
+ self.fields["name"].widget.attrs["class"] = "form-control"
+ self.fields["submode"].widget.attrs["class"] = "form-control"
+ self.fields["oes"].widget.attrs["class"] = "form-check-input"
+ self.fields["designation_type"].widget.attrs["class"] = "form-control"
+ self.fields["registered_company_name"].widget.attrs["class"] = "form-control"
class Meta:
model = Organisation
@@ -43,6 +28,7 @@ class OrganisationCreateForm(forms.ModelForm):
"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",
+ "registered_company_name": "Probably different from the Organisation name"
}