Commit 212ce199 authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Minor fixes to templates

parent e2469e7f
......@@ -43,6 +43,7 @@ body {
function setlang(lang){
$("#langsel").val(lang);
$("#langform").submit();
}
</script>
......@@ -81,16 +82,20 @@ body {
<div class="navbar-inner">
<div class="container" style="padding-left: 0px; width: auto;">
<a class="brand" href="#"><img src="/static/img/logo_holder.png" /></a>
{% block topmenu %}
<ul class="nav">
<li class="active">
<a href="#">Home</a>
<a href="{% url index %}">Home</a>
</li>
<li>
<a href="/faq/{{LANGUAGE_CODE}}/">FAQ</a>
</li>
<li>
<a href="/faq/en/">FAQ</a>
<a href="{% url login %}" style="padding-top: 3px; padding-bottom: 0px;">{% trans "Manage" %}<img src="/static/img/image_shibboleth_logo_color.png" style="padding: 0px;"></a>
</li>
</ul>
{% endblock %}
<ul class="nav pull-right">
<li class="dropdown pull-right">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Language" %}: {% for lang in LANGUAGES %}{% ifequal LANGUAGE_CODE lang.0 %}{% trans lang.1 %}{% endifequal %}{% endfor %}<b class="caret"></b></a>
......
......@@ -65,7 +65,7 @@
{% endfor %}
</div>
</div>
{% if instdets.ertype == 2 or instdets.ertype == 3 %}
{% if institution.ertype == 2 or institution.ertype == 3 %}
<div class="control-group">
<label class="control-label" for="id_oper_name">{% trans "Oper Name" %}</label>
<div class="controls">
......@@ -73,7 +73,7 @@
</div>
</div>
{% endif %}
{% if instdets.ertype == 1 or instdets.ertype == 3 %}
{% if institution.ertype == 1 or institution.ertype == 3 %}
<div class="control-group">
<label class="control-label" for="id_number_user">{% trans "Number User" %}</label>
<div class="controls">
......@@ -89,7 +89,7 @@
</div>
<div class="control-group">
<div class="controls">
<a class="btn btn-large btn-primary" href="{% url edit-institution institution.pk %}">{% trans "Edit" %}</a>
<a class="btn btn-primary" href="{% url edit-institution institution.pk %}">{% trans "Edit" %}</a>
</div>
</div>
</div>
......
......@@ -84,19 +84,19 @@ function addButton(row){
{{form.institution}}
</div>
<div class="control-group">
<label class="control-label" for="id_name">{% trans "Name" %}</label>
<label class="control-label" for="id_name"><b>{% trans "Name" %}</b></label>
<div class="controls">
<input class="input" id="disabledInput" type="text" placeholder="{% tolocale institution LANGUAGE_CODE %}" disabled>
</div>
</div>
<div class="control-group {% if form.ertype.errors %} error {% endif %}">
<label class="control-label" for="id_ertype">{% trans "Type" %}</label>
<label class="control-label" for="id_ertype"><b>{% trans "Type" %}</b></label>
<div class="controls">
<input class="input" id="disabledInput" type="text" placeholder="{{institution.get_ertype_display}}" disabled>
<input class="input" id="disabledInput2" type="text" placeholder="{{institution.get_ertype_display}}" disabled>
</div>
</div>
<div class="control-group {% if form.address_street.errors %} error {% endif %}">
<label class="control-label" for="id_address_street">{% trans "Address Street" %}</label>
<label class="control-label" for="id_address_street"><b>{% trans "Address Street" %}</b></label>
<div class="controls">
{{ form.address_street }}
{% if form.address_street.errors %} <span class="help-inline"> {{ form.address_street.errors|join:", " }} </span>
......@@ -104,7 +104,7 @@ function addButton(row){
</div>
</div>
<div class="control-group {% if form.address_city.errors %} error {% endif %}">
<label class="control-label" for="id_address_city">{% trans "Address City" %}</label>
<label class="control-label" for="id_address_city"><b>{% trans "Address City" %}</b></label>
<div class="controls">
{{ form.address_city }}
{% if form.address_city.errors %} <span class="help-inline"> {{ form.address_city.errors|join:", " }} </span>
......@@ -112,7 +112,7 @@ function addButton(row){
</div>
</div>
<div class="control-group {% if form.contact.errors %} error {% endif %}">
<label class="control-label" for="id_contact">{% trans "Contacts" %}</label>
<label class="control-label" for="id_contact"><b>{% trans "Contacts" %}</b></label>
<div class="controls">
{{ form.contact }} <button class="btn btn-small btn-info" id="add_contact"><i class="icon-plus-sign icon-white"></i>Add...</button>
{% if form.contact.errors %} <span class="help-inline"> {{ form.ertype.contact|join:", " }} </span>
......@@ -120,7 +120,7 @@ function addButton(row){
</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>
<label class="control-label" for="id_urls"><b>{% trans "Urls" %}</b></label>
{{urls_form.management_form}}
<div class="controls">
{% if urls_form.non_form_errors %} <span class="help-inline"> {{ urls_form.non_form_errors|join:", "}}</span>{% endif %}
......@@ -139,9 +139,9 @@ function addButton(row){
</tbody></table>
</div>
</div>
{% if instdets.ertype == 2 or instdets.ertype == 3 %}
{% if institution.ertype == 2 or institution.ertype == 3 %}
<div class="control-group {% if form.oper_name.errors %} error {% endif %}">
<label class="control-label" for="id_oper_name">{% trans "Oper Name" %}</label>
<label class="control-label" for="id_oper_name"><b>{% trans "Oper Name" %}</b></label>
<div class="controls">
{{ form.oper_name }}
{% if form.oper_name.errors %} <span class="help-inline"> {{ form.oper_name.errors|join:", " }} </span>
......@@ -149,9 +149,9 @@ function addButton(row){
</div>
</div>
{% endif %}
{% if instdets.ertype == 1 or instdets.ertype == 3 %}
{% if institution.ertype == 1 or institution.ertype == 3 %}
<div class="control-group {% if form.number_user.errors %} error {% endif %}">
<label class="control-label" for="id_number_user">{% trans "Number of Users" %}</label>
<label class="control-label" for="id_number_user"><b>{% trans "Number of Users" %}</b></label>
<div class="controls">
{{ form.number_user }}
{% if form.number_user.errors %} <span class="help-inline"> {{ form.number_user.errors|join:", " }} </span>
......@@ -160,7 +160,7 @@ function addButton(row){
</div>
{% endif %}
<div class="control-group {% if form.number_id.errors %} error {% endif %}">
<label class="control-label" for="id_number_id">{% trans "Number Id" %}</label>
<label class="control-label" for="id_number_id"><b>{% trans "Number Id" %}</b></label>
<div class="controls">
{{ form.number_id }}
{% if form.number_id.errors %} <span class="help-inline"> {{ form.number_id.errors|join:", " }} </span>
......
......@@ -103,9 +103,9 @@ $("#delrealmSubmit").click(function(){
{% endfor %}
</table>
{% endif %}
<div>{% if instdets.ertype == 1 or instdets.ertype == 3 %}<a href="{% url edit-realms %}" class="btn btn-primary">{% trans "Add new realm" %}</a>{% endif %}</div>
<div>{% if institution.ertype == 1 or institution.ertype == 3 %}<a href="{% url edit-realms %}" class="btn btn-primary">{% trans "Add new realm" %}</a>{% endif %}</div>
<div class="span10"></div>
{% if instdets.ertype == 1 or instdets.ertype == 3 %}
{% if institution.ertype == 1 or institution.ertype == 3 %}
{% if realms %}
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table">
<thead>
......
......@@ -26,7 +26,7 @@
{% endfor %}
</table>
{% endif %}
{% if instdets.ertype == 1 or instdets.ertype == 3 %}
{% if institution.ertype == 1 or institution.ertype == 3 %}
<form method="POST" class="form-horizontal">
{% csrf_token %}
{% if form.non_field_errors %}
......
......@@ -45,7 +45,7 @@
{{ server.host }}
</div>
</div>
{% if instdets.ertype == 1 or instdets.ertype == 3 %}
{% if institution.ertype == 1 or institution.ertype == 3 %}
<div class="control-group">
<label class="control-label" for="id_port">{% trans "Port" %}</label>
<div class="controls">
......
......@@ -48,7 +48,7 @@
{% endif %} <span class="help-block"> {{ form.host.help_text }}</span>
</div>
</div>
{% if instdets.ertype == 1 or instdets.ertype == 3 %}
{% if institution.ertype == 1 or institution.ertype == 3 %}
<div class="control-group {% if form.port.errors %} error {% endif %}">
<label class="control-label" for="id_port"><b>{% trans "Port" %}</b></label>
<div class="controls">
......
......@@ -103,10 +103,10 @@ $("#delserviceSubmit").click(function(){
{% endfor %}
</table>
{% endif %}
<div>{% if instdets.ertype == 2 or instdets.ertype == 3 %}<a href="{% url edit-services %}" class="btn btn-primary">{% trans "Add new service" %}</a>{% endif %}</div>
<div>{% if institution.ertype == 2 or institution.ertype == 3 %}<a href="{% url edit-services %}" class="btn btn-primary">{% trans "Add new service" %}</a>{% endif %}</div>
<div class="span10"></div>
{% load tolocale %}
{% if instdets.ertype == 2 or instdets.ertype == 3 %}
{% if institution.ertype == 2 or institution.ertype == 3 %}
{% if services %}
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table">
<thead>
......
......@@ -162,6 +162,15 @@ $.get("{% url get-service-points %}", function(data){
{% endif %}});</script>
{% endblock %}
{% block headtitle %}eduroam@Greece admin{% endblock %}
{% block topmenu %}
<ul class="nav">
<li class="disabled">
<a class="brand" href="#">Management</a>
</li>
</ul>
{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row-fluid">
......@@ -186,10 +195,10 @@ $.get("{% url get-service-points %}", function(data){
</li>
{% if institution_exists %}
<li {% block instactive %}{% endblock %}>
<a href="{% url institutions %}">{% trans "Institution" %} {% if not instdets %}<font style="color: red; font-weight: bold; font-size: 14px;">(!)</font>{% endif %}</a>
<a href="{% url institutions %}">{% trans "Institution" %} {% if not institutiondetails %}<font style="color: red; font-weight: bold; font-size: 14px;">(!)</font>{% endif %}</a>
</li>
{% endif %}
{% if instdets %}
{% if institutiondetails %}
<li {% block servicesactive %}{% endblock %}>
<a href="{% url services %}">{% trans "Services" %} ({{services_num}})</a>
</li>
......@@ -223,7 +232,7 @@ $.get("{% url get-service-points %}", function(data){
<hr>
{% if services %} <div id="map_canvas" style="width:100%; height:450px;"></div>
{% else %}
<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>
<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>
{% endif %}
{% endblock %}{% endif %}
......
......@@ -10,9 +10,41 @@
.headtitle {font-family: "Franklin Gothic Demi", "Franklin Gothic", "ITC Franklin Gothic", Arial, sans-serif; letter-spacing: -1px; }
</style>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript">
function setlang(lang) {
$("#langsel").val(lang);
var form = $("#langform");
$.ajax({
url: form.attr('action'),
data: form.serialize(),
type: "POST",
cache: false,
success:function(data){
window.location.href=location.href + "../" + lang + "/";
}
});
}
</script>
{% endblock %}
{% block topmenu %}
<ul class="nav">
<li>
<a href="{% url index %}">Home</a>
</li>
<li {% if "faq" in flatpage.url %} class="active" {% endif %}>
<a href="/faq/{{LANGUAGE_CODE}}/">FAQ</a>
</li>
<li>
<a href="{% url login %}" style="padding-top: 3px; padding-bottom: 0px;">{% trans "Manage" %}<img src="/static/img/image_shibboleth_logo_color.png" style="padding: 0px;"></a>
</li>
</ul>
{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row-fluid">
......@@ -20,13 +52,9 @@
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="active"><a href="{% url index %}">{% trans "Home" %}</a></li>
<li><a href="#">News</a></li>
<li><a href="{% url index %}">{% trans "Home" %}</a></li>
<li><a href="{% url geolocate %}" target="about:blank()">eduroam near me</a></li>
<li class="nav-header">Users</li>
<li><a href="#">Where</a></li>
<li><a href="#">How</a></li>
<li><a href="#">About</a></li>
<li class="active"><a href="/faq/{{LANGUAGE_CODE}}/">FAQ</a></li>
<li class="nav-header">Institutions</li>
<li><a href="{% url manage %}">{% trans "Management" %}</a></li>
</ul>
......
......@@ -11,7 +11,7 @@
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<script src="/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true&language=en"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true&language=en&libraries=places"></script>
<style>
......@@ -60,6 +60,7 @@ margin-bottom: 0px;
var eduMarker = false;
var infoWindow;
var getOnce = false;
var geocoder = null;
var infoWindow;
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
......@@ -136,9 +137,16 @@ margin-bottom: 0px;
mapTypeControl : false,
};
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
//var input = document.getElementById('searchTextField');
//var autocomplete = new google.maps.places.Autocomplete(input);
//autocomplete.bindTo('bounds', map);
infoWindow = new google.maps.InfoWindow();
bounds = new google.maps.LatLngBounds();
directionsDisplay = new google.maps.DirectionsRenderer();
geocoder = new google.maps.Geocoder();
directionsDisplay.setMap(map);
if (getOnce == false) {
......@@ -159,6 +167,18 @@ margin-bottom: 0px;
google.maps.event.addListener(map, 'click', function(event) {
moveMarker(event.latLng);
});
/*google.maps.event.addListener(autocomplete, 'place_changed', function() {
var place = autocomplete.getPlace();
console.log(place);
if (place.geometry.viewport) {
map.fitBounds(place.geometry.viewport);
} else {
map.setCenter(place.geometry.location);
map.setZoom(17); // Why 17? Because it looks good.
}
moveMarker(place.geometry.location);
})*/
}
function calcRoute(start, end) {
......@@ -233,10 +253,34 @@ margin-bottom: 0px;
}
function autocomplete() {
var input = $('#searchTextField');
var autocomplete = new google.maps.places.Autocomplete(input);
autocomplete.bindTo('bounds', map);
var marker = new google.maps.Marker({
map: map
});
google.maps.event.addListener(autocomplete, 'place_changed', function() {
console.log(autocomplete)
});
// Sets a listener on a radio button to change the filter type on Places
// Autocomplete.
}
$(document).ready(function() {
initialize();
});
......@@ -248,12 +292,16 @@ margin-bottom: 0px;
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#"><img src="/static/img/eduroam_trans_80pix.png" style="height:20px"> near me</a>
<a class="brand" href="#" style="font-size: 14px;"><img src="/static/img/eduroam_trans_80pix.png" style="height:20px"> near me</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li></li>
<li id="distanceText" style="line-height:40px;"></li>
<li id="distanceText" style="line-height:40px;" style="font-size: 14px;"></li>
<li></li>
<!-- <div class="navbar-search pull-left" style="margin-left: 5px;">
<input type="text" class="search-query" placeholder="Search" id="searchTextField" style="width: 150px;">
</div> -->
</ul>
</div><!--/.nav-collapse -->
......
......@@ -261,12 +261,8 @@
<ul class="nav nav-list">
<li class="active"><a href="{% url index %}">{% trans "Home" %}</a></li>
<li><a href="#">News</a></li>
<li><a href="{% url geolocate %}" target="about:blank()">eduroam near me</a></li>
<li class="nav-header">Users</li>
<li><a href="#">Where</a></li>
<li><a href="/how/en/">How</a></li>
<li><a href="#">About</a></li>
<li><a href="/faq/{{LANGUAGE_CODE}}/">FAQ</a></li>
<li class="nav-header">Institutions</li>
<li><a href="{% url login %}">{% trans "Management" %}</a></li>
</ul>
......@@ -278,7 +274,8 @@
<div class="span10">
<div class="row-fluid">
<!--/span-->
<h4>{% trans "Eduroam in Greece" %}</h4>
<hr>
{% block subcontent %}
<div id="map_canvas" style="width:100%; height:600px; overflow: hidden;"></div>
{% endblock %}
......@@ -288,7 +285,6 @@
</div><!--/span-->
</div><!--/span-->
</div><!--/row-->
<hr>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment