Files
PyRIGS/assets/templates/asset_form.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

79 lines
2.6 KiB
HTML

{% extends 'base_assets.html' %}
{% load widget_tweaks %}
{% load static %}
{% block css %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'css/selects.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'css/easymde.min.css' %}">
{% endblock %}
{% block preload_js %}
{{ block.super }}
<script src="{% static 'js/selects.js' %}"></script>
<script src="{% static 'js/easymde.min.js' %}"></script>
{% endblock %}
{% block js %}
{{ block.super }}
<script src="{% static 'js/autocompleter.js' %}"></script>
<script>
const matches = window.matchMedia("(prefers-reduced-motion: reduce)").matches || window.matchMedia("(update: slow)").matches;
dur = matches ? 0 : 500;
function checkIfCableHidden() {
if ($("#id_is_cable").prop('checked')) {
$("#cable-table").slideDown(dur);
} else {
$("#cable-table").slideUp(dur);
}
}
checkIfCableHidden();
</script>
<script>
$('document').ready(function(){
$(document).find(".selectpicker").selectpicker().each(function(){initPicker($(this))});
});
</script>
<script src="{% static "js/tooltip.js" %}"></script>
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
{% endblock %}
{% block content %}
{% if duplicate %}
<form method="POST" id="asset_update_form" action="{% url 'asset_duplicate' pk=previous_asset_id %}">
{% elif edit %}
<form method="POST" id="asset_update_form" action="{% url 'asset_update' pk=object.asset_id %}">
{% else %}
<form method="POST" id="asset_update_form" action="{% url 'asset_create' %}">
{% endif %}
{% include 'form_errors.html' %}
{% csrf_token %}
<input type="hidden" name="id" value="{{ object.id|default:0 }}" hidden=true>
<div class="row pt-2">
<div class="col-sm-12">
{% include 'partials/asset_detail_form.html' %}
</div>
</div>
<div class="row pt-2">
<div class="col-12 col-sm">
{% include 'partials/purchasedetails_form.html' %}
</div>
<div class="col-12 col-sm-6 col-md-4" id="cable-table">
{% include 'partials/cable_form.html' %}
</div>
<div class="col-12 col-md-4">
{% include 'partials/parent_form.html' %}
</div>
</div>
<div class="row">
<div class="col-12">
{% include 'partials/asset_buttons.html' %}
</div>
</div>
</form>
{% endblock %}