Commit 8a796650 authored by Zenon Mousmoulas's avatar Zenon Mousmoulas Committed by GitHub

Merge pull request #25 from zmousm/fix/master/google_maps_api_keys

Introduce optional API key for Google Maps
parents 462aec17 f71829e0
......@@ -20,6 +20,9 @@ ALLOWED_HOSTS = []
# Make this unique, and don't share it with anybody.
SECRET_KEY = '<put something really random here, eg. %$#%@#$^2312351345#$%3452345@#$%@#$234#@$hhzdavfsdcFDGVFSDGhn>'
# Google Maps API key, see https://developers.google.com/maps/documentation/javascript/get-api-key#key
GOOGLE_MAPS_API_KEY = 'thisisthelongapikey'
# Check for headers indicating the request was received on a secure SSL connection
# Uncomment this if you are running DjNRO behind an HTTP proxy that sets this
# header for SSL connections (and protects it for non-SSL connections).
......
......@@ -3,7 +3,7 @@
{% load i18n %}
{% block extrajs %}
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if GOOGLE_MAPS_API_KEY %}key={{ GOOGLE_MAPS_API_KEY }}{% endif %}"></script>
{% endblock %}
{% block homeactive %}{% endblock %}
......
......@@ -137,7 +137,7 @@
{% block extrajs %}
<script type="text/javascript" src="{% static 'js/showpass.js' %}"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if GOOGLE_MAPS_API_KEY %}key={{ GOOGLE_MAPS_API_KEY }}{% endif %}"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#id_secret').showPassword();
......
......@@ -15,7 +15,7 @@
width: auto !important;
}
</style>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if GOOGLE_MAPS_API_KEY %}key={{ GOOGLE_MAPS_API_KEY }}{% endif %}"></script>
<script type="text/javascript">
var map = '';
var lat = "{{service.latitude}}";
......
......@@ -254,7 +254,7 @@
{% block extrajs %}
<script type="text/javascript" src="{% static 'js/jquery.formset.js' %}"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=true&language=en&libraries=places"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3.exp{% if GOOGLE_MAPS_API_KEY %}&amp;key={{ GOOGLE_MAPS_API_KEY }}{% endif %}&amp;language=en&amp;libraries=places"></script>
<script src="{% static 'js/jquery_csrf_protect.js' %}" type="text/javascript"></script>
<script type="text/javascript">
......
......@@ -89,6 +89,6 @@
{% block extrajs %}
<script type="text/javascript" src="{% static 'js/markerclusterer.js' %}"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if GOOGLE_MAPS_API_KEY %}key={{ GOOGLE_MAPS_API_KEY }}{% endif %}"></script>
<script type="text/javascript" src="{% static 'js/management-map.js' %}"></script>
{% endblock %}
......@@ -36,10 +36,10 @@
{% endblock %}
{% block content %}
<div id="map_canvas" data-center-lat="{{ MAP_CENTER.0 }}" data-closest="{% url closest %}"" data-center-lng="{{ MAP_CENTER.1 }}" data-pin="{% static 'img/edupin.png' %}" data-group="{% static 'img/edugroup.png' %}" style="width:100%"></div>
<div id="map_canvas" data-center-lat="{{ MAP_CENTER.0 }}" data-closest="{% url 'closest' %}" data-center-lng="{{ MAP_CENTER.1 }}" data-pin="{% static 'img/edupin.png' %}" data-group="{% static 'img/edugroup.png' %}" style="width:100%"></div>
{% endblock %}
{% block extrajs %}
<script type="text/javascript" src="//maps.google.com/maps/api/js?v=3.exp&language=en&libraries=places"></script>
<script type="text/javascript" src="//maps.google.com/maps/api/js?v=3.exp{% if GOOGLE_MAPS_API_KEY %}&amp;key={{ GOOGLE_MAPS_API_KEY }}{% endif %}&amp;language=en&amp;libraries=places"></script>
<script type="text/javascript" src="{% static 'js/geolocate.js' %}"></script>
{% endblock %}
......@@ -69,7 +69,7 @@
{% block extrajs %}
<script type="text/javascript" src="{% static 'js/markerclusterer.js' %}"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&region={{COUNTRY_CODE}}"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&amp;region={{COUNTRY_CODE}}{% if GOOGLE_MAPS_API_KEY %}&amp;key={{ GOOGLE_MAPS_API_KEY }}{% endif %}"></script>
<script type="text/javascript" src="{% static 'js/jquery.adapt_height.js' %}"></script>
<script type="text/javascript" src="{% static 'js/mapescape.js' %}"></script>
<script type="text/javascript" src="{% static 'js/home-page-map.js' %}"></script>
......
......@@ -21,7 +21,7 @@
{% block extrajs %}
<script type="text/javascript" src="{% static 'js/markerclusterer.js' %}"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&region={{COUNTRY_CODE}}"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&amp;region={{COUNTRY_CODE}}{% if GOOGLE_MAPS_API_KEY %}&amp;key={{ GOOGLE_MAPS_API_KEY }}{% endif %}"></script>
<script type="text/javascript" src="{% static 'js/jquery.adapt_height.js' %}"></script>
<script type="text/javascript" src="{% static 'js/mapescape.js' %}"></script>
<script type="text/javascript" src="{% static 'js/world-map.js' %}"></script>
......
......@@ -5,7 +5,7 @@
<div>
<div class="container">
{% if user.is_authenticated %}
{% trans "If you have any questions or need help, contact" %} {{ BRANDING.helpdesk.name }} (<a href="{{ BRANDING.helpdesk.uri}}">{{BRANDING.helpdesk.uri}}</a>) - {{BRANDING.helpdesk.phone}}</br>
{% trans "If you have any questions or need help, contact" %} {{ BRANDING.helpdesk.name }} (<a href="{{ BRANDING.helpdesk.uri}}">{{BRANDING.helpdesk.uri}}</a>) - {{BRANDING.helpdesk.phone}}<br>
{% endif %}
{% trans "This is a service provided by" %} <a href="{{ BRANDING.service_provided_by.url}}" target="_blank">{{BRANDING.service_provided_by.name}}</a>
{% for media in BRANDING.social_media %}
......
......@@ -11,7 +11,8 @@ def country_code(context):
'MAP_CENTER': settings.MAP_CENTER,
'PROV_TEAM': settings.NRO_PROV_BY_DICT,
'SOCIAL_MEDIA_LIST': settings.NRO_PROV_SOCIAL_MEDIA_CONTACT,
'VERSION': settings.SW_VERSION
'VERSION': settings.SW_VERSION,
'GOOGLE_MAPS_API_KEY': settings.GOOGLE_MAPS_API_KEY if hasattr(settings,"GOOGLE_MAPS_API_KEY") else None,
}
......
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