mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-11 00:59:41 +00:00
Refactor buildsystem to NPM/Gulp, port to BS4 & rewrite RIGS tests accordingly... (#412)
* Start to seperate versioning into its own app * Start reworking invoice things * Reduced overall font size a touch * Improvements to generic lists * Tweak some colours to be a bit less OTT I need to work out if I can seperate background and primary colours like BS3 did * Improvements to event table mobile * First pass at mobile-ising the generic list * Item table fixes * Fixed fullcalendar print css not included * Asset list table improvements * Tweak asset list to be more in line with other lists * Versioning template improvements //TODO Rather than have seperate asset templates, convert 'id' into a template variable * Tweak versioning templates to allow ID overrides Asset specific templates begone. Still need to bring back the ID formatting for the Rigboard. * Asset form fixes * Use the right autocompleter.js... * Breakout (most) user stuff to separate module The model remains in RIGS for now, as it's pretty painful to move... * Python Format/import opt * Test Refactor Part 1 - Shuffle things around * Fix migrations TODO - need to ensure moved models are *moved* rather than deleted and recreated! * Start on new tests * Initial work on event create test reimpl * Init other tests, more rigs test faffery * Desaturate theme colors even more Much closer to BS3 * Fix event item adding Bit too heavy handed with the deduplication there Arona * Initial refactor of event item testing * Upgrade bootstrap-select * Updated bootstrap-select for BS4 * Initial port of duplicate testing Needs the latter half rewriting once we have an EventDetail POM * Refactor date validation test So close to killing test_functional.EventTest! * Deduplication of testing code * pep8 * Fix some tests And some things that were actually borked * FIX: Prevent setting access time after start time Cherry pick ofd274ea4606. Will close #405. * Refactor calendar tests * FIX: Don't show asset buttons/history for basic users * Really ought to get a pre-commit hook for pep8... * Fully replace test_functional * Dedupe generic search logic * Fix the remaining tests * Ensure submit button is scrolled to in tests * Fix asset creation test + actually verify its results * Make CI use latest (stable) chromedriver rather than some ancient one Since Travis uses the latest stable chrome, should always match. Bash oneliner \o/ * Of course | is part of YAML syntax, of course... Maybe this works. * Update python version Trying to get CI to match my local environment as much as possible... * Minor test futzing * Well that wasn't clever of me * That was even less clever of me * Revert to old submit wait behaviour * What about if I did this * Try disabling chrome cache * Added screenshot recording of test failures * Fixed RIGS tests not being run * Fixed Pep8 - I promise I'll make a pre-commit hook sometime! * Very initial work at togglable darktheme. Dammit @alexdaniel654 just when I had my scope creep kinda under control. It'll be v. nice to have though...! * More dark theme wangling * Fix some asset template things * FIX: CI Locale Issues * Fix sample command * Initial work at integrating the risk assessment #136. No clever database structure as yet... * FIX: Don't set every boolean input to radios * Different approach to RA linking * Move text definitions to somewhere more authoratitive * FIX: Undo breakage causing autopep8 o.O * Expand detail template * Use correct view for RA history * Initial work at coercing activity feed into showing RAs Also shows Asset/Supplier on the homepage feed. * Refactor activity feed template logic Yay for removing arbitrary if/else chains! * Initial work on caching activity feed Server side that is. Ref #162. * Start RA list template * Refactor RA creation stuff, again * Add H&S Details to Event Detail View * Display venue notes in event detail Notes are no use if nobody reads them. Not sure on this one. * Add ability to filter event archive by status Closes #168. * Fix lingering naive time * Use locmem cache in sqlite environments Otherwise the tests just lock up totally. Should close #162 * Update dependencies Mirrors/supersedes0e67da82e2* Add global ctrl/meta-enter shortcut for form submission Wants rewriting for better efficiency, but hey, it works! * Update dependencies * Fix for a situation that should be impossible * Fix navbar alignment * FEAT: Improve 'omni'search - Partialised template - Added to assets header - Added ability to search assets/suppliers - Improved selection logic - Have it display current query * Move closemodal into PyRIGS * Fix tests for search improvements * Dark mode colour improvements * Fix table colors for dry hires * further darktheme fixes * Remove the dark header from light theme * Fix reload loops when CSS/JS is changed * Move dark theme SCSS to separate file, fix inactive pagination styling * Genercise detail pages * Testing something re notes I wonder if I can make that global, rather than per-template... * Dark theme palette shenanigans I just can't decide * Match darktheme palette to forum darktheme palette Why reinvent the wheel. * Make supplier detail use the generic template * Disable mobile event table PoC for now * Remove the defaults from the RA fields + make them required * More RA fixes * Fixes to revisions for RAs * Add bootstrap 4 test page * Bunch of dark mode fixes from test page * Do not use Django 'required' for radio selects As this requires them to be True, whereas we just need to require that an option be entered. * Properly fixed popover darktheme * Fixed search for events * Style fixes to asset list * Start RA 'mark review' feature * Add reviewing to revision history, fix RA editing not working Also actually commit all the files, that helps * Fix Power MIC being lost on RA edit Why it is subtly different to the Event Update behaviour? Who knows * Invalidate RA review if it is edited after review * Start work on event checklist * Add a button for creating and instantly voiding invoices Handy dandy for when you have loads of cancelled events, like say, a pandemic * Mooooore status chips, mooore * Initial shenanigans on storing my overly fancy EC form * Proof of concept for JSON parsing/storage \o/ * Add new line functionality for vehicles/drivers Might it have been easier to create 'dummy' models like with EventItems? Probably... * Alter rig_count to not include un-checked-in dry hires * Insert a divider between still-out dry hires and actually upcoming events on rigboard * Initial work on new checklist handling. No more JSON! * Versioning module now does magic Automatic creation of views/urls for anything registered with reversion, with a small amount of hackage to preserve legacy stuff. (and the DAMNED asset IDs!) I would never get distracted... * Cleanup * Event checklist crew works Mostly - its not happy with timezones * Medium event power stuff done, barring worst case stuff * Misc fixes * Validation of power reqs * Worst case points on checklist * Templating improvements to RA/EC stuff * Do event table color logic at python level * Audit template fixes * Restrict versioning to one level of depth for speed Also fixed the template for nested changes * Event properties internal/authorised always return a explicit boolean rather than sometimes None * Use template filter for notes * Fix list templates TODO: Sensible place to define the 'expected answer' stuff. * Fix cable table template * Rethink rigboard color logic again Also revert some broken stuff * Test fixes * Modify auth test so it doesn't try and test for external authorisations Cause that's not a thing * Why does this work Bloody overzealous autoformatter... * Formatting... * Initial work on RA tests * Pages/start of tests for EventChecklists * Much better coverage of H&S things * Cleanup & Squash migrations * Fix wrong variable name in settings.py * Fix broken invoice list template * Add revision history to invoices/payments. Also patches previously introduced reversion permissions hole. Supersedes and closes #337. * Various misc fixes * Fix for my fix * Curse youuuuu pep8 * Invoice template improvements * Minor fixes * More tweaks * More fixes * Major improvements/fixes to authorisation templates * Add ability to mark event checklists as Large Event This just disables the checks to allow the rest of it to be filled out for large events, though I expect paper forms may still be used... * Remove database ID from generic list * Put power threshold values in a collapse * Use template filter for consistent removal of 'None links' Plus cleaner template markup! More HTML-in-Python tho, which always feels a bit CSS-in-JS * Tweak asset list markup * Begin to change add buttons success -> primary Also change search primary -> info to avoid clash * Begin to improve event checklist on mobile * Asset detail template improvements * Fix #326 (again) * Fix errors being squashed * Fix rigboard validation tests * Initial work on BS4 button templatetag Newfeatureitis strikes again * Allow multiple event checklists per event TODO: Status chip now needs rethinking * Minor event detail fixes * Fix tests * Rework button tag * Mobile fixes for search * Fix event checklist on mobile * Redo light theme palette * Switch rigboard new button to primary * Kill off excess whitespace on rigboard * Rigboard Timing display tweaks * Fix tests * Properly handle eventauthorisations in new versioning It's not great, not terrible... * Prevent creating duplicate revisions on event Potential fix for #322 - I couldn't reproduce even before this change... * Template improvements * Minor test fixes * Revert "Prevent creating duplicate revisions on event" Apparently it was too strong at preventing dupes... This reverts commitcce0ad0f9f. # Conflicts: # RIGS/models.py * Better approach to generic list templates + other deduplication * Also apply better approach to generic detail pages * One of these days I'll remember to test BEFORE pushing... * And now the same for generic forms * Display tick/cross rather than true/false in boolean version diffs * Upgrade dependencies * Fixes fixes fixes * Fix dependency hell Probably * Correct handling of spaces in paperwork filenames Also normalises display of Invoice IDs. Partial fix for #391. * Buggerit millennium hand and shrimp Knew I was gonna forget to fix the tests * FIX: Set duplicated event status to provisional Closes #398. Flip flop. Flip flop. * Update polyfill for datetime-local Bloody Firefox. We love to hate you. Proper CSS of the fill to come, SoonTM. Closes #391 * Curses! * Minor typo fixes * Initial pass at soop-consult confirmation screen for RAs * Fix migration * Make venue/date editable on EC For multi venue, multi day events Defaults to date and venue set on the event. Also made power MIC default to that set in RA * Clearer logic for RA inverted fields * (probably) fix tests * Give keyholders supplier edit perm * Generic list only displays edit button if user has perm * Same perm check for generic details * H&S Details takes up free space on non-internal events * Remove flash of content when loading new rig page * First pass at clearer display of asset list filters * Fix tests / default to headless tests (fingers crossed) * Fix autocompleter.js to properly disable edit links again * Move status color logic back to template Cause that somehow makes it work better?? * Display note icon on event detail page * Fix caching * Put rounded corners back where they belong * Remove lingering use of 'page-header' BS removed that style * More search and replace for BS changes Thought I'd got them all. Clearly not! * Remove enforced linebreak on status chips * Fix horizontal-ness on some forms * Remove animation on prefers-reduced-motion/low referesh rate devices Also normalises handling of asset list cable table & improves its use of space on large devices * Make version changes badges more readable * First pass at making the calendar less crap * Fix event table success logic Yay for copy paste fails >.> * Use borders rather than block colors for coloured tables under darktheme * First pass at porting calendar from FC V3 to V5 Two major versions and all they did was rename a bunch of names...TWICE. * Rework version name method to avoid blank names on eventchecklist vehicles/crew * Fix cable test * Made radio button focus much more obvious on dark theme * Implement Jerb's wording changes * Fix one test, break another... * Fix recent change stream list mutation issue * FIX: Do not naively cache event table Not that easy, it turns out. Duh. * FEAT: Implement #413 show associated assets on cable type detail pg Closes #413 * Allow H&S for non-events * Update emergency contact number * Improvements to profile detail page * Implement some of Jonny's suggested changes TODO: - Define event size at RA time, pass through to EC - Have later power questions be context dependent * Test fixes * Add space for power/rigging plans to be linked to RAs * Start move of event size logic to RA from Ec * Javascript required shenanigans for RA power * More moving of event size logic * Fixing tests for new logic etc * Why does this work Indeed, it may not * FIX: Stupid typo in versioning.py * Further minor fixes to versioning * Add icons to H&S menu items * Should fix calendar breaking in production * Small alignment fix in asset list * Squash migrations Co-authored-by: Matthew Smith <psyms13@nottingham.ac.uk>
This commit is contained in:
8
RIGS/templates/partials/associated_events.html
Normal file
8
RIGS/templates/partials/associated_events.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12 py-3">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Events</div>
|
||||
{% include 'partials/event_table.html' with events=object.latest_events %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
10
RIGS/templates/partials/associated_organisations.html
Normal file
10
RIGS/templates/partials/associated_organisations.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Organisations</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for organisation,count in object.organisations %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'organisation_detail' organisation.pk %}">{{ organisation.pk|stringformat:"05d" }} | {{ organisation.name }} <span class="badge badge-secondary" title="{{count}} events with {{object.name}} for {{organisation.name}}">{{count}}</span></a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
12
RIGS/templates/partials/associated_people.html
Normal file
12
RIGS/templates/partials/associated_people.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated People</div>
|
||||
<div class="list-group list-group-flush">
|
||||
{% for person,count in object.persons %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'person_detail' person.pk %}">{{ person.pk|stringformat:"05d" }} | {{ person.name }} <span class="badge badge-secondary" title="{{count}} events with {{person.name}} for {{object.name}}">{{count}}</span></a>
|
||||
{% empty %}
|
||||
<div class="card-body">None</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
52
RIGS/templates/partials/auth_details.html
Normal file
52
RIGS/templates/partials/auth_details.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<div class="card card-default
|
||||
{% if object.authorised %}
|
||||
card-success
|
||||
{% elif event.authorisation and event.authorisation.amount != event.total and event.authorisation.last_edited_at > event.auth_request_at %}
|
||||
card-warning
|
||||
{% elif event.auth_request_to %}
|
||||
card-info
|
||||
{% endif %}
|
||||
">
|
||||
<div class="card-header">Client Authorisation</div>
|
||||
<div class="card-body row">
|
||||
<dl class="col-md-6">
|
||||
<dt>Authorisation Request</dt>
|
||||
<dd>{{ object.auth_request_to|yesno:"Yes,No" }}</dd>
|
||||
|
||||
<dt>By</dt>
|
||||
<dd>{{ object.auth_request_by }}</dd>
|
||||
|
||||
<dt>At</dt>
|
||||
<dd>{{ object.auth_request_at|date:"D d M Y H:i"|default:"" }}</dd>
|
||||
|
||||
<dt>To</dt>
|
||||
<dd>{{ object.auth_request_to }}</dd>
|
||||
</dl>
|
||||
<dd class="d-block d-sm-none"> </dd>
|
||||
<dl class="col-md-6">
|
||||
<dt>Authorised</dt>
|
||||
<dd>{{ object.authorised|yesno:"Yes,No" }}</dd>
|
||||
|
||||
<dt>Authorised by</dt>
|
||||
<dd>
|
||||
{% if object.authorisation %}
|
||||
{{ object.authorisation.name }}
|
||||
(<a href="mailto:{{ object.authorisation.email }}">{{ object.authorisation.email }}</a>)
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt>Authorised at</dt>
|
||||
<dd>{{ object.authorisation.last_edited_at|date:"D d M Y H:i" }}</dd>
|
||||
|
||||
<dt>Authorised amount</dt>
|
||||
<dd>
|
||||
{% if object.authorisation %}
|
||||
£ {{ object.authorisation.amount|floatformat:"2" }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt>Requested by</dt>
|
||||
<dd>{{ object.authorisation.sent_by }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
6
RIGS/templates/partials/checklist_checkbox.html
Normal file
6
RIGS/templates/partials/checklist_checkbox.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% load widget_tweaks %}
|
||||
{% load help_text from filters %}
|
||||
<div class="form-check">
|
||||
{% render_field formitem class+="form-check-input" %}
|
||||
<label class="form-check-label" for="{{ formitem.id_for_label }}">{{formitem.help_text|safe}}</label>
|
||||
</div>
|
||||
76
RIGS/templates/partials/client_eventdetails.html
Normal file
76
RIGS/templates/partials/client_eventdetails.html
Normal file
@@ -0,0 +1,76 @@
|
||||
<div class="col-sm-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">Contact Details</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-sm-5">Person</dt>
|
||||
<dd class="col-sm-7">
|
||||
{% if event.person %}
|
||||
{{ event.person.name }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-5">Email</dt>
|
||||
<dd class="col-sm-7">
|
||||
<span class="overflow-ellipsis">{{ event.person.email }}</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-5">Phone Number</dt>
|
||||
<dd class="col-sm-7">{{ event.person.phone }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{% if event.organisation %}
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Organisation Details</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-sm-5">Organisation</dt>
|
||||
<dd class="col-sm-7">
|
||||
{{ event.organisation.name }}
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-5">Phone Number</dt>
|
||||
<dd class="col-sm-7">{{ object.organisation.phone }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="card border-info">
|
||||
<div class="card-header">Event Info</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-sm-5">Event Venue</dt>
|
||||
<dd class="col-sm-7">
|
||||
{% if object.venue %}
|
||||
<a href="{% url 'venue_detail' object.venue.pk %}" class="modal-href">
|
||||
{{ object.venue }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-5">Status</dt>
|
||||
<dd class="col-sm-7">{{ event.get_status_display }}</dd>
|
||||
|
||||
<dd class="col-sm-12"> </dd>
|
||||
|
||||
<dt class="col-sm-5">Access From</dt>
|
||||
<dd class="col-sm-7">{{ event.access_at|date:"D d M Y H:i"|default:"" }}</dd>
|
||||
|
||||
<dt class="col-sm-5">Event Starts</dt>
|
||||
<dd class="col-sm-7">{{ event.start_date|date:"D d M Y" }} {{ event.start_time|date:"H:i" }}</dd>
|
||||
|
||||
<dt class="col-sm-5">Event Ends</dt>
|
||||
<dd class="col-sm-7">{{ event.end_date|date:"D d M Y" }} {{ event.end_time|date:"H:i" }}</dd>
|
||||
|
||||
<dd class="col-sm-12"> </dd>
|
||||
|
||||
<dt class="col-sm-5">Event Description</dt>
|
||||
<dd class="col-sm-12">{{ event.description|linebreaksbr }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
51
RIGS/templates/partials/ec_power_info.html
Normal file
51
RIGS/templates/partials/ec_power_info.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<h5 class="py-3"><a class="btn btn-info" data-toggle="collapse" href="#values" aria-expanded="false" aria-controls="values">View Threshold Values</a></h5>
|
||||
<div class="row collapse" id="values">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<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 table-bordered">
|
||||
<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>
|
||||
89
RIGS/templates/partials/event_details.html
Normal file
89
RIGS/templates/partials/event_details.html
Normal file
@@ -0,0 +1,89 @@
|
||||
{% load namewithnotes from filters %}
|
||||
<div class="card card-info">
|
||||
<div class="card-header">Event Info</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-sm-6">Event Venue</dt>
|
||||
<dd class="col-sm-6">
|
||||
{% if object.venue %}
|
||||
<a href="{% url 'venue_detail' object.venue.pk %}" class="modal-href">
|
||||
{{ object.venue|namewithnotes:'venue_detail' }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</dd>
|
||||
{% if object.venue %}
|
||||
<dt class="col-sm-6">Venue Notes</dt>
|
||||
<dd class="col-sm-6">
|
||||
{{ object.venue.notes }}{% if object.venue.three_phase_available %}<br>(Three phase available){%endif%}
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if event.is_rig %}
|
||||
<dt class="col-sm-6">Event MIC</dt>
|
||||
<dd class="col-sm-6">
|
||||
{% if event.mic and perms.RIGS.view_profile %}
|
||||
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
|
||||
{{ event.mic.name }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ event.mic.name }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-sm-6">Status</dt>
|
||||
<dd class="col-sm-6">{{ event.get_status_display }}</dd>
|
||||
|
||||
<dd class="col-sm-12"> </dd>
|
||||
|
||||
{% if event.is_rig %}
|
||||
<dt class="col-sm-6">Crew Meet</dt>
|
||||
<dd class="col-sm-6">{{ event.meet_at|date:"D d M Y H:i"|default:"TBC" }}</dd>
|
||||
<!---TODO<dd class="col-sm-6">{{ event.meet_info|default:"" }}</dd>--->
|
||||
|
||||
<dt class="col-sm-6">Access From</dt>
|
||||
<dd class="col-sm-6">{{ event.access_at|date:"D d M Y H:i"|default:"TBC" }}</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-sm-6">Event Starts</dt>
|
||||
<dd class="col-sm-6">{{ event.start_date|date:"D d M Y" }} {{ event.start_time|date:"H:i" }}</dd>
|
||||
|
||||
<dt class="col-sm-6">Event Ends</dt>
|
||||
<dd class="col-sm-6">{{ event.end_date|date:"D d M Y" }} {{ event.end_time|date:"H:i" }}</dd>
|
||||
|
||||
<dd class="col-sm-12"> </dd>
|
||||
|
||||
<dt class="col-sm-6">Event Description</dt>
|
||||
<dd class="dont-break-out col-sm-12">{{ event.description|linebreaksbr }}</dd>
|
||||
|
||||
<dd class="col-sm-12"> </dd>
|
||||
|
||||
<dt class="col-sm-6">Based On</dt>
|
||||
<dd class="col-sm-6">
|
||||
{% if object.based_on %}
|
||||
<a href="{% url 'event_detail' pk=object.based_on.pk %}">
|
||||
{% if object.based_on.is_rig %}N{{ object.based_on.pk|stringformat:"05d" }}{% else %}
|
||||
{{ object.based_on.pk }}{% endif %}
|
||||
{{ object.based_on.name }} {% if object.based_on.mic %}by {{ object.based_on.mic.name }}{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
{% if event.dry_hire %}
|
||||
<dt class="col-sm-6">Checked In By</dt>
|
||||
<dd class="col-sm-6">{{ object.checked_in_by.name }}</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if event.is_rig %}
|
||||
<dt class="col-sm-6">Collected By</dt>
|
||||
<dd class="col-sm-6">{{ object.collector }}</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if event.is_rig and not event.internal and perms.RIGS.view_event %}
|
||||
<dd class="col-sm-12"> </dd>
|
||||
<dt class="col-sm-6">PO</dt>
|
||||
<dd class="col-sm-6">{{ object.purchase_order }}</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
7
RIGS/templates/partials/event_size.html
Normal file
7
RIGS/templates/partials/event_size.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% if object.event_size == 2 %}
|
||||
<span class="badge badge-danger p-2 my-3">Large Event</span>
|
||||
{% elif object.event_size == 1 %}
|
||||
<span class="badge badge-warning p-2 my-3">Medium Event</span>
|
||||
{%else%}
|
||||
<span class="badge badge-success p-2 my-3">Small Event</span>
|
||||
{%endif%}
|
||||
44
RIGS/templates/partials/event_status.html
Normal file
44
RIGS/templates/partials/event_status.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<h5>
|
||||
<span class="badge badge-{% if event.confirmed %}success{% elif event.cancelled %}dark{% else %}warning{% endif %}">Status: {{ event.get_status_display }}</span>
|
||||
{% if event.is_rig %}
|
||||
{% if event.purchase_order %}
|
||||
<span class="badge badge-success">PO: {{ event.purchase_order }}</span>
|
||||
{% elif event.authorised %}
|
||||
<span class="badge badge-success">Authorisation: Complete <span class="fas fa-check"></span></span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">Authorisation: <span class="fas fa-times"></span></span>
|
||||
{% endif %}
|
||||
{% if not event.dry_hire %}
|
||||
{% if event.riskassessment %}
|
||||
<span class="badge badge-success">RA: <span class="fas fa-check"></span>{%if event.riskassessment.reviewed_by%}<span class="fas fa-check"></span>{%endif%}</span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">RA: <span class="fas fa-times"></span></span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="badge badge-secondary">RA: N/A</span>
|
||||
{% endif %}
|
||||
{% if not event.dry_hire %}
|
||||
{% if event.hs_done %}
|
||||
{# TODO Display status of all checklists #}
|
||||
<span class="badge badge-success">Checklist: <span class="fas fa-check"></span></span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">Checklist: <span class="fas fa-times"></span></span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="badge badge-secondary">Checklist: N/A</span>
|
||||
{% endif %}
|
||||
{% if perms.RIGS.view_invoice %}
|
||||
{% if event.invoice %}
|
||||
{% if event.invoice.void %}
|
||||
<span class="badge badge-secondary">Invoice: Void</span>
|
||||
{% elif event.invoice.is_closed %}
|
||||
<span class="badge badge-success">Invoice: Paid</span>
|
||||
{% else %}
|
||||
<span class="badge badge-warning">Invoice: Outstanding</span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="badge badge-info">Invoice: Not Generated</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</h5>
|
||||
104
RIGS/templates/partials/event_table.html
Normal file
104
RIGS/templates/partials/event_table.html
Normal file
@@ -0,0 +1,104 @@
|
||||
{% load namewithnotes from filters %}
|
||||
<div class="table-responsive">
|
||||
<table class="table mb-0" id="event_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Dates & Times</th>
|
||||
<th scope="col">Event Details</th>
|
||||
<th scope="col">MIC</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for event in events %}
|
||||
<tr class="{% if event.cancelled %}
|
||||
table-secondary
|
||||
{% elif not event.is_rig %}
|
||||
table-info
|
||||
{% elif not event.mic %}
|
||||
table-danger
|
||||
{% elif event.confirmed and event.authorised %}
|
||||
{% if event.dry_hire or event.riskassessment %}
|
||||
table-success
|
||||
{% else %}
|
||||
table-warning
|
||||
{% endif %}
|
||||
{% else %}
|
||||
table-warning
|
||||
{% endif %}" id="event_row">
|
||||
<!---Number-->
|
||||
<th scope="row" id="event_number">{{ event.display_id }}</th>
|
||||
<!--Dates & Times-->
|
||||
<td id="event_dates">
|
||||
<span class="text-nowrap">Start: <strong>{{ event.start_date|date:"D d/m/Y" }}</strong>
|
||||
{% if event.has_start_time %}
|
||||
{{ event.start_time|date:"H:i" }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% if event.end_date %}
|
||||
<br>
|
||||
<span class="text-nowrap">End: {% if event.end_date != event.start_date %}<strong>{{ event.end_date|date:"D d/m/Y" }}</strong>{% endif %}
|
||||
{% if event.has_end_time %}
|
||||
{{ event.end_time|date:"H:i" }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if not event.cancelled %}
|
||||
{% if event.meet_at %}
|
||||
<br><span>Crew meet: <strong>{{ event.meet_at|date:"H:i" }}</strong> {{ event.meet_at|date:"(d/m/Y)" }}</span>
|
||||
{% endif %}
|
||||
{% if event.access_at %}
|
||||
<br><span>Access at: <strong>{{ event.access_at|date:"H:i" }}</strong> {{ event.access_at|date:"(d/m/Y)" }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<!---Details-->
|
||||
<td id="event_details" class="w-100">
|
||||
<h4>
|
||||
<a href="{% url 'event_detail' event.pk %}">
|
||||
{{ event.name }}
|
||||
</a>
|
||||
{% if event.venue %}
|
||||
<small>at {{ event.venue|namewithnotes:'venue_detail' }}</small>
|
||||
{% endif %}
|
||||
{% if event.dry_hire %}
|
||||
<span class="badge badge-secondary">Dry Hire</span>
|
||||
{% endif %}
|
||||
</h4>
|
||||
{% if event.is_rig and not event.cancelled %}
|
||||
<h5>
|
||||
{{ event.person.name }}
|
||||
{% if event.organisation %}
|
||||
for {{ event.organisation.name }}
|
||||
{% endif %}
|
||||
</h5>
|
||||
{% endif %}
|
||||
{% if not event.cancelled and event.description %}
|
||||
<p>{{ event.description|linebreaksbr }}</p>
|
||||
{% endif %}
|
||||
{% include 'partials/event_status.html' %}
|
||||
</td>
|
||||
<!---MIC-->
|
||||
<td id="event_mic" class="text-nowrap">
|
||||
{% if event.mic %}
|
||||
{% if perms.RIGS.view_profile %}
|
||||
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
|
||||
{% endif %}
|
||||
<img src="{{ event.mic.profile_picture }}" class="event-mic-photo"/>
|
||||
{{ event.mic }}
|
||||
{% if perms.RIGS.view_profile %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% elif event.is_rig %}
|
||||
<span class="fas fa-exclamation"></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr class="bg-warning">
|
||||
<td colspan="4">No events found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
19
RIGS/templates/partials/hs_details.html
Normal file
19
RIGS/templates/partials/hs_details.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="card {% if event.hs_done %}
|
||||
border-success
|
||||
{% else %}
|
||||
border-warning
|
||||
{% endif %}">
|
||||
<div class="card-header">Health & Safety Details</div>
|
||||
<div class="card-body">
|
||||
<h5>Risk Assessment:</h5>
|
||||
{% include 'partials/hs_status.html' with event=event object=event.riskassessment view='ra_detail' edit='ra_edit' create='event_ra' review='ra_review' perm=perms.RIGS.review_riskassessment %}
|
||||
<hr>
|
||||
<h5>Event Checklists:</h5>
|
||||
{% for checklist in event.checklists.all %}
|
||||
{% include 'partials/hs_status.html' with event=event object=checklist view='ec_detail' edit='ec_edit' create='event_ec' review='ec_review' perm=perms.RIGS.review_eventchecklist %}
|
||||
<br/>
|
||||
{% endfor %}
|
||||
<a href="{% url 'event_ec' event.pk %}" class="btn btn-info mt-2"><span class="fas fa-paperclip"></span> <span
|
||||
class="hidden-xs">Create</span></a>
|
||||
</div>
|
||||
</div>
|
||||
11
RIGS/templates/partials/hs_status.html
Normal file
11
RIGS/templates/partials/hs_status.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% load button from filters %}
|
||||
{% if object.pk != None %}
|
||||
<div class="btn-group">
|
||||
{% button 'view' view object.pk %}
|
||||
{% button 'edit' edit object.pk %}
|
||||
</div>
|
||||
{% include 'partials/review_status.html' %}
|
||||
{% elif event != None %}
|
||||
<a href="{% url create event.pk %}" class="btn btn-info"><span class="fas fa-paperclip"></span> <span
|
||||
class="hidden-xs">Create</span></a>
|
||||
{% endif %}
|
||||
7
RIGS/templates/partials/review_status.html
Normal file
7
RIGS/templates/partials/review_status.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% if object.reviewed_by %}
|
||||
<span class="badge badge-success py-2">Reviewed by <a href="{% url 'profile_detail' object.reviewed_by.pk %}">{{object.reviewed_by}}</a> at {{object.reviewed_at}}</span>
|
||||
{% elif perm %}
|
||||
<a class="btn btn-success my-2" href="{% url review object.pk %}">Mark Reviewed</a>
|
||||
{% else %}
|
||||
<span class="badge badge-danger py-2">Not reviewed</span>
|
||||
{% endif %}
|
||||
12
RIGS/templates/partials/yes_no_radio.html
Normal file
12
RIGS/templates/partials/yes_no_radio.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="row">
|
||||
<label for="{{ formitem.id_for_label }}"
|
||||
class="col-8 control-label">{{ formitem.help_text|safe }}</label>
|
||||
<div class="col-4 pb-3" id="{{ formitem.id_for_label|slice:'-2' }}">
|
||||
{% for radio in formitem %}
|
||||
<div class="custom-control custom-radio">
|
||||
{{ radio.tag }}
|
||||
<label class="custom-control-label" for="{{ radio.id_for_label }}">{{ radio.choice_label }}</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user