service_details.html 7.72 KB
Newer Older
1 2 3
{% extends "edumanage/welcome.html"%}
{% load i18n %}
{% load tolocale %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
4 5
{% load staticfiles %}

6 7 8 9 10 11 12 13 14 15 16 17
{% block crumbs %}
    <li><a href="{% url manage %}">{% trans "Home" %}</a><span class="divider">/</span></li>
    <li><a href="{% url services %}">{% trans "Locations" %}</a><span class="divider">/</span></li>
    <li class="active">{% tolocale service LANGUAGE_CODE %}</li>
{% endblock %}
{% block extrahead %}
<style type="text/css">
	.control-label{
		padding-top: 0px !important;
		width: auto !important;
	}
</style>
18
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if GOOGLE_MAPS_API_KEY %}key={{ GOOGLE_MAPS_API_KEY }}{% endif %}"></script>
19 20 21 22 23 24 25 26
<script type="text/javascript">
        var map = '';
        var lat = "{{service.latitude}}";
		var lat = parseFloat(lat.replace(",","."));
		var lng = "{{service.longitude}}";
		var lng = parseFloat(lng.replace(",","."));
		var latlng = new google.maps.LatLng(lat,lng);
		var zoomLevel = 16;
Kroustouris Stauros's avatar
Kroustouris Stauros committed
27

28
        function initialize() {
Kroustouris Stauros's avatar
Kroustouris Stauros committed
29
            image = new google.maps.MarkerImage('{% static 'img/edupin.png' %}',
30 31 32 33 34 35 36 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 68 69 70 71 72 73 74 75
                    // 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" }
			                     ]}
			                   ];
            var mapOptions = {
                center : latlng,
                zoom : zoomLevel,
                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);
        	var marker = new google.maps.Marker({
        		'position' : latlng,
        		'map' : map,
        		'icon': image,
        		});
Kroustouris Stauros's avatar
Kroustouris Stauros committed
76

77 78 79 80
            }


        $(document).ready(function() {
Kroustouris Stauros's avatar
Kroustouris Stauros committed
81

82
            initialize();
Kroustouris Stauros's avatar
Kroustouris Stauros committed
83 84


85
        });
Kroustouris Stauros's avatar
Kroustouris Stauros committed
86 87 88 89




90 91 92 93
    </script>


{% endblock %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
94

95 96
{% block homeactive %}{% endblock %}
{% block servicesactive %}class="active"{% endblock %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
97 98
{% block management_content %}

99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114

<h4>{% tolocale service LANGUAGE_CODE %}</h4>
<hr>
<div class="form-horizontal span7">

    <div class="control-group {% if form.longitude.errors or form.latitude.errors %} error {% endif %}">
        <label class="control-label" for="id_map_canvas">{% trans "Location" %}</label>

        <div class="controls">
            Lat: {{ service.latitude }}<br>
            Lng: {{ service.longitude }}
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="id_address_city">{% trans "Location Name" %}</label>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
115

116 117 118 119 120 121 122 123 124 125 126
        <div class="controls">
        	{% for name in service.loc_name.all %}
        		{{name.name}} ({{name.get_lang_display}}){% if not forloop.last %}<br>{% endif %}
        	{% endfor %}
        </div>
    </div>
    <div class="control-group {% if form.address_street.errors %} error {% endif %}">
        <label class="control-label" for="id_address_street">{% trans "Address" %}</label>
        <div class="controls">
            {{ service.address_street }}<br>
            {{ service.address_city }}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
127

128 129 130 131 132 133
        </div>
    </div>
    <div class="control-group {% if form.SSID.errors %} error {% endif %}">
        <label class="control-label" for="id_url">SSID</label>
        <div class="controls">
            {{ service.SSID }}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
134

135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
        </div>
    </div>
    <div class="control-group {% if form.contact.errors %} error {% endif %}">
        <label class="control-label" for="id_contact">{% trans "Contacts" %}</label>
        <div class="controls">
           	{% for contact in service.contact.all %}
        		{{contact.name}} (<a href="mailto:{{contact.email}}">{{contact.email}}</a> - tel:{{contact.phone}}){% if not forloop.last %}<br>{% endif %}
        	{% endfor %}
        </div>
    </div>
    <div class="control-group {% if form.enc_level.errors %} error {% endif %}">
        <label class="control-label" for="id_oper_name">{% trans "Encryption Level" %}</label>
        <div class="controls">
            {% for enc in service.enc_level %}{% if enc == '' %}-{% else %}{{enc}}{% if not forloop.last%},{% endif %}{% endif %}{% endfor %}
        </div>
    </div>
    <div class="control-group {% if form.port_restrict.errors %} error {% endif %}">
        <label class="control-label" for="id_number_user">{% trans "Port Restrict" %}</label>
        <div class="controls">
            {{ service.port_restrict }}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
155

156 157 158 159 160 161
        </div>
    </div>
    <div class="control-group {% if form.transp_proxy.errors %} error {% endif %}">
        <label class="control-label" for="id_number_id">{% trans "Transparent Proxy" %}</label>
        <div class="controls">
            {{ service.transp_proxy }}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
162

163 164 165 166 167 168
        </div>
    </div>
    <div class="control-group {% if form.IPv6.errors %} error {% endif %}">
        <label class="control-label" for="id_number_id">IPv6</label>
        <div class="controls">
            {{ service.IPv6 }}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
169

170 171 172 173 174 175
        </div>
    </div>
    <div class="control-group {% if form.NAT.errors %} error {% endif %}">
        <label class="control-label" for="id_number_id">NAT</label>
        <div class="controls">
            {{ service.NAT }}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
176

177 178 179 180 181 182
        </div>
    </div>
    <div class="control-group {% if form.AP_no.errors %} error {% endif %}">
        <label class="control-label" for="id_number_id">{% trans "AP number" %}</label>
        <div class="controls">
            {{ service.AP_no }}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
183

184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
        </div>
    </div>
    <div class="control-group {% if form.wired.errors %} error {% endif %}">
        <label class="control-label" for="id_number_id">{% trans "Wired" %}</label>
        <div class="controls">
            {{ service.wired }}
        </div>
    </div>
    <div class="control-group {% for err in urls_form.errors %}{% if err|length > 0 %}error{% endif %}{% endfor %}{% if urls_form.non_form_errors %}error{% endif %}">
        <label class="control-label" for="id_urls">{% trans "Urls" %}</label>
        <div class="controls">
       		{% for url in service.url.all %}
        		<a href="{{url.url}}">{{url.url}}</a> - {{url.get_urltype_display}} ({{url.get_lang_display}}){% if not forloop.last %}<br>{% endif %}
        	{% endfor %}
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <a class="btn btn-primary" href="{% url edit-services service.pk %}">{% trans "Edit" %}</a>
        </div>
    </div>


</div>
<div class="span4"><div id="map_canvas" style="width:300px; height: 300px;"></div>
</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
210
{% endblock %}