Medium event power stuff done, barring worst case stuff

This commit is contained in:
2020-08-29 23:56:08 +01:00
parent dbe0d35400
commit 9198724748
7 changed files with 317 additions and 61 deletions

View File

@@ -5,7 +5,7 @@
{% block content %}
<div class="row my-3 py-3">
<div class="col-sm-12">
<div class="col-12">
<h3>Event Checklist for Event N{{ object.event.pk|stringformat:"05d" }} {{ object.event.name }}</h3>
<div class="row">
<div class="col-12 text-right">
@@ -13,74 +13,109 @@
class="hidden-xs">Edit</span></a>
</div>
</div>
<div class="card card-default mb-3">
<div class="card-header">General</div>
<div class="card-body">
<dl class="row">
<dt class="col-10">{{ object|help_text:'power_mic' }}</dt>
<dd class="col-2">
{{ object.power_mic.name }}
</dd>
</dl>
<p>List vehicles and their drivers</p>
<ul>
{% for i in object.vehicles.all %}
<li>{{i}}</li>
{% endfor %}
</ul>
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="card card-default mb-3">
<div class="card-header">General</div>
<div class="card-body">
<dl class="row">
<dt class="col-6">{{ object|help_text:'power_mic' }}</dt>
<dd class="col-6">
{{ object.power_mic.name }}
</dd>
</dl>
<p>List vehicles and their drivers</p>
<ul>
{% for i in object.vehicles.all %}
<li>{{i}}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<div class="card card-default mb-3">
<div class="card-header">Safety Checks</div>
<div class="card-body">
<dl class="row">
<dt class="col-10">{{ object|help_text:'safe_parking'|safe }}</dt>
<dd class="col-2">
{{ object.safe_parking|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'safe_packing'|safe }}</dt>
<dd class="col-2">
{{ object.safe_packing|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'exits'|safe }}</dt>
<dd class="col-2">
{{ object.exits|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'trip_hazard'|safe }}</dt>
<dd class="col-2">
{{ object.trip_hazard|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'warning_signs'|safe }}</dt>
<dd class="col-2">
{{ object.warning_signs|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'ear_plugs'|safe }}</dt>
<dd class="col-2">
{{ object.ear_plugs|yesno|title }}
</dd>
</dl>
</div>
<div class="col-md-6 col-sm-12">
<div class="card card-default mb-3">
<div class="card-header">Safety Checks</div>
<div class="card-body">
<dl class="row">
<dt class="col-10">{{ object|help_text:'safe_parking'|safe }}</dt>
<dd class="col-2">
{{ object.safe_parking|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'safe_packing'|safe }}</dt>
<dd class="col-2">
{{ object.safe_packing|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'exits'|safe }}</dt>
<dd class="col-2">
{{ object.exits|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'trip_hazard'|safe }}</dt>
<dd class="col-2">
{{ object.trip_hazard|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'warning_signs'|safe }}</dt>
<dd class="col-2">
{{ object.warning_signs|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'ear_plugs'|safe }}</dt>
<dd class="col-2">
{{ object.ear_plugs|yesno|title }}
</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="card card-default mb-3">
<div class="card-header">Crew Record</div>
<div class="card-body">
<ul>
{% for i in object.crew.all %}
<li>{{i}}</li>
<table class="table">
<thead>
<tr>
<th scope="col">Crewmember</th>
<th scope="col">Start Time</th>
<th scope="col">Role</th>
<th scope="col">End Time</th>
</tr>
</thead>
<tbody id="crewmemberst">
{% for crew in object.crew.all %}
<tr>
<td>{{crew.crewmember}}</td>
<td>{{crew.start}}</td>
<td>{{crew.role}}</td>
<td>{{crew.end}}</td>
</tr>
{% endfor %}
</ul>
</div>
</tbody>
</table>
</div>
<div class="card card-default mb-3">
<div class="card-header">Power</div>
<div class="card-body">
{% if object.medium_event %}
<span class="badge badge-success">Small Event</span>
<span class="badge badge-warning p-2 my-3">Medium Event</span>
{% else %}
<span class="badge badge-warning">Medium Event</span>
{% endif %}
<span class="badge badge-success p-2 my-3">Small Event</span>
<dl class="row">
<dt class="col-10">{{ object|help_text:'rcds'|safe }}</dt>
<dd class="col-2">
{{ object.rcds|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'supply_test'|safe }}</dt>
<dd class="col-2">
{{ object.supply_test|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'earthing'|safe }}</dt>
<dd class="col-2">
{{ object.earthing|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'pat'|safe }}</dt>
<dd class="col-2">
{{ object.pat|yesno|title }}
</dd>
</dl>
{% endif %}
</div>
</div>
</div>

View File

@@ -77,7 +77,12 @@
});
$('button[data-action=delete]').on('click', function(event) {
event.preventDefault();
$($(this).attr('data-target') + '_' + $(this).attr('data-id')).remove();
$(this).closest('tr').remove();
});
//Somewhat rudimentary way of ensuring people fill in completely (if it hits the database validation the whole table row disappears when the page reloads...)
//the not is to avoid adding it to some of bootstrap-selects extra crap
$('#vehiclest,#crewmemberst').find("select,input[type!='search']").change(function () {
$(this).closest('tr').find('input,select').attr('required', 'true');
});
});
</script>
@@ -255,6 +260,52 @@
<div class="card">
<div class="card-header">Electrical Checks <small>for Medium TEC Events </small></div>
<div class="card-body">
{% include 'partials/checklist_checkbox.html' with formitem=form.source_rcd %}
{% include 'partials/checklist_checkbox.html' with formitem=form.clear_labelling %}
{% include 'partials/checklist_checkbox.html' with formitem=form.earthing %}
{% include 'partials/checklist_checkbox.html' with formitem=form.pat %}
<hr>
<p>Tests at first distro</p>
<table class="table">
<thead>
<tr>
<th scope="col">Test</th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" rowspan="2">Voltage<br><small>(cube meter)</small></th>
<th>{{object|help_text:'fd_voltage_l1'}}</th>
<th>{{object|help_text:'fd_voltage_l2'}}</th>
<th>{{object|help_text:'fd_voltage_l3'}}</th>
</tr>
<tr>
<td>{% render_field form.fd_voltage_l1 class+="form-control" %}</td>
<td>{% render_field form.fd_voltage_l2 class+="form-control" %}</td>
<td>{% render_field form.fd_voltage_l1 class+="form-control" %}</td>
</tr>
<tr>
<th scope="row">{{object|help_text:'fd_phase_rotation'|safe}}</th>
<td colspan="3">{% render_field form.fd_phase_rotation %}</td>
</tr>
<tr>
<th scope="row">{{object|help_text:'fd_earth_fault'|safe}}</th>
<td colspan="3">{% render_field form.fd_earth_fault class+="form-control" %}</td>
</tr>
<tr>
<th scope="row">{{object|help_text:'fd_pssc'|safe}}</th>
<td colspan="3">{% render_field form.fd_pssc class+="form-control" %}</td>
</tr>
</tbody>
</table>
<hr>
{% include 'partials/checklist_checkbox.html' with formitem=form.all_rcds_tested %}
{% include 'partials/checklist_checkbox.html' with formitem=form.public_sockets_tested %}
{% include 'partials/ec_power_info.html' %}
</div>
</div>
</div>

View File

@@ -0,0 +1,51 @@
<h3 class="py-3">Threshhold Values</h3>
<div class="row">
<div class="col-md-6 col-sm-12">
<table class="table">
<thead>
<tr>
<th scope="row">RCD Value (mA)</th>
<th scope="row">Max Z<small>S</small> (Ohms)</th>
</tr>
</thead>
<tbody>
<tr>
<td>30</td>
<td>1667</td>
</tr>
<tr>
<td>100</td>
<td>500</td>
</tr>
<tr>
<td>300</td>
<td>167</td>
<tr>
<td>500</td>
<td>100</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6 col-sm-12">
<table class="table">
<thead>
<tr>
<th scope="row">Distro</th>
<th scope="row">Max PSSC (kA)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Intel & Toblerone distros</td>
<td>6</td>
</tr>
<tr>
<td>All other distros</td>
<td>10</td>
</tr>
</tbody>
</table>
<p><strong>Voltage Drop on Circuit:</strong> 5% (approx. 12v)</p>
</div>
</div>

View File

@@ -77,7 +77,6 @@
<div class="form-group" data-toggle="tooltip" title="The date/time at which TEC have access to the venue">
<label for="{{ form.access_at.id_for_label }}"
class="col-sm-4 control-label">{{ form.access_at.label }}</label>
<div class="col-sm-8">
{% render_field form.access_at class+="form-control" step="60" %}
</div>