root / templates / edumanage / services.html @ 138dad8b
History | View | Annotate | Download (6.3 kB)
1 | b778f19c | Leonidas Poulopoulos | {% extends "edumanage/welcome.html"%} |
---|---|---|---|
2 | 25028c1d | Leonidas Poulopoulos | {% load i18n %} |
3 | af9d484b | Leonidas Poulopoulos | {% block crumbs %} |
4 | 25028c1d | Leonidas Poulopoulos | <li><a href="{% url manage %}">{% trans "Home" %}</a><span class="divider">/</span></li> |
5 | 25028c1d | Leonidas Poulopoulos | <li class="active">{% trans "Services" %}</li> |
6 | af9d484b | Leonidas Poulopoulos | {% endblock %} |
7 | b1e7b4ee | Leonidas Poulopoulos | {% load i18n %} |
8 | b1e7b4ee | Leonidas Poulopoulos | {% block extrahead %} |
9 | b1e7b4ee | Leonidas Poulopoulos | <script type="text/javascript" src="/static/js/jquery.dataTables.min.js"></script> |
10 | b1e7b4ee | Leonidas Poulopoulos | <script type="text/javascript" src="/static/js/datatables_bootstrap.js"></script> |
11 | b1e7b4ee | Leonidas Poulopoulos | <script type="text/javascript"> |
12 | b1e7b4ee | Leonidas Poulopoulos | $(document).ready(function(){
|
13 | b1e7b4ee | Leonidas Poulopoulos | {% if services %}
|
14 | b1e7b4ee | Leonidas Poulopoulos | var oTable = $('#table').dataTable({
|
15 | b1e7b4ee | Leonidas Poulopoulos | "sPaginationType": "bootstrap",
|
16 | b1e7b4ee | Leonidas Poulopoulos | "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
17 | b1e7b4ee | Leonidas Poulopoulos | "aoColumns": [{
|
18 | b1e7b4ee | Leonidas Poulopoulos | "bSearchable": true,
|
19 | b1e7b4ee | Leonidas Poulopoulos | "bSortable": true
|
20 | b1e7b4ee | Leonidas Poulopoulos | }, {
|
21 | b1e7b4ee | Leonidas Poulopoulos | "bSearchable": true,
|
22 | b1e7b4ee | Leonidas Poulopoulos | "bSortable": true
|
23 | b1e7b4ee | Leonidas Poulopoulos | }, {
|
24 | b1e7b4ee | Leonidas Poulopoulos | "bSearchable": true,
|
25 | b1e7b4ee | Leonidas Poulopoulos | "bSortable": true
|
26 | b1e7b4ee | Leonidas Poulopoulos | }, {
|
27 | b1e7b4ee | Leonidas Poulopoulos | "bSearchable": true,
|
28 | b1e7b4ee | Leonidas Poulopoulos | "bSortable": true
|
29 | b1e7b4ee | Leonidas Poulopoulos | }, {
|
30 | b1e7b4ee | Leonidas Poulopoulos | "bSearchable": true,
|
31 | b1e7b4ee | Leonidas Poulopoulos | "bSortable": true
|
32 | b1e7b4ee | Leonidas Poulopoulos | }, {
|
33 | b1e7b4ee | Leonidas Poulopoulos | "bVisible": true,
|
34 | b1e7b4ee | Leonidas Poulopoulos | "bSearchable": false,
|
35 | b1e7b4ee | Leonidas Poulopoulos | "bSortable": false
|
36 | b1e7b4ee | Leonidas Poulopoulos | }],
|
37 | b1e7b4ee | Leonidas Poulopoulos | "aaSorting": [[0, 'desc']],
|
38 | b1e7b4ee | Leonidas Poulopoulos | "iDisplayLength": 25,
|
39 | b1e7b4ee | Leonidas Poulopoulos | "oSearch": {"bSmart": false, "bRegex":true},
|
40 | b1e7b4ee | Leonidas Poulopoulos | "oLanguage": {
|
41 | b1e7b4ee | Leonidas Poulopoulos | "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "services" %}',
|
42 | b1e7b4ee | Leonidas Poulopoulos | "sProcessing": "Processing...",
|
43 | b1e7b4ee | Leonidas Poulopoulos | "sZeroRecords": '{% trans "No records to display" %}',
|
44 | b1e7b4ee | Leonidas Poulopoulos | "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
|
45 | b1e7b4ee | Leonidas Poulopoulos | "sInfoEmpty": "{% trans "Showing 0 to 0 of 0 entries" %}",
|
46 | b1e7b4ee | Leonidas Poulopoulos | "sInfoFiltered": "(filtered from _MAX_ total entries)",
|
47 | b1e7b4ee | Leonidas Poulopoulos | "sInfoPostFix": "",
|
48 | b1e7b4ee | Leonidas Poulopoulos | "sSearch": '{% trans "Search:" %}',
|
49 | b1e7b4ee | Leonidas Poulopoulos | "sUrl": "",
|
50 | b1e7b4ee | Leonidas Poulopoulos | "oPaginate": {
|
51 | b1e7b4ee | Leonidas Poulopoulos | "sFirst": '{% trans "First" %}',
|
52 | b1e7b4ee | Leonidas Poulopoulos | "sPrevious": '{% trans "Previous" %}',
|
53 | b1e7b4ee | Leonidas Poulopoulos | "sNext": '{% trans "Next" %}',
|
54 | b1e7b4ee | Leonidas Poulopoulos | "sLast": '{% trans "Last" %}'
|
55 | b1e7b4ee | Leonidas Poulopoulos | }
|
56 | b1e7b4ee | Leonidas Poulopoulos | }
|
57 | b1e7b4ee | Leonidas Poulopoulos | });
|
58 | f60df981 | Leonidas Poulopoulos | |
59 | b1e7b4ee | Leonidas Poulopoulos | oTable.fnDraw();
|
60 | 2398cbad | Leonidas Poulopoulos | $('[id^=del_service_]').click(function(){
|
61 | 2398cbad | Leonidas Poulopoulos | server_id = (this.id).replace("del_service_", '');
|
62 | 2398cbad | Leonidas Poulopoulos | name = this.getAttribute("data-servicename");
|
63 | 25028c1d | Leonidas Poulopoulos | $("#mymodalbody").html("{% trans 'You are about to delete service' %}: <b>"+name+"</b><br>{% trans 'Press Delete to proceed or Cancel to cancel deletion' %}");
|
64 | 25028c1d | Leonidas Poulopoulos | $("#myModalLabel").html("{% trans 'Delete Service' %} "+name);
|
65 | 2398cbad | Leonidas Poulopoulos | $('#myModal').modal('show');
|
66 | 2398cbad | Leonidas Poulopoulos | $(".modal-footer").show();
|
67 | 2398cbad | Leonidas Poulopoulos | $("#service_name_del").html(name)
|
68 | 2398cbad | Leonidas Poulopoulos | return false;
|
69 | 2398cbad | Leonidas Poulopoulos | });
|
70 | b1e7b4ee | Leonidas Poulopoulos | |
71 | 2398cbad | Leonidas Poulopoulos | $("#delserviceSubmit").click(function(){
|
72 | 2398cbad | Leonidas Poulopoulos | $.ajax({
|
73 | 2398cbad | Leonidas Poulopoulos | url:"{% url del-service %}/?service_pk="+server_id,
|
74 | 2398cbad | Leonidas Poulopoulos | type: "GET",
|
75 | 2398cbad | Leonidas Poulopoulos | success: function(data){
|
76 | 2398cbad | Leonidas Poulopoulos | if (data.error){
|
77 | 2398cbad | Leonidas Poulopoulos | $(".modal-footer").hide();
|
78 | 2398cbad | Leonidas Poulopoulos | $("#mymodalbody").html("<font style='color:#B94A48'>"+data.error+"</font>");
|
79 | 2398cbad | Leonidas Poulopoulos | }
|
80 | 2398cbad | Leonidas Poulopoulos | if (data.success){
|
81 | 2398cbad | Leonidas Poulopoulos | $(".modal-footer").hide();
|
82 | 25028c1d | Leonidas Poulopoulos | $("#mymodalbody").html("{% trans 'Service' %} "+name+" {% trans 'successfully deleted' %}");
|
83 | 2398cbad | Leonidas Poulopoulos | window.setTimeout('location.reload()', 1000);
|
84 | 2398cbad | Leonidas Poulopoulos |
|
85 | 2398cbad | Leonidas Poulopoulos | }
|
86 | 2398cbad | Leonidas Poulopoulos | }
|
87 | 2398cbad | Leonidas Poulopoulos | });
|
88 | 2398cbad | Leonidas Poulopoulos | });
|
89 | b1e7b4ee | Leonidas Poulopoulos | {% endif %}
|
90 | b1e7b4ee | Leonidas Poulopoulos | });
|
91 | b1e7b4ee | Leonidas Poulopoulos | </script>
|
92 | b1e7b4ee | Leonidas Poulopoulos | {% endblock %} |
93 | b778f19c | Leonidas Poulopoulos | {% block homeactive %}{% endblock %} |
94 | b778f19c | Leonidas Poulopoulos | {% block servicesactive %}class="active"{% endblock %} |
95 | b778f19c | Leonidas Poulopoulos | {% block subcontent %} |
96 | cb8f049b | Leonidas Poulopoulos | <h4>{% trans "Services" %}</h4> |
97 | af9d484b | Leonidas Poulopoulos | <hr>
|
98 | 8e13bb07 | Leonidas Poulopoulos | {% if messages %} |
99 | 8e13bb07 | Leonidas Poulopoulos | <table class="table table-condensed"> |
100 | 8e13bb07 | Leonidas Poulopoulos | |
101 | 8e13bb07 | Leonidas Poulopoulos | {% for message in messages %} |
102 | 8e13bb07 | Leonidas Poulopoulos | <tr {% if %} class="{{ message.tags }}"{% endif %}><td>{{ message }}<td></tr> |
103 | 8e13bb07 | Leonidas Poulopoulos | {% endfor %} |
104 | 8e13bb07 | Leonidas Poulopoulos | </table>
|
105 | 8e13bb07 | Leonidas Poulopoulos | {% endif %} |
106 | 212ce199 | Leonidas Poulopoulos | <div>{% if institution.ertype == 2 or institution.ertype == 3 %}<a href="{% url edit-services %}" class="btn btn-primary">{% trans "Add new service" %}</a>{% endif %}</div> |
107 | b1e7b4ee | Leonidas Poulopoulos | <div class="span10"></div> |
108 | f60df981 | Leonidas Poulopoulos | {% load tolocale %} |
109 | 212ce199 | Leonidas Poulopoulos | {% if institution.ertype == 2 or institution.ertype == 3 %} |
110 | f60df981 | Leonidas Poulopoulos | {% if services %} |
111 | b1e7b4ee | Leonidas Poulopoulos | <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table"> |
112 | b778f19c | Leonidas Poulopoulos | <thead>
|
113 | b778f19c | Leonidas Poulopoulos | <tr>
|
114 | 25028c1d | Leonidas Poulopoulos | <th>{% trans "Name" %}</th> |
115 | 25028c1d | Leonidas Poulopoulos | <th>{% trans "Address" %}</th> |
116 | 25028c1d | Leonidas Poulopoulos | <th>{% trans "SSID" %}</th> |
117 | 25028c1d | Leonidas Poulopoulos | <th>{% trans "Encryption Level" %}</th> |
118 | 25028c1d | Leonidas Poulopoulos | <th>{% trans "AP no" %}</th> |
119 | 25028c1d | Leonidas Poulopoulos | <th>{% trans "Actions" %}</th> |
120 | b778f19c | Leonidas Poulopoulos | </tr>
|
121 | b778f19c | Leonidas Poulopoulos | </thead>
|
122 | b778f19c | Leonidas Poulopoulos | <tbody>
|
123 | b778f19c | Leonidas Poulopoulos | {% for service in services %} |
124 | b1e7b4ee | Leonidas Poulopoulos | <tr class="GradeC"> |
125 | c01b785c | Leonidas Poulopoulos | <td><a href="{% url services service.pk %}">{% tolocale service LANGUAGE_CODE %}</a></td> |
126 | b1e7b4ee | Leonidas Poulopoulos | <td>{{service.address_street}}<br>{{service.address_city}}</td> |
127 | b1e7b4ee | Leonidas Poulopoulos | <td>{{service.SSID}}</td> |
128 | 138dad8b | Leonidas Poulopoulos | <td>{% for enc in service.enc_level %}{{enc}}{% if not forloop.last%},{% endif %}{% endfor %}</td> |
129 | b1e7b4ee | Leonidas Poulopoulos | <td>{{service.AP_no}}</td> |
130 | 25028c1d | Leonidas Poulopoulos | <td style="text-align: center;"><a href="{% url edit-services service.pk %}" class="btn btn-small">{% trans "edit" %}</a> <a href="#" id="del_service_{{service.pk}}" data-servicename="{% tolocale service LANGUAGE_CODE%}" class="btn btn-small btn-warning">{% trans "delete" %}</a></td> |
131 | b778f19c | Leonidas Poulopoulos | </tr>
|
132 | b778f19c | Leonidas Poulopoulos | {% endfor %} |
133 | b778f19c | Leonidas Poulopoulos | </tbody>
|
134 | b778f19c | Leonidas Poulopoulos | </table>
|
135 | 8e13bb07 | Leonidas Poulopoulos | {% endif %} |
136 | f60df981 | Leonidas Poulopoulos | {% endif %} |
137 | 2398cbad | Leonidas Poulopoulos | <div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
138 | 2398cbad | Leonidas Poulopoulos | <div class="modal-header"> |
139 | 2398cbad | Leonidas Poulopoulos | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
140 | 2398cbad | Leonidas Poulopoulos | <h3 id="myModalLabel">Delete Service</h3> |
141 | 2398cbad | Leonidas Poulopoulos | </div>
|
142 | 2398cbad | Leonidas Poulopoulos | <div class="modal-body" id="mymodalbody"> |
143 | b1e7b4ee | Leonidas Poulopoulos | |
144 | 2398cbad | Leonidas Poulopoulos | </div>
|
145 | 2398cbad | Leonidas Poulopoulos | <div class="modal-footer"> |
146 | 25028c1d | Leonidas Poulopoulos | <button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Cancel" %}</button> |
147 | 25028c1d | Leonidas Poulopoulos | <a class="btn btn-warning" id="delserviceSubmit" href="#">{% trans "Delete" %}</a> |
148 | 2398cbad | Leonidas Poulopoulos | </div>
|
149 | 2398cbad | Leonidas Poulopoulos | </div>
|
150 | c01b785c | Leonidas Poulopoulos | |
151 | c01b785c | Leonidas Poulopoulos | <div class="modal hide fade" id="servDets" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
152 | c01b785c | Leonidas Poulopoulos | <div class="modal-header"> |
153 | c01b785c | Leonidas Poulopoulos | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
154 | 25028c1d | Leonidas Poulopoulos | <h3 id="myModalLabelservdets">{% trans "Service Details" %}</h3> |
155 | c01b785c | Leonidas Poulopoulos | </div>
|
156 | c01b785c | Leonidas Poulopoulos | <div class="modal-body" id="servDetsbody"> |
157 | c01b785c | Leonidas Poulopoulos | |
158 | c01b785c | Leonidas Poulopoulos | </div>
|
159 | c01b785c | Leonidas Poulopoulos | <div class="modal-footer"> |
160 | 25028c1d | Leonidas Poulopoulos | <button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Close" %}</button> |
161 | c01b785c | Leonidas Poulopoulos | </div>
|
162 | c01b785c | Leonidas Poulopoulos | </div>
|
163 | b778f19c | Leonidas Poulopoulos | {% endblock %} |