mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
69 lines
2.2 KiB
HTML
69 lines
2.2 KiB
HTML
{% extends 'base_assets.html' %}
|
|
{% load widget_tweaks %}
|
|
{% load static %}
|
|
|
|
{% block title %}Asset {{ object.asset_id }}{% endblock %}
|
|
|
|
{% block css %}
|
|
<link rel="stylesheet" href="{% static "css/bootstrap-select.css" %}"/>
|
|
<link rel="stylesheet" href="{% static "css/ajax-bootstrap-select.css" %}"/>
|
|
{% endblock %}
|
|
|
|
{% block js %}
|
|
<script src="{% static 'js/bootstrap-select.js' %}"></script>
|
|
<script src="{% static 'js/ajax-bootstrap-select.js' %}"></script>
|
|
<script src="{% static 'js/autocompleter.js' %}"></script>
|
|
<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 %}
|
|
|
|
{% block content %}
|
|
<h1>
|
|
{% if edit and object %}
|
|
Edit Asset: {{ object.asset_id }}
|
|
{% elif duplicate %}
|
|
Duplication of Asset: {{ previous_asset_id }}
|
|
{% else %}
|
|
Create Asset
|
|
{% endif %}
|
|
</h1>
|
|
{% 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 pt-4">
|
|
<div class="col-sm-12">
|
|
{% include 'partials/asset_detail_form.html' %}
|
|
</div>
|
|
</div>
|
|
<div class="row pt-4">
|
|
<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 %}
|