welcome.html 7.38 KB
Newer Older
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
6
7
8
9
10
11
12
13
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
	var lat = 36.97;
	var lng = 23.71;
	var zoomLevel = 6;
	var latlng = new google.maps.LatLng(lat,lng);
	var map = '';
	var bounds = '';
	var image = '';
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
14
15
	var infoWindow;
	
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var styles = [{
	url: '/static/img/edugroup.png',
	height: 54,
	width: 63,
	textColor: '#ffffff',
	textSize: 11
	},
	{
	url: '/static/img/edugroup.png',
	height: 54,
	width: 63,
	textColor: '#ffffff',
	textSize: 11
	},
	{
	url: '/static/img/edugroup.png',
	height: 54,
	width: 63,
	textColor: '#ffffff',
	textSize: 11
}];
37

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
function initialize() {
	image = new google.maps.MarkerImage('/static/img/edupin.png',
	// This marker is 29 pixels wide by 40 pixels tall.
	new google.maps.Size(29, 40),
	// The origin for this image is 0,0.
	new google.maps.Point(0,0),
	// The anchor for this image is the base of the flagpole at 18,42.
	new google.maps.Point(14, 40)
);
var styleArray = [
{
	featureType: "all",
	stylers: [
	{ saturation: -60 },
	{gamma: 1.00 }
	]
	},{
	featureType: "poi.business",
	elementType: "labels",
	stylers: [
	{ visibility: "off" }
	]
	},
	{ "featureType": "transit.line", "elementType": "geometry", "stylers": [ { "visibility": "off" } ] },
	{ "featureType": "poi", "elementType": "all", "stylers": [ { "visibility": "off" } ] },
	{'featureType': "administrative.country",
	'elementType': "labels",
	'stylers': [
	{ 'visibility': "off" }
	]}
68

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
];
var mapOptions = {
	center : latlng,
	zoom : zoomLevel,
	mapTypeId : google.maps.MapTypeId.ROADMAP,
	styles: styleArray,
	mapTypeId: google.maps.MapTypeId.ROADMAP,
	mapTypeControlOptions: {
	style: google.maps.MapTypeControlStyle.DEFAULT
	},
	navigationControl: true,
	mapTypeControl: false,
	};
	map = new google.maps.Map(document.getElementById("map_canvas"),
	mapOptions);
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
84
	
85
	bounds = new google.maps.LatLngBounds();
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
86
	infoWindow = new google.maps.InfoWindow();
87

88
}
89

Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
90

91
92
93
94
95
96
97
function placeMarkers(){
var markers = new Array();
$.get("{% url get-service-points %}", function(data){
	$.each(data, function(index, jsonMarker) {
	var marker = createMarker(jsonMarker);
	if (marker){
	bounds.extend(marker.position);
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
	markers.push(marker);
	google.maps.event.addListener(marker, 'click', function() {
		infoWindow.content = "<div><h4>"+jsonMarker.name+"</h4>"+
			
	"<div class='tabbable'>"+ 
    "<ul class='nav nav-tabs'>"+
    "<li class='active'><a href='#tab1' data-toggle='tab'>Main</a></li>"+
    "<li><a href='#tab2' data-toggle='tab'>Advanced</a></li>"+
    "</ul>"+
    "<div class='tab-content'>"+
    "<div class='tab-pane active' id='tab1'>"+
    "<dl class='dl-horizontal'>"+
			"<dt>Name</dt><dd>"+jsonMarker.name+"</dd>"+
			"<dt>Address</dt><dd>"+jsonMarker.address+"</dd>"+
			"<dt>Encryption</dt><dd>"+jsonMarker.enc+"</dd>"+
			"<dt>SSID</dt><dd>"+jsonMarker.SSID+"</dd>"+
			"<dt>Number of APs</dt><dd>"+jsonMarker.AP_no+"</dd></dl>"+
    "</div>"+
    "<div class='tab-pane' id='tab2'>"+
    "<dl class='dl-horizontal'>"+
			"<dt>Port Restrict</dt><dd>"+jsonMarker.port_restrict+"</dd>"+
			"<dt>transp_proxy</dt><dd>"+jsonMarker.transp_proxy+"</dd>"+
			"<dt>IPv6</dt><dd>"+jsonMarker.IPv6+"</dd>"+
			"<dt>NAT</dt><dd>"+jsonMarker.NAT+"</dd>"+
			"<dt>Wired</dt><dd>"+jsonMarker.wired+"</dd></dl>"+
    "</div>"+
    "</div>"+
    "</div>"+
    "<div style='text-align:right;'><a href = '{% url edit-services  %}"+jsonMarker.key+"' class='btn btn-primary'>Edit</a></div>"+
    "</div>";
		infoWindow.open(map,marker);
     });
130
131
132
	}
	});
	var mcOptions = {gridSize: 50, maxZoom: 15, styles: styles};
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
133
134
	
	
135

136
137
138
139
	var markerCluster = new MarkerClusterer(map, markers, mcOptions);
	map.fitBounds(bounds)
	});
	}
140

141
142
143
144
145
146
147
148
149
	function createMarker(markerObj){
	var title = markerObj.name;
	var latLng = new google.maps.LatLng(markerObj.lat, markerObj.lng);
	var marker = new google.maps.Marker({
	'position' : latLng,
	'map' : map,
	'title': title,
	'icon': image,
	});
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
150
	return marker;
151
	}
152

153
154
155
	function clusterMarkers(markers){
	var markerCluster = new MarkerClusterer(map, markers);
	}
156

157
158
159
160
161
162
163
	$(document).ready(function() {
{% if services %}
	initialize();
	marks = placeMarkers();
	clusterMarkers(marks);
{% endif %}});</script>
{% endblock %}
164
{% block headtitle %}eduroam@Greece admin{% endblock %}
165
166
167
168
169
170
171
172
173
    {% block topmenu %}
    <ul class="nav">
        <li class="disabled">
           <a class="brand" href="#">Management</a>
        </li>
        

    </ul>
    {% endblock %}
174
175
{% block content %}
<div class="container-fluid">
176
177
178
179
180
181
	<div class="row-fluid">
		<div class="span2"></div>
		<div class="span10">
			<div class="row-fluid"><div class="span10">
				<ul class="breadcrumb" style="display: inline-table; padding: 0">
					{% block crumbs %}
182
	    			<li class="active">{% trans "Home" %}</li>
183
184
	    			{% endblock %}
	    		</ul>
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
185
			<p class="pull-right"><strong>{{user}}</strong> (<a href="{% url logout %}">{% trans "Logout" %}</a>)</p>
186
187
188
			</div></div>
		</div>
	</div>
189
190
	<div class="row-fluid">
		<div class="span2">
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
191
192
			<div class="well sidebar-nav">
				<ul class="nav nav-list">
193
					<li {% block homeactive %}class="active"{% endblock %}>
194
						<a href="{% url manage %}">{% trans "Home" %}</a>
195
					</li>
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
196
					{% if institution_exists %}
197
					<li {% block instactive %}{% 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>
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
200
					{% endif %}
201
					{% if institutiondetails %}
202
					<li {% block servicesactive %}{% endblock %}>
203
						<a href="{% url services %}">{% trans "Services" %} ({{services_num}})</a>
204
205
					</li>
					<li {% block serversactive %}{% endblock %}>
206
						<a href="{% url servers %}">{% trans "Servers" %} ({{servers_num}})</a>
207
					</li>
208
					<li {% block realmsactive %}{% endblock %}>
209
						<a href="{% url realms %}">{% trans "Realms" %} ({{realms_num}})</a>
210
					</li>
211
					<li {% block contactsactive %}{% endblock %}>
212
						<a href="{% url contacts %}">{% trans "Contacts" %} ({{contacts_num}})</a>
213
					</li>
214
					{% endif %}
215
216
217
218
219
220
221
				</ul>
			</div><!--/.well -->
		</div><!--/span-->
		<div class="span10">
			<div class="row-fluid">
				<!--/span-->
				<div class="span10">
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
222
223
224
225
226
227
				{% if not institution_exists %}
	                <table class="table table-condensed">
					    <tr class="error"><td>You are not associated with any institution. Please contact your administrator<td></tr>
					</table>
				  {% endif %}
				  {% if institution_exists %}
228
					{% block subcontent %}
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
229
230
					
				  
231
					<h4>{% trans "Home" %} - {% trans "Service Locations" %}</h4>
232
              		<hr>
233
234
					{% if services %} <div id="map_canvas" style="width:100%; height:450px;"></div>
					{% 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 %}
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
237
238
				
					{% endblock %}{% endif %}
239
240
241
242
243
244
245
246
				</div><!--/span-->
				<!--/span-->
			</div><!--/row-->
		</div><!--/span-->
	</div><!--/row-->
	<hr>
	<footer>
		<p>
247
			&copy;  GRNET NOC - GRNET S.A - 2012
248
249
250
		</p>
	</footer>
</div><!--/.fluid-container-->
251
{% endblock %}