root / templates / edumanage / welcome.html @ 53979954
History | View | Annotate | Download (7.5 kB)
1 |
{% extends "base.html"%} |
---|---|
2 |
{% load i18n %} |
3 |
{% block title %}eduroam | gr - Management{% endblock %} |
4 |
{% block extrahead %} <script type="text/javascript" src="/static/js/jquery.min.js"></script> |
5 |
<script type="text/javascript" src="/static/js/markerclusterer.js"></script> |
6 |
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script> |
7 |
<script type="text/javascript"> |
8 |
var lat = 36.97;
|
9 |
var lng = 23.71;
|
10 |
var zoomLevel = 6;
|
11 |
var latlng = new google.maps.LatLng(lat,lng);
|
12 |
var map = '';
|
13 |
var bounds = '';
|
14 |
var image = '';
|
15 |
var infoWindow;
|
16 |
|
17 |
var styles = [{
|
18 |
url: '/static/img/edugroup.png',
|
19 |
height: 54,
|
20 |
width: 63,
|
21 |
textColor: '#ffffff',
|
22 |
textSize: 11
|
23 |
},
|
24 |
{
|
25 |
url: '/static/img/edugroup.png',
|
26 |
height: 54,
|
27 |
width: 63,
|
28 |
textColor: '#ffffff',
|
29 |
textSize: 11
|
30 |
},
|
31 |
{
|
32 |
url: '/static/img/edugroup.png',
|
33 |
height: 54,
|
34 |
width: 63,
|
35 |
textColor: '#ffffff',
|
36 |
textSize: 11
|
37 |
}];
|
38 |
|
39 |
function initialize() {
|
40 |
image = new google.maps.MarkerImage('/static/img/edupin.png',
|
41 |
// This marker is 29 pixels wide by 40 pixels tall.
|
42 |
new google.maps.Size(29, 40),
|
43 |
// The origin for this image is 0,0.
|
44 |
new google.maps.Point(0,0),
|
45 |
// The anchor for this image is the base of the flagpole at 18,42.
|
46 |
new google.maps.Point(14, 40)
|
47 |
);
|
48 |
var styleArray = [
|
49 |
{
|
50 |
featureType: "all",
|
51 |
stylers: [
|
52 |
{ saturation: -60 },
|
53 |
{gamma: 1.00 }
|
54 |
]
|
55 |
},{
|
56 |
featureType: "poi.business",
|
57 |
elementType: "labels",
|
58 |
stylers: [
|
59 |
{ visibility: "off" }
|
60 |
]
|
61 |
},
|
62 |
{ "featureType": "transit.line", "elementType": "geometry", "stylers": [ { "visibility": "off" } ] },
|
63 |
{ "featureType": "poi", "elementType": "all", "stylers": [ { "visibility": "off" } ] },
|
64 |
{'featureType': "administrative.country",
|
65 |
'elementType': "labels",
|
66 |
'stylers': [
|
67 |
{ 'visibility': "off" }
|
68 |
]}
|
69 |
|
70 |
];
|
71 |
var mapOptions = {
|
72 |
center : latlng,
|
73 |
zoom : zoomLevel,
|
74 |
mapTypeId : google.maps.MapTypeId.ROADMAP,
|
75 |
styles: styleArray,
|
76 |
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
77 |
mapTypeControlOptions: {
|
78 |
style: google.maps.MapTypeControlStyle.DEFAULT
|
79 |
},
|
80 |
navigationControl: true,
|
81 |
mapTypeControl: false,
|
82 |
};
|
83 |
map = new google.maps.Map(document.getElementById("map_canvas"),
|
84 |
mapOptions);
|
85 |
|
86 |
bounds = new google.maps.LatLngBounds();
|
87 |
infoWindow = new google.maps.InfoWindow();
|
88 |
|
89 |
}
|
90 |
|
91 |
|
92 |
function placeMarkers(){
|
93 |
var markers = new Array();
|
94 |
$.get("{% url get-service-points %}", function(data){
|
95 |
$.each(data, function(index, jsonMarker) {
|
96 |
var marker = createMarker(jsonMarker);
|
97 |
if (marker){
|
98 |
bounds.extend(marker.position);
|
99 |
markers.push(marker);
|
100 |
google.maps.event.addListener(marker, 'click', function() {
|
101 |
infoWindow.content = "<div><h4>"+jsonMarker.name+"</h4>"+
|
102 |
|
103 |
"<div class='tabbable'>"+
|
104 |
"<ul class='nav nav-tabs'>"+
|
105 |
"<li class='active'><a href='#tab1' data-toggle='tab'>Main</a></li>"+
|
106 |
"<li><a href='#tab2' data-toggle='tab'>Advanced</a></li>"+
|
107 |
"</ul>"+
|
108 |
"<div class='tab-content'>"+
|
109 |
"<div class='tab-pane active' id='tab1'>"+
|
110 |
"<dl class='dl-horizontal'>"+
|
111 |
"<dt>Name</dt><dd>"+jsonMarker.name+"</dd>"+
|
112 |
"<dt>Address</dt><dd>"+jsonMarker.address+"</dd>"+
|
113 |
"<dt>Encryption</dt><dd>"+jsonMarker.enc+"</dd>"+
|
114 |
"<dt>SSID</dt><dd>"+jsonMarker.SSID+"</dd>"+
|
115 |
"<dt>Number of APs</dt><dd>"+jsonMarker.AP_no+"</dd></dl>"+
|
116 |
"</div>"+
|
117 |
"<div class='tab-pane' id='tab2'>"+
|
118 |
"<dl class='dl-horizontal'>"+
|
119 |
"<dt>Port Restrict</dt><dd>"+jsonMarker.port_restrict+"</dd>"+
|
120 |
"<dt>transp_proxy</dt><dd>"+jsonMarker.transp_proxy+"</dd>"+
|
121 |
"<dt>IPv6</dt><dd>"+jsonMarker.IPv6+"</dd>"+
|
122 |
"<dt>NAT</dt><dd>"+jsonMarker.NAT+"</dd>"+
|
123 |
"<dt>Wired</dt><dd>"+jsonMarker.wired+"</dd></dl>"+
|
124 |
"</div>"+
|
125 |
"</div>"+
|
126 |
"</div>"+
|
127 |
"<div style='text-align:right;'><a href = '{% url edit-services %}"+jsonMarker.key+"' class='btn btn-primary'>Edit</a></div>"+
|
128 |
"</div>";
|
129 |
infoWindow.open(map,marker);
|
130 |
});
|
131 |
}
|
132 |
});
|
133 |
var mcOptions = {gridSize: 50, maxZoom: 15, styles: styles};
|
134 |
|
135 |
|
136 |
|
137 |
var markerCluster = new MarkerClusterer(map, markers, mcOptions);
|
138 |
map.fitBounds(bounds)
|
139 |
});
|
140 |
}
|
141 |
|
142 |
function createMarker(markerObj){
|
143 |
var title = markerObj.name;
|
144 |
var latLng = new google.maps.LatLng(markerObj.lat, markerObj.lng);
|
145 |
var marker = new google.maps.Marker({
|
146 |
'position' : latLng,
|
147 |
'map' : map,
|
148 |
'title': title,
|
149 |
'icon': image,
|
150 |
});
|
151 |
return marker;
|
152 |
}
|
153 |
|
154 |
function clusterMarkers(markers){
|
155 |
var markerCluster = new MarkerClusterer(map, markers);
|
156 |
}
|
157 |
|
158 |
$(document).ready(function() {
|
159 |
{% if services %}
|
160 |
initialize();
|
161 |
marks = placeMarkers();
|
162 |
clusterMarkers(marks);
|
163 |
{% endif %}});</script> |
164 |
{% endblock %} |
165 |
{% block headtitle %}eduroam@Greece admin{% endblock %} |
166 |
{% block topmenu %} |
167 |
<ul class="nav"> |
168 |
<li>
|
169 |
{% load tolocale %} |
170 |
<a class="brand" href="{% url manage %}" style="font-size: 14px;">{% tolocale institution LANGUAGE_CODE %}</a> |
171 |
</li>
|
172 |
|
173 |
|
174 |
</ul>
|
175 |
{% endblock %} |
176 |
{% block content %} |
177 |
<div class="container-fluid"> |
178 |
<div class="row-fluid"> |
179 |
<div class="span2"></div> |
180 |
<div class="span10"> |
181 |
<div class="row-fluid"><div class="span12"> |
182 |
<ul class="breadcrumb" style="display: inline-table; padding: 0"> |
183 |
{% block crumbs %} |
184 |
<li class="active">{% trans "Home" %}</li> |
185 |
{% endblock %} |
186 |
</ul>
|
187 |
<p class="pull-right"><strong>{{user}}</strong> (<a href="{% url logout %}">{% trans "Logout" %}</a>)</p> |
188 |
</div></div> |
189 |
</div>
|
190 |
</div>
|
191 |
<div class="row-fluid"> |
192 |
<div class="span2"> |
193 |
<div class="well sidebar-nav"> |
194 |
<ul class="nav nav-list"> |
195 |
<li {% block %}class="active"{% endblock %}> |
196 |
<a href="{% url manage %}">{% trans "Home" %}</a> |
197 |
</li>
|
198 |
{% if institution_exists %} |
199 |
<li {% block %}{% endblock %}> |
200 |
<a href="{% url institutions %}">{% trans "Institution" %} {% if not institutiondetails %}<font style="color: red; font-weight: bold; font-size: 14px;">(!)</font>{% endif %}</a> |
201 |
</li>
|
202 |
{% endif %} |
203 |
{% if institutiondetails %} |
204 |
<li {% block %}{% endblock %}> |
205 |
<a href="{% url services %}">{% trans "Services" %} ({{services_num}})</a> |
206 |
</li>
|
207 |
<li {% block %}{% endblock %}> |
208 |
<a href="{% url servers %}">{% trans "Servers" %} ({{servers_num}})</a> |
209 |
</li>
|
210 |
<li {% block %}{% endblock %}> |
211 |
<a href="{% url realms %}">{% trans "Realms" %} ({{realms_num}})</a> |
212 |
</li>
|
213 |
<li {% block %}{% endblock %}> |
214 |
<a href="{% url contacts %}">{% trans "Contacts" %} ({{contacts_num}})</a> |
215 |
</li>
|
216 |
{% endif %} |
217 |
</ul>
|
218 |
</div><!--/.well --> |
219 |
</div><!--/span--> |
220 |
<div class="span10"> |
221 |
<div class="row-fluid"> |
222 |
<!--/span-->
|
223 |
<div class="span12"> |
224 |
{% if not institution_exists %} |
225 |
<table class="table table-condensed"> |
226 |
<tr class="error"><td>You are not associated with any institution. Please contact your administrator<td></tr> |
227 |
</table>
|
228 |
{% endif %} |
229 |
{% if institution_exists %} |
230 |
{% block subcontent %} |
231 |
|
232 |
|
233 |
<h4>{% trans "Home" %} - {% trans "Service Locations" %} - {% tolocale institution LANGUAGE_CODE %}</h4> |
234 |
<hr>
|
235 |
{% if services %} <div id="map_canvas" style="width:100%; height:450px;"></div> |
236 |
{% else %} |
237 |
<div>{% if institutiondetails %}{% trans "No services defined yet"%}! <a href="{% url edit-services %}" class="btn btn-primary">{% trans "Add new service" %}</a>{% else %}Specify your institution details to proceed <a class="btn btn-small btn-primary" href="{% url edit-institution institution.pk %}">{% trans "Edit" %}</a>{% endif %}</div> |
238 |
{% endif %} |
239 |
|
240 |
{% endblock %}{% endif %} |
241 |
</div><!--/span--> |
242 |
<!--/span-->
|
243 |
</div><!--/row--> |
244 |
</div><!--/span--> |
245 |
</div><!--/row--> |
246 |
</div><!--/.fluid-container--> |
247 |
{% endblock %} |