@@ -27,8 +27,6 def configurate_frequencies(request, id=0): | |||||
27 | 'device': device, |
|
27 | 'device': device, | |
28 | 'devices':devices, |
|
28 | 'devices':devices, | |
29 | 'title': ('YAP'), |
|
29 | 'title': ('YAP'), | |
30 | 'experiment': conf.experiment, |
|
|||
31 |
|
||||
32 | } |
|
30 | } | |
33 |
|
31 | |||
34 | data['dev_conf'] = conf |
|
32 | data['dev_conf'] = conf |
@@ -22,6 +22,7 def jars_config(request, id): | |||||
22 | kwargs = { |
|
22 | kwargs = { | |
23 | 'form': form, |
|
23 | 'form': form, | |
24 | 'devices':devices, |
|
24 | 'devices':devices, | |
|
25 | 'dev_conf': conf | |||
25 | } |
|
26 | } | |
26 |
|
27 | |||
27 | return render_to_response('jars.html', kwargs, context_instance=RequestContext(request)) |
|
28 | return render_to_response('jars.html', kwargs, context_instance=RequestContext(request)) |
@@ -17,29 +17,12 | |||||
17 | <tr><th>{{key|title}}</th><td>{{campaign|attr:key}}</td></tr> |
|
17 | <tr><th>{{key|title}}</th><td>{{campaign|attr:key}}</td></tr> | |
18 | {% endfor %} |
|
18 | {% endfor %} | |
19 | </table> |
|
19 | </table> | |
20 | <hr> |
|
20 | <button class="btn btn-primary pull-right" id="bt_edit_campaign">Edit Campaign</button> | |
|
21 | <br></br> | |||
|
22 | <br></br> | |||
21 |
|
23 | |||
22 | <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> |
|
24 | <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> | |
23 | <div class="panel panel-default"> |
|
25 | ||
24 | <div class="panel-heading" role="tab" id="headingOne"> |
|
|||
25 | <h4 class="panel-title"> |
|
|||
26 | <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> |
|
|||
27 | Edit Campaign Details |
|
|||
28 | </a> |
|
|||
29 | </h4> |
|
|||
30 | </div> |
|
|||
31 | <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne"> |
|
|||
32 | <div class="panel-body"> |
|
|||
33 | <form class="form" method="post" action="{% url 'url_edit_campaign' campaign.id %}"> |
|
|||
34 | {% csrf_token %} |
|
|||
35 | {% bootstrap_form form layout='horizontal' size='medium' %} |
|
|||
36 | <div style="clear: both;"></div> |
|
|||
37 | <br> |
|
|||
38 | <button type="submit" class="btn btn-primary pull-right" id="bt_update">Update</button> |
|
|||
39 | </form> |
|
|||
40 | </div> |
|
|||
41 | </div> |
|
|||
42 | </div> |
|
|||
43 | <div class="panel panel-default"> |
|
26 | <div class="panel panel-default"> | |
44 | <div class="panel-heading" role="tab" id="headingTwo"> |
|
27 | <div class="panel-heading" role="tab" id="headingTwo"> | |
45 | <h4 class="panel-title"> |
|
28 | <h4 class="panel-title"> | |
@@ -84,13 +67,17 | |||||
84 | <script type="text/javascript"> |
|
67 | <script type="text/javascript"> | |
85 | $('.input-group.date').datetimepicker({"format": "YYYY-MM-DD HH:mm"}); |
|
68 | $('.input-group.date').datetimepicker({"format": "YYYY-MM-DD HH:mm"}); | |
86 |
|
69 | |||
87 | $("#bt_add").click(function() { |
|
|||
88 | document.location = "{% url 'url_add_experiment' campaign.id%}"; |
|
|||
89 | }); |
|
|||
90 |
|
||||
91 | $(".clickable-row").click(function() { |
|
70 | $(".clickable-row").click(function() { | |
92 | document.location = $(this).data("href"); |
|
71 | document.location = $(this).data("href"); | |
93 | }); |
|
72 | }); | |
|
73 | ||||
|
74 | $("#bt_edit_campaign").click(function() { | |||
|
75 | document.location = "{% url 'url_edit_campaign' campaign.id%}"; | |||
|
76 | }); | |||
|
77 | ||||
|
78 | $("#bt_add").click(function() { | |||
|
79 | document.location = "{% url 'url_add_experiment' campaign.id%}"; | |||
|
80 | }); | |||
94 |
|
81 | |||
95 | </script> |
|
82 | </script> | |
96 | {% endblock %} No newline at end of file |
|
83 | {% endblock %} |
@@ -2,9 +2,6 | |||||
2 | {% load bootstrap3 %} |
|
2 | {% load bootstrap3 %} | |
3 | {% load static %} |
|
3 | {% load static %} | |
4 | {% load main_tags %} |
|
4 | {% load main_tags %} | |
5 | {% block extra-head %} |
|
|||
6 | <link href="{% static 'css/bootstrap-datetimepicker.min.css' %}" media="screen" rel="stylesheet"> |
|
|||
7 | {% endblock %} |
|
|||
8 |
|
5 | |||
9 | {% block dev-active %}active{% endblock %} |
|
6 | {% block dev-active %}active{% endblock %} | |
10 |
|
7 | |||
@@ -39,8 +36,6 | |||||
39 | <script src="{% static 'js/moment.min.js' %}"></script> |
|
36 | <script src="{% static 'js/moment.min.js' %}"></script> | |
40 | <script src="{% static 'js/bootstrap-datetimepicker.min.js' %}"></script> |
|
37 | <script src="{% static 'js/bootstrap-datetimepicker.min.js' %}"></script> | |
41 | <script type="text/javascript"> |
|
38 | <script type="text/javascript"> | |
42 | $('.input-group.date').datetimepicker({"format": "YYYY-MM-DD HH:mm"}); |
|
|||
43 | $('.input-group.time').datetimepicker({"format": "HH:mm"}); |
|
|||
44 |
|
39 | |||
45 | $("#bt_add").click(function() { |
|
40 | $("#bt_add").click(function() { | |
46 | document.location = "{% url 'url_add_device' %}"; |
|
41 | document.location = "{% url 'url_add_device' %}"; |
@@ -27,7 +27,7 | |||||
27 | <div class="panel-heading" role="tab" id="headingTwo"> |
|
27 | <div class="panel-heading" role="tab" id="headingTwo"> | |
28 | <h4 class="panel-title"> |
|
28 | <h4 class="panel-title"> | |
29 | <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseThree"> |
|
29 | <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseThree"> | |
30 | Experiment's Devices |
|
30 | Device Configurations | |
31 | </a> |
|
31 | </a> | |
32 | </h4> |
|
32 | </h4> | |
33 | </div> |
|
33 | </div> |
@@ -1,23 +1,62 | |||||
1 | {% if experiment %} |
|
1 | {% if experiment %} | |
2 | <div class="panel panel-default"> |
|
2 | <div class="panel panel-default"> | |
3 | <div class="panel-heading"> |
|
3 | <div class="panel-heading"> | |
4 |
<h |
|
4 | <h4>Campaign</h4> | |
5 | </div> |
|
5 | </div> | |
6 | <div class="list-group"> |
|
6 | <div class="list-group"> | |
7 |
<a href="{% url 'url_ |
|
7 | <a href="{% url 'url_campaign' experiment.campaign.id %}" class="list-group-item active" >{{ experiment.campaign.name }}</a> | |
8 | </div> |
|
8 | </div> | |
9 | </div> |
|
9 | </div> | |
|
10 | ||||
|
11 | <div class="panel panel-default"> | |||
|
12 | <div class="panel-heading"> | |||
|
13 | <h4>Experiment</h4> | |||
|
14 | </div> | |||
|
15 | <div class="list-group"> | |||
|
16 | <a href="{% url 'url_experiment' experiment.id %}" class="list-group-item active" >{{ experiment.name }}</a> | |||
|
17 | </div> | |||
|
18 | </div> | |||
|
19 | ||||
|
20 | {% if configurations %} | |||
|
21 | <div class="panel panel-default"> | |||
|
22 | <div class="panel-heading"> | |||
|
23 | <h4>Device Configurations</h4> | |||
|
24 | </div> | |||
|
25 | <div class="list-group"> | |||
|
26 | {% for item in configurations %} | |||
|
27 | <a href="/{{item.device__device_type__name}}/{{item.id}}" class="list-group-item {{item.active}}">{{item.device__name}}</a> | |||
|
28 | {% endfor %} | |||
|
29 | </div> | |||
|
30 | </div> | |||
|
31 | {% endif %} | |||
10 | {% endif %} |
|
32 | {% endif %} | |
11 |
|
33 | |||
12 |
{% if dev |
|
34 | {% if dev_conf %} | |
13 | <div class="panel panel-default"> |
|
35 | <div class="panel panel-default"> | |
14 | <div class="panel-heading"> |
|
36 | <div class="panel-heading"> | |
15 | <h3>Devices</h3> |
|
37 | <h4>Campaign</h4> | |
16 | </div> |
|
38 | </div> | |
17 | <div class="list-group"> |
|
39 | <div class="list-group"> | |
18 | {% for item in devices %} |
|
40 | <a href="{% url 'url_campaign' dev_conf.experiment.campaign.id %}" class="list-group-item active" >{{ dev_conf.experiment.campaign.name }}</a> | |
19 | <a href="/{{item.device_type__name}}/{{item.configuration__id}}/" class="list-group-item {{item.active}}">{{item.device_type__alias}}</a> |
|
41 | </div> | |
20 | {% endfor %} |
|
42 | </div> | |
21 | </div> |
|
43 | ||
22 | </div> |
|
44 | <div class="panel panel-default"> | |
23 | {% endif %} No newline at end of file |
|
45 | <div class="panel-heading"> | |
|
46 | <h4>Experiment</h4> | |||
|
47 | </div> | |||
|
48 | <div class="list-group"> | |||
|
49 | <a href="{% url 'url_experiment' dev_conf.experiment.id %}" class="list-group-item active" >{{ dev_conf.experiment.name }}</a> | |||
|
50 | </div> | |||
|
51 | </div> | |||
|
52 | ||||
|
53 | <div class="panel panel-default"> | |||
|
54 | <div class="panel-heading"> | |||
|
55 | <h4>Device</h4> | |||
|
56 | </div> | |||
|
57 | <div class="list-group"> | |||
|
58 | <a href="{% url 'url_device' dev_conf.device.id %}" class="list-group-item active" >{{ dev_conf.device.name }}</a> | |||
|
59 | </div> | |||
|
60 | </div> | |||
|
61 | ||||
|
62 | {% endif %} |
@@ -217,15 +217,15 def experiments(request): | |||||
217 | def experiment(request, id_exp): |
|
217 | def experiment(request, id_exp): | |
218 |
|
218 | |||
219 | experiment = Experiment.objects.get(pk=id_exp) |
|
219 | experiment = Experiment.objects.get(pk=id_exp) | |
220 | campaign = Campaign.objects.get(pk = experiment.campaign.id) |
|
220 | # campaign = Campaign.objects.get(pk = experiment.campaign.id) | |
221 | configurations = Configuration.objects.filter(experiment=experiment) |
|
221 | configurations = Configuration.objects.filter(experiment=experiment) | |
222 |
|
222 | |||
223 | # form = ExperimentForm(instance=experiment) |
|
223 | # form = ExperimentForm(instance=experiment) | |
224 |
|
224 | |||
225 | kwargs = {} |
|
225 | kwargs = {} | |
226 |
|
226 | |||
227 | kwargs['campaign_keys'] = ['name', 'start_date', 'end_date', 'tags', 'description'] |
|
227 | # kwargs['campaign_keys'] = ['name', 'start_date', 'end_date', 'tags', 'description'] | |
228 | kwargs['campaign'] = campaign |
|
228 | # kwargs['campaign'] = campaign | |
229 |
|
229 | |||
230 | kwargs['experiment_keys'] = ['campaign', 'name', 'start_time', 'end_time'] |
|
230 | kwargs['experiment_keys'] = ['campaign', 'name', 'start_time', 'end_time'] | |
231 | kwargs['experiment'] = experiment |
|
231 | kwargs['experiment'] = experiment | |
@@ -296,7 +296,7 def dev_confs(request): | |||||
296 | kwargs['configuration_keys'] = keys[1:] |
|
296 | kwargs['configuration_keys'] = keys[1:] | |
297 | kwargs['configurations'] = configurations.values(*keys) |
|
297 | kwargs['configurations'] = configurations.values(*keys) | |
298 |
|
298 | |||
299 |
kwargs['title'] = 'Configuration |
|
299 | kwargs['title'] = 'Configuration' | |
300 | kwargs['suptitle'] = 'List' |
|
300 | kwargs['suptitle'] = 'List' | |
301 | kwargs['button'] = 'New Configuration' |
|
301 | kwargs['button'] = 'New Configuration' | |
302 |
|
302 |
General Comments 0
You need to be logged in to leave comments.
Login now