Files
PyRIGS/assets/templates/asset_audit_list.html
Arona Jones 54b44404ba Fix various minor issues (#545)
* Add absolute URL to power tests

* Update to target Python 3.10

* Return user to current page when clicking 'mark reviewed'

* Add units to power test record detail and form

I'm a bad scientist (coz I'm an engineer)

* Allow a higher value in PSSC fields

* Default venue to event venue in EC/PT

* Fix population of initial venue values for EC/PT

* Add link to create power test from EC detail

* Do not set power plan field to required on RA

"This might be a problem if the risk assessment is being done by one person and the power plan by another."

* Default power MIC to MIC

* Implement some suggestions from the Doctor

* Prevent checking in to cancelled events and dry hires

Will close #539

* Exclude dry hires from H&S overview list

* Add "ex VAT" tooltips to asset purchase price and replacement cost

* Automagically clear and focus ID field when audit modal closes

Closes #533

* Delete unused things

* Allow two decimal places in cable length, show training item IDs in selectpicker

Will close #540

* Fix #524 500 Error when viewing qualification list for items nobody is qualified in

* Update README.md

* Add a guard against nulls in recent changes

Maybe fixes #537 I'm unable to replicate locally

* Turn down verbosity of CI tests, fix tests, potential speedup

* Squash migration

* Add encoding to open

* Update to v3 upload-artifact

Resolves a deprecation warning
2023-05-29 11:50:04 +01:00

74 lines
2.4 KiB
HTML

{% extends 'base_assets.html' %}
{% load static %}
{% load paginator from filters %}
{% load widget_tweaks %}
{% block js %}
<script>
$('document').ready(function(){
$('#asset-search-form').submit(function () {
$('#searchButton').focus().click();
return false;
});
$('#searchButton').click(function (e) {
e.preventDefault();
var url = "{% url 'asset_audit' None %}".replace('None', $("#{{form.q.id_for_label}}").val());
$.ajax({
url: url,
success: function(){
$link = $(this);
// Anti modal inception
if ($link.parents('#modal').length === 0) {
modaltarget = $link.data('target');
modalobject = "";
$('#modal').load(url, function (e) {
$('#modal').modal();
});
}
},
error:function(){
$("#error404").attr("hidden", false);
}
});
});
});
function onAuditClick(assetID) {
$('#' + assetID).remove();
}
$('#modal').on('hidden.bs.modal', function (e) {
searchbar = document.getElementById('id_q');
searchbar.value = "";
setTimeout(searchbar.focus(), 2000);
})
</script>
{% endblock %}
{% block content %}
<div id="error404" class="alert alert-danger alert-dismissable" hidden=true>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<span>Asset with that ID does not exist!</span>
</div>
<form id="asset-search-form" class="mb-3" method="GET">
<div class="form-group form-row">
<h3>Audit Asset:</h3>
<div class="input-group input-group-lg">
{% render_field form.q|add_class:'form-control' placeholder='Enter Asset ID' autofocus="true" %}
<div class="input-group-append">
<label for="q" class="sr-only">Asset ID:</label>
<a id="searchButton" class="btn btn-primary" class="submit" type="submit">Search</a>
</div>
</div>
</div>
</form>
<h3>Assets Requiring Audit:</h3>
{% include 'partials/asset_list_table.html' with audit="true" %}
{% if is_paginated %}
<div class="text-center">
{% paginator %}
</div>
{% endif %}
{% endblock %}