Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion RIGS/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions RIGS/management/commands/generateSampleRIGSData.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 18 additions & 0 deletions RIGS/migrations/0052_event_parking_and_access.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
19 changes: 19 additions & 0 deletions RIGS/migrations/0053_riskassessment_parking_and_access.py
Original file line number Diff line number Diff line change
@@ -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,
),
]
7 changes: 7 additions & 0 deletions RIGS/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 <a href='https://nottinghamtec.sharepoint.com/'>Sharepoint</a> 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)
Expand All @@ -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()

Expand Down
5 changes: 4 additions & 1 deletion RIGS/templates/event_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
{% endif %}
{% if object.is_rig and perms.RIGS.view_event %}
{# only need contact details for a rig #}
<div class="col-md-6">
<div class="col-md-6 mb-3">
{% include 'partials/contact_details.html' %}
{% if object.parking_and_access or object.riskassessment.parking_and_access %}
{% include 'partials/parking_and_access.html' %}
{% endif %}
</div>
{% endif %}
<div class="col-md-6">
Expand Down
7 changes: 7 additions & 0 deletions RIGS/templates/event_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,15 @@
{{ form.dry_hire.label }} {% render_field form.dry_hire %}
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<label data-toggle="tooltip" title="Do we need to secure campus parking permits, wristbands for backstage access or other non-standard requirements?">
{{ form.parking_and_access.label }} {% render_field form.parking_and_access %}
</label>
</div>
</div>
</div>
</div>

{# Status is needed on all events types and it looks good here in the form #}
<div class="form-group" data-toggle="tooltip" title="The current status of the event. Only mark as booked once paperwork is received">
Expand Down
7 changes: 7 additions & 0 deletions RIGS/templates/hs/ra_print.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@
<td><para>{{ object|help_text:'persons_responsible_structures'|striptags }}</para></td>
<td><para>{{ object.persons_responsible_structures|default:'N/A' }}</para></td>
</tr>
<tr>
<td colspan="2"><h3><strong>Venue Access</strong></h3></td>
</tr>
<tr>
<td><para>{{ object|help_text:'parking_and_access'|striptags }}</para></td>
<td><para>{{ object.parking_and_access|yesno|capfirst }}</para></td>
</tr>
</blockTable>
<spacer length="15"/>\
<hr/>
Expand Down
13 changes: 12 additions & 1 deletion RIGS/templates/hs/risk_assessment_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,19 @@
</dl>
</div>
</div>
<div class="card card-default mb-3">
<div class="card-header">Venue Access</div>
<div class="card-body">
<dl class="row">
<dt class="col-10">{{ object|help_text:'parking_and_access' }}</dt>
<dd class="col-2">
{{ object.parking_and_access|yesnoi:'invert' }}
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 text-right">
{% button 'print' 'ra_print' object.pk %}
Expand Down
11 changes: 11 additions & 0 deletions RIGS/templates/hs/risk_assessment_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@
</div>
</div>
</div>
<div class="row my-3">
<div class="col-12">
<div class="card">
<div class="card-header">Venue Access</div>
<div class="card-body">
<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>
{% include 'partials/yes_no_radio.html' with formitem=form.parking_and_access %}
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-sm-12 text-right">
<div class="btn-group">
Expand Down
4 changes: 2 additions & 2 deletions RIGS/templates/partials/contact_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>
{% endif %}
{% if object.organisation %}
<div class="card card-default">
<div class="card card-default mb-3">
<div class="card-header">Organisation Details</div>
<div class="card-body">
<dl class="row">
Expand All @@ -44,4 +44,4 @@
</dl>
</div>
</div>
{% endif %}
{% endif %}
1 change: 1 addition & 0 deletions RIGS/templates/partials/event_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{{ object.venue|namewithnotes:'venue_detail' }}
</a>
{% endif %}
{% if object.parking_and_access or object.riskassessment.parking_and_access %}<span class="badge badge-warning">Additional Access Requirements</span>{% endif %}
</dd>
{% if object.venue %}
<dt class="col-sm-6">Venue Notes</dt>
Expand Down
3 changes: 3 additions & 0 deletions RIGS/templates/partials/event_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@
<span class="badge badge-info">Invoice: Not Generated</span>
{% endif %}
{% endif %}
{% if event.parking_and_access %}
<span class="badge badge-warning">Addititional Access Requirements</span>
{% endif %}
{% endif %}
</div>
22 changes: 22 additions & 0 deletions RIGS/templates/partials/parking_and_access.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="card card-default">
<div class="card-header">Parking and Access</div>
<div class="card-body">
<p>This venue has additional parking and/or access requirements.</p>

<p>Ensure the MIC has:</p>
<ul>
<li>Details of where to park</li>
<li>Details of how to access the venue</li>
<li>Details of any access restrictions</li>
<li>If on campus, sorted parking permits</li>
</ul>

{% if object.parking_and_access and object.riskassessment.parking_and_access %}
<small>Additional parking marked on both rig details and risk assessment.</small>
{% elif object.parking_and_access %}
<small>Additional parking marked on rig details.</small>
{% elif object.riskassessment.parking_and_access %}
<small>Additional parking marked on risk assessment.</small>
{% endif %}
</div>
</div>
2 changes: 1 addition & 1 deletion RIGS/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions RIGS/tests/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions RIGS/tests/test_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down