root / templates / edumanage / welcome.html @ 25028c1d
History | View | Annotate | Download (6.9 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 content %} |
166 |
<div class="container-fluid"> |
167 |
<div class="row-fluid"> |
168 |
<div class="span2"></div> |
169 |
<div class="span10"> |
170 |
<div class="row-fluid"><div class="span10"> |
171 |
<ul class="breadcrumb" style="display: inline-table; padding: 0"> |
172 |
{% block crumbs %} |
173 |
<li class="active">{% trans "Home" %}</li> |
174 |
{% endblock %} |
175 |
</ul>
|
176 |
<p class="pull-right">{% trans "You are logged in as" %}: {{user}} (<a href="{% url logout %}">{% trans "Logout" %}</a>)</p> |
177 |
</div></div> |
178 |
</div>
|
179 |
</div>
|
180 |
<div class="row-fluid"> |
181 |
<div class="span2"> |
182 |
<div class="sidebar-nav"> |
183 |
<ul class="nav nav-list nav-stacked side-menu"> |
184 |
<li {% block %}class="active"{% endblock %}> |
185 |
<a href="{% url manage %}">{% trans "Home" %}</a> |
186 |
</li>
|
187 |
<li {% block %}{% endblock %}> |
188 |
<a href="{% url institutions %}">{% trans "Institution" %} {% if not instdets %}<font style="color: red; font-weight: bold; font-size: 14px;">(!)</font>{% endif %}</a> |
189 |
</li>
|
190 |
{% if instdets %} |
191 |
<li {% block %}{% endblock %}> |
192 |
<a href="{% url services %}">{% trans "Services" %} ({{services_num}})</a> |
193 |
</li>
|
194 |
<li {% block %}{% endblock %}> |
195 |
<a href="{% url servers %}">{% trans "Servers" %} ({{servers_num}})</a> |
196 |
</li>
|
197 |
<li {% block %}{% endblock %}> |
198 |
<a href="{% url realms %}">{% trans "Realms" %} ({{realms_num}})</a> |
199 |
</li>
|
200 |
<li {% block %}{% endblock %}> |
201 |
<a href="{% url contacts %}">{% trans "Contacts" %} ({{contacts_num}})</a> |
202 |
</li>
|
203 |
{% endif %} |
204 |
</ul>
|
205 |
</div><!--/.well --> |
206 |
</div><!--/span--> |
207 |
<div class="span10"> |
208 |
<div class="row-fluid"> |
209 |
<!--/span-->
|
210 |
<div class="span10"> |
211 |
{% block subcontent %} |
212 |
<h4>{% trans "Home" %} - {% trans "Service Locations" %}</h4> |
213 |
<hr>
|
214 |
{% if services %} <div id="map_canvas" style="width:100%; height:450px;"></div> |
215 |
{% else %} |
216 |
<div>{% if instdets %}{% 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> |
217 |
{% endif %} |
218 |
{% endblock %} |
219 |
</div><!--/span--> |
220 |
<!--/span-->
|
221 |
</div><!--/row--> |
222 |
</div><!--/span--> |
223 |
</div><!--/row--> |
224 |
<hr>
|
225 |
<footer>
|
226 |
<p>
|
227 |
© GRNET NOC - GRNET S.A - 2012
|
228 |
</p>
|
229 |
</footer>
|
230 |
</div><!--/.fluid-container--> |
231 |
{% endblock %} |