mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
* FIX #388: Prevent assets losing supplier data on edit * FEAT: Add associated assets to supplier detail view * FIX: Tweak supplier list to make detail view accessible * Potential fix for #380 No idea if it works because I can't reproduce locally. S/O Reckons it should... :P * FEAT #386: Asset search searches serial number. Pending addition of advanced search. * FIX: Order asset categories/statuses alphabetically Instead of by pk because that's silly. * FEAT: Statuses can have a CSS class defined in the admin panel This replaces the hardcoding of colours in the asset list. * FIX: Squash migrations * Fixed supplier not working on all the create asset template * Refactored away "assets" property on "Supplier" by using "related_name" instead Co-authored-by: Matthew Smith <mattysmith22@googlemail.com>
62 lines
1.6 KiB
HTML
62 lines
1.6 KiB
HTML
{% extends 'base_assets.html' %}
|
|
{% load widget_tweaks %}
|
|
{% load asset_templatetags %}
|
|
{% block title %}Asset {{ object.asset_id }}{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="page-header">
|
|
<h1>
|
|
{% if duplicate %}
|
|
Duplication of Asset: {{ previous_asset_id }}
|
|
{% else %}
|
|
Create Asset
|
|
{% endif %}
|
|
</h1>
|
|
</div>
|
|
{% if duplicate %}
|
|
<form method="post" id="asset_update_form" action="{% url 'asset_duplicate' pk=previous_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">
|
|
<div class="col-sm-12">
|
|
{% include 'partials/asset_form.html' %}
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
{% include 'partials/purchasedetails_form.html' %}
|
|
</div>
|
|
<div class="col-md-6" hidden="true" id="cable-table">
|
|
{% include 'partials/cable_form.html' %}
|
|
</div>
|
|
<div class="col-md-4">
|
|
{% include 'partials/parent_form.html' %}
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
{% include 'partials/asset_buttons.html' %}
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
{% endblock %}
|
|
|
|
{% block js%}
|
|
<script>
|
|
function checkIfCableHidden() {
|
|
if (document.getElementById("id_is_cable").checked) {
|
|
document.getElementById("cable-table").hidden = false;
|
|
} else {
|
|
document.getElementById("cable-table").hidden = true;
|
|
}
|
|
}
|
|
checkIfCableHidden();
|
|
</script>
|
|
{%endblock%}
|