From: Tom Hughes Date: Fri, 26 Feb 2010 18:49:22 +0000 (+0000) Subject: Make the tooltips for the tabs a bit more consistent and make the edit X-Git-Tag: live~6371^2~7 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/c6077fd124c79559e45174f8e5df9ba4a1d09bc3?ds=sidebyside Make the tooltips for the tabs a bit more consistent and make the edit and history tooltips change when those tabs are disabled to explain that the user needs to zoom in to use them. --- diff --git a/app/views/layouts/site.html.erb b/app/views/layouts/site.html.erb index dc621c631..8fb9beae1 100644 --- a/app/views/layouts/site.html.erb +++ b/app/views/layouts/site.html.erb @@ -65,8 +65,8 @@ diaryclass = 'active' if params['controller'] == 'diary_entry' %>
  • <%= link_to t('layouts.view'), {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => t('layouts.view_tooltip'), :class => viewclass} %>
  • -
  • <%= link_to t('layouts.edit'), {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => t('layouts.edit_tooltip'), :class => editclass} %>
  • -
  • <%= link_to t('layouts.history'), {:controller => 'changeset', :action => 'list' }, {:id => 'historyanchor', :title => t('layouts.history_tooltip'), :class => historyclass} %>
  • +
  • <%= link_to t('layouts.edit'), {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => t('javascripts.site.edit_tooltip'), :class => editclass} %>
  • +
  • <%= link_to t('layouts.history'), {:controller => 'changeset', :action => 'list' }, {:id => 'historyanchor', :title => t('javascripts.site.history_tooltip'), :class => historyclass} %>
  • <% if params['controller'] == 'site' and (params['action'] == 'index' or params['action'] == 'export') %>
  • <%= link_to_remote t('layouts.export'), {:url => {:controller => 'export', :action => 'start'}}, {:id => 'exportanchor', :title => t('layouts.export_tooltip'), :class => exportclass, :href => url_for(:controller => 'site', :action => 'export')} %>
  • <% else %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 64690965d..37538cc1a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -887,15 +887,13 @@ en: sign_up: sign up sign_up_tooltip: Create an account for editing view: View - view_tooltip: View maps + view_tooltip: View the map edit: Edit - edit_tooltip: Edit maps history: History - history_tooltip: Changeset history export: Export export_tooltip: Export map data gps_traces: GPS Traces - gps_traces_tooltip: Manage traces + gps_traces_tooltip: Manage GPS traces user_diaries: User Diaries user_diaries_tooltip: View user diaries tag_line: The Free Wiki World Map @@ -1619,5 +1617,9 @@ en: overlays: maplint: Maplint site: + edit_tooltip: Edit the map + edit_disabled_tooltip: Zoom in to edit the map edit_zoom_alert: You must zoom in to edit the map - history_zoom_alert: You must zoom in to see the editing history + history_tooltip: View edits for this area + history_disabled_tooltip: Zoom in to view edits for this area + history_zoom_alert: You must zoom in to view edits for this area diff --git a/public/javascripts/site.js b/public/javascripts/site.js index 43cca261c..c17500f57 100644 --- a/public/javascripts/site.js +++ b/public/javascripts/site.js @@ -60,9 +60,11 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj args[objtype] = objid; } node.href = setArgs("/edit", args); + node.title = i18n("javascripts.site.edit_tooltip"); node.style.fontStyle = 'normal'; } else { node.href = 'javascript:alert(i18n("javascripts.site.edit_zoom_alert"));'; + node.title = i18n("javascripts.site.edit_disabled_tooltip"); node.style.fontStyle = 'italic'; } } @@ -85,9 +87,11 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj } node.href = setArgs("/history", args); + node.title = i18n("javascripts.site.history_tooltip"); node.style.fontStyle = 'normal'; } else { node.href = 'javascript:alert(i18n("javascripts.site.history_zoom_alert"));'; + node.title = i18n("javascripts.site.history_disabled_tooltip"); node.style.fontStyle = 'italic'; } }