WIP: Audit modal works

Need to get the ID search working.
This commit is contained in:
2020-02-14 11:45:42 +00:00
parent e9a9250027
commit e7fcaa36bb
5 changed files with 70 additions and 46 deletions

View File

@@ -1,14 +1,9 @@
{% extends 'base_assets.html' %}
{% extends request.is_ajax|yesno:'base_ajax.html,base_assets.html' %}
{% load widget_tweaks %}
{% block title %}Audit Asset {{ object.asset_id }}{% endblock %}
{% block content %}
<div class="page-header">
<h1>
Audit Asset: {{ object.asset_id }}
</h1>
</div>
<form class="form-horizontal" method="post" id="asset_update_form" action="{% url 'asset_audit' pk=object.asset_id%}">
<form class="form-horizontal" method="post" id="asset_update_form" action="{{ form.action|default:request.path }}">
{% include 'form_errors.html' %}
{% csrf_token %}
<input type="hidden" name="id" value="{{ object.id|default:0 }}" hidden=true>
@@ -58,25 +53,10 @@
</div>
<div class="row">
<div class="col-md-10 pull-right">
<button type="submit" class="btn btn-success"><i class="glyphicon glyphicon-floppy-disk"></i> Audit</button>
<br>
<button type="reset" class="btn btn-link" onclick="history.back()">Cancel</button>
<div class="form-group">
<input class="btn btn-primary pull-left" type="submit"/>
</div>
</div>
</div>
</form>
{% endblock %}
{% block js%}
{% if edit %}
<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>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,46 @@
{% extends 'base_assets.html' %}
{% block title %}Asset Audit List{% endblock %}
{% load static %}
{% load paginator from filters %}
{% load widget_tweaks %}
{% block js %}
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="{% static "js/interaction.js" %}"></script>
<script src="{% static "js/modal.js" %}"></script>
{% endblock %}
{% block content %}
<div class="page-header">
<h1 class="text-center">Asset Audit List</h1>
</div>
<form id="asset-search-form" class="form-horizontal" method="POST">
<div class="input-group pull-right" style="width: auto;">
{% render_field form.query|add_class:'form-control' placeholder='Enter Asset ID' style="width: 250px"%}
<label for="query" class="sr-only">Asset ID:</label>
<span class="input-group-btn"><a class="btn btn-default modal-href" href="{% url 'asset_audit' 9000 %}"">Search</a></span>
</div>
</form>
<table class="table">
<thead>
<tr>
<th>Asset ID</th>
<th>Description</th>
<th>Category</th>
<th>Status</th>
<th class="hidden-xs">Quick Links</th>
</tr>
</thead>
<tbody id="asset_table_body">
{% include 'partials/asset_list_table_body.html' %}
</tbody>
</table>
{% if is_paginated %}
<div class="text-center">
{% paginator %}
</div>
{% endif %}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base_assets.html' %}
{% extends request.is_ajax|yesno:'base_ajax.html,base_assets.html' %}
{% load widget_tweaks %}
{% block title %}Asset {{ object.asset_id }}{% endblock %}