From: Tom Hughes Date: Tue, 9 Jun 2009 21:50:37 +0000 (+0000) Subject: Merge 15722:15806 from head and adjust new views to rails 2 style names. X-Git-Tag: live~6865^2~20 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/edaddbedaec78a252e988e2271962407e64483fd?hp=ea93ad2f077de1be04a9087c7d20547395fdef9e Merge 15722:15806 from head and adjust new views to rails 2 style names. --- diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index dd0438218..aee31295c 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -127,14 +127,13 @@ class AmfController < ApplicationController case message when 'putway'; orn=renumberednodes.dup r=putway(renumberednodes,*args) - renumberednodes=r[4].dup - r[4].delete_if { |k,v| orn.has_key?(k) } + r[4]=renumberednodes.reject { |k,v| orn.has_key?(k) } if r[2] != r[3] then renumberedways[r[2]] = r[3] end results[index]=AMF.putdata(index,r) when 'putrelation'; results[index]=AMF.putdata(index,putrelation(renumberednodes, renumberedways, *args)) when 'deleteway'; results[index]=AMF.putdata(index,deleteway(*args)) when 'putpoi'; r=putpoi(*args) - if r[2] != r[3] then renumberednodes[r[2]] = r[3] end + if r[2] != r[3] then renumberednodes[r[2]] = r[3] end results[index]=AMF.putdata(index,r) when 'startchangeset'; results[index]=AMF.putdata(index,startchangeset(*args)) end @@ -588,11 +587,12 @@ class AmfController < ApplicationController # # Returns: # 0. '0' (code for success), - # 1. original way id (unchanged), - # 2. new way id, - # 3. hash of renumbered nodes (old id=>new id), - # 4. way version, - # 5. hash of node versions (node=>version) + # 1. message, + # 2. original way id (unchanged), + # 3. new way id, + # 4. hash of renumbered nodes (old id=>new id), + # 5. way version, + # 6. hash of node versions (node=>version) def putway(renumberednodes, usertoken, changeset_id, wayversion, originalway, pointlist, attributes, nodes, deletednodes) #:doc: amf_handle_error("'putway' #{originalway}") do diff --git a/app/controllers/changeset_controller.rb b/app/controllers/changeset_controller.rb index 8c20ddb4d..d7f3d39c8 100644 --- a/app/controllers/changeset_controller.rb +++ b/app/controllers/changeset_controller.rb @@ -265,7 +265,7 @@ class ChangesetController < ApplicationController else conditions = cond_merge conditions, ['false'] end - elsif params[:format] == 'rhtml' + elsif request.format == :html @title = t 'user.no_such_user.title' @not_found_user = params[:display_name] render :template => 'user/no_such_user', :status => :not_found diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 16186314f..165f41306 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -78,6 +78,8 @@ class DiaryEntryController < ApplicationController end def rss + request.format = :rss + if params[:display_name] user = User.find_by_display_name(params[:display_name], :conditions => {:visible => true}) @@ -86,8 +88,6 @@ class DiaryEntryController < ApplicationController @title = "OpenStreetMap diary entries for #{user.display_name}" @description = "Recent OpenStreetmap diary entries from #{user.display_name}" @link = "http://#{SERVER_URL}/user/#{user.display_name}/diary" - - render :content_type => Mime::RSS else render :nothing => true, :status => :not_found end @@ -98,8 +98,6 @@ class DiaryEntryController < ApplicationController @title = "OpenStreetMap diary entries in #{params[:language]}" @description = "Recent diary entries from users of OpenStreetMap" @link = "http://#{SERVER_URL}/diary/#{params[:language]}" - - render :content_type => Mime::RSS else @entries = DiaryEntry.find(:all, :include => :user, :conditions => ["users.visible = ?", true], @@ -107,8 +105,6 @@ class DiaryEntryController < ApplicationController @title = "OpenStreetMap diary entries" @description = "Recent diary entries from users of OpenStreetMap" @link = "http://#{SERVER_URL}/diary" - - render :content_type => Mime::RSS end end diff --git a/app/controllers/node_controller.rb b/app/controllers/node_controller.rb index 19add265d..8eb698920 100644 --- a/app/controllers/node_controller.rb +++ b/app/controllers/node_controller.rb @@ -16,12 +16,9 @@ class NodeController < ApplicationController node = Node.from_xml(request.raw_post, true) - if node - node.create_with_history @user - render :text => node.id.to_s, :content_type => "text/plain" - else - raise OSM::APIBadXMLError.new(:node, request.raw_post) - end + # Assume that Node.from_xml has thrown an exception if there is an error parsing the xml + node.create_with_history @user + render :text => node.id.to_s, :content_type => "text/plain" end # Dump the details on a node given in params[:id] @@ -39,13 +36,12 @@ class NodeController < ApplicationController def update node = Node.find(params[:id]) new_node = Node.from_xml(request.raw_post) - - if new_node and new_node.id == node.id - node.update_from(new_node, @user) - render :text => node.version.to_s, :content_type => "text/plain" - else - render :nothing => true, :status => :bad_request + + unless new_node and new_node.id == node.id + raise OSM::BadUserInput.new("The id in the url (#{node.id}) is not the same as provided in the xml (#{new_node.id})") end + node.update_from(new_node, @user) + render :text => node.version.to_s, :content_type => "text/plain" end # Delete a node. Doesn't actually delete it, but retains its history @@ -55,28 +51,26 @@ class NodeController < ApplicationController node = Node.find(params[:id]) new_node = Node.from_xml(request.raw_post) - if new_node and new_node.id == node.id - node.delete_with_history!(new_node, @user) - render :text => node.version.to_s, :content_type => "text/plain" - else - render :nothing => true, :status => :bad_request + unless new_node and new_node.id == node.id + raise OSM::BadUserInput.new("The id in the url (#{node.id}) is not the same as provided in the xml (#{new_node.id})") end + node.delete_with_history!(new_node, @user) + render :text => node.version.to_s, :content_type => "text/plain" end # Dump the details on many nodes whose ids are given in the "nodes" parameter. def nodes ids = params['nodes'].split(',').collect { |n| n.to_i } - if ids.length > 0 - doc = OSM::API.new.get_xml_doc - - Node.find(ids).each do |node| - doc.root << node.to_xml_node - end + if ids.length == 0 + raise OSM::BadUserInput.new("No nodes were given to search for") + end + doc = OSM::API.new.get_xml_doc - render :text => doc.to_s, :content_type => "text/xml" - else - render :nothing => true, :status => :bad_request + Node.find(ids).each do |node| + doc.root << node.to_xml_node end + + render :text => doc.to_s, :content_type => "text/xml" end end diff --git a/app/models/node.rb b/app/models/node.rb index 01b0f220e..6ef1b9e6f 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -92,17 +92,14 @@ class Node < ActiveRecord::Base node.version = create ? 0 : pt['version'].to_i unless create + raise OSM::APIBadXMLError.new("node", pt, "ID is required when updating.") if pt['id'].nil? if pt['id'] != '0' node.id = pt['id'].to_i end end - # visible if it says it is, or as the default if the attribute - # is missing. - # Don't need to set the visibility, when it is set explicitly in the create/update/delete - #node.visible = pt['visible'].nil? or pt['visible'] == 'true' - # We don't care about the time, as it is explicitly set on create/update/delete + # We don't care about the visibility as it is implicit based on the action tags = [] diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 9793caee7..80a8ae485 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -33,7 +33,7 @@ class Notifier < ActionMailer::Base def gpx_success(trace, possible_points) common_headers trace.user - subject "[OpenStreetMap] GPX Import success" + subject I18n.t('notifier.gpx_notification.success.subject') body :trace_name => trace.name, :trace_points => trace.size, :trace_description => trace.description, @@ -44,7 +44,7 @@ class Notifier < ActionMailer::Base def gpx_failure(trace, error) common_headers trace.user from "webmaster@openstreetmap.org" - subject "[OpenStreetMap] GPX Import failure" + subject I18n.t('notifier.gpx_notification.failure.subject') body :trace_name => trace.name, :trace_description => trace.description, :trace_tags => trace.tags, diff --git a/app/views/api/map.rxml b/app/views/api/map.xml.builder similarity index 100% rename from app/views/api/map.rxml rename to app/views/api/map.xml.builder diff --git a/app/views/browse/_changeset_details.rhtml b/app/views/browse/_changeset_details.html.erb similarity index 91% rename from app/views/browse/_changeset_details.rhtml rename to app/views/browse/_changeset_details.html.erb index 92002b6e3..24d5da08c 100644 --- a/app/views/browse/_changeset_details.rhtml +++ b/app/views/browse/_changeset_details.html.erb @@ -49,7 +49,7 @@ <% unless @nodes.empty? %> - <%= t 'browse.changeset_details.has_nodes', :node_count => @node_pages.item_count %> + <%= t 'browse.changeset_details.has_nodes', :count => @node_pages.item_count %> <% @nodes.each do |node| %> @@ -63,7 +63,7 @@ <% unless @ways.empty? %> - +
<%= t 'browse.changeset_details.has_ways', :way_count => @way_pages.item_count %><%= t 'browse.changeset_details.has_ways', :count => @way_pages.item_count %> <% @ways.each do |way| %> @@ -80,7 +80,7 @@ <% unless @relations.empty? %> - +
<%= t 'browse.changeset_details.has_relations', :relation_count => @relation_pages.item_count %><%= t 'browse.changeset_details.has_relations', :count => @relation_pages.item_count %> <% @relations.each do |relation| %> diff --git a/app/views/browse/_common_details.rhtml b/app/views/browse/_common_details.html.erb similarity index 100% rename from app/views/browse/_common_details.rhtml rename to app/views/browse/_common_details.html.erb diff --git a/app/views/browse/_containing_relation.rhtml b/app/views/browse/_containing_relation.html.erb similarity index 100% rename from app/views/browse/_containing_relation.rhtml rename to app/views/browse/_containing_relation.html.erb diff --git a/app/views/browse/_map.rhtml b/app/views/browse/_map.html.erb similarity index 100% rename from app/views/browse/_map.rhtml rename to app/views/browse/_map.html.erb diff --git a/app/views/browse/_navigation.rhtml b/app/views/browse/_navigation.html.erb similarity index 100% rename from app/views/browse/_navigation.rhtml rename to app/views/browse/_navigation.html.erb diff --git a/app/views/browse/_node_details.rhtml b/app/views/browse/_node_details.html.erb similarity index 100% rename from app/views/browse/_node_details.rhtml rename to app/views/browse/_node_details.html.erb diff --git a/app/views/browse/_paging_nav.rhtml b/app/views/browse/_paging_nav.html.erb similarity index 100% rename from app/views/browse/_paging_nav.rhtml rename to app/views/browse/_paging_nav.html.erb diff --git a/app/views/browse/_relation_details.rhtml b/app/views/browse/_relation_details.html.erb similarity index 100% rename from app/views/browse/_relation_details.rhtml rename to app/views/browse/_relation_details.html.erb diff --git a/app/views/browse/_relation_member.rhtml b/app/views/browse/_relation_member.html.erb similarity index 100% rename from app/views/browse/_relation_member.rhtml rename to app/views/browse/_relation_member.html.erb diff --git a/app/views/browse/_start.rhtml b/app/views/browse/_start.html.erb similarity index 100% rename from app/views/browse/_start.rhtml rename to app/views/browse/_start.html.erb diff --git a/app/views/browse/_tag.rhtml b/app/views/browse/_tag.html.erb similarity index 100% rename from app/views/browse/_tag.rhtml rename to app/views/browse/_tag.html.erb diff --git a/app/views/browse/_tag_details.rhtml b/app/views/browse/_tag_details.html.erb similarity index 100% rename from app/views/browse/_tag_details.rhtml rename to app/views/browse/_tag_details.html.erb diff --git a/app/views/browse/_way_details.rhtml b/app/views/browse/_way_details.html.erb similarity index 100% rename from app/views/browse/_way_details.rhtml rename to app/views/browse/_way_details.html.erb diff --git a/app/views/browse/changeset.rhtml b/app/views/browse/changeset.html.erb similarity index 100% rename from app/views/browse/changeset.rhtml rename to app/views/browse/changeset.html.erb diff --git a/app/views/browse/node.rhtml b/app/views/browse/node.html.erb similarity index 100% rename from app/views/browse/node.rhtml rename to app/views/browse/node.html.erb diff --git a/app/views/browse/node_history.rhtml b/app/views/browse/node_history.html.erb similarity index 100% rename from app/views/browse/node_history.rhtml rename to app/views/browse/node_history.html.erb diff --git a/app/views/browse/not_found.rhtml b/app/views/browse/not_found.html.erb similarity index 100% rename from app/views/browse/not_found.rhtml rename to app/views/browse/not_found.html.erb diff --git a/app/views/browse/relation.rhtml b/app/views/browse/relation.html.erb similarity index 100% rename from app/views/browse/relation.rhtml rename to app/views/browse/relation.html.erb diff --git a/app/views/browse/relation_history.rhtml b/app/views/browse/relation_history.html.erb similarity index 100% rename from app/views/browse/relation_history.rhtml rename to app/views/browse/relation_history.html.erb diff --git a/app/views/browse/start.rjs b/app/views/browse/start.rjs index 64e4431a4..707054526 100644 --- a/app/views/browse/start.rjs +++ b/app/views/browse/start.rjs @@ -76,7 +76,7 @@ page << < '{{num_features}}')}", { num_features: browseFeatureList.length }))); + p.appendChild(document.createTextNode(i18n("#{I18n.t('browse.start_rjs.loaded_an_area_with_num_features')}", { num_features: browseFeatureList.length }))); div.appendChild(p); var input = document.createElement("input"); @@ -187,7 +187,7 @@ page << < #{APP_CONFIG['max_request_area']}) { - setStatus(i18n_js("#{I18n.t('browse.start_rjs.unable_to_load_size', :bbox_size => '{{bbox_size}}', :max_bbox_size => APP_CONFIG['max_request_area'])}", { bbox_size: size })); + setStatus(i18n("#{I18n.t('browse.start_rjs.unable_to_load_size', :max_bbox_size => APP_CONFIG['max_request_area'])}", { bbox_size: size })); } else { loadGML("/api/#{API_VERSION}/map?bbox=" + projected.toBBOX()); } @@ -421,7 +421,7 @@ page << < '{{feature}}')}", { feature: featureNameHistory(this.feature) }))); + heading.appendChild(document.createTextNode(i18n("#{I18n.t('browse.start_rjs.history_for_feature')}", { feature: featureNameHistory(this.feature) }))); tr.appendChild(heading); var td = document.createElement("td"); @@ -442,7 +442,7 @@ page << < '{{user}}', :timestamp => '{{timestamp}}')}", { user: user, timestamp: timestamp }))); + item.appendChild(document.createTextNode(i18n("#{I18n.t('browse.start_rjs.edited_by_user_at_timestamp')}", { user: user, timestamp: timestamp }))); history.appendChild(item); } div.appendChild(history); @@ -470,9 +470,9 @@ page << < '{{id}}')}", { id: feature.osm_id }); + return i18n("#{I18n.t('browse.start_rjs.object_list.selected.type.node')}", { id: feature.osm_id }); } else if (featureType(feature) == "way") { - return i18n_js("#{I18n.t('browse.start_rjs.object_list.selected.type.way', :id => '{{id}}')}", { id: feature.osm_id }); + return i18n("#{I18n.t('browse.start_rjs.object_list.selected.type.way')}", { id: feature.osm_id }); } } @@ -480,28 +480,12 @@ page << < '{{id}}')}", { id: feature.osm_id }); + return i18n("#{I18n.t('browse.start_rjs.object_list.history.type.node')}", { id: feature.osm_id }); } else if (featureType(feature) == "way") { - return i18n_js("#{I18n.t('browse.start_rjs.object_list.history.type.way', :id => '{{id}}')}", { id: feature.osm_id }); + return i18n("#{I18n.t('browse.start_rjs.object_list.history.type.way')}", { id: feature.osm_id }); } } - /* - This is a hack so that we can interpolate JavaScript variables in - translation strings from Ruby, doing the string replacement - client-side instead of on the server. - */ - function i18n_js(string, keys) { - for (var key in keys) { - var re_key = '\{\{' + key + '\}\}'; - var re = new RegExp(re_key, "g"); - - string = string.replace(re, keys[key]); - } - - return string; - } - function setStatus(status) { $("browse_status").innerHTML = status; $("browse_status").style.display = "block"; diff --git a/app/views/browse/way.rhtml b/app/views/browse/way.html.erb similarity index 100% rename from app/views/browse/way.rhtml rename to app/views/browse/way.html.erb diff --git a/app/views/browse/way_history.rhtml b/app/views/browse/way_history.html.erb similarity index 100% rename from app/views/browse/way_history.rhtml rename to app/views/browse/way_history.html.erb diff --git a/app/views/changeset/_changeset.rhtml b/app/views/changeset/_changeset.html.erb similarity index 100% rename from app/views/changeset/_changeset.rhtml rename to app/views/changeset/_changeset.html.erb diff --git a/app/views/changeset/_changeset_paging_nav.rhtml b/app/views/changeset/_changeset_paging_nav.html.erb similarity index 100% rename from app/views/changeset/_changeset_paging_nav.rhtml rename to app/views/changeset/_changeset_paging_nav.html.erb diff --git a/app/views/changeset/_changesets.rhtml b/app/views/changeset/_changesets.html.erb similarity index 100% rename from app/views/changeset/_changesets.rhtml rename to app/views/changeset/_changesets.html.erb diff --git a/app/views/changeset/list.rhtml b/app/views/changeset/list.html.erb similarity index 100% rename from app/views/changeset/list.rhtml rename to app/views/changeset/list.html.erb diff --git a/app/views/changeset/list.rxml b/app/views/changeset/list.rss.builder similarity index 100% rename from app/views/changeset/list.rxml rename to app/views/changeset/list.rss.builder diff --git a/app/views/diary_entry/_diary_comment.rhtml b/app/views/diary_entry/_diary_comment.html.erb similarity index 100% rename from app/views/diary_entry/_diary_comment.rhtml rename to app/views/diary_entry/_diary_comment.html.erb diff --git a/app/views/diary_entry/_diary_entry.rhtml b/app/views/diary_entry/_diary_entry.html.erb similarity index 100% rename from app/views/diary_entry/_diary_entry.rhtml rename to app/views/diary_entry/_diary_entry.html.erb diff --git a/app/views/diary_entry/edit.rhtml b/app/views/diary_entry/edit.html.erb similarity index 100% rename from app/views/diary_entry/edit.rhtml rename to app/views/diary_entry/edit.html.erb diff --git a/app/views/diary_entry/list.rhtml b/app/views/diary_entry/list.html.erb similarity index 100% rename from app/views/diary_entry/list.rhtml rename to app/views/diary_entry/list.html.erb diff --git a/app/views/diary_entry/no_such_entry.rhtml b/app/views/diary_entry/no_such_entry.html.erb similarity index 100% rename from app/views/diary_entry/no_such_entry.rhtml rename to app/views/diary_entry/no_such_entry.html.erb diff --git a/app/views/diary_entry/no_such_user.rhtml b/app/views/diary_entry/no_such_user.html.erb similarity index 100% rename from app/views/diary_entry/no_such_user.rhtml rename to app/views/diary_entry/no_such_user.html.erb diff --git a/app/views/diary_entry/rss.rxml b/app/views/diary_entry/rss.rss.builder similarity index 100% rename from app/views/diary_entry/rss.rxml rename to app/views/diary_entry/rss.rss.builder diff --git a/app/views/diary_entry/view.rhtml b/app/views/diary_entry/view.html.erb similarity index 100% rename from app/views/diary_entry/view.rhtml rename to app/views/diary_entry/view.html.erb diff --git a/app/views/export/_start.rhtml b/app/views/export/_start.html.erb similarity index 100% rename from app/views/export/_start.rhtml rename to app/views/export/_start.html.erb diff --git a/app/views/export/start.rjs b/app/views/export/start.rjs index 8a17ca6ae..c146e236d 100644 --- a/app/views/export/start.rjs +++ b/app/views/export/start.rjs @@ -77,7 +77,7 @@ page << <#{I18n.t('export.start_rjs.view_larger_map')}'; + html += '
'+"#{I18n.t('export.start_rjs.view_larger_map')}"+''; $("export_html_text").value = html; diff --git a/app/views/geocoder/_results.rhtml b/app/views/geocoder/_results.html.erb similarity index 100% rename from app/views/geocoder/_results.rhtml rename to app/views/geocoder/_results.html.erb diff --git a/app/views/layouts/site.rhtml b/app/views/layouts/site.html.erb similarity index 77% rename from app/views/layouts/site.rhtml rename to app/views/layouts/site.html.erb index 7cefc59d8..37d2b1962 100644 --- a/app/views/layouts/site.rhtml +++ b/app/views/layouts/site.html.erb @@ -1,5 +1,5 @@ - + <%= javascript_include_tag 'prototype' %> <%= javascript_include_tag 'site' %> @@ -9,7 +9,7 @@ <%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => "/opensearch/osm.xml" }) %> <%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %> <%= yield :head %> - OpenStreetMap<%= ' | '+ h(@title) if @title %> + <%= t 'layouts.project_name.title' %><%= ' | '+ h(@title) if @title %>
@@ -22,14 +22,18 @@ <% if @user and @user.id %> - <%= t 'layouts.welcome_user', :user_link => (link_to h(@user.display_name), {:controller => 'user', :action => 'view', :display_name => @user.display_name}) %> | - <% @inbox_weight = 'bold' if @user.new_messages.size > 0 %> + <%= t 'layouts.welcome_user', :user_link => (link_to h(@user.display_name), {:controller => 'user', :action => 'view', :display_name => @user.display_name}, :title => t('layouts.welcome_user_link_tooltip')) %> | <%= yield :greeting %> - <%= link_to t('layouts.inbox', :size => @user.new_messages.size), {:controller => 'message', :action => 'inbox', :display_name => @user.display_name}, {:style => "font-weight: #{@inbox_weight};" } %> | - <%= link_to t('layouts.logout'), {:controller => 'user', :action => 'logout', :referer => request.request_uri}, {:id => 'logoutanchor'}%> - <% else %> - <%= link_to t('layouts.log_in'), {:controller => 'user', :action => 'login', :referer => request.request_uri}, {:id => 'loginanchor'}%> | - <%= link_to t('layouts.sign_up'), {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %> + <% + inbox_attributes = {} + inbox_attributes[:class] = 'greeting-bar-unread' if @user.new_messages.size > 0 + inbox_attributes[:title] = t 'layouts.inbox_tooltip', :count => @user.new_messages.size + %> + <%= link_to t('layouts.inbox', :count => @user.new_messages.size), {:controller => 'message', :action => 'inbox', :display_name => @user.display_name}, inbox_attributes %> | + <%= link_to t('layouts.logout'), {:controller => 'user', :action => 'logout', :referer => request.request_uri}, {:id => 'logoutanchor', :title => t('layouts.logout_tooltip')}%> + <% else %> + <%= link_to t('layouts.log_in'), {:controller => 'user', :action => 'login', :referer => request.request_uri}, {:id => 'loginanchor', :title => t('layouts.log_in_tooltip')} %> | + <%= link_to t('layouts.sign_up'), {:controller => 'user', :action => 'new'}, {:id => 'registeranchor', :title => t('layouts.sign_up_tooltip')} %> <% end %> @@ -65,8 +69,8 @@ @@ -81,8 +85,8 @@

<%= t 'layouts.intro_3', - :ucl => 'UCL VR Centre', - :bytemark => 'bytemark' %> + :ucl => link_to(t('layouts.intro_3_ucl'), "http://www.vr.ucl.ac.uk"), + :bytemark => link_to(t('layouts.intro_3_bytemark'), "http://www.bytemark.co.uk") %>

<% end %> @@ -103,9 +107,9 @@ <% end %> diff --git a/app/views/layouts/site.rxml b/app/views/layouts/site.rss.builder similarity index 100% rename from app/views/layouts/site.rxml rename to app/views/layouts/site.rss.builder diff --git a/app/views/message/_message_summary.rhtml b/app/views/message/_message_summary.html.erb similarity index 100% rename from app/views/message/_message_summary.rhtml rename to app/views/message/_message_summary.html.erb diff --git a/app/views/message/_sent_message_summary.rhtml b/app/views/message/_sent_message_summary.html.erb similarity index 100% rename from app/views/message/_sent_message_summary.rhtml rename to app/views/message/_sent_message_summary.html.erb diff --git a/app/views/message/inbox.rhtml b/app/views/message/inbox.html.erb similarity index 100% rename from app/views/message/inbox.rhtml rename to app/views/message/inbox.html.erb diff --git a/app/views/message/new.rhtml b/app/views/message/new.html.erb similarity index 100% rename from app/views/message/new.rhtml rename to app/views/message/new.html.erb diff --git a/app/views/message/no_such_user.rhtml b/app/views/message/no_such_user.html.erb similarity index 100% rename from app/views/message/no_such_user.rhtml rename to app/views/message/no_such_user.html.erb diff --git a/app/views/message/outbox.rhtml b/app/views/message/outbox.html.erb similarity index 100% rename from app/views/message/outbox.rhtml rename to app/views/message/outbox.html.erb diff --git a/app/views/message/read.rhtml b/app/views/message/read.html.erb similarity index 100% rename from app/views/message/read.rhtml rename to app/views/message/read.html.erb diff --git a/app/views/notifier/_gpx_description.html.erb b/app/views/notifier/_gpx_description.html.erb new file mode 100644 index 000000000..282579919 --- /dev/null +++ b/app/views/notifier/_gpx_description.html.erb @@ -0,0 +1,14 @@ +<%= t'notifier.gpx_notification.greeting' %> + +<%= t'notifier.gpx_notification.your_gpx_file' %> + + <%= @trace_name %> + +<%= t'notifier.gpx_notification.with_description' %> + + <%= @trace_description %> +<% if @trace_tags.length>0 %> +<%= t'notifier.gpx_notification.and_the_tags' %> +<% @trace_tags.each do |tag| %> + <%= tag.tag.rstrip %><% end %><% else %> +<%= t'notifier.gpx_notification.and_no_tags' %><% end %> diff --git a/app/views/notifier/_gpx_description.rhtml b/app/views/notifier/_gpx_description.rhtml deleted file mode 100644 index b31c7744e..000000000 --- a/app/views/notifier/_gpx_description.rhtml +++ /dev/null @@ -1,14 +0,0 @@ -Hi, - -It looks like your GPX file - - <%= @trace_name %> - -with the description - - <%= @trace_description %> -<% if @trace_tags.length>0 %> -and the following tags: -<% @trace_tags.each do |tag| %> - <%= tag.tag.rstrip %><% end %><% else %> -and no tags.<% end %> diff --git a/app/views/notifier/diary_comment_notification.rhtml b/app/views/notifier/diary_comment_notification.html.erb similarity index 100% rename from app/views/notifier/diary_comment_notification.rhtml rename to app/views/notifier/diary_comment_notification.html.erb diff --git a/app/views/notifier/email_confirm.text.html.rhtml b/app/views/notifier/email_confirm.text.html.erb similarity index 100% rename from app/views/notifier/email_confirm.text.html.rhtml rename to app/views/notifier/email_confirm.text.html.erb diff --git a/app/views/notifier/email_confirm.text.plain.rhtml b/app/views/notifier/email_confirm.text.plain.erb similarity index 100% rename from app/views/notifier/email_confirm.text.plain.rhtml rename to app/views/notifier/email_confirm.text.plain.erb diff --git a/app/views/notifier/friend_notification.rhtml b/app/views/notifier/friend_notification.html.erb similarity index 100% rename from app/views/notifier/friend_notification.rhtml rename to app/views/notifier/friend_notification.html.erb diff --git a/app/views/notifier/gpx_failure.html.erb b/app/views/notifier/gpx_failure.html.erb new file mode 100644 index 000000000..f59aa3dbb --- /dev/null +++ b/app/views/notifier/gpx_failure.html.erb @@ -0,0 +1,9 @@ +<%= render :partial => "gpx_description" %> +<%= t'notifier.gpx_notification.failure.failed_to_import' %> + + <%= @error %> + +<%= t'notifier.gpx_notification.failure.more_info_1' %> +<%= t'notifier.gpx_notification.failure.more_info_2' %> + + <%= t'notifier.gpx_notification.failure.import_failures_url' %> diff --git a/app/views/notifier/gpx_failure.rhtml b/app/views/notifier/gpx_failure.rhtml deleted file mode 100644 index 70d5d9b71..000000000 --- a/app/views/notifier/gpx_failure.rhtml +++ /dev/null @@ -1,9 +0,0 @@ -<%= render :partial => "gpx_description" %> -failed to import. Here's the error: - - <%= @error %> - -More information about GPX import failures and how to avoid -them can be found at: - - http://wiki.openstreetmap.org/wiki/GPX_Import_Failures diff --git a/app/views/notifier/gpx_success.html.erb b/app/views/notifier/gpx_success.html.erb new file mode 100644 index 000000000..1983fe71c --- /dev/null +++ b/app/views/notifier/gpx_success.html.erb @@ -0,0 +1,2 @@ +<%= render :partial => "gpx_description" %> +<%= t'notifier.gpx_notification.success.loaded_successfully', :trace_points => @trace_points, :possible_points => @possible_points %> diff --git a/app/views/notifier/gpx_success.rhtml b/app/views/notifier/gpx_success.rhtml deleted file mode 100644 index 2613d7429..000000000 --- a/app/views/notifier/gpx_success.rhtml +++ /dev/null @@ -1,3 +0,0 @@ -<%= render :partial => "gpx_description" %> -loaded successfully with <%= @trace_points %> out of a possible -<%= @possible_points %> points. diff --git a/app/views/notifier/lost_password.text.html.rhtml b/app/views/notifier/lost_password.text.html.erb similarity index 100% rename from app/views/notifier/lost_password.text.html.rhtml rename to app/views/notifier/lost_password.text.html.erb diff --git a/app/views/notifier/lost_password.text.plain.rhtml b/app/views/notifier/lost_password.text.plain.erb similarity index 100% rename from app/views/notifier/lost_password.text.plain.rhtml rename to app/views/notifier/lost_password.text.plain.erb diff --git a/app/views/notifier/message_notification.rhtml b/app/views/notifier/message_notification.html.erb similarity index 100% rename from app/views/notifier/message_notification.rhtml rename to app/views/notifier/message_notification.html.erb diff --git a/app/views/notifier/reset_password.text.html.rhtml b/app/views/notifier/reset_password.text.html.erb similarity index 100% rename from app/views/notifier/reset_password.text.html.rhtml rename to app/views/notifier/reset_password.text.html.erb diff --git a/app/views/notifier/reset_password.text.plain.rhtml b/app/views/notifier/reset_password.text.plain.erb similarity index 100% rename from app/views/notifier/reset_password.text.plain.rhtml rename to app/views/notifier/reset_password.text.plain.erb diff --git a/app/views/notifier/signup_confirm.text.html.rhtml b/app/views/notifier/signup_confirm.text.html.erb similarity index 100% rename from app/views/notifier/signup_confirm.text.html.rhtml rename to app/views/notifier/signup_confirm.text.html.erb diff --git a/app/views/notifier/signup_confirm.text.plain.rhtml b/app/views/notifier/signup_confirm.text.plain.erb similarity index 100% rename from app/views/notifier/signup_confirm.text.plain.rhtml rename to app/views/notifier/signup_confirm.text.plain.erb diff --git a/app/views/site/_key.rhtml b/app/views/site/_key.html.erb similarity index 86% rename from app/views/site/_key.rhtml rename to app/views/site/_key.html.erb index bf7954783..f01cb67dd 100644 --- a/app/views/site/_key.rhtml +++ b/app/views/site/_key.html.erb @@ -1,5 +1,5 @@ <% content_for :left_menu do %> -<%= link_to_function t('site.key.map_key'), "showKey();" %> +<%= link_to_function t('site.key.map_key'), "showKey();", { :title => t('site.key.map_key_tooltip') } %> <% end %>