Skip to content

Commit 89d7c51

Browse files
authored
Add fields to rig info for additional access requirements (#611)
* Add fields to rig info for additional access requirements * Add form field for additional access requirements * Display access requirements in rig info * Make access requirements field non-required Oops... * Add event access field to risk assessment * Allow for modification and display risk assessment venue access item * Correct tests for RAs with new parking fields * Add note to new venue access component of RA * Correct div boundaries for non-rig access requirements * Fill parking and access field in sample data generator * Set parking and access field to false in RA creation test * Hopefully the final correction of the RA test suite
1 parent 6b4a1ce commit 89d7c51

17 files changed

+119
-6
lines changed

RIGS/forms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class EventForm(forms.ModelForm):
2222
datetime_input_formats = list(settings.DATETIME_INPUT_FORMATS)
2323
meet_at = forms.DateTimeField(input_formats=datetime_input_formats, required=False)
2424
access_at = forms.DateTimeField(input_formats=datetime_input_formats, required=False)
25+
parking_and_access = forms.BooleanField(label="Additional parking or access requirements (i.e. campus parking permits, wristbands)?", required=False)
2526

2627
items_json = forms.CharField()
2728

@@ -125,7 +126,7 @@ class Meta:
125126
fields = ['is_rig', 'name', 'venue', 'start_time', 'end_date', 'start_date',
126127
'end_time', 'meet_at', 'access_at', 'description', 'notes', 'mic',
127128
'person', 'organisation', 'dry_hire', 'checked_in_by', 'status',
128-
'purchase_order', 'collector', 'forum_url']
129+
'purchase_order', 'collector', 'forum_url', 'parking_and_access']
129130

130131

131132
class BaseClientEventAuthorisationForm(forms.ModelForm):

RIGS/management/commands/generateSampleRIGSData.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ def setup_events(self):
276276
nonstandard_emergency_procedure=bool(random.getrandbits(1)),
277277
special_structures=bool(random.getrandbits(1)),
278278
suspended_structures=bool(random.getrandbits(1)),
279+
parking_and_access=bool(random.getrandbits(1)),
279280
outside=bool(random.getrandbits(1)))
280281
if i == 0 or random.randint(0, 1) > 0: # Event 1 and 1 in 10 have a Checklist
281282
models.EventChecklist.objects.create(event=new_event,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 3.2.25 on 2024-11-20 20:17
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('RIGS', '0051_alter_payment_method'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='event',
15+
name='parking_and_access',
16+
field=models.BooleanField(default=False),
17+
),
18+
]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 3.2.25 on 2024-11-20 21:18
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('RIGS', '0052_event_parking_and_access'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='riskassessment',
15+
name='parking_and_access',
16+
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)'),
17+
preserve_default=False,
18+
),
19+
]

RIGS/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ class Event(models.Model, RevisionMixin):
351351
access_at = models.DateTimeField(blank=True, null=True)
352352
meet_at = models.DateTimeField(blank=True, null=True)
353353

354+
# Venue requirements
355+
parking_and_access = models.BooleanField(default=False)
356+
354357
# Crew management
355358
checked_in_by = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='event_checked_in', blank=True, null=True,
356359
on_delete=models.CASCADE)
@@ -779,6 +782,9 @@ class RiskAssessment(ReviewableModel, RevisionMixin):
779782
persons_responsible_structures = models.TextField(blank=True, default='', help_text="Who are the persons on site responsible for their use?")
780783
rigging_plan = models.URLField(blank=True, default='', help_text="Upload your rigging plan to the <a href='https://nottinghamtec.sharepoint.com/'>Sharepoint</a> and submit a link", validators=[validate_url])
781784

785+
# Venue Access
786+
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)")
787+
782788
# Blimey that was a lot of options
783789

784790
supervisor_consulted = models.BooleanField(null=True)
@@ -803,6 +809,7 @@ class RiskAssessment(ReviewableModel, RevisionMixin):
803809
'nonstandard_emergency_procedure': False,
804810
'special_structures': False,
805811
'suspended_structures': False,
812+
'parking_and_access': False
806813
}
807814
inverted_fields = {key: value for (key, value) in expected_values.items() if not value}.keys()
808815

RIGS/templates/event_detail.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
{% endif %}
1616
{% if object.is_rig and perms.RIGS.view_event %}
1717
{# only need contact details for a rig #}
18-
<div class="col-md-6">
18+
<div class="col-md-6 mb-3">
1919
{% include 'partials/contact_details.html' %}
20+
{% if object.parking_and_access or object.riskassessment.parking_and_access %}
21+
{% include 'partials/parking_and_access.html' %}
22+
{% endif %}
2023
</div>
2124
{% endif %}
2225
<div class="col-md-6">

RIGS/templates/event_form.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,15 @@
281281
{{ form.dry_hire.label }} {% render_field form.dry_hire %}
282282
</div>
283283
</div>
284+
<div class="form-group">
285+
<div class="col-sm-offset-4 col-sm-8">
286+
<label data-toggle="tooltip" title="Do we need to secure campus parking permits, wristbands for backstage access or other non-standard requirements?">
287+
{{ form.parking_and_access.label }} {% render_field form.parking_and_access %}
288+
</label>
289+
</div>
284290
</div>
285291
</div>
292+
</div>
286293

287294
{# Status is needed on all events types and it looks good here in the form #}
288295
<div class="form-group" data-toggle="tooltip" title="The current status of the event. Only mark as booked once paperwork is received">

RIGS/templates/hs/ra_print.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@
124124
<td><para>{{ object|help_text:'persons_responsible_structures'|striptags }}</para></td>
125125
<td><para>{{ object.persons_responsible_structures|default:'N/A' }}</para></td>
126126
</tr>
127+
<tr>
128+
<td colspan="2"><h3><strong>Venue Access</strong></h3></td>
129+
</tr>
130+
<tr>
131+
<td><para>{{ object|help_text:'parking_and_access'|striptags }}</para></td>
132+
<td><para>{{ object.parking_and_access|yesno|capfirst }}</para></td>
133+
</tr>
127134
</blockTable>
128135
<spacer length="15"/>\
129136
<hr/>

RIGS/templates/hs/risk_assessment_detail.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,19 @@
151151
</dl>
152152
</div>
153153
</div>
154+
<div class="card card-default mb-3">
155+
<div class="card-header">Venue Access</div>
156+
<div class="card-body">
157+
<dl class="row">
158+
<dt class="col-10">{{ object|help_text:'parking_and_access' }}</dt>
159+
<dd class="col-2">
160+
{{ object.parking_and_access|yesnoi:'invert' }}
161+
</dd>
162+
</dl>
163+
</div>
164+
</div>
165+
</div>
154166
</div>
155-
</div>
156167
</div>
157168
<div class="col-12 text-right">
158169
{% button 'print' 'ra_print' object.pk %}

RIGS/templates/hs/risk_assessment_form.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@
162162
</div>
163163
</div>
164164
</div>
165+
<div class="row my-3">
166+
<div class="col-12">
167+
<div class="card">
168+
<div class="card-header">Venue Access</div>
169+
<div class="card-body">
170+
<p><strong>If yes to the below, ensure you have communicated with the client and secured all necessary access prior to the event commencing.</strong></p>
171+
{% include 'partials/yes_no_radio.html' with formitem=form.parking_and_access %}
172+
</div>
173+
</div>
174+
</div>
175+
</div>
165176
<div class="row mt-3">
166177
<div class="col-sm-12 text-right">
167178
<div class="btn-group">

0 commit comments

Comments
 (0)