From 73d6f56eba8cd625fd14f67c68e367d7f5aa6d2f Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 20:54:48 +0000 Subject: [PATCH 01/12] Add fields to rig info for additional access requirements --- RIGS/forms.py | 3 ++- .../0052_event_parking_and_access.py | 18 ++++++++++++++++++ RIGS/models.py | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 RIGS/migrations/0052_event_parking_and_access.py diff --git a/RIGS/forms.py b/RIGS/forms.py index b4de22f4..c7a37dd1 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -22,6 +22,7 @@ class EventForm(forms.ModelForm): datetime_input_formats = list(settings.DATETIME_INPUT_FORMATS) meet_at = forms.DateTimeField(input_formats=datetime_input_formats, required=False) access_at = forms.DateTimeField(input_formats=datetime_input_formats, required=False) + parking_and_access = forms.BooleanField(label="Additional parking or access requirements (i.e. campus parking permits, wristbands)?") items_json = forms.CharField() @@ -125,7 +126,7 @@ class Meta: fields = ['is_rig', 'name', 'venue', 'start_time', 'end_date', 'start_date', 'end_time', 'meet_at', 'access_at', 'description', 'notes', 'mic', 'person', 'organisation', 'dry_hire', 'checked_in_by', 'status', - 'purchase_order', 'collector', 'forum_url'] + 'purchase_order', 'collector', 'forum_url', 'parking_and_access'] class BaseClientEventAuthorisationForm(forms.ModelForm): diff --git a/RIGS/migrations/0052_event_parking_and_access.py b/RIGS/migrations/0052_event_parking_and_access.py new file mode 100644 index 00000000..4df4ec56 --- /dev/null +++ b/RIGS/migrations/0052_event_parking_and_access.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.25 on 2024-11-20 20:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('RIGS', '0051_alter_payment_method'), + ] + + operations = [ + migrations.AddField( + model_name='event', + name='parking_and_access', + field=models.BooleanField(default=False), + ), + ] diff --git a/RIGS/models.py b/RIGS/models.py index 415bcd5d..f90d9abc 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -351,6 +351,9 @@ class Event(models.Model, RevisionMixin): access_at = models.DateTimeField(blank=True, null=True) meet_at = models.DateTimeField(blank=True, null=True) + # Venue requirements + parking_and_access = models.BooleanField(default=False) + # Crew management checked_in_by = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='event_checked_in', blank=True, null=True, on_delete=models.CASCADE) From 45a88fa518bc10603d3df46a36a83db70326f68a Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 20:54:59 +0000 Subject: [PATCH 02/12] Add form field for additional access requirements --- RIGS/templates/event_form.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RIGS/templates/event_form.html b/RIGS/templates/event_form.html index c19a88b0..64703c73 100644 --- a/RIGS/templates/event_form.html +++ b/RIGS/templates/event_form.html @@ -282,6 +282,14 @@ + {# Parking & Access requirements #} +
+
+ +
+
{# Status is needed on all events types and it looks good here in the form #} From 4c4060c9806a86d56e6333b58c9dcc5b22ef889f Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 20:55:23 +0000 Subject: [PATCH 03/12] Display access requirements in rig info --- RIGS/templates/event_detail.html | 5 ++++- RIGS/templates/partials/contact_details.html | 4 ++-- RIGS/templates/partials/event_details.html | 1 + RIGS/templates/partials/event_status.html | 3 +++ RIGS/templates/partials/parking_and_access.html | 14 ++++++++++++++ 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 RIGS/templates/partials/parking_and_access.html diff --git a/RIGS/templates/event_detail.html b/RIGS/templates/event_detail.html index a1de143d..fc58ec4e 100644 --- a/RIGS/templates/event_detail.html +++ b/RIGS/templates/event_detail.html @@ -15,8 +15,11 @@ {% endif %} {% if object.is_rig and perms.RIGS.view_event %} {# only need contact details for a rig #} -
+
{% include 'partials/contact_details.html' %} + {% if object.parking_and_access %} + {% include 'partials/parking_and_access.html' %} + {% endif %}
{% endif %}
diff --git a/RIGS/templates/partials/contact_details.html b/RIGS/templates/partials/contact_details.html index 779b5d90..202770e8 100644 --- a/RIGS/templates/partials/contact_details.html +++ b/RIGS/templates/partials/contact_details.html @@ -23,7 +23,7 @@
{% endif %} {% if object.organisation %} -
+
Organisation Details
@@ -44,4 +44,4 @@
-{% endif %} +{% endif %} \ No newline at end of file diff --git a/RIGS/templates/partials/event_details.html b/RIGS/templates/partials/event_details.html index 70074be6..d95211e5 100644 --- a/RIGS/templates/partials/event_details.html +++ b/RIGS/templates/partials/event_details.html @@ -11,6 +11,7 @@ {{ object.venue|namewithnotes:'venue_detail' }} {% endif %} + {% if object.parking_and_access %}Additional Access Requirements{% endif %} {% if object.venue %}
Venue Notes
diff --git a/RIGS/templates/partials/event_status.html b/RIGS/templates/partials/event_status.html index 55c9192a..42643608 100644 --- a/RIGS/templates/partials/event_status.html +++ b/RIGS/templates/partials/event_status.html @@ -44,5 +44,8 @@ Invoice: Not Generated {% endif %} {% endif %} + {% if event.parking_and_access %} + Addititional Access Requirements + {% endif %} {% endif %}
diff --git a/RIGS/templates/partials/parking_and_access.html b/RIGS/templates/partials/parking_and_access.html new file mode 100644 index 00000000..f962a27b --- /dev/null +++ b/RIGS/templates/partials/parking_and_access.html @@ -0,0 +1,14 @@ +
+
Parking and Access
+
+

This venue has additional parking and/or access requirements.

+ +

Ensure the MIC has:

+
    +
  • Details of where to park
  • +
  • Details of how to access the venue
  • +
  • Details of any access restrictions
  • +
  • If on campus, sorted parking permits
  • +
+
+
From 32d3a54b4fac55c52936e24b040a3ec06196fcca Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 21:09:34 +0000 Subject: [PATCH 04/12] Make access requirements field non-required Oops... --- RIGS/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/forms.py b/RIGS/forms.py index c7a37dd1..e2e62fca 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -22,7 +22,7 @@ class EventForm(forms.ModelForm): datetime_input_formats = list(settings.DATETIME_INPUT_FORMATS) meet_at = forms.DateTimeField(input_formats=datetime_input_formats, required=False) access_at = forms.DateTimeField(input_formats=datetime_input_formats, required=False) - parking_and_access = forms.BooleanField(label="Additional parking or access requirements (i.e. campus parking permits, wristbands)?") + parking_and_access = forms.BooleanField(label="Additional parking or access requirements (i.e. campus parking permits, wristbands)?", required=False) items_json = forms.CharField() From a75f538c17a9fef7faa6ae5bb93b279f331afe50 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 21:30:09 +0000 Subject: [PATCH 05/12] Add event access field to risk assessment --- .../0053_riskassessment_parking_and_access.py | 19 +++++++++++++++++++ RIGS/models.py | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 RIGS/migrations/0053_riskassessment_parking_and_access.py diff --git a/RIGS/migrations/0053_riskassessment_parking_and_access.py b/RIGS/migrations/0053_riskassessment_parking_and_access.py new file mode 100644 index 00000000..82fa3170 --- /dev/null +++ b/RIGS/migrations/0053_riskassessment_parking_and_access.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.25 on 2024-11-20 21:18 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('RIGS', '0052_event_parking_and_access'), + ] + + operations = [ + migrations.AddField( + model_name='riskassessment', + name='parking_and_access', + field=models.BooleanField(default=False, help_text='Are there additional requirements for parking and access to the venue? (i.e. campus parking permits, event access wristbands)'), + preserve_default=False, + ), + ] diff --git a/RIGS/models.py b/RIGS/models.py index f90d9abc..a97e91ee 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -782,6 +782,9 @@ class RiskAssessment(ReviewableModel, RevisionMixin): persons_responsible_structures = models.TextField(blank=True, default='', help_text="Who are the persons on site responsible for their use?") rigging_plan = models.URLField(blank=True, default='', help_text="Upload your rigging plan to the Sharepoint and submit a link", validators=[validate_url]) + # Venue Access + parking_and_access = models.BooleanField(help_text="Are there additional requirements for parking and access to the venue? (i.e. campus parking permits, event access wristbands)") + # Blimey that was a lot of options supervisor_consulted = models.BooleanField(null=True) From 036a9b035207c79f3eddc79fa56d9ccafa8d2d8c Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 21:30:45 +0000 Subject: [PATCH 06/12] Allow for modification and display risk assessment venue access item --- RIGS/templates/event_detail.html | 2 +- RIGS/templates/hs/ra_print.xml | 7 +++++++ RIGS/templates/hs/risk_assessment_detail.html | 13 ++++++++++++- RIGS/templates/hs/risk_assessment_form.html | 10 ++++++++++ RIGS/templates/partials/event_details.html | 2 +- RIGS/templates/partials/parking_and_access.html | 8 ++++++++ 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/RIGS/templates/event_detail.html b/RIGS/templates/event_detail.html index fc58ec4e..96296546 100644 --- a/RIGS/templates/event_detail.html +++ b/RIGS/templates/event_detail.html @@ -17,7 +17,7 @@ {# only need contact details for a rig #}
{% include 'partials/contact_details.html' %} - {% if object.parking_and_access %} + {% if object.parking_and_access or object.riskassessment.parking_and_access %} {% include 'partials/parking_and_access.html' %} {% endif %}
diff --git a/RIGS/templates/hs/ra_print.xml b/RIGS/templates/hs/ra_print.xml index 4dabd8d3..09887dba 100644 --- a/RIGS/templates/hs/ra_print.xml +++ b/RIGS/templates/hs/ra_print.xml @@ -124,6 +124,13 @@ {{ object|help_text:'persons_responsible_structures'|striptags }} {{ object.persons_responsible_structures|default:'N/A' }} + +

Venue Access

+ + + {{ object|help_text:'parking_and_access'|striptags }} + {{ object.parking_and_access|yesno|capfirst }} + \
diff --git a/RIGS/templates/hs/risk_assessment_detail.html b/RIGS/templates/hs/risk_assessment_detail.html index a78941a7..a933e152 100644 --- a/RIGS/templates/hs/risk_assessment_detail.html +++ b/RIGS/templates/hs/risk_assessment_detail.html @@ -151,8 +151,19 @@
+
+
Venue Access
+
+
+
{{ object|help_text:'parking_and_access' }}
+
+ {{ object.parking_and_access|yesnoi:'invert' }} +
+
+
+
+ -
{% button 'print' 'ra_print' object.pk %} diff --git a/RIGS/templates/hs/risk_assessment_form.html b/RIGS/templates/hs/risk_assessment_form.html index 0fcef1be..27d5f18b 100644 --- a/RIGS/templates/hs/risk_assessment_form.html +++ b/RIGS/templates/hs/risk_assessment_form.html @@ -162,6 +162,16 @@
+
+
+
+
Venue Access
+
+ {% include 'partials/yes_no_radio.html' with formitem=form.parking_and_access %} +
+
+
+
diff --git a/RIGS/templates/partials/event_details.html b/RIGS/templates/partials/event_details.html index d95211e5..6f017628 100644 --- a/RIGS/templates/partials/event_details.html +++ b/RIGS/templates/partials/event_details.html @@ -11,7 +11,7 @@ {{ object.venue|namewithnotes:'venue_detail' }} {% endif %} - {% if object.parking_and_access %}Additional Access Requirements{% endif %} + {% if object.parking_and_access or object.riskassessment.parking_and_access %}Additional Access Requirements{% endif %} {% if object.venue %}
Venue Notes
diff --git a/RIGS/templates/partials/parking_and_access.html b/RIGS/templates/partials/parking_and_access.html index f962a27b..f72155ac 100644 --- a/RIGS/templates/partials/parking_and_access.html +++ b/RIGS/templates/partials/parking_and_access.html @@ -10,5 +10,13 @@
  • Details of any access restrictions
  • If on campus, sorted parking permits
  • + + {% if object.parking_and_access and object.riskassessment.parking_and_access %} + Additional parking marked on both rig details and risk assessment. + {% elif object.parking_and_access %} + Additional parking marked on rig details. + {% elif object.riskassessment.parking_and_access %} + Additional parking marked on risk assessment. + {% endif %}
    From 1fd1aa6c3bdf8f2b8da05b60c17cd42df9d6f99e Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 21:37:40 +0000 Subject: [PATCH 07/12] Correct tests for RAs with new parking fields --- RIGS/tests/conftest.py | 2 +- RIGS/tests/test_interaction.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RIGS/tests/conftest.py b/RIGS/tests/conftest.py index bcb4add9..3d7be854 100644 --- a/RIGS/tests/conftest.py +++ b/RIGS/tests/conftest.py @@ -20,7 +20,7 @@ def ra(basic_event, admin_user): known_venue=True, safe_loading=True, safe_storage=True, area_outside_of_control=True, barrier_required=True, nonstandard_emergency_procedure=True, special_structures=False, - suspended_structures=False, outside=False) + suspended_structures=False, outside=False, parking_and_access=False) yield ra ra.delete() diff --git a/RIGS/tests/test_interaction.py b/RIGS/tests/test_interaction.py index b035098e..4fcc9f53 100644 --- a/RIGS/tests/test_interaction.py +++ b/RIGS/tests/test_interaction.py @@ -759,6 +759,7 @@ def test_ra_creation(logged_in_browser, live_server, admin_user, basic_event): page.barrier_required = False page.nonstandard_emergency_procedure = False page.special_structures = False + page.parking_and_access = True # self.page.persons_responsible_structures = "Nobody and her cat, She" page.suspended_structures = True From 2a4ee5194e8239691e6df4e2e6d75cc90b8369c1 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 21:38:49 +0000 Subject: [PATCH 08/12] Add note to new venue access component of RA --- RIGS/templates/hs/risk_assessment_form.html | 1 + 1 file changed, 1 insertion(+) diff --git a/RIGS/templates/hs/risk_assessment_form.html b/RIGS/templates/hs/risk_assessment_form.html index 27d5f18b..3a3e9f1b 100644 --- a/RIGS/templates/hs/risk_assessment_form.html +++ b/RIGS/templates/hs/risk_assessment_form.html @@ -167,6 +167,7 @@
    Venue Access
    +

    If yes to the below, ensure you have communicated with the client and secured all necessary access prior to the event commencing.

    {% include 'partials/yes_no_radio.html' with formitem=form.parking_and_access %}
    From 8bfeba791f2cefbd55bcb0b55e6bf14b5231be3f Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 21:47:17 +0000 Subject: [PATCH 09/12] Correct div boundaries for non-rig access requirements --- RIGS/templates/event_form.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RIGS/templates/event_form.html b/RIGS/templates/event_form.html index 64703c73..69d28455 100644 --- a/RIGS/templates/event_form.html +++ b/RIGS/templates/event_form.html @@ -281,8 +281,6 @@ {{ form.dry_hire.label }} {% render_field form.dry_hire %}
    - - {# Parking & Access requirements #}
    + {# Status is needed on all events types and it looks good here in the form #}
    From b5d300242a4c48ed4f5d959484bc20d02398325c Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 21:59:47 +0000 Subject: [PATCH 10/12] Fill parking and access field in sample data generator --- RIGS/management/commands/generateSampleRIGSData.py | 1 + 1 file changed, 1 insertion(+) diff --git a/RIGS/management/commands/generateSampleRIGSData.py b/RIGS/management/commands/generateSampleRIGSData.py index b8331891..1292fb67 100644 --- a/RIGS/management/commands/generateSampleRIGSData.py +++ b/RIGS/management/commands/generateSampleRIGSData.py @@ -276,6 +276,7 @@ def setup_events(self): nonstandard_emergency_procedure=bool(random.getrandbits(1)), special_structures=bool(random.getrandbits(1)), suspended_structures=bool(random.getrandbits(1)), + parking_and_access=bool(random.getrandbits(1)), outside=bool(random.getrandbits(1))) if i == 0 or random.randint(0, 1) > 0: # Event 1 and 1 in 10 have a Checklist models.EventChecklist.objects.create(event=new_event, From 0f3b80fcb02e116258dcd3bf6b67cf4b82776506 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 21:59:59 +0000 Subject: [PATCH 11/12] Set parking and access field to false in RA creation test --- RIGS/tests/test_interaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/tests/test_interaction.py b/RIGS/tests/test_interaction.py index 4fcc9f53..f519ee89 100644 --- a/RIGS/tests/test_interaction.py +++ b/RIGS/tests/test_interaction.py @@ -759,7 +759,7 @@ def test_ra_creation(logged_in_browser, live_server, admin_user, basic_event): page.barrier_required = False page.nonstandard_emergency_procedure = False page.special_structures = False - page.parking_and_access = True + page.parking_and_access = False # self.page.persons_responsible_structures = "Nobody and her cat, She" page.suspended_structures = True From d1e839c2cd6c0c1a15aa76b4725ab86580c759aa Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 20 Nov 2024 22:05:52 +0000 Subject: [PATCH 12/12] Hopefully the final correction of the RA test suite --- RIGS/models.py | 1 + RIGS/tests/pages.py | 1 + 2 files changed, 2 insertions(+) diff --git a/RIGS/models.py b/RIGS/models.py index a97e91ee..ad4267e1 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -809,6 +809,7 @@ class RiskAssessment(ReviewableModel, RevisionMixin): 'nonstandard_emergency_procedure': False, 'special_structures': False, 'suspended_structures': False, + 'parking_and_access': False } inverted_fields = {key: value for (key, value) in expected_values.items() if not value}.keys() diff --git a/RIGS/tests/pages.py b/RIGS/tests/pages.py index a2765830..977e0bb8 100644 --- a/RIGS/tests/pages.py +++ b/RIGS/tests/pages.py @@ -207,6 +207,7 @@ class CreateRiskAssessment(FormPage): 'suspended_structures': (regions.RadioSelect, (By.ID, 'id_suspended_structures')), 'supervisor_consulted': (regions.CheckBox, (By.ID, 'id_supervisor_consulted')), 'rigging_plan': (regions.TextBox, (By.ID, 'id_rigging_plan')), + 'parking_and_access': (regions.RadioSelect, (By.ID, 'id_parking_and_access')), } @property