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