]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.html.erb
Fix interpolation issues in attribution text
[rails.git] / app / views / site / index.html.erb
index 0bbf66e1557ab43473e81c88b05f8048dc4eacb9..3e4c4d996c8150304ff2db13551ab10ee65795c8 100644 (file)
@@ -1,16 +1,16 @@
 <% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
   <% content_for :greeting do %>
-    <%= link_to t("layouts.home"), "#", :class => "set_position", "data-lat" => @user.home_lat, "data-lon" => @user.home_lon, "data-zoom" => 15, :title => t("layouts.home_tooltip") %> |
+    <%= link_to t("layouts.home"), "#", :class => "set_position", :data => { :lat => @user.home_lat, :lon => @user.home_lon, :zoom => 15 }, :title => t("layouts.home_tooltip") %> |
   <% end %>
 <% end %>
 
 <% unless STATUS == :api_offline or STATUS == :database_offline -%>
   <% content_for :editmenu do -%>
-    <li><%= link_to t("browse.start_rjs.data_layer_name"), "#", :id => "show_data" %></li>
+    <li><%= link_to t("browse.start_rjs.data_layer_name"), { :controller => :browse, :action => :start }, :id => "show_data" %></li>
   <% end -%>
 <% end -%>
 
-<%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
+<%= render :partial => 'sidebar' %>
 <%= render :partial => 'key' %>
 <%= render :partial => 'search' %>
 
       <td class="attribution_project"><%= t'site.index.license.project_url' %></td>
     </tr>
     <tr>
-      <td colspan="2" class="attribution_notice"><%=
-        t'site.index.license.notice',
-          :license_name => t('site.index.license.license_name'),
-          :project_name => t('site.index.license.project_name')
-        %></td>
+      <td colspan="2" class="attribution_notice"><%= t'site.index.license.copyright' %></td>
     </tr>
   </table>
 </div>
@@ -125,17 +121,10 @@ else
 end
 %>
 
-<%= javascript_include_tag 'openlayers.js' %>
-<%= javascript_include_tag 'map.js' %>
-
-<%= render :partial => 'resize' %>
-
 <script type="text/javascript">
   var marker;
   var map;
 
-  OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
-
   function mapInit(){
     map = createMap("map");
 
@@ -194,8 +183,11 @@ end
   }
 
   $(document).ready(function () {
-    $("#show_data").click(function () {
-      $.ajax({ url: "<%= url_for :controller => :browse, :action => :start %>" });
+    $("#show_data").click(function (e) {
+      $.ajax({ url: $(this).attr('href'), success: function (sidebarHtml) {
+        startBrowse(sidebarHtml);
+      }});
+      e.preventDefault();
     });
 
     $("body").on("click", "a.set_position", function () {
@@ -287,12 +279,14 @@ end
 
   $(document).ready(function () {
     $("#exportanchor").click(function (e) {
-      $.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" });
-      Event.stop(e);
+      $.ajax({ url: "<%= url_for :controller => :export, :action => :start %>", success: function (sidebarHtml) {
+        startExport(sidebarHtml);
+      }});
+      e.preventDefault();
     });
 
-    <% if params[:action] == 'export' -%>
-    $.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" });
+    <% if params[:export] -%>
+    $("#exportanchor").click();
     <% end -%>
 
     <% if params[:query] -%>