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