From dade2f791d101d1fd582782c50d76fcb95ba5596 Mon Sep 17 00:00:00 2001 From: MR Lemon Date: Tue, 5 May 2020 16:12:41 +0100 Subject: tidied organisation create form - now with submit and cancel buttons --- ctrack/organisations/models.py | 2 +- .../organisations/org_create_formset.html | 50 +++++++++++----------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index 6824eeb..b14b03b 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -123,7 +123,7 @@ class Organisation(models.Model): submode = models.ForeignKey( Submode, on_delete=models.CASCADE, blank=True, null=True ) - oes = models.BooleanField() + oes = models.BooleanField(default=True) designation_type = models.IntegerField(choices=DESIGNATION_TYPE, default=1) registered_company_name = models.CharField(max_length=255, blank=True) registered_company_number = models.CharField(max_length=100, blank=True) diff --git a/ctrack/organisations/templates/organisations/org_create_formset.html b/ctrack/organisations/templates/organisations/org_create_formset.html index a73a2af..d78abb1 100644 --- a/ctrack/organisations/templates/organisations/org_create_formset.html +++ b/ctrack/organisations/templates/organisations/org_create_formset.html @@ -8,21 +8,21 @@ {% block content %} -
+

Create a new organisation

-
+
{% csrf_token %} {# this is the parent form - in this case the organisation form #} -
+
{{ form.non_field_errors }} {{ form.name }} {{ form.name.help_text }}
-
+
{{ form.non_field_errors }} {{ form.oes }} @@ -30,35 +30,35 @@
-
+
{{ form.non_field_errors }} {{ form.submode }} {{ form.submode.help_text }}
-
+
{{ form.non_field_errors }} {{ form.designation_type }} {{ form.designation_type.help_text }}
-
+
{{ form.non_field_errors }} {{ form.registered_company_name }} {{ form.registered_company_name.help_text }}
-
+
{{ form.non_field_errors }} {{ form.registered_company_number }} {{ form.registered_company_number.help_text }}
-
+
{{ form.non_field_errors }} {{ form.comments }} @@ -70,80 +70,80 @@
Address:
-
+
{{ addresses.management_form }} {% for form in addresses %} - {% if forloop.counter > 1 %} -
Optional (add an alternative address):
+ {% if forloop.counter > 1 %} +
Optional (add an alternative address):
{% endif %} -
+
{{ form.non_field_errors }} {{ form.type }} {{ form.type.help_text }}
-
+
{{ form.non_field_errors }} {{ form.line1 }} {{ form.line1.help_text }}
-
+
{{ form.non_field_errors }} {{ form.line2 }} {{ form.line2.help_text }}
-
+
{{ form.non_field_errors }} {{ form.line3 }} {{ form.line3.help_text }}
-
+
{{ form.non_field_errors }} {{ form.city }} {{ form.city.help_text }}
-
+
{{ form.non_field_errors }} {{ form.county }} {{ form.county.help_text }}
-
+
{{ form.non_field_errors }} {{ form.postcode }} {{ form.postcode.help_text }}
-
+
{{ form.non_field_errors }} {{ form.country }} {{ form.country.help_text }}
- {% endfor %} +
+ + Cancel +
- +
- {# This is the address inlineformset#} - -
{% endblock %} -- cgit v1.2.3