mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-16 21:12:13 +00:00
WIP: Javascript shenanigans for asset audit search
It's not clean but it works..
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
<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>
|
||||
function onClick() {
|
||||
$('#searchButton').attr("href", "{% url 'asset_audit' None %}".replace('None', $('#{{form.query.id_for_label}}').val()));
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
@@ -19,7 +24,7 @@
|
||||
<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>
|
||||
<span class="input-group-btn"><a id="searchButton" class="btn btn-default modal-href" href="{% url 'asset_audit' None %}" onclick="onClick()">Search</a></span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -187,6 +187,8 @@ class AssetEmbed(AssetDetail):
|
||||
class AssetAuditList(AssetList):
|
||||
template_name = 'asset_audit_list.html'
|
||||
|
||||
def form_valid(self):
|
||||
print('test')
|
||||
|
||||
class AssetAudit(AssetEdit):
|
||||
template_name = 'asset_audit.html'
|
||||
|
||||
Reference in New Issue
Block a user