operation.html
129 lines
| 4.1 KiB
| text/html
|
HtmlDjangoLexer
|
r50 | {% extends "base.html" %} | ||
{% load bootstrap3 %} | ||||
{% load static %} | ||||
{% load main_tags %} | ||||
{% block extra-head %} | ||||
<link href="{% static 'css/bootstrap-datetimepicker.min.css' %}" media="screen" rel="stylesheet"> | ||||
{% endblock %} | ||||
|
r172 | {% block operation-active %}active{% endblock %} | ||
|
r50 | |||
{% block content %} | ||||
|
r172 | {% bootstrap_form form layout='horizontal' size='medium' %} | ||
<div style="clear: both;"></div> | ||||
|
r73 | |||
|
r172 | {% if campaign %} | ||
|
r74 | |||
|
r138 | <div class="clearfix"></div> | ||
<h2>Radar Systems</h2> | ||||
<br> | ||||
|
r50 | <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" > | ||
|
r172 | |||
|
r53 | {% for location in locations %} | ||
|
r172 | |||
|
r50 | <div class="panel panel-default"> | ||
<div class="panel-heading" role="tab" id="headingTwo"> | ||||
<h4 class="panel-title"> | ||||
|
r172 | |||
|
r53 | <a class="collapsed" role="button" data-toggle="collapse" href="#collapseTwo-{{ location.id }}" aria-expanded="false" aria-controls="collapseTwo"> | ||
|
r172 | {{location.name}} | ||
|
r52 | <span> | ||
</span> | ||||
|
r50 | </a> | ||
|
r172 | |||
|
r83 | <button type="button" name="bt_play" class="btn btn-primary pull-right btn-xs" data-url="{% url 'url_radar_play' campaign.id location.id %}" style="margin-left: 10px"> | ||
|
r52 | <span class="glyphicon glyphicon-play" aria-hidden="true"></span> | ||
</button> | ||||
|
r83 | <button type="button" name="bt_stop" class="btn btn-primary pull-right btn-xs" data-url="{% url 'url_radar_stop' campaign.id location.id %}" aria-label="Left Align" style="margin-left: 10px"> | ||
|
r52 | <span class="glyphicon glyphicon-stop" aria-hidden="true"></span> | ||
</button> | ||||
|
r88 | <button type="button" name="bt_refresh" class="btn btn-primary pull-right btn-xs" data-url="{% url 'url_radar_refresh' campaign.id location.id %}" aria-label="Left Align" style="margin-left: 10px"> | ||
|
r87 | <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> | ||
</button> | ||||
|
r50 | </h4> | ||
</div> | ||||
|
r172 | |||
|
r56 | <div id="collapseTwo-{{ location.id }}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingTwo"> | ||
|
r50 | <div class="panel-body"> | ||
<table class="table table-hover"> | ||||
<tr> | ||||
|
r62 | <th>#</th> | ||
|
r50 | {% for header in experiment_keys %} | ||
<th>{{ header|title }}</th> | ||||
{% endfor%} | ||||
</tr> | ||||
|
r172 | |||
{% for item in location.experiments %} | ||||
|
r62 | {% if location.name in item.location.name %} | ||
<tr class="clickable-row" data-href="{% url 'url_experiment' item.id %}" > | ||||
<td>{{ forloop.counter }}</td> | ||||
|
r53 | {% for key in experiment_keys %} | ||
|
r175 | {% if 'name' in key %} | ||
<td class="col-md-5">{{ item|value:key }}</td> | ||||
{% elif 'status' in key %} | ||||
|
r83 | <td class="text-{{item.status_color}}">{{ item|value:key }}</td> | ||
{% else %} | ||||
<td>{{ item|value:key }}</td> | ||||
{% endif %} | ||||
|
r82 | {% endfor %} | ||
|
r53 | </tr> | ||
|
r62 | {% endif %} | ||
|
r50 | {% endfor %} | ||
|
r172 | </table> | ||
|
r50 | </div> | ||
</div> | ||||
</div> | ||||
{% endfor %} | ||||
</div> | ||||
|
r172 | {% endif %} | ||
|
r71 | |||
|
r50 | {% endblock %} | ||
{% block extra-js%} | ||||
<script type="text/javascript"> | ||||
|
r172 | |||
//--------For PLAY Button------- | ||||
|
r83 | $("#accordion").on("click", "button[name=bt_play]", function(){ | ||
//alert($(this).data('url')); | ||||
document.location = $(this).data('url'); | ||||
}); | ||||
|
r172 | |||
//--------For STOP Button------- | ||||
|
r83 | $("#accordion").on("click", "button[name=bt_stop]", function(){ | ||
//alert($(this).data('url')); | ||||
document.location = $(this).data('url'); | ||||
}); | ||||
|
r172 | |||
//--------For REFRESH Button------- | ||||
|
r88 | $("#accordion").on("click", "button[name=bt_refresh]", function(){ | ||
document.location = $(this).data('url'); | ||||
}); | ||||
|
r172 | |||
|
r50 | $(".clickable-row").click(function() { | ||
document.location = $(this).data("href"); | ||||
}); | ||||
|
r172 | |||
|
r69 | {% if search_button == True %} | ||
|
r50 | $(document).ready(function() { | ||
$("#id_campaign").change(function() { | ||||
var id_camp = document.getElementById("id_campaign").value; | ||||
//alert(id_camp); | ||||
document.location = "{% url 'url_operation'%}"+String(id_camp); | ||||
}); | ||||
}); | ||||
|
r69 | {% else %} | ||
$(document).ready(function() { | ||||
|
r172 | $("#id_campaign").change(function() { | ||
document.location = "{% url 'url_operation'%}"+$(this).val(); | ||||
|
r69 | }); | ||
}); | ||||
{% endif %} | ||||
|
r172 | |||
|
r50 | </script> | ||
|
r172 | {% endblock %} | ||