Move text definitions to somewhere more authoratitive

This commit is contained in:
2020-05-28 23:02:07 +01:00
parent 4cfd83eeb3
commit d3b3d1c9d7
9 changed files with 131 additions and 111 deletions

View File

@@ -161,9 +161,9 @@ class EventRiskAssessmentForm(forms.ModelForm):
for name, field in self.fields.items():
if field.__class__ == forms.BooleanField:
field.widget = forms.RadioSelect(choices=[
(True, 'Yes'),
(False, 'No')
], attrs={'class': 'custom-control-input'})
(True, 'Yes'),
(False, 'No')
], attrs={'class': 'custom-control-input'})
class Meta:
model = models.RiskAssessment

View File

@@ -1,50 +0,0 @@
# Generated by Django 3.0.3 on 2020-05-28 20:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('RIGS', '0040_delete_rigsversion'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='risk_assessment_edit_url',
),
migrations.CreateModel(
name='RiskAssessment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nonstandard_equipment', models.BooleanField(default=False)),
('nonstandard_use', models.BooleanField(default=False)),
('contractors', models.BooleanField(default=False)),
('other_companies', models.BooleanField(default=False)),
('crew_fatigue', models.BooleanField(default=False)),
('general_notes', models.TextField(blank=True, null=True)),
('big_power', models.BooleanField(default=False)),
('generators', models.BooleanField(default=False)),
('other_companies_power', models.BooleanField(default=False)),
('nonstandard_equipment_power', models.BooleanField(default=False)),
('multiple_electrical_environments', models.BooleanField(default=False)),
('power_notes', models.TextField(blank=True, null=True)),
('noise_monitoring', models.BooleanField(default=False)),
('sound_notes', models.TextField(blank=True, null=True)),
('known_venue', models.BooleanField(default=False)),
('safe_loading', models.BooleanField(default=False)),
('safe_storage', models.BooleanField(default=False)),
('area_outside_of_control', models.BooleanField(default=False)),
('barrier_required', models.BooleanField(default=False)),
('nonstandard_emergency_procedure', models.BooleanField(default=False)),
('special_structures', models.BooleanField(default=False)),
('persons_responsible_structures', models.TextField(blank=True, null=True)),
('suspended_structures', models.BooleanField(default=False)),
('event', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='RIGS.Event')),
('power_mic', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='power_mic', to=settings.AUTH_USER_MODEL, verbose_name='Power MIC')),
],
),
]

View File

@@ -0,0 +1,50 @@
# Generated by Django 3.0.3 on 2020-05-28 21:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('RIGS', '0040_delete_rigsversion'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='risk_assessment_edit_url',
),
migrations.CreateModel(
name='RiskAssessment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nonstandard_equipment', models.BooleanField(default=False, help_text="Does the event require any hired in equipment or use of equipment that is not covered by TEC's standard risk assessments and method statements?")),
('nonstandard_use', models.BooleanField(default=False, help_text='Are TEC using their equipment in a way that is abnormal?<br><small>i.e. Not covered by TECs standard health and safety documentation</small>')),
('contractors', models.BooleanField(default=False, help_text='Are you using any external contractors?')),
('other_companies', models.BooleanField(default=False, help_text='Are TEC working with any other companies on site?')),
('crew_fatigue', models.BooleanField(default=False, help_text='Is crew fatigue likely to be a risk at any point during this event?')),
('general_notes', models.TextField(blank=True, help_text='Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?', null=True)),
('big_power', models.BooleanField(default=False, help_text='Does the event require larger power supplies than 13A or 16A single phase wall sockets, or draw more than 20A total current?')),
('generators', models.BooleanField(default=False, help_text='Will generators be used?')),
('other_companies_power', models.BooleanField(default=False, help_text='Will TEC be supplying power to any other companies?')),
('nonstandard_equipment_power', models.BooleanField(default=False, help_text='Does the power plan require the use of any power equipment (distros, dimmers, motor controllers, etc.) that does not belong to TEC?')),
('multiple_electrical_environments', models.BooleanField(default=False, help_text='Will the electrical installation occupy more than one electrical environment?')),
('power_notes', models.TextField(blank=True, help_text='Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?', null=True)),
('noise_monitoring', models.BooleanField(default=False, help_text='Does the event require noise monitoring or any non-standard procedures in order to comply with health and safety legislation or site rules?')),
('sound_notes', models.TextField(blank=True, help_text='Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?', null=True)),
('known_venue', models.BooleanField(default=False, help_text='Is the event in a venue that you and/or TEC have experience working in?')),
('safe_loading', models.BooleanField(default=False, help_text='Is there a safe load in/out?<br><small>e.g. sufficient lighting, flat, not in a crowded area etc.</small>')),
('safe_storage', models.BooleanField(default=False, help_text='Are there areas to safely store equipment?')),
('area_outside_of_control', models.BooleanField(default=False, help_text="Is any part of the work area out of TEC's direct control or openly accessible during the build or breakdown period?")),
('barrier_required', models.BooleanField(default=False, help_text='Is there a requirement for TEC to provide any barrier for security or protection of persons/equipment?')),
('nonstandard_emergency_procedure', models.BooleanField(default=False, help_text="Does the emergency procedure for the event differ from TEC's standard procedures?")),
('special_structures', models.BooleanField(default=False, help_text='Does the event require use of winch stands, motors, MPT Towers, or staging?')),
('persons_responsible_structures', models.TextField(blank=True, help_text='Who are the persons on site responsible for their use?', null=True)),
('suspended_structures', models.BooleanField(default=False, help_text="Are any structures (excluding projector screens and IWBs) being suspended from TEC's structures?")),
('event', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='RIGS.Event')),
('power_mic', models.ForeignKey(blank=True, help_text='Who is the Power MIC?', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='power_mic', to=settings.AUTH_USER_MODEL, verbose_name='Power MIC')),
],
),
]

View File

@@ -325,7 +325,7 @@ class Event(models.Model, RevisionMixin):
auth_request_by = models.ForeignKey('Profile', null=True, blank=True, on_delete=models.CASCADE)
auth_request_at = models.DateTimeField(null=True, blank=True)
auth_request_to = models.EmailField(null=True, blank=True)
# Calculated values
"""
EX Vat
@@ -573,38 +573,38 @@ class Payment(models.Model):
class RiskAssessment(models.Model):
event = models.OneToOneField('Event', on_delete=models.CASCADE)
# General
nonstandard_equipment = models.BooleanField(default=False)
nonstandard_use = models.BooleanField(default=False)
contractors = models.BooleanField(default=False)
other_companies = models.BooleanField(default=False)
crew_fatigue = models.BooleanField(default=False)
general_notes = models.TextField(blank=True, null=True)
nonstandard_equipment = models.BooleanField(default=False, help_text="Does the event require any hired in equipment or use of equipment that is not covered by TEC's standard risk assessments and method statements?")
nonstandard_use = models.BooleanField(default=False, help_text="Are TEC using their equipment in a way that is abnormal?<br><small>i.e. Not covered by TECs standard health and safety documentation</small>")
contractors = models.BooleanField(default=False, help_text="Are you using any external contractors?")
other_companies = models.BooleanField(default=False, help_text="Are TEC working with any other companies on site?")
crew_fatigue = models.BooleanField(default=False, help_text="Is crew fatigue likely to be a risk at any point during this event?")
general_notes = models.TextField(blank=True, null=True, help_text="Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?")
# Power
big_power = models.BooleanField(default=False)
big_power = models.BooleanField(default=False, help_text="Does the event require larger power supplies than 13A or 16A single phase wall sockets, or draw more than 20A total current?")
power_mic = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='power_mic', blank=True, null=True,
verbose_name="Power MIC", on_delete=models.CASCADE)
generators = models.BooleanField(default=False)
other_companies_power = models.BooleanField(default=False)
nonstandard_equipment_power = models.BooleanField(default=False)
multiple_electrical_environments = models.BooleanField(default=False)
power_notes = models.TextField(blank=True, null=True)
verbose_name="Power MIC", on_delete=models.CASCADE, help_text="Who is the Power MIC?")
generators = models.BooleanField(default=False, help_text="Will generators be used?")
other_companies_power = models.BooleanField(default=False, help_text="Will TEC be supplying power to any other companies?")
nonstandard_equipment_power = models.BooleanField(default=False, help_text="Does the power plan require the use of any power equipment (distros, dimmers, motor controllers, etc.) that does not belong to TEC?")
multiple_electrical_environments = models.BooleanField(default=False, help_text="Will the electrical installation occupy more than one electrical environment?")
power_notes = models.TextField(blank=True, null=True, help_text="Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?")
# Sound
noise_monitoring = models.BooleanField(default=False)
sound_notes = models.TextField(blank=True, null=True)
noise_monitoring = models.BooleanField(default=False, help_text="Does the event require noise monitoring or any non-standard procedures in order to comply with health and safety legislation or site rules?")
sound_notes = models.TextField(blank=True, null=True, help_text="Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?")
# Site
known_venue = models.BooleanField(default=False)
safe_loading = models.BooleanField(default=False)
safe_storage = models.BooleanField(default=False)
area_outside_of_control = models.BooleanField(default=False)
barrier_required = models.BooleanField(default=False)
nonstandard_emergency_procedure = models.BooleanField(default=False)
known_venue = models.BooleanField(default=False, help_text="Is the event in a venue that you and/or TEC have experience working in?")
safe_loading = models.BooleanField(default=False, help_text="Is there a safe load in/out?<br><small>e.g. sufficient lighting, flat, not in a crowded area etc.</small>")
safe_storage = models.BooleanField(default=False, help_text="Are there areas to safely store equipment?")
area_outside_of_control = models.BooleanField(default=False, help_text="Is any part of the work area out of TEC's direct control or openly accessible during the build or breakdown period?")
barrier_required = models.BooleanField(default=False, help_text="Is there a requirement for TEC to provide any barrier for security or protection of persons/equipment?")
nonstandard_emergency_procedure = models.BooleanField(default=False, help_text="Does the emergency procedure for the event differ from TEC's standard procedures?")
# Structures
special_structures = models.BooleanField(default=False)
persons_responsible_structures = models.TextField(blank=True, null=True)
suspended_structures = models.BooleanField(default=False)
special_structures = models.BooleanField(default=False, help_text="Does the event require use of winch stands, motors, MPT Towers, or staging?")
persons_responsible_structures = models.TextField(blank=True, null=True, help_text="Who are the persons on site responsible for their use?")
suspended_structures = models.BooleanField(default=False, help_text="Are any structures (excluding projector screens and IWBs) being suspended from TEC's structures?")
# Blimey that was a lot of options

View File

@@ -101,7 +101,7 @@ class EventRAEdit(generic.UpdateView):
form_class = forms.EventRiskAssessmentForm
def get_success_url(self):
return reverse_lazy('event_ra', kwargs={'pk': self.object.event.pk })
return reverse_lazy('event_ra', kwargs={'pk': self.object.event.pk})
class EventCreate(generic.CreateView):

View File

@@ -1,5 +1,6 @@
{% load help_text from filters %}
<label for="{{ formitem.id_for_label }}"
class="col-sm-8 control-label">{{label}}{% if note %}<br><small>{{note}}</small>{%endif%}</label>
class="col-sm-8 control-label">{{ object|help_text:formitem.name|safe }}</label>
<div class="col-4 pb-3">
{% for radio in formitem %}
<div class="custom-control custom-radio">

View File

@@ -1,27 +1,40 @@
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
{% block title %}Risk Assessment for Event N{{ object.event.pk|stringformat:"05d" }} {{ object.event.name }}{% endblock %}
{% load help_text from filters %}
{% block content %}
<div class="row my-3 py-3">
<div class="col-sm-12">
<h3>Risk Assessment for Event N{{ object.event.pk|stringformat:"05d" }} {{ object.event.name }}</h3>
<a href="{% url 'event_ra_edit' object.pk %}" class="btn btn-warning"><span class="fas fa-edit"></span> <span
<a href="{% url 'event_ra_edit' object.pk %}" class="btn btn-warning my-3"><span class="fas fa-edit"></span> <span
class="hidden-xs">Edit</span></a>
<div class="card card-default mb-3">
<div class="card-header">Meta Details</div>
<div class="card-header">General</div>
<div class="card-body">
<dl class="row">
<dt class="col-sm-6">Created</dt>
<dt class="col-sm-6">{{ object|help_text:'nonstandard_equipment' }}</dt>
<dd class="col-sm-6">
{{ object.created }}
{{ object.nonstandard_equipment|yesno|title }}
</dd>
<dt class="col-sm-6">By</dt>
<dt class="col-sm-6">{{ object|help_text:'nonstandard_use'|safe }}</dt>
<dd class="col-sm-6">
{{ object.completed_by.name }}
{{ object.nonstandard_use|yesno|title }}
</dd>
<dt class="col-sm-6">Last Edited</dt>
<dt class="col-sm-6">{{ object|help_text:'contractors' }}</dt>
<dd class="col-sm-6">
{{ object.last_edited }}
{{ object.contractors|yesno|title }}
</dd>
<dt class="col-sm-6">{{ object|help_text:'other_companies' }}</dt>
<dd class="col-sm-6">
{{ object.othercompanies|yesno|title }}
</dd>
<dt class="col-sm-6">{{ object|help_text:'crew_fatigue' }}</dt>
<dd class="col-sm-6">
{{ object.crewfatigue|yesno|title }}
</dd>
<dt class="col-sm-6">{{ object|help_text:'general_notes' }}</dt>
<dd class="col-sm-6">
{{ object.general_notes|linebreaks|default:'N/A' }}
</dd>
</dl>
</div>

View File

@@ -1,6 +1,7 @@
{% extends request.is_ajax|yesno:'base_ajax.html,base_rigs.html' %}
{% load widget_tweaks %}
{% load static %}
{% load help_text from filters %}
{% block title %}{% if object.pk %}Edit{% else %}Create{% endif %} Risk Assessment for Event N{{ event.pk|stringformat:"05d" }}{% endblock %}
@@ -37,13 +38,13 @@
<div class="card-header">General</div>
<div class="card-body">
<p><strong>If the answer is yes to any of the below, you must consult a supervisor and make sure all activities planned to be undertaken are sufficiently covered by health and safety documentation</strong></p>
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_equipment label="Does the event require any hired in equipment or use of equipment that is not covered by TEC's standard risk assessments and method statements?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_use label="Are TEC using their equipment in a way that is abnormal?" note="i.e. Not covered by TECs standard health and safety documentation" %}
{% include 'partials/yes_no_radio.html' with formitem=form.contractors label="Are you using any external contractors?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.other_companies label="Are TEC working with any other companies on site?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.crew_fatigue label="Is crew fatigue likely to be a risk at any point during this event?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_equipment %}
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_use %}
{% include 'partials/yes_no_radio.html' with formitem=form.contractors %}
{% include 'partials/yes_no_radio.html' with formitem=form.other_companies %}
{% include 'partials/yes_no_radio.html' with formitem=form.crew_fatigue %}
<label for="{{ form.general_notes.id_for_label }}">Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?</label>
<label for="{{ form.general_notes.id_for_label }}">{{ form.general_notes.help_text }}</label>
{% render_field form.general_notes class+="form-control" %}
</div>
</div>
@@ -54,9 +55,9 @@
<div class="card">
<div class="card-header">Power</div>
<div class="card-body">
{% include 'partials/yes_no_radio.html' with formitem=form.big_power label="Does the event require larger power supplies than 13A or 16A single phase wall sockets, or draw more than 20A total current?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.big_power %}
<label for="{{ form.power_mic.id_for_label }}"
class="col-sm-8 control-label">Who is the Power MIC?</label>
class="col-sm-8 control-label">{{ form.power_mic.help_text }}</label>
<div class="col-sm-8">
<select id="{{ form.power_mic.id_for_label }}" name="{{ form.power_mic.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials">
{% if power_mic %}
@@ -66,10 +67,10 @@
</div>
<p class="pt-4"><strong>If the answer is yes to any of the below questions you must consult a power supervisor</strong></p>
{% include 'partials/yes_no_radio.html' with formitem=form.generators label="Will generators be used?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.other_companies_power label="Will TEC be supplying power to any other companies?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_equipment_power label="Does the power plan require the use of any power equipment (distros, dimmers, motor controllers, etc.) that does not belong to TEC?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.multiple_electrical_environments label="Will the electrical installation occupy more than one electrical environment?" %}
<label for="{{ form.power_notes.id_for_label }}">Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?</label>
{% include 'partials/yes_no_radio.html' with formitem=form.other_companies_power %}
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_equipment_power %}
{% include 'partials/yes_no_radio.html' with formitem=form.multiple_electrical_environments %}
<label for="{{ form.power_notes.id_for_label }}">{{ form.power_notes.help_text }}</label>
{% render_field form.power_notes class+="form-control" %}
</div>
</div>
@@ -81,8 +82,8 @@
<div class="card-header">Sound</div>
<div class="card-body">
<p><strong>If yes, consult a supervisor of sound and make sure an appropriate noise monitoring plan and risk assessment is drawn up</strong></p>
{% include 'partials/yes_no_radio.html' with formitem=form.noise_monitoring label="Does the event require noise monitoring or any non-standard procedures in order to comply with health and safety legislation or site rules?" %}
<label for="{{ form.sound_notes.id_for_label }}">Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?</label>
{% include 'partials/yes_no_radio.html' with formitem=form.noise_monitoring %}
<label for="{{ form.sound_notes.id_for_label }}">{{ form.sound_notes.help_text }}</label>
{% render_field form.sound_notes class+="form-control" %}
</div>
</div>
@@ -94,12 +95,12 @@
<div class="card-header">Site Details</div>
<div class="card-body">
<p><strong>If no to any of the below, a site visit normally should be conducted and an assessment of the venue completed and added to TEC's records</strong></p>
{% include 'partials/yes_no_radio.html' with formitem=form.known_venue label="Is the event in a venue that you and/or TEC have experience working in?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.safe_loading label="Is there a safe load in/out?" note="e.g. sufficient lighting, flat, not in a crowded area etc." %}
{% include 'partials/yes_no_radio.html' with formitem=form.safe_storage label="Are there areas to safely store equipment?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.area_outside_of_control label="Is any part of the work area out of TEC's direct control or openly accessible during the build or breakdown period?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.barrier_required label="Is there a requirement for TEC to provide any barrier for security or protection of persons/equipment?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_emergency_procedure label="Does the emergency procedure for the event differ from TEC's standard procedures?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.known_venue %}
{% include 'partials/yes_no_radio.html' with formitem=form.safe_loading %}
{% include 'partials/yes_no_radio.html' with formitem=form.safe_storage %}
{% include 'partials/yes_no_radio.html' with formitem=form.area_outside_of_control %}
{% include 'partials/yes_no_radio.html' with formitem=form.barrier_required %}
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_emergency_procedure %}
</div>
</div>
</div>
@@ -109,10 +110,10 @@
<div class="card">
<div class="card-header">Structures</div>
<div class="card-body">
{% include 'partials/yes_no_radio.html' with formitem=form.special_structures label="Does the event require use of winch stands, motors, MPT Towers, or staging?" %}
<label for="{{ form.persons_responsible_structures.id_for_label }}" class="mt-3">Who are the persons on site responsible for their use?</label>
{% include 'partials/yes_no_radio.html' with formitem=form.special_structures %}
<label for="{{ form.persons_responsible_structures.id_for_label }}" class="mt-3">{{ form.persons_responsible_structures.help_text }}</label>
{% render_field form.persons_responsible_structures class+="form-control mb-3" %}
{% include 'partials/yes_no_radio.html' with formitem=form.suspended_structures label="Are any structures (excluding projector screens and IWBs) being suspended from TEC's structures?" %}
{% include 'partials/yes_no_radio.html' with formitem=form.suspended_structures %}
</div>
</div>
</div>

View File

@@ -111,3 +111,8 @@ def orderby(request, field, attr):
dict_[field] = attr
return dict_.urlencode()
@register.filter
def help_text(obj, field):
return obj._meta.get_field(field).help_text