Statistics
| Branch: | Tag: | Revision:

root / djnro / templates / edumanage / welcome.html @ d3ea44a4

History | View | Annotate | Download (8 kB)

1
{% extends "base.html"%}
2
{% load i18n %}
3
{% block currentpagetitle %}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 = "{{MAP_CENTER.0}}";
9
        var lat = parseFloat(lat.replace(",","."));
10
        var lng = "{{MAP_CENTER.1}}";
11
        var lng = parseFloat(lng.replace(",","."));
12
        var zoomLevel = 6;
13
        var latlng = new google.maps.LatLng(lat,lng);
14
        var map = '';
15
        var bounds = '';
16
        var image = '';
17
        var infoWindow;
18

19
var styles = [{
20
        url: '/static/img/edugroup.png',
21
        height: 54,
22
        width: 63,
23
        textColor: '#ffffff',
24
        textSize: 11
25
        },
26
        {
27
        url: '/static/img/edugroup.png',
28
        height: 54,
29
        width: 63,
30
        textColor: '#ffffff',
31
        textSize: 11
32
        },
33
        {
34
        url: '/static/img/edugroup.png',
35
        height: 54,
36
        width: 63,
37
        textColor: '#ffffff',
38
        textSize: 11
39
}];
40

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

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

88
        bounds = new google.maps.LatLngBounds();
89
        infoWindow = new google.maps.InfoWindow();
90

91
}
92

93

94
function placeMarkers(){
95
var markers = new Array();
96
$.get("{% url get-service-points %}", function(data){
97
        $.each(data, function(index, jsonMarker) {
98
        var marker = createMarker(jsonMarker);
99
        if (marker){
100
        bounds.extend(marker.position);
101
        markers.push(marker);
102
        google.maps.event.addListener(marker, 'click', function() {
103
                infoWindow.setContent( "<div><h4>"+jsonMarker.name+"</h4>"+
104

105
        "<div class='tabbable'>"+
106
    "<ul class='nav nav-tabs'>"+
107
    "<li class='active'><a href='#tab1' data-toggle='tab'>{% trans 'Info' %}</a></li>"+
108
    "<li><a href='#tab2' data-toggle='tab'>{% trans 'More...' %}</a></li>"+
109
    "</ul>"+
110
    "<div class='tab-content'>"+
111
    "<div class='tab-pane active' id='tab1'>"+
112
    "<dl class='dl-horizontal'>"+
113
                        "<dt>Name</dt><dd>"+jsonMarker.name+"&nbsp;</dd>"+
114
                        "<dt>Address</dt><dd>"+jsonMarker.address+"&nbsp;</dd>"+
115
                        "<dt>Encryption</dt><dd>"+jsonMarker.enc+"&nbsp;</dd>"+
116
                        "<dt>SSID</dt><dd>"+jsonMarker.SSID+"&nbsp;</dd>"+
117
                        "<dt>Number of APs</dt><dd>"+jsonMarker.AP_no+"&nbsp;</dd></dl>"+
118
    "</div>"+
119
    "<div class='tab-pane' id='tab2'>"+
120
    "<dl class='dl-horizontal'>"+
121
                        "<dt>Port Restrict</dt><dd>"+jsonMarker.port_restrict+"&nbsp;</dd>"+
122
                        "<dt>transp_proxy</dt><dd>"+jsonMarker.transp_proxy+"&nbsp;</dd>"+
123
                        "<dt>IPv6</dt><dd>"+jsonMarker.IPv6+"&nbsp;</dd>"+
124
                        "<dt>NAT</dt><dd>"+jsonMarker.NAT+"&nbsp;</dd>"+
125
                        "<dt>Wired</dt><dd>"+jsonMarker.wired+"&nbsp;</dd></dl>"+
126
    "</div>"+
127
    "</div>"+
128
    "</div>"+
129
    "<div style='text-align:right;'><a href = '{% url edit-services  %}"+jsonMarker.key+"' class='btn btn-primary'>Edit</a></div>"+
130
    "</div>");
131
                infoWindow.open(map,marker);
132
     });
133
        }
134
        });
135
        var mcOptions = {gridSize: 50, maxZoom: 15, styles: styles};
136

137

138

139
        var markerCluster = new MarkerClusterer(map, markers, mcOptions);
140
        map.fitBounds(bounds)
141
        });
142
        }
143

144
        function createMarker(markerObj){
145
        var title = markerObj.name;
146
        var latLng = new google.maps.LatLng(markerObj.lat, markerObj.lng);
147
        var marker = new google.maps.Marker({
148
        'position' : latLng,
149
        'map' : map,
150
        'title': title,
151
        'icon': image,
152
        });
153
        return marker;
154
        }
155

156
        function clusterMarkers(markers){
157
        var markerCluster = new MarkerClusterer(map, markers);
158
        }
159

160
        $(document).ready(function() {
161
{% if services %}
162
        initialize();
163
        marks = placeMarkers();
164
        clusterMarkers(marks);
165
{% endif %}});</script>
166
{% endblock %}
167
{% block headtitle %}eduroam@Greece admin{% endblock %}
168
    {% block topmenu %}
169
    <ul class="nav">
170
        <li>
171
                {% load tolocale %}
172
           <a class="brand" href="{% url manage %}" style="font-size: 14px;">{% if institution_exists %}{% tolocale institution LANGUAGE_CODE %}{% else %}Management{% endif %}</a>
173
        </li>
174

    
175

    
176
    </ul>
177
    {% endblock %}
178
{% block content %}
179
<div class="container-fluid">
180
        <div class="row-fluid">
181
                <div class="span2"></div>
182
                <div class="span10">
183
                        <div class="row-fluid"><div class="span12">
184
                                <ul class="breadcrumb" style="display: inline-table; padding: 0">
185
                                        {% block crumbs %}
186
                                    <li class="active">{% trans "Home" %}</li>
187
                                    {% endblock %}
188
                            </ul>
189
                        <p class="pull-right"><strong>{{user}}</strong> (<a href="{% url logout %}">{% trans "Logout" %}</a>)</p>
190
                        </div></div>
191
                </div>
192
        </div>
193
        <div class="row-fluid">
194
                <div class="span2">
195
                        <div class="well sidebar-nav">
196
                                <ul class="nav nav-list">
197
                                        <li {% block  %}class="active"{% endblock %}>
198
                                                <a href="{% url manage %}">{% trans "Home" %}</a>
199
                                        </li>
200
                                        {% if institution_exists %}
201
                                        <li {% block  %}{% endblock %}>
202
                                                <a href="{% url institutions %}">{% trans "Institution" %} {% if not institutiondetails %}<font style="color: red; font-weight: bold; font-size: 14px;">(!)</font>{% endif %}</a>
203
                                        </li>
204
                                        {% endif %}
205
                                        {% if institutiondetails %}
206
                                        <li {% block  %}{% endblock %}>
207
                                                <a href="{% url services %}">{% trans "Locations" %} ({{services_num}})</a>
208
                                        </li>
209
                                        <li {% block  %}{% endblock %}>
210
                                                <a href="{% url servers %}">{% trans "Servers" %} ({{servers_num}})</a>
211
                                        </li>
212
                                        <li {% block  %}{% endblock %}>
213
                                                <a href="{% url realms %}">{% trans "Realms" %} ({{realms_num}})</a>
214
                                        </li>
215
                                        <li {% block  %}{% endblock %}>
216
                                                <a href="{% url instrealmmon %}">{% trans "Monitored Realms" %} ({{monrealms_num}})</a>
217
                                        </li>
218
                                        <li {% block  %}{% endblock %}>
219
                                                <a href="{% url contacts %}">{% trans "Contacts" %} ({{contacts_num}})</a>
220
                                        </li>
221
                                        {% if CAT_INSTANCES %}
222
                                        <li {% block  %}{% endblock %}>
223
                                                <a href="{% url catenroll %}">{% trans "eduroam CAT" %}</a>
224
                                        </li>
225
                                        {% endif %}
226

    
227
                                        {% endif %}
228
                                </ul>
229
                        </div><!--/.well -->
230
                </div><!--/span-->
231
                <div class="span10">
232
                        <div class="row-fluid">
233
                                <!--/span-->
234
                                <div class="span12">
235
                                {% if not institution_exists %}
236
                        <table class="table table-condensed">
237
                                            <tr class="error"><td>You are not associated with any institution. Please contact your administrator<td></tr>
238
                                        </table>
239
                                  {% endif %}
240
                                  {% if institution_exists %}
241
                                        {% block subcontent %}
242

    
243

    
244
                                        <h4>{% trans "Home" %} - {% trans "Service Locations" %} - {% tolocale institution LANGUAGE_CODE %}</h4>
245
                              <hr>
246
                                        {% if services %} <div id="map_canvas" style="width:100%; height:450px;"></div>
247
                                        {% else %}
248
                                        <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>
249
                                        {% endif %}
250

    
251
                                        {% endblock %}{% endif %}
252
                                </div><!--/span-->
253
                                <!--/span-->
254
                        </div><!--/row-->
255
                </div><!--/span-->
256
        </div><!--/row-->
257
</div><!--/.fluid-container-->
258
{% endblock %}