operation.html
148 lines
| 4.6 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 %} | |||
{% block camp-active %}active{% endblock %} | |||
{% block content-title %}{{title}}{% endblock %} | |||
{% block content-suptitle %}{{suptitle}}{% endblock %} | |||
{% block content %} | |||
|
r78 | <!-- Not Empty--> | |
{% if details %} | |||
|
r73 | ||
|
r50 | <form class="form" method="post" action=""> | |
{% csrf_token %} | |||
|
r74 | ||
|
r50 | {% bootstrap_form form layout='horizontal' size='medium' %} | |
<div style="clear: both;"></div> | |||
<br> | |||
|
r69 | <!-- For deep search --> | |
{% if search_button == True %} | |||
|
r62 | <button id="button-1" type="button" class="btn btn-primary pull-right">{{button}}</button> | |
|
r69 | {% endif %} | |
|
r50 | <br> | |
<br> | |||
</form> | |||
<br> | |||
|
r53 | <br> | |
|
r50 | ||
|
r74 | {% endif %} | |
|
r71 | ||
|
r50 | <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" > | |
|
r53 | {% for location in locations %} | |
|
r50 | ||
<div class="panel panel-default"> | |||
<div class="panel-heading" role="tab" id="headingTwo"> | |||
<h4 class="panel-title"> | |||
|
r83 | ||
|
r53 | <a class="collapsed" role="button" data-toggle="collapse" href="#collapseTwo-{{ location.id }}" aria-expanded="false" aria-controls="collapseTwo"> | |
{{location.name}}: Experiment List | |||
|
r52 | <span> | |
</span> | |||
|
r50 | </a> | |
|
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> | |||
|
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> | |||
|
r62 | ||
|
r50 | {% for item in 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 %} | |
|
r83 | {% if 'status' in key %} | |
<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 %} | |
</table> | |||
</div> | |||
</div> | |||
</div> | |||
{% endfor %} | |||
</div> | |||
|
r74 | ||
|
r71 | ||
|
r50 | {% endblock %} | |
{% block extra-js%} | |||
<script type="text/javascript"> | |||
|
r83 | ||
//--------For PLAY Button------- | |||
$("#accordion").on("click", "button[name=bt_play]", function(){ | |||
//alert($(this).data('url')); | |||
document.location = $(this).data('url'); | |||
}); | |||
//--------For STOP Button------- | |||
$("#accordion").on("click", "button[name=bt_stop]", function(){ | |||
//alert($(this).data('url')); | |||
document.location = $(this).data('url'); | |||
}); | |||
|
r88 | ||
//--------For REFRESH Button------- | |||
$("#accordion").on("click", "button[name=bt_refresh]", function(){ | |||
document.location = $(this).data('url'); | |||
}); | |||
|
r50 | ||
$(".clickable-row").click(function() { | |||
document.location = $(this).data("href"); | |||
}); | |||
|
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() { | |||
$("#id_campaign").change(function() { | |||
var id_camp = document.getElementById("id_campaign").value; | |||
//alert(id_camp); | |||
document.location = "{% url 'url_operation_search'%}"+String(id_camp); | |||
}); | |||
}); | |||
{% endif %} | |||
|
r50 | ||
|
r62 | $("#button-1").click(function() { | |
document.location = "{% url 'url_operation_search' %}"; | |||
}); | |||
|
r50 | ||
</script> | |||
{% endblock %} |