aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-05-29 17:11:21 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-05-29 17:11:21 +0100
commit3aec120ae42cb29049c8ba3d8d52d2388e56bb36 (patch)
treeb474c440f524750825af6efefcf1948aa9cb8232 /ctrack
parentc2073816d1181797c44a6549334762e6501315d8 (diff)
tweaked the IR model and the form page
Diffstat (limited to 'ctrack')
-rw-r--r--ctrack/organisations/forms.py2
-rw-r--r--ctrack/organisations/migrations/0009_incidentreport_person_involved.py18
-rw-r--r--ctrack/organisations/migrations/0010_auto_20200529_1602.py18
-rw-r--r--ctrack/organisations/models.py9
-rw-r--r--ctrack/organisations/templates/organisations/incidentreport_form.html45
5 files changed, 64 insertions, 28 deletions
diff --git a/ctrack/organisations/forms.py b/ctrack/organisations/forms.py
index 6bcd723..e5ed3ad 100644
--- a/ctrack/organisations/forms.py
+++ b/ctrack/organisations/forms.py
@@ -99,6 +99,7 @@ class IncidentReportForm(forms.ModelForm):
super().__init__(*args, **kwargs)
self.helper = FormHelper(self)
self.helper.layout = Layout(
+ "person_involved",
"role",
"phone_number",
"email",
@@ -133,6 +134,7 @@ class IncidentReportForm(forms.ModelForm):
class Meta:
model = IncidentReport
fields = [
+ "person_involved",
"role",
"phone_number",
"email",
diff --git a/ctrack/organisations/migrations/0009_incidentreport_person_involved.py b/ctrack/organisations/migrations/0009_incidentreport_person_involved.py
new file mode 100644
index 0000000..ea4799c
--- /dev/null
+++ b/ctrack/organisations/migrations/0009_incidentreport_person_involved.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.12 on 2020-05-29 16:01
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organisations', '0008_auto_20200529_1545'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='incidentreport',
+ name='person_involved',
+ field=models.CharField(blank=True, max_length=100, verbose_name='Name of person reporting/detecting incident'),
+ ),
+ ]
diff --git a/ctrack/organisations/migrations/0010_auto_20200529_1602.py b/ctrack/organisations/migrations/0010_auto_20200529_1602.py
new file mode 100644
index 0000000..2986d36
--- /dev/null
+++ b/ctrack/organisations/migrations/0010_auto_20200529_1602.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.12 on 2020-05-29 16:02
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organisations', '0009_incidentreport_person_involved'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='incidentreport',
+ name='role',
+ field=models.CharField(blank=True, help_text='Role of person reporting/detecting incident', max_length=100),
+ ),
+ ]
diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py
index 8fbe296..75b28df 100644
--- a/ctrack/organisations/models.py
+++ b/ctrack/organisations/models.py
@@ -215,8 +215,15 @@ class IncidentReport(models.Model):
on_delete=models.CASCADE,
verbose_name="Person " "reporting the incident",
)
+ person_involved = models.CharField(
+ max_length=100,
+ blank=True,
+ verbose_name="Name of person reporting/detecting incident",
+ )
role = models.CharField(
- max_length=100, blank=False, help_text="Please identify your role"
+ max_length=100,
+ blank=True,
+ help_text="Role of person reporting/detecting incident",
)
phone_number = models.CharField(max_length=30, blank=False)
email = models.EmailField(blank=False)
diff --git a/ctrack/organisations/templates/organisations/incidentreport_form.html b/ctrack/organisations/templates/organisations/incidentreport_form.html
index 2683302..a8db01a 100644
--- a/ctrack/organisations/templates/organisations/incidentreport_form.html
+++ b/ctrack/organisations/templates/organisations/incidentreport_form.html
@@ -1,40 +1,31 @@
{% extends "base_stakeholder.html" %}
{% block title %}
- Submit a new NIS Incident Report to DfT
+ Submit a new NIS Incident Report to DfT
{% endblock title %}
{% load crispy_forms_tags %}
{% block content %}
- <div class="container mt-3">
- <div class="row">
- <div class="col-md-12 pl-0 my-2">
- <h4>NIS Incident Report - for DfT</h4>
+ <div class="container mt-3">
<div class="row">
- <div class="col-8 my-2">
- <div class="border border-danger rounded p-2">
- <h5>IMPORTANT:</h5>
- <p>Please ensure full details are provided. Incident reports MUST be submitted
- within 72 of an incident being detected. Your lead inspector will follow-up with
- you in due course. Thank you.</p></div>
+ <div class="col-md-10 pl-0 my-2">
+ <h4>NIS Incident Report - for DfT</h4>
+ <div class="row">
+ <div class="col-md-8 pt-2">
+ <div class="border border-danger rounded p-2">
+ <h5>IMPORTANT:</h5>
+ <p>Please ensure full details are provided. Incident reports MUST be submitted
+ within 72 of an incident being detected. Your lead inspector will follow-up with
+ you in due course. Thank you.</p></div>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-10 pt-2">
+ {% crispy form %}
+ </div>
</div>
</div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-8 pt-2 border bg-light">
- {% crispy form %}
- </div>
- <div class="col-sm-4">
- <div class="card" style="width: 18rem;">
- <div class="card-body">
- <h5 class="card-title">Help submitting an incident form</h5>
- <p class="card-text">Bobbins for now..</p>
- <a href="#" class="btn btn-primary">Go somewhere</a>
- </div>
- </div>
- </div>
</div>
- </div>
{% endblock content %}