mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-05 14:48:22 +00:00
Merge branch 'master' into bs4
# Conflicts: # assets/models.py # assets/templates/asset_update.html # assets/templates/partials/asset_buttons.html # assets/templates/partials/asset_list_table_body.html # assets/views.py # templates/base_assets.html
This commit is contained in:
74
assets/templates/asset_audit_list.html
Normal file
74
assets/templates/asset_audit_list.html
Normal file
@@ -0,0 +1,74 @@
|
||||
{% 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>
|
||||
<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 %}";
|
||||
var id = $("#{{form.query.id_for_label}}").val();
|
||||
url = url.replace('None', id);
|
||||
$.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();
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1 class="text-center">Asset Audit List</h1>
|
||||
</div>
|
||||
|
||||
<div id="error404" class="alert alert-danger alert-dismissable" hidden=true>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<span>Asset with that ID does not exist!</span>
|
||||
</div>
|
||||
|
||||
<h3>Audit Asset:</h3>
|
||||
<form id="asset-search-form" class="form-horizontal" method="POST">
|
||||
<div class="input-group input-group-lg" style="width: auto;">
|
||||
{% render_field form.query|add_class:'form-control' placeholder='Enter Asset ID' autofocus="true" %}
|
||||
<label for="query" class="sr-only">Asset ID:</label>
|
||||
<span class="input-group-btn"><a id="searchButton" class="btn btn-default" class="submit" type="submit">Search</a></span>
|
||||
</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 %}
|
||||
Reference in New Issue
Block a user