@@ -1,105 +1,122 | |||||
1 | {% extends "base.html" %} |
|
1 | {% extends "base.html" %} | |
2 | {% load bootstrap3 %} |
|
2 | {% load bootstrap3 %} | |
3 | {% load static %} |
|
3 | {% load static %} | |
4 | {% load main_tags %} |
|
4 | {% load main_tags %} | |
5 | {% block extra-head %} |
|
5 | {% block extra-head %} | |
6 | <link href="{% static 'css/bootstrap-datetimepicker.min.css' %}" media="screen" rel="stylesheet"> |
|
6 | <link href="{% static 'css/bootstrap-datetimepicker.min.css' %}" media="screen" rel="stylesheet"> | |
7 | {% endblock %} |
|
7 | {% endblock %} | |
8 |
|
8 | |||
9 | {% block camp-active %}active{% endblock %} |
|
9 | {% block camp-active %}active{% endblock %} | |
10 |
|
10 | |||
11 | {% block content-title %}{{title}}{% endblock %} |
|
11 | {% block content-title %}{{title}}{% endblock %} | |
12 | {% block content-suptitle %}{{suptitle}}{% endblock %} |
|
12 | {% block content-suptitle %}{{suptitle}}{% endblock %} | |
13 |
|
13 | |||
14 | {% block content %} |
|
14 | {% block content %} | |
15 |
|
15 | |||
16 | <form class="form" method="post" action=""> |
|
16 | <form class="form" method="post" action=""> | |
17 | {% csrf_token %} |
|
17 | {% csrf_token %} | |
18 | {% bootstrap_form form layout='horizontal' size='medium' %} |
|
18 | {% bootstrap_form form layout='horizontal' size='medium' %} | |
19 | <div style="clear: both;"></div> |
|
19 | <div style="clear: both;"></div> | |
20 | <br> |
|
20 | <br> | |
21 |
<button type=" |
|
21 | <button id="button-1" type="button" class="btn btn-primary pull-right">{{button}}</button> | |
22 | <br> |
|
22 | <br> | |
23 | <br> |
|
23 | <br> | |
24 | </form> |
|
24 | </form> | |
25 | <br> |
|
25 | <br> | |
26 | <br> |
|
26 | <br> | |
27 |
|
27 | |||
28 | <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" > |
|
28 | <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" > | |
29 |
|
29 | |||
30 | {% for location in locations %} |
|
30 | {% for location in locations %} | |
31 |
|
31 | |||
32 | <div class="panel panel-default"> |
|
32 | <div class="panel panel-default"> | |
33 | <div class="panel-heading" role="tab" id="headingTwo"> |
|
33 | <div class="panel-heading" role="tab" id="headingTwo"> | |
34 | <h4 class="panel-title"> |
|
34 | <h4 class="panel-title"> | |
35 | <a class="collapsed" role="button" data-toggle="collapse" href="#collapseTwo-{{ location.id }}" aria-expanded="false" aria-controls="collapseTwo"> |
|
35 | <a class="collapsed" role="button" data-toggle="collapse" href="#collapseTwo-{{ location.id }}" aria-expanded="false" aria-controls="collapseTwo"> | |
36 | {{location.name}}: Experiment List |
|
36 | {{location.name}}: Experiment List | |
37 | <span> |
|
37 | <span> | |
38 | </span> |
|
38 | </span> | |
39 | </a> |
|
39 | </a> | |
40 | <button type="button" class="btn btn-primary pull-right btn-xs" aria-label="Left Align" style="margin-left: 10px"> |
|
40 | <button id="play-{{ location.id }}" type="button" class="btn btn-primary pull-right btn-xs" aria-label="Left Align" style="margin-left: 10px"> | |
41 | <span class="glyphicon glyphicon-play" aria-hidden="true"></span> |
|
41 | <span class="glyphicon glyphicon-play" aria-hidden="true"></span> | |
42 | </button> |
|
42 | </button> | |
43 | <button type="button" class="btn btn-primary pull-right btn-xs" aria-label="Left Align" style="margin-left: 10px"> |
|
43 | <button id="stop-{{ location.id }}" type="button" class="btn btn-primary pull-right btn-xs" aria-label="Left Align" style="margin-left: 10px"> | |
44 | <span class="glyphicon glyphicon-stop" aria-hidden="true"></span> |
|
44 | <span class="glyphicon glyphicon-stop" aria-hidden="true"></span> | |
45 | </button> |
|
45 | </button> | |
46 |
|
46 | |||
47 | </h4> |
|
47 | </h4> | |
48 | </div> |
|
48 | </div> | |
49 |
|
49 | |||
50 | <div id="collapseTwo-{{ location.id }}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingTwo"> |
|
50 | <div id="collapseTwo-{{ location.id }}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingTwo"> | |
51 | <div class="panel-body"> |
|
51 | <div class="panel-body"> | |
52 | <table class="table table-hover"> |
|
52 | <table class="table table-hover"> | |
53 | <tr> |
|
53 | <tr> | |
54 |
|
54 | <th>#</th> | ||
55 | {% for header in experiment_keys %} |
|
55 | {% for header in experiment_keys %} | |
56 | <th>{{ header|title }}</th> |
|
56 | <th>{{ header|title }}</th> | |
57 | {% endfor%} |
|
57 | {% endfor%} | |
58 | </tr> |
|
58 | </tr> | |
59 |
|
59 | |||
60 | {% for item in experiments %} |
|
60 | {% for item in experiments %} | |
61 | {% for exs in item %} |
|
61 | {% if location.name in item.location.name %} | |
62 | <tr class="clickable-row" data-href="{% url 'url_experiment' exs.id %}" > |
|
|||
63 |
|
|
62 | ||
|
63 | <tr class="clickable-row" data-href="{% url 'url_experiment' item.id %}" > | |||
|
64 | <td>{{ forloop.counter }}</td> | |||
64 | {% for key in experiment_keys %} |
|
65 | {% for key in experiment_keys %} | |
65 | {% if location.name in exs.location.name %} |
|
66 | <td>{{ item|value:key }}</td> | |
66 | <td>{{ exs|value:key }}</td> |
|
|||
67 | {% endif %} |
|
|||
68 | {% endfor %} |
|
|||
69 | {% endfor %} |
|
67 | {% endfor %} | |
70 | </tr> |
|
68 | </tr> | |
|
69 | {% endif %} | |||
71 | {% endfor %} |
|
70 | {% endfor %} | |
72 | </table> |
|
71 | </table> | |
73 | </div> |
|
72 | </div> | |
74 | </div> |
|
73 | </div> | |
75 | </div> |
|
74 | </div> | |
76 | {% endfor %} |
|
75 | {% endfor %} | |
77 | </div> |
|
76 | </div> | |
78 |
|
77 | |||
79 | {% endblock %} |
|
78 | {% endblock %} | |
80 |
|
79 | |||
81 |
|
80 | |||
82 |
|
81 | |||
83 | {% block extra-js%} |
|
82 | {% block extra-js%} | |
84 | <script type="text/javascript"> |
|
83 | <script type="text/javascript"> | |
|
84 | //for (i = 0; i < locations.length; i++) { | |||
|
85 | // text += cars[i] + "<br>"; | |||
|
86 | //} | |||
|
87 | //------For PLAY Button------- | |||
|
88 | {% for location in locations %} | |||
|
89 | $("#play-{{ location.id }}").click(function() { | |||
|
90 | //alert("Play-{{location}}"); | |||
|
91 | var id_loc = {{location.id}} | |||
|
92 | //document.location = | |||
|
93 | }); | |||
|
94 | {% endfor %} | |||
85 |
|
95 | |||
86 | //$("#bt_add").click(function() { |
|
96 | //--------For STOP Button------- | |
87 | //alert("sometext"); |
|
97 | {% for location in locations %} | |
|
98 | $("#stop-{{ location.id }}").click(function() { | |||
|
99 | alert("Stop-{{location}}"); | |||
88 | // document.location = "{% url 'url_operation' campaign.id %}"; |
|
100 | // document.location = "{% url 'url_operation' campaign.id %}"; | |
89 |
|
|
101 | }); | |
|
102 | {% endfor %} | |||
90 |
|
|
103 | ||
91 | $(".clickable-row").click(function() { |
|
104 | $(".clickable-row").click(function() { | |
92 | document.location = $(this).data("href"); |
|
105 | document.location = $(this).data("href"); | |
93 | }); |
|
106 | }); | |
94 |
|
107 | |||
95 | $(document).ready(function() { |
|
108 | $(document).ready(function() { | |
96 | $("#id_campaign").change(function() { |
|
109 | $("#id_campaign").change(function() { | |
97 | var id_camp = document.getElementById("id_campaign").value; |
|
110 | var id_camp = document.getElementById("id_campaign").value; | |
98 | //alert(id_camp); |
|
111 | //alert(id_camp); | |
99 | document.location = "{% url 'url_operation'%}"+String(id_camp); |
|
112 | document.location = "{% url 'url_operation'%}"+String(id_camp); | |
100 | }); |
|
113 | }); | |
101 | }); |
|
114 | }); | |
102 |
|
115 | |||
|
116 | $("#button-1").click(function() { | |||
|
117 | document.location = "{% url 'url_operation_search' %}"; | |||
|
118 | }); | |||
|
119 | ||||
103 |
|
120 | |||
104 | </script> |
|
121 | </script> | |
105 | {% endblock %} No newline at end of file |
|
122 | {% endblock %} |
General Comments 0
You need to be logged in to leave comments.
Login now