commit 1d70dbce75cf158f00431279bc9889fd831980ba
Author: Kroustouris Stauros <staurosk@noc.grnet.gr>
Date:   Thu Jun 25 19:00:05 2015 +0300

    management pages

diff --git a/djnro/templates/edumanage/services.html b/djnro/templates/edumanage/services.html
index e71a40d..d82273b 100644
--- a/djnro/templates/edumanage/services.html
+++ b/djnro/templates/edumanage/services.html
@@ -1,164 +1,187 @@
 {% extends "edumanage/welcome.html"%}
 {% load i18n %}
 {% load staticfiles %}
+{% load tolocale %}
 
-{% block crumbs %}
-<li><a href="{% url manage %}">{% trans "Home" %}</a><span class="divider">/</span></li>
-<li class="active">{% trans "Locations" %}</li>
-{% endblock %}
-{% block extrahead %}
-<script type="text/javascript" src="{% static 'js/jquery.dataTables.min.js' %}"></script>
-<script type="text/javascript" src="{% static 'js/datatables_bootstrap.js' %}"></script>
-<script type="text/javascript">
-$(document).ready(function(){
-	 {% if services %}
-var oTable = $('#table').dataTable({
-	"sPaginationType": "bootstrap",
-	"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
-	"aoColumns": [{
-        "bSearchable": true,
-        "bSortable": true
-    }, {
-        "bSearchable": true,
-        "bSortable": true
-    }, {
-        "bSearchable": true,
-        "bSortable": true
-    }, {
-        "bSearchable": true,
-        "bSortable": true
-    }, {
-        "bSearchable": true,
-        "bSortable": true
-    }, {
-        "bVisible": true,
-        "bSearchable": false,
-        "bSortable": false
-    }],
-    "aaSorting": [[0, 'desc']],
-    "iDisplayLength": 25,
-    "oSearch": {"bSmart": false, "bRegex":true},
-    "oLanguage": {
-    	"sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "locations" %}',
-        "sProcessing":   "Processing...",
-        "sZeroRecords": '{% trans "No records to display" %}',
-        "sInfo":         "Showing _START_ to _END_ of _TOTAL_ entries",
-        "sInfoEmpty":    "{% trans "Showing 0 to 0 of 0 entries" %}",
-        "sInfoFiltered": "(filtered from _MAX_ total entries)",
-        "sInfoPostFix":  "",
-        "sSearch":       '{% trans "Search:" %}',
-        "sUrl":          "",
-        "oPaginate": {
-            "sFirst":    '{% trans "First" %}',
-            "sPrevious": '{% trans "Previous" %}',
-            "sNext":     '{% trans "Next" %}',
-            "sLast":     '{% trans "Last" %}'
-        }
-    }
-});
-
-oTable.fnDraw();
-$('[id^=del_service_]').click(function(){
-	server_id = (this.id).replace("del_service_", '');
-	name = this.getAttribute("data-servicename");
-	$("#mymodalbody").html("{% trans 'You are about to delete location' %}: <b>"+name+"</b><br>{% trans 'Press Delete to proceed or Cancel to cancel deletion' %}");
-	$("#myModalLabel").html("{% trans 'Delete Location' %} "+name);
-	$('#myModal').modal('show');
-	$(".modal-footer").show();
-	$("#service_name_del").html(name)
-	return false;
-});
+{% block homeactive %}{% endblock %}
+{% block servicesactive %}class="active"{% endblock %}
 
-$("#delserviceSubmit").click(function(){
-	$.ajax({
-		url:"{% url del-service %}/?service_pk="+server_id,
-		type: "GET",
-		success: function(data){
-			if (data.error){
-				$(".modal-footer").hide();
-				$("#mymodalbody").html("<font style='color:#B94A48'>"+data.error+"</font>");
-			}
-			if (data.success){
-				$(".modal-footer").hide();
-				$("#mymodalbody").html("{% trans 'Service' %} "+name+" {% trans 'successfully deleted' %}");
-				window.setTimeout('location.reload()', 1000);
-
-			}
-			}
-		});
-});
-{% endif %}
-});
-</script>
+{% block extrahead %}
+<link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">
 {% endblock %}
-			{% block homeactive %}{% endblock %}
-    		{% block servicesactive %}class="active"{% endblock %}
-            {% block subcontent %}
-              <h4>{% trans "Locations" %}</h4>
-              <hr>
-              {% if messages %}
-	                <table class="table table-condensed">
 
-					    {% for message in messages %}
-					    <tr {% if message.tags %} class="{{ message.tags }}"{% endif %}><td>{{ message }}<td></tr>
-					    {% endfor %}
-					</table>
-			  {% endif %}
-              <div>{% if institution.ertype == 2 or institution.ertype == 3 %}<a href="{% url edit-services %}" class="btn btn-primary">{% trans "Add location" %}</a>{% endif %}</div>
-	              <div class="span10"></div>
-              {% load tolocale %}
-              {% if institution.ertype == 2 or institution.ertype == 3 %}
-              {% if services %}
-               <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table">
-	               <thead>
-					<tr>
+{% block management_content %}
+		<h4>{% trans "Locations" %}</h4>
+		<hr>
+		{% if messages %}
+			<table class="table table-condensed">
+			{% for message in messages %}
+				<tr {% if message.tags %} class="{{ message.tags }}"{% endif %}><td>{{ message }}<td></tr>
+			{% endfor %}
+			</table>
+		{% endif %}
+		<div>
+			{% if institution.ertype == 2 or institution.ertype == 3 %}
+				<a href="{% url edit-services %}" class="btn btn-primary">
+					{% trans "Add location" %}
+				</a>
+			{% endif %}
+		</div>
+{% if institution.ertype == 2 or institution.ertype == 3 %}
+	{% if services %}
+		<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table">
+			<thead>
+				<tr>
 					<th>{% trans "Name" %}</th>
 					<th>{% trans "Address" %}</th>
 					<th>{% trans "SSID" %}</th>
 					<th>{% trans "Encryption Level" %}</th>
 					<th>{% trans "AP no" %}</th>
 					<th>{% trans "Actions" %}</th>
-					</tr>
-					</thead>
-					<tbody>
-	                {% for service in services %}
-	              	<tr class="GradeC">
-	                	<td><a href="{% url services service.pk %}">{% tolocale service LANGUAGE_CODE %}</a></td>
-	                	<td>{{service.address_street}}<br>{{service.address_city}}</td>
-	                	<td>{{service.SSID}}</td>
-                        <td>{% for enc in service.enc_level %}{% if enc == '' %}-{% else %}{{enc}}{% if not forloop.last%},{% endif %}{% endif %}{% endfor %}</td>
-	                	<td>{{service.AP_no}}</td>
-	                	<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>
-	                </tr>
-	              	{% endfor %}
-	              	</tbody>
-	              </table>
-	              {% endif %}
-              {% endif %}
-<div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
-<div class="modal-header">
-<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
-<h3 id="myModalLabel">{% trans "Delete Location" %}</h3>
-</div>
-<div class="modal-body" id="mymodalbody">
+				</tr>
+			</thead>
+			<tbody>
+			{% for service in services %}
+		    	<tr class="GradeC">
+		        	<td><a href="{% url services service.pk %}">{% tolocale service LANGUAGE_CODE %}</a></td>
+		        	<td>{{service.address_street}}<br>{{service.address_city}}</td>
+		        	<td>{{service.SSID}}</td>
+		            <td>{% for enc in service.enc_level %}{% if enc == '' %}-{% else %}{{enc}}{% if not forloop.last%},{% endif %}{% endif %}{% endfor %}</td>
+		        	<td>{{service.AP_no}}</td>
+		        	<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>
+		        </tr>
+			{% endfor %}
+			</tbody>
+		</table>
+	    {% endif %}
+	{% endif %}
 
-</div>
-<div class="modal-footer">
-<button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Cancel" %}</button>
-<a class="btn btn-warning" id="delserviceSubmit" href="#">{% trans "Delete" %}</a>
-</div>
+<div class="modal" id="myModal">
+	<div class="modal-dialog">
+    	<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+				<h3 id="myModalLabel">{% trans "Delete Location" %}</h3>
+			</div>
+			<div class="modal-body" id="mymodalbody">
+			</div>
+			<div class="modal-footer">
+			<button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Cancel" %}</button>
+			<a class="btn btn-warning" id="delserviceSubmit" href="#">{% trans "Delete" %}</a>
+			</div>
+		</div>
+	</div>
 </div>
 
-<div class="modal hide fade" id="servDets" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
-<div class="modal-header">
-<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
-<h3 id="myModalLabelservdets">{% trans "Location Details" %}</h3>
+<div class="modal" id="servDets">
+	<div class="modal-dialog">
+    	<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+				<h3 id="myModalLabelservdets">{% trans "Location Details" %}</h3>
+			</div>
+			<div class="modal-body" id="servDetsbody">
+			</div>
+			<div class="modal-footer">
+				<button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Close" %}</button>
+			</div>
+		</div>
+	</div>
 </div>
-<div class="modal-body" id="servDetsbody">
+{% endblock %}
 
-</div>
-<div class="modal-footer">
-<button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Close" %}</button>
-</div>
-</div>
-		{% endblock %}
+
+{% block extrajs %}
+<script type="text/javascript" src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
+<script type="text/javascript" src="//cdn.datatables.net/plug-ins/505bef35b56/integration/bootstrap/1/dataTables.bootstrap.js"></script>
+<script type="text/javascript">
+$(document).ready(function(){
+	{% if services %}
+	var oTable = $('#table')
+	.on( 'init.dt', function () {
+       	$('.pagination ul').addClass('pagination');
+    })
+    .dataTable({
+		"sPaginationType": "bootstrap",
+		"sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
+		"aoColumns": [{
+	        "bSearchable": true,
+	        "bSortable": true
+	    },
+	    {
+	        "bSearchable": true,
+	        "bSortable": true
+	    },
+	    {
+	        "bSearchable": true,
+	        "bSortable": true
+	    },
+	    {
+	        "bSearchable": true,
+	        "bSortable": true
+	    },
+	    {
+	        "bSearchable": true,
+	        "bSortable": true
+	    },
+	    {
+	        "bVisible": true,
+	        "bSearchable": false,
+	        "bSortable": false
+	    }],
+	    "aaSorting": [[0, 'desc']],
+	    "iDisplayLength": 25,
+	    "oSearch": {"bSmart": false, "bRegex":true},
+	    "oLanguage": {
+	    	"sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "locations" %}',
+	        "sProcessing":   "Processing...",
+	        "sZeroRecords": '{% trans "No records to display" %}',
+	        "sInfo":         "Showing _START_ to _END_ of _TOTAL_ entries",
+	        "sInfoEmpty":    "{% trans "Showing 0 to 0 of 0 entries" %}",
+	        "sInfoFiltered": "(filtered from _MAX_ total entries)",
+	        "sInfoPostFix":  "",
+	        "sSearch":       '{% trans "Search:" %}',
+	        "sUrl":          "",
+	        "oPaginate": {
+	            "sFirst":    '{% trans "First" %}',
+	            "sPrevious": '{% trans "Previous" %}',
+	            "sNext":     '{% trans "Next" %}',
+	            "sLast":     '{% trans "Last" %}'
+	        }
+	    }
+	});
+
+	oTable.fnDraw();
+	$('[id^=del_service_]').click(function(){
+		server_id = (this.id).replace("del_service_", '');
+		name = this.getAttribute("data-servicename");
+		$("#mymodalbody").html("{% trans 'You are about to delete location' %}: <b>"+name+"</b><br>{% trans 'Press Delete to proceed or Cancel to cancel deletion' %}");
+		$("#myModalLabel").html("{% trans 'Delete Location' %} "+name);
+		$('#myModal').modal('show');
+		$(".modal-footer").show();
+		$("#service_name_del").html(name)
+		return false;
+	});
+
+	$("#delserviceSubmit").click(function(){
+		$.ajax({
+			url:"{% url del-service %}/?service_pk="+server_id,
+			type: "GET",
+			success: function(data){
+				if (data.error){
+					$(".modal-footer").hide();
+					$("#mymodalbody").html("<font style='color:#B94A48'>"+data.error+"</font>");
+				}
+				if (data.success){
+					$(".modal-footer").hide();
+					$("#mymodalbody").html("{% trans 'Service' %} "+name+" {% trans 'successfully deleted' %}");
+					window.setTimeout('location.reload()', 1000);
+
+				}
+				}
+			});
+	});
+	{% endif %}
+});
+</script>
+{% endblock %}
