Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
501 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{% extends '_layout.html' %} | ||
{% load bootstrap3 %} | ||
{% load static %} | ||
{% load utils %} | ||
|
||
{% block title %}Reports{% endblock %} | ||
|
||
{% block content %} | ||
<div class="row"> | ||
<h1 class="col-sm-12"> | ||
<span>Standard Report</span> | ||
</h1> | ||
</div> | ||
|
||
<div class="container" style="margin-bottom:20px;"> | ||
</div> | ||
|
||
<form action="" method="POST" style="width: 50%"> | ||
{% csrf_token %} | ||
<div class="form-group"> | ||
<label class="control-label" for="id_service">Service</label> | ||
<select name="service" class="form-control" title="" id="id_service" multiple="multiple"> | ||
{% for service in services %} | ||
<option value="{{ service.id }}" class="{{ service.id }}">{{ service.name }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label class="control-label" for="id_component">Component</label> | ||
<select name="component" class="form-control" title="" id="id_component" multiple="multiple"> | ||
{% for component in components %} | ||
<option value="{{ component.id }}" class="{{ component.service.id }}">{{ component.name }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
|
||
<input class="btn btn-primary" type="submit" value="Generate Excel"/> | ||
<a href="{% url 'home' %}" | ||
class="btn btn-default">Cancel</a> | ||
</form> | ||
|
||
{% endblock %} | ||
|
||
{% block scripts %} | ||
<script> | ||
$(document).ready(function () { | ||
var allOptions = $('#id_component option') | ||
$('#id_service').change(function () { | ||
$('#id_component option').remove() | ||
var classes = []; | ||
$('#id_service option:selected').each(function( index ) { | ||
classes.push($(this).prop('class')); | ||
}); | ||
var opts = allOptions.filter( function(index) { | ||
return $.inArray($(this).prop('class'), classes) > -1; | ||
}); | ||
$.each(opts, function (i, j) { | ||
$(j).appendTo('#id_component'); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.