Scripts and styleshets for geolocation map - Conditional
authorJoar Wandborg <git@wandborg.com>
Fri, 27 Jan 2012 01:13:07 +0000 (02:13 +0100)
committerJoar Wandborg <git@wandborg.com>
Fri, 27 Jan 2012 01:13:07 +0000 (02:13 +0100)
Scripts and stylesheets for the geolocation map are now
switched on/off with the geolocation map itself.

mediagoblin/templates/mediagoblin/user_pages/media.html

index a2ad117e6710334270255722941c0d08f7174a38..2229bbb2cc3d753fb80cf85916417193796112b7 100644 (file)
 {% block title %}{{ media.title }} &mdash; {{ super() }}{% endblock %}
 
 {% block mediagoblin_head %}
-  <link rel="stylesheet" 
-       href="{{ request.staticdirect('/extlib/leaflet/leaflet.css') }}" />
 <!--[if lte IE 8]><link rel="stylesheet"
     href="{{ request.staticdirect('/extlib/leaflet/leaflet.ie.css') }}" /><![endif]-->
   <script type="text/javascript"
           src="{{ request.staticdirect('/js/comment_show.js') }}"></script>
-  <script type="text/javascript"
-          src="{{ request.staticdirect('/extlib/leaflet/leaflet.js') }}"></script>
-  <script type="text/javascript"
-          src="{{ request.staticdirect('/js/geolocation-map.js') }}"></script>
+
+  {% if app_config['geolocation_map_visible'] %}
+    <link rel="stylesheet"
+         href="{{ request.staticdirect('/extlib/leaflet/leaflet.css') }}" />
+
+    <script type="text/javascript"
+            src="{{ request.staticdirect('/extlib/leaflet/leaflet.js') }}"></script>
+    <script type="text/javascript"
+            src="{{ request.staticdirect('/js/geolocation-map.js') }}"></script>
+  {% endif %}
 {% endblock mediagoblin_head %}
 
 {% block mediagoblin_content %}