]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.html.erb
Move more styling into CSS and make it support RTL layout
[rails.git] / app / views / site / index.html.erb
index 0a0b7c1da5e873a9e2a9a450dee08e963773d77a..5c02efb82ffc5854e22d5cb0d69d3aecb25a2028 100644 (file)
 </noscript>
 
 <div id="map">
 </noscript>
 
 <div id="map">
+  <div id="permalink">
+    <a href="/" id="permalinkanchor"><%= t 'site.index.permalink' %></a><br/>
+    <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a>
+  </div>
 </div>
 
 <iframe id="linkloader" style="display: none">
 </iframe>
 
 </div>
 
 <iframe id="linkloader" style="display: none">
 </iframe>
 
-<div id="permalink">
-  <a href="/" id="permalinkanchor"><%= t 'site.index.permalink' %></a><br/>
-  <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a>
-</div>
-
 <div id="attribution">
   <table width="100%">
     <tr>
 <div id="attribution">
   <table width="100%">
     <tr>
-      <td align="left"><%= t'site.index.license.license_url' %></td>
-      <td align="right"><%= t'site.index.license.project_url' %></td>
+      <td class="attribution_license"><%= t'site.index.license.license_url' %></td>
+      <td class="attribution_project"><%= t'site.index.license.project_url' %></td>
     </tr>
     <tr>
     </tr>
     <tr>
-      <td colspan="2" align="center"><%=
+      <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')
         t'site.index.license.notice',
           :license_name => t('site.index.license.license_name'),
           :project_name => t('site.index.license.project_name')
@@ -95,7 +94,9 @@ elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil?
     lat =  @user.home_lat
     zoom = '10'
 else
     lat =  @user.home_lat
     zoom = '10'
 else
-    session[:location] = OSM::IPLocation(request.env['REMOTE_ADDR']) unless session[:location]
+    unless STATUS == :database_readonly or STATUS == :database_offline
+      session[:location] = OSM::IPLocation(request.env['REMOTE_ADDR']) unless session[:location]
+    end
 
     if session[:location]
         bbox = true
 
     if session[:location]
         bbox = true
@@ -254,7 +255,11 @@ end
       sidebar_width = sidebar_width + 5
     }
 
       sidebar_width = sidebar_width + 5
     }
 
+    <% if t('html.dir') == "ltr" -%>
     $("map").style.left = (sidebar_width) + "px";
     $("map").style.left = (sidebar_width) + "px";
+    <% else -%>
+    $("map").style.right = (sidebar_width) + "px";
+    <% end -%>
     $("map").style.width = ($("content").offsetWidth - sidebar_width) + "px";
     $("map").style.height = ($("content").offsetHeight - 2) + "px";
 
     $("map").style.width = ($("content").offsetWidth - sidebar_width) + "px";
     $("map").style.height = ($("content").offsetHeight - 2) + "px";