Add copyright in attribution control
authorJohn Firebaugh <john.firebaugh@gmail.com>
Tue, 16 Jul 2013 21:30:27 +0000 (14:30 -0700)
committerTom Hughes <tom@compton.nu>
Thu, 8 Aug 2013 09:59:13 +0000 (10:59 +0100)
app/assets/javascripts/index.js
app/views/layouts/site.html.erb
config/locales/en.yml

index bd366b6..5190277 100644 (file)
@@ -22,27 +22,29 @@ $(document).ready(function () {
 
   map.hash = L.hash(map);
 
+  var copyright = I18n.t('javascripts.map.copyright', {copyright_url: '/copyright'});
+
   var layers = [
     new L.OSM.Mapnik({
-      attribution: '',
+      attribution: copyright,
       code: "M",
       keyid: "mapnik",
       name: I18n.t("javascripts.map.base.standard")
     }),
     new L.OSM.CycleMap({
-      attribution: "Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
+      attribution: copyright + ". Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
       code: "C",
       keyid: "cyclemap",
       name: I18n.t("javascripts.map.base.cycle_map")
     }),
     new L.OSM.TransportMap({
-      attribution: "Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
+      attribution: copyright + ". Tiles courtesy of <a href='http://www.opencyclemap.org/' target='_blank'>Andy Allan</a>",
       code: "T",
       keyid: "transportmap",
       name: I18n.t("javascripts.map.base.transport_map")
     }),
     new L.OSM.MapQuestOpen({
-      attribution: "Tiles courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>",
+      attribution: copyright + ". Tiles courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>",
       code: "Q",
       keyid: "mapquest",
       name: I18n.t("javascripts.map.base.mapquest")
index 44edfc6..548dc35 100644 (file)
@@ -44,7 +44,6 @@
           <ul>
             <li><%= link_to(t('layouts.help_centre'), t('layouts.help_url'), :title => t('layouts.help_title')) %></li>
             <li><%= link_to(t('layouts.documentation'), t('layouts.wiki_url'), :title => t('layouts.documentation_title')) %></li>
-            <li><%= link_to t('layouts.copyright'), copyright_path %></li>
           </ul>
         </li>
         <li>
@@ -59,6 +58,9 @@
         </li>
         <li>
           <h4><%= t'layouts.data' %></h4>
+          <ul>
+            <li><%= link_to t('layouts.copyright'), copyright_path %></li>
+          </ul>
           <ul>
             <li><%= link_to t('layouts.export_data'), export_path %></li>
           </ul>
index 62fcb84..697c9a7 100644 (file)
@@ -2085,6 +2085,7 @@ en:
         notes: Map Notes
         data: Map Data
         overlays: Enable overlays for troubleshooting the map
+      copyright: "© <a href='%{copyright_url}'>OpenStreetMap contributors</a>"
     site:
       edit_tooltip: Edit the map
       edit_disabled_tooltip: Zoom in to edit the map