diff --git a/RIGS/forms.py b/RIGS/forms.py index b4de22f4..e2e62fca 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)?", required=False) 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/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, 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/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 415bcd5d..ad4267e1 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) @@ -779,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) @@ -803,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/templates/event_detail.html b/RIGS/templates/event_detail.html index a1de143d..96296546 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 or object.riskassessment.parking_and_access %} + {% include 'partials/parking_and_access.html' %} + {% endif %}
{% endif %}
diff --git a/RIGS/templates/event_form.html b/RIGS/templates/event_form.html index c19a88b0..69d28455 100644 --- a/RIGS/templates/event_form.html +++ b/RIGS/templates/event_form.html @@ -281,8 +281,15 @@ {{ form.dry_hire.label }} {% render_field form.dry_hire %}
+
+
+ +
+ {# Status is needed on all events types and it looks good here in the form #}
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..3a3e9f1b 100644 --- a/RIGS/templates/hs/risk_assessment_form.html +++ b/RIGS/templates/hs/risk_assessment_form.html @@ -162,6 +162,17 @@
+
+
+
+
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 %} +
+
+
+
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..6f017628 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 or object.riskassessment.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..f72155ac --- /dev/null +++ b/RIGS/templates/partials/parking_and_access.html @@ -0,0 +1,22 @@ +
+
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
  • +
+ + {% 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 %} +
+
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/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 diff --git a/RIGS/tests/test_interaction.py b/RIGS/tests/test_interaction.py index b035098e..f519ee89 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 = False # self.page.persons_responsible_structures = "Nobody and her cat, She" page.suspended_structures = True