Commit 0c86fff0 authored by Vladimir Mencl's avatar Vladimir Mencl Committed by Zenon Mousmoulas

Google Maps API: make API_KEY optional

To support older installations that do not have a key in local_settings.py
parent aa5a63e8
......@@ -3,7 +3,7 @@
{% load i18n %}
{% block extrajs %}
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key={{ API_KEY }}"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if API_KEY %}key={{ 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?key={{ API_KEY }}"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if API_KEY %}key={{ 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?key={{ API_KEY }}"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if API_KEY %}key={{ 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&key={{ API_KEY }}&language=en&libraries=places"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3.exp{% if API_KEY %}&key={{ API_KEY }}{% endif %}&language=en&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?key={{ API_KEY }}"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?{% if API_KEY %}key={{ API_KEY }}{% endif %}"></script>
<script type="text/javascript" src="{% static 'js/management-map.js' %}"></script>
{% endblock %}
......@@ -40,6 +40,6 @@
{% endblock %}
{% block extrajs %}
<script type="text/javascript" src="//maps.google.com/maps/api/js?key={{ API_KEY }}&v=3.exp&language=en&libraries=places"></script>
<script type="text/javascript" src="//maps.google.com/maps/api/js?v=3.exp{% if API_KEY %}&key={{ API_KEY }}{% endif %}&language=en&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}}&key={{ API_KEY }}"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&region={{COUNTRY_CODE}}{% if API_KEY %}&key={{ 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}}&key={{ API_KEY }}"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&region={{COUNTRY_CODE}}{% if API_KEY %}&key={{ 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>
......
......@@ -12,7 +12,7 @@ def country_code(context):
'PROV_TEAM': settings.NRO_PROV_BY_DICT,
'SOCIAL_MEDIA_LIST': settings.NRO_PROV_SOCIAL_MEDIA_CONTACT,
'VERSION': settings.SW_VERSION,
'API_KEY': settings.GOOGLE_API_KEY
'API_KEY': settings.GOOGLE_API_KEY if hasattr(settings,"GOOGLE_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