From d3b3d1c9d74eed57cc320cb51fe760d5a200a8f1 Mon Sep 17 00:00:00 2001 From: Arona Date: Thu, 28 May 2020 23:02:07 +0100 Subject: [PATCH] Move text definitions to somewhere more authoratitive --- RIGS/forms.py | 6 +-- RIGS/migrations/0041_auto_20200528_2143.py | 50 ---------------------- RIGS/migrations/0041_auto_20200528_2253.py | 50 ++++++++++++++++++++++ RIGS/models.py | 50 +++++++++++----------- RIGS/rigboard.py | 2 +- RIGS/templates/partials/yes_no_radio.html | 3 +- RIGS/templates/risk_assessment_detail.html | 29 +++++++++---- RIGS/templates/risk_assessment_form.html | 47 ++++++++++---------- RIGS/templatetags/filters.py | 5 +++ 9 files changed, 131 insertions(+), 111 deletions(-) delete mode 100644 RIGS/migrations/0041_auto_20200528_2143.py create mode 100644 RIGS/migrations/0041_auto_20200528_2253.py diff --git a/RIGS/forms.py b/RIGS/forms.py index 5c7c553a..a26f9c94 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -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 diff --git a/RIGS/migrations/0041_auto_20200528_2143.py b/RIGS/migrations/0041_auto_20200528_2143.py deleted file mode 100644 index c4c98831..00000000 --- a/RIGS/migrations/0041_auto_20200528_2143.py +++ /dev/null @@ -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')), - ], - ), - ] diff --git a/RIGS/migrations/0041_auto_20200528_2253.py b/RIGS/migrations/0041_auto_20200528_2253.py new file mode 100644 index 00000000..326aedfd --- /dev/null +++ b/RIGS/migrations/0041_auto_20200528_2253.py @@ -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?
i.e. Not covered by TECs standard health and safety documentation')), + ('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?
e.g. sufficient lighting, flat, not in a crowded area etc.')), + ('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')), + ], + ), + ] diff --git a/RIGS/models.py b/RIGS/models.py index c730ef1f..58b18a1c 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -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?
i.e. Not covered by TECs standard health and safety documentation") + 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?
e.g. sufficient lighting, flat, not in a crowded area etc.") + 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 diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index ed0839ef..2493a6e7 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -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): diff --git a/RIGS/templates/partials/yes_no_radio.html b/RIGS/templates/partials/yes_no_radio.html index a4dacf70..d0f415ed 100644 --- a/RIGS/templates/partials/yes_no_radio.html +++ b/RIGS/templates/partials/yes_no_radio.html @@ -1,5 +1,6 @@ +{% load help_text from filters %} + class="col-sm-8 control-label">{{ object|help_text:formitem.name|safe }}
{% for radio in formitem %}
diff --git a/RIGS/templates/risk_assessment_detail.html b/RIGS/templates/risk_assessment_detail.html index 2066591e..8b4d5c63 100644 --- a/RIGS/templates/risk_assessment_detail.html +++ b/RIGS/templates/risk_assessment_detail.html @@ -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 %}

Risk Assessment for Event N{{ object.event.pk|stringformat:"05d" }} {{ object.event.name }}

-
-
Meta Details
+
General
-
Created
+
{{ object|help_text:'nonstandard_equipment' }}
- {{ object.created }} + {{ object.nonstandard_equipment|yesno|title }}
-
By
+
{{ object|help_text:'nonstandard_use'|safe }}
- {{ object.completed_by.name }} + {{ object.nonstandard_use|yesno|title }}
-
Last Edited
+
{{ object|help_text:'contractors' }}
- {{ object.last_edited }} + {{ object.contractors|yesno|title }} +
+
{{ object|help_text:'other_companies' }}
+
+ {{ object.othercompanies|yesno|title }} +
+
{{ object|help_text:'crew_fatigue' }}
+
+ {{ object.crewfatigue|yesno|title }} +
+
{{ object|help_text:'general_notes' }}
+
+ {{ object.general_notes|linebreaks|default:'N/A' }}
diff --git a/RIGS/templates/risk_assessment_form.html b/RIGS/templates/risk_assessment_form.html index a9aadaee..b286e673 100644 --- a/RIGS/templates/risk_assessment_form.html +++ b/RIGS/templates/risk_assessment_form.html @@ -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 @@
General

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

- {% 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 %} - + {% render_field form.general_notes class+="form-control" %}
@@ -54,9 +55,9 @@
Power
- {% 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 %} + class="col-sm-8 control-label">{{ form.power_mic.help_text }}