From: Tom Hughes Date: Thu, 9 Jan 2020 10:36:31 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/2499' X-Git-Tag: live~3360 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/928465764e52407884b35e31a08bf9241e651269?hp=304deb3ca7adb17b412b0fda4fad10d73d0b90b6 Merge remote-tracking branch 'upstream/pull/2499' --- diff --git a/.travis.yml b/.travis.yml index b950b1e18..31f4aec53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,8 @@ before_script: - psql -U postgres -f db/functions/functions.sql openstreetmap - cp config/travis.database.yml config/database.yml - cp config/example.storage.yml config/storage.yml - - echo -e "---\nmemcache_servers:\n - 127.0.0.1" > config/settings.local.yml + - touch config/settings.local.yml + - echo -e "---\nmemcache_servers:\n - 127.0.0.1" > config/settings/test.local.yml - bundle exec rake db:migrate - bundle exec rake i18n:js:export - bundle exec rake yarn:install diff --git a/Gemfile.lock b/Gemfile.lock index a0d50c15a..997a7df09 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,7 +74,7 @@ GEM autoprefixer-rails (9.7.3) execjs aws-eventstream (1.0.3) - aws-partitions (1.260.0) + aws-partitions (1.261.0) aws-sdk-core (3.86.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) @@ -110,7 +110,7 @@ GEM autoprefixer-rails (>= 9.1.0) popper_js (>= 1.14.3, < 2) sassc-rails (>= 2.0.0) - browser (2.7.1) + browser (3.0.0) builder (3.2.4) bzip2-ffi (1.0.0) ffi (~> 1.0) @@ -131,10 +131,9 @@ GEM composite_primary_keys (12.0.1) activerecord (~> 6.0.0) concurrent-ruby (1.1.5) - config (2.0.0) - activesupport (>= 4.2) + config (2.1.0) deep_merge (~> 1.2, >= 1.2.1) - dry-schema (~> 1.0) + dry-validation (~> 1.0) coveralls (0.8.23) json (>= 1.8, < 3) simplecov (~> 0.16.1) @@ -183,6 +182,13 @@ GEM dry-equalizer (~> 0.3) dry-inflector (~> 0.1, >= 0.1.2) dry-logic (~> 1.0, >= 1.0.2) + dry-validation (1.4.0) + concurrent-ruby (~> 1.0) + dry-container (~> 0.7, >= 0.7.1) + dry-core (~> 0.4) + dry-equalizer (~> 0.2) + dry-initializer (~> 3.0) + dry-schema (~> 1.0, >= 1.3.1) dynamic_form (1.1.4) erb_lint (0.0.30) activesupport @@ -318,7 +324,7 @@ GEM parallel (1.19.1) parser (2.7.0.1) ast (~> 2.4.0) - pg (1.2.0) + pg (1.2.1) poltergeist (1.18.1) capybara (>= 2.1, < 4) cliver (~> 0.3.1) diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 5c6e58170..514d6dbb2 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -214,17 +214,15 @@ OSM.Query = function (map) { if (interestingFeature(element)) { var $li = $("
  • ") - .addClass("query-result") + .addClass("query-result list-group-item") .data("geometry", featureGeometry(element)) - .appendTo($ul); - var $p = $("

    ") .text(featurePrefix(element) + " ") - .appendTo($li); + .appendTo($ul); $("") .attr("href", "/" + element.type + "/" + element.id) .text(featureName(element)) - .appendTo($p); + .appendTo($li); } } diff --git a/app/assets/stylesheets/_bootstrap-custom.scss b/app/assets/stylesheets/_bootstrap-custom.scss index 96d37415f..e502f7db6 100644 --- a/app/assets/stylesheets/_bootstrap-custom.scss +++ b/app/assets/stylesheets/_bootstrap-custom.scss @@ -13,7 +13,7 @@ @import "bootstrap/type"; // @import "bootstrap/images"; // @import "bootstrap/code"; -// @import "bootstrap/grid"; +@import "bootstrap/grid"; // @import "bootstrap/tables"; // @import "bootstrap/forms"; // @import "bootstrap/buttons"; @@ -32,7 +32,7 @@ @import "bootstrap/alert"; // @import "bootstrap/progress"; // @import "bootstrap/media"; -// @import "bootstrap/list-group"; +@import "bootstrap/list-group"; // @import "bootstrap/close"; // @import "bootstrap/toasts"; // @import "bootstrap/modal"; diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 540f03e02..d7984436a 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -58,36 +58,6 @@ strong { clear: both; } -/* Basic grid */ - -.col0 { float:left; width:04.1666%; } -.col1 { float:left; width:08.3333%; } -.col2 { float:left; width:16.6666%; } -.col3 { float:left; width:25.0000%; } -.col4 { float:left; width:33.3333%; } -.col5 { float:left; width:41.6666%; } -.col6 { float:left; width:50.0000%; } -.col7 { float:left; width:58.3333%; } -.col8 { float:left; width:66.6666%; } -.col9 { float:left; width:75.0000%; } -.col10 { float:left; width:83.3333%; } -.col11 { float:left; width:91.6666%; } -.col12 { width:100%; } - -.margin0 { margin-left:04.1666%; } -.margin1 { margin-left:08.3333%; } -.margin2 { margin-left:16.6666%; } -.margin3 { margin-left:25.0000%; } -.margin4 { margin-left:33.3333%; } -.margin5 { margin-left:41.6666%; } -.margin6 { margin-left:50.0000%; } -.margin7 { margin-left:58.3333%; } -.margin8 { margin-left:66.6666%; } -.margin9 { margin-left:75.0000%; } -.margin10 { margin-left:83.3333%; } -.margin11 { margin-left:91.6666%; } -.margin12 { margin-left:100.0000%; } - .fillL { background-color: white; } /* Default rules for the body of every page */ @@ -541,6 +511,7 @@ body.compact { #sidebar { float: left; width: $sidebarWidth; + background: #fff; #sidebar_loader { display: none; @@ -1107,21 +1078,12 @@ tr.turn:hover { #sidebar .changesets { li { - padding: 15px 20px; - border-bottom: 1px solid $grey; cursor: pointer; &.selected { background: $list-highlight; } /* color is derived from changeset bbox fillColor in history.js */ } - h4 { - margin: 0; - a { - color: #000; - } - } - .comments { float: right; color: $darkgrey; @@ -1190,7 +1152,6 @@ tr.turn:hover { background-color: #F6F6F6; border: 1px solid $grey; border-radius: 3px; - font-size: 12px; table-layout: fixed; border-collapse: separate; @@ -1222,8 +1183,8 @@ tr.turn:hover { .colour-preview-box { float: right; - width: 12px; - height: 12px; + width: 14px; + height: 14px; margin: 4px 0px; border: 1px solid rgba(0, 0, 0, .1); // add color via inline css on element: background-color: ; @@ -1276,17 +1237,14 @@ tr.turn:hover { .query-results { display: none; + padding-bottom: $lineheight/2; h3 { - padding: $lineheight $lineheight $lineheight/2; - margin: 0; + padding: 0 $lineheight; } ul { li { - padding: 15px 20px; - border-bottom: 1px solid $grey; - &.query-result { cursor: pointer; } @@ -1403,19 +1361,6 @@ tr.turn:hover { /* Overrides for pages that use new layout conventions */ -.users-new, -.users-create, -.users-terms { - .content-body .content-inner { - padding: 0; - - .message { - margin-top: 80px; - padding: 20px; - } - } -} - .users-new, .users-create, .users-terms, @@ -2093,13 +2038,6 @@ abbr.geo { border-bottom: none; } -/* Rules for RSS buttons */ - -.rsssmall { - position: relative; - top: 3px; -} - /* General styles for action lists / subnavs / pager navs */ ul.secondary-actions { @@ -2269,12 +2207,6 @@ a.button { .richtext, .prose { - h1, h2 { - padding-bottom: $lineheight/2; - border-bottom: 1px dashed $grey; - margin-bottom: $lineheight/2; - } - code { font-size: 13px; background: $lightgrey; @@ -2632,11 +2564,6 @@ input.richtext_title[type="text"] { text-decoration: none; } - .note-box { - margin-top: 20px; - background-color: $offwhite; - } - .icon.note { background-color: #333; border-radius: 4px; diff --git a/app/assets/stylesheets/small.scss b/app/assets/stylesheets/small.scss index 12e21c7d8..f6126391a 100644 --- a/app/assets/stylesheets/small.scss +++ b/app/assets/stylesheets/small.scss @@ -182,19 +182,6 @@ body.small { top: auto; } - /* Rules for the sign-up page */ - - &.user-new, - &.user-create { - .col6 { - width: 100%; - } - - .aside { - display: none; - } - } - &.site-about #content .attr h1 { font-size: 28px; } diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a61a10d94..514b3f8ee 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -269,7 +269,7 @@ class UsersController < ApplicationController def logout @title = t "users.logout.title" - if params[:session] == session.id + if request.post? if session[:token] token = UserToken.find_by(:token => session[:token]) token&.destroy diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 1d33db9d8..c60dff84b 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -218,7 +218,9 @@ class Notifier < ApplicationMailer def set_references(scope, reference_object) ref = "osm-#{scope}-#{reference_object.id}@#{Settings.server_url}" + + headers["X-Entity-Ref-ID"] = ref headers["In-Reply-To"] = ref - headers["References"] = ref + headers["References"] = ref end end diff --git a/app/views/browse/_containing_relation.html.erb b/app/views/browse/_containing_relation.html.erb index b3cb90cec..ba05c1fe4 100644 --- a/app/views/browse/_containing_relation.html.erb +++ b/app/views/browse/_containing_relation.html.erb @@ -1,7 +1,7 @@

  • <%= linked_name = link_to h(printable_name(containing_relation.relation)), :action => "relation", :id => containing_relation.relation.id.to_s if containing_relation.member_role.blank? - raw t ".entry", :relation_name => linked_name + t ".entry_html", :relation_name => linked_name else - raw t ".entry_role", :relation_name => linked_name, :relation_role => h(containing_relation.member_role) + t ".entry_role_html", :relation_name => linked_name, :relation_role => h(containing_relation.member_role) end %>
  • diff --git a/app/views/browse/_relation_member.html.erb b/app/views/browse/_relation_member.html.erb index bb37bdf21..fe0f36357 100644 --- a/app/views/browse/_relation_member.html.erb +++ b/app/views/browse/_relation_member.html.erb @@ -3,8 +3,8 @@ type_str = t ".type." + relation_member.member_type.downcase %>
  • <%= if relation_member.member_role.blank? - raw t ".entry", :type => type_str, :name => linked_name + t ".entry_html", :type => type_str, :name => linked_name else - raw t ".entry_role", :type => type_str, :name => linked_name, :role => h(relation_member.member_role) + t ".entry_role_html", :type => type_str, :name => linked_name, :role => h(relation_member.member_role) end %>
  • diff --git a/app/views/browse/_way.html.erb b/app/views/browse/_way.html.erb index ed206c59b..5560344a8 100644 --- a/app/views/browse/_way.html.erb +++ b/app/views/browse/_way.html.erb @@ -25,7 +25,7 @@ <%= link_to printable_name(wn.node), { :action => "node", :id => wn.node_id.to_s }, { :class => link_class("node", wn.node), :title => link_title(wn.node), :rel => link_follow(wn.node) } %> <% related_ways = wn.node.ways.reject { |w| w.id == wn.way_id } %> <% if related_ways.size > 0 then %> - (<%= raw t ".also_part_of", :count => related_ways.size, :related_ways => related_ways.map { |w| link_to(printable_name(w), { :action => "way", :id => w.id.to_s }, { :class => link_class("way", w), :title => link_title(w) }) }.to_sentence %>) + (<%= t ".also_part_of_html", :count => related_ways.size, :related_ways => to_sentence(related_ways.map { |w| link_to(printable_name(w), { :action => "way", :id => w.id.to_s }, { :class => link_class("way", w), :title => link_title(w) }) }) %>) <% end %> <% end %> diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index 9ad35b2a7..148cb5a88 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -6,7 +6,7 @@
    -

    <%= linkify(h(@changeset.tags["comment"].to_s.presence || t("browse.no_comment"))) %>

    +
    <%= linkify(h(@changeset.tags["comment"].to_s.presence || t("browse.no_comment"))) %>
    <%= changeset_details(@changeset) %>
    <%= render :partial => "tag_details", :object => @changeset.tags.except("comment") %> diff --git a/app/views/browse/feature.html.erb b/app/views/browse/feature.html.erb index 6c94b0a9d..75e54f0b2 100644 --- a/app/views/browse/feature.html.erb +++ b/app/views/browse/feature.html.erb @@ -1,8 +1,8 @@ -<% set_title(t("browse.#{@type}.title", :name => printable_name(@feature))) %> +<% set_title(t("browse.#{@type}.title_html", :name => printable_name(@feature))) %>

    - <%= raw t("browse.#{@type}.title", :name => printable_name(@feature)) %> + <%= t("browse.#{@type}.title_html", :name => printable_name(@feature)) %>

    <%= render :partial => @type, :object => @feature %> diff --git a/app/views/browse/history.html.erb b/app/views/browse/history.html.erb index 0a2c1811c..faa88359e 100644 --- a/app/views/browse/history.html.erb +++ b/app/views/browse/history.html.erb @@ -1,8 +1,8 @@ -<% set_title(t("browse.#{@type}.history_title", :name => printable_name(@feature))) %> +<% set_title(t("browse.#{@type}.history_title_html", :name => printable_name(@feature))) %>

    - <%= raw t("browse.#{@type}.history_title", :name => printable_name(@feature)) %> + <%= t("browse.#{@type}.history_title_html", :name => printable_name(@feature)) %>

    <%= render :partial => @type, :collection => @feature.send("old_#{@type}s").reverse %> diff --git a/app/views/browse/query.html.erb b/app/views/browse/query.html.erb index ea40a00db..ad6fdddb5 100644 --- a/app/views/browse/query.html.erb +++ b/app/views/browse/query.html.erb @@ -12,11 +12,15 @@

    <%= t(".nearby") %>

    <%= image_tag "searching.gif", :class => "loader" %> -
      +
      +
        +

        <%= t(".enclosing") %>

        <%= image_tag "searching.gif", :class => "loader" %> -
          +
          +
            +
            diff --git a/app/views/changesets/_changeset.html.erb b/app/views/changesets/_changeset.html.erb index 56726e2d9..f1173671e 100644 --- a/app/views/changesets/_changeset.html.erb +++ b/app/views/changesets/_changeset.html.erb @@ -10,12 +10,12 @@ } end %> -<%= content_tag "li", :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data } do %> -

            - +<%= content_tag "li", :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data }, :class => "list-group-item" do %> +
            + <%= changeset.tags["comment"].to_s.presence || t("browse.no_comment") %> -
            +

            <%= changeset.comments.length %> diff --git a/app/views/changesets/index.html.erb b/app/views/changesets/index.html.erb index 1e3daa081..527a0a232 100644 --- a/app/views/changesets/index.html.erb +++ b/app/views/changesets/index.html.erb @@ -1,5 +1,5 @@ <% if @changesets.present? %> -
              +
                <%= render @changesets %>
              <% if @changesets.size == 20 -%> diff --git a/app/views/diary_entries/_diary_comment.html.erb b/app/views/diary_entries/_diary_comment.html.erb index 639ac9a19..3893072ad 100644 --- a/app/views/diary_entries/_diary_comment.html.erb +++ b/app/views/diary_entries/_diary_comment.html.erb @@ -1,6 +1,6 @@
              "> <%= user_thumbnail diary_comment.user %> -

              <%= raw(t(".comment_from", :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %> +

              <%= t(".comment_from_html", :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %> <% if current_user and diary_comment.user.id != current_user.id %> | <%= report_link(t(".report"), diary_comment) %> <% end %> diff --git a/app/views/diary_entries/_diary_entry.html.erb b/app/views/diary_entries/_diary_entry.html.erb index ef983ebde..5508817a8 100644 --- a/app/views/diary_entries/_diary_entry.html.erb +++ b/app/views/diary_entries/_diary_entry.html.erb @@ -7,7 +7,7 @@

              <%= link_to h(diary_entry.title), diary_entry_path(diary_entry.user, diary_entry) %>

              - <%= raw(t(".posted_by", :link_user => (link_to h(diary_entry.user.display_name), user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => "diary_entries", :action => "index", :display_name => nil, :language => diary_entry.language_code))) %> + <%= t(".posted_by_html", :link_user => (link_to h(diary_entry.user.display_name), user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to diary_entry.language.name, :controller => "diary_entries", :action => "index", :display_name => nil, :language => diary_entry.language_code)) %>
              diff --git a/app/views/diary_entries/show.html.erb b/app/views/diary_entries/show.html.erb index 1cc1e1c53..d8f4cd8f5 100644 --- a/app/views/diary_entries/show.html.erb +++ b/app/views/diary_entries/show.html.erb @@ -29,7 +29,7 @@
              <%= link_to t("javascripts.changesets.show.subscribe"), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %>
              <% end %> <% else %> -

              <%= raw t(".login_to_leave_a_comment", :login_link => link_to(t(".login"), :controller => "users", :action => "login", :referer => request.fullpath)) %>

              +

              <%= t(".login_to_leave_a_comment_html", :login_link => link_to(t(".login"), :controller => "users", :action => "login", :referer => request.fullpath)) %>

              <% end %>
            diff --git a/app/views/geocoder/search.html.erb b/app/views/geocoder/search.html.erb index 3eb9561a2..13144d568 100644 --- a/app/views/geocoder/search.html.erb +++ b/app/views/geocoder/search.html.erb @@ -5,7 +5,7 @@ <%= t("site.sidebar.search_results") %> <% @sources.each do |source| %> -

            <%= raw(t(".title.#{source}")) %>

            +

            <%= t(".title.#{source}_html") %>

            "> <%= image_tag "searching.gif", :class => "loader" %>
            diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 6df8f02da..3963c211e 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -102,7 +102,7 @@ <%= yield :greeting %>
          • - <%= link_to t("layouts.logout"), logout_path(:session => session.id, :referer => request.fullpath), :class => "geolink" %> + <%= link_to t("layouts.logout"), logout_path(:referer => request.fullpath), :method => "post", :class => "geolink" %>
          • diff --git a/app/views/messages/inbox.html.erb b/app/views/messages/inbox.html.erb index 40bb8e8a3..c3065f911 100644 --- a/app/views/messages/inbox.html.erb +++ b/app/views/messages/inbox.html.erb @@ -24,5 +24,5 @@ <% else %> -
            <%= raw(t(".no_messages_yet", :people_mapping_nearby_link => link_to(t(".people_mapping_nearby"), user_path(current_user)))) %>
            +
            <%= t(".no_messages_yet_html", :people_mapping_nearby_link => link_to(t(".people_mapping_nearby"), user_path(current_user))) %>
            <% end %> diff --git a/app/views/messages/new.html.erb b/app/views/messages/new.html.erb index 2429feb52..2aac33efa 100644 --- a/app/views/messages/new.html.erb +++ b/app/views/messages/new.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

            <%= raw(t(".send_message_to", :name => link_to(h(@message.recipient.display_name), user_path(@message.recipient)))) %>

            +

            <%= t(".send_message_to_html", :name => link_to(h(@message.recipient.display_name), user_path(@message.recipient))) %>

            <% end %> <%= error_messages_for "message" %> diff --git a/app/views/messages/outbox.html.erb b/app/views/messages/outbox.html.erb index a06e18838..806f1207a 100644 --- a/app/views/messages/outbox.html.erb +++ b/app/views/messages/outbox.html.erb @@ -3,7 +3,7 @@ <% end %> <% content_for :heading do %> -

            <%= raw(t(".my_inbox", :inbox_link => link_to(t(".inbox"), inbox_messages_path))) %>/<%= t ".outbox" %>

            +

            <%= t(".my_inbox_html", :inbox_link => link_to(t(".inbox"), inbox_messages_path)) %>/<%= t ".outbox" %>

            <% end %>

            <%= t ".messages", :count => current_user.sent_messages.size %>

            @@ -23,5 +23,5 @@ <% else %> -
            <%= raw(t(".no_sent_messages", :people_mapping_nearby_link => link_to(t(".people_mapping_nearby"), user_path(current_user)))) %>
            +
            <%= t(".no_sent_messages_html", :people_mapping_nearby_link => link_to(t(".people_mapping_nearby"), user_path(current_user))) %>
            <% end %> diff --git a/app/views/oauth/authorize.html.erb b/app/views/oauth/authorize.html.erb index c480b4c99..5fd3c2fee 100644 --- a/app/views/oauth/authorize.html.erb +++ b/app/views/oauth/authorize.html.erb @@ -2,7 +2,7 @@

            <%= t ".title" %>

            <% end %> -

            <%= raw t(".request_access", :app_name => link_to(@token.client_application.name, @token.client_application.url), :user => link_to(current_user.display_name, user_path(current_user))) %>

            +

            <%= t(".request_access_html", :app_name => link_to(@token.client_application.name, @token.client_application.url), :user => link_to(current_user.display_name, user_path(current_user))) %>

            <%= form_tag authorize_url do %> <%= hidden_field_tag "oauth_token", @token.token %> diff --git a/app/views/oauth/authorize_success.html.erb b/app/views/oauth/authorize_success.html.erb index 9c817372f..63239a386 100644 --- a/app/views/oauth/authorize_success.html.erb +++ b/app/views/oauth/authorize_success.html.erb @@ -2,7 +2,7 @@

            <%= t ".title" %>

            <% end %> -

            <%= raw t(".allowed", :app_name => link_to(@token.client_application.name, @token.client_application.url)) %>

            +

            <%= t(".allowed_html", :app_name => link_to(@token.client_application.name, @token.client_application.url)) %>

            <% if @token.oob? and not @token.oauth10? %>

            <%= t ".verification", :code => @token.verifier %>

            diff --git a/app/views/oauth_clients/index.html.erb b/app/views/oauth_clients/index.html.erb index 54bb4f9f6..0ce09d57c 100644 --- a/app/views/oauth_clients/index.html.erb +++ b/app/views/oauth_clients/index.html.erb @@ -29,7 +29,7 @@ <% end %>

            <%= t ".my_apps" %>

            <% if @client_applications.empty? %> -

            <%= raw(t(".no_apps", :oauth => "OAuth")) %>

            +

            <%= t(".no_apps_html", :oauth => link_to(t(".oauth"), "https://oauth.net")) %>

            <% else %>

            <%= t ".registered_apps" %>

            <% @client_applications.each do |client| %> diff --git a/app/views/site/_potlatch.html.erb b/app/views/site/_potlatch.html.erb index 3ebcf7fab..fedecbae8 100644 --- a/app/views/site/_potlatch.html.erb +++ b/app/views/site/_potlatch.html.erb @@ -6,5 +6,5 @@ <% data[:lat] = @lat if @lat -%> <% data[:lon] = @lon if @lon -%> <% data[:zoom] = @zoom if @zoom -%> - <%= content_tag :div, raw(t("site.edit.flash_player_required")), :id => "potlatch", :data => data %> + <%= content_tag :div, t("site.edit.flash_player_required_html"), :id => "potlatch", :data => data %> diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index 11519c26e..bab612491 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -15,5 +15,5 @@ <% end %> <% data[:locale] = Locale.list(Potlatch2::LOCALES.keys).preferred(preferred_languages).to_s -%> <% data[:locale_path] = asset_path("potlatch2/locales/#{Potlatch2::LOCALES[data[:locale]]}.swf") -%> - <%= content_tag :div, raw(t("site.edit.flash_player_required")), :id => "potlatch", :data => data %> + <%= content_tag :div, t("site.edit.flash_player_required_html"), :id => "potlatch", :data => data %> diff --git a/app/views/site/about.html.erb b/app/views/site/about.html.erb index f5e90ff25..717059fa2 100644 --- a/app/views/site/about.html.erb +++ b/app/views/site/about.html.erb @@ -6,7 +6,7 @@
            -

            <%= raw t ".used_by", :name => "OpenStreetMap", :locale => @locale %>

            +

            <%= t ".used_by_html", :name => content_tag(:span, "OpenStreetMap", :class => "user-name"), :locale => @locale %>

            diff --git a/app/views/site/copyright.html.erb b/app/views/site/copyright.html.erb index feec81c82..75f4e878d 100644 --- a/app/views/site/copyright.html.erb +++ b/app/views/site/copyright.html.erb @@ -6,14 +6,14 @@ <%= tag.h1 :lang => @locale, :dir => t("html.dir", :locale => @locale) do %>

            <%= t ".native.title" %>

            - <%= raw t ".native.text", - :native_link => link_to(t(".native.native_link"), - :controller => "site", - :action => "copyright", - :copyright_locale => nil), - :mapping_link => link_to(t(".native.mapping_link"), - :controller => "site", - :action => "index") %> + <%= t ".native.html", + :native_link => link_to(t(".native.native_link"), + :controller => "site", + :action => "copyright", + :copyright_locale => nil), + :mapping_link => link_to(t(".native.mapping_link"), + :controller => "site", + :action => "index") %>

            <% end %>
            @@ -24,11 +24,11 @@ <% if t(".legal_babble", :locale => @locale) != t(".legal_babble", :locale => :en) %>

            <%= t ".foreign.title" %>

            - <%= raw t ".foreign.text", - :english_original_link => link_to(t(".foreign.english_link"), - :controller => "site", - :action => "copyright", - :copyright_locale => "en") %> + <%= t ".foreign.html", + :english_original_link => link_to(t(".foreign.english_link"), + :controller => "site", + :action => "copyright", + :copyright_locale => "en") %>

            <% end %>
            diff --git a/app/views/site/edit.html.erb b/app/views/site/edit.html.erb index 1dba95e5d..d991adf39 100644 --- a/app/views/site/edit.html.erb +++ b/app/views/site/edit.html.erb @@ -5,8 +5,8 @@

            <%= t "layouts.osm_read_only" %>

            <% elsif !current_user.data_public? %>

            <%= t ".not_public" %>

            -

            <%= raw t ".not_public_description", :user_page => (link_to t(".user_page_link"), :controller => "users", :action => "account", :display_name => current_user.display_name, :anchor => "public") %>

            -

            <%= raw t "site.edit.anon_edits", :link => link_to(t(".anon_edits_link_text"), t(".anon_edits_link")) %>

            +

            <%= t ".not_public_description_html", :user_page => (link_to t(".user_page_link"), :controller => "users", :action => "account", :display_name => current_user.display_name, :anchor => "public") %>

            +

            <%= t ".anon_edits_html", :link => link_to(t(".anon_edits_link_text"), t(".anon_edits_link")) %>

            <% else %> <%= render :partial => preferred_editor %> <% end %> diff --git a/app/views/site/export.html.erb b/app/views/site/export.html.erb index 4af1a0ff3..f1eed33cf 100644 --- a/app/views/site/export.html.erb +++ b/app/views/site/export.html.erb @@ -21,7 +21,7 @@

            <%= t ".licence" %>

            -

            <%= raw t ".export_details" %>

            +

            <%= t ".export_details_html" %>

            diff --git a/app/views/site/fixthemap.html.erb b/app/views/site/fixthemap.html.erb index 4bb478c7e..3c82e2374 100644 --- a/app/views/site/fixthemap.html.erb +++ b/app/views/site/fixthemap.html.erb @@ -7,31 +7,30 @@ <% end %>

            <%= t "layouts.intro_header" %>

            -

            <%= t "layouts.intro_text" %>

            <%= t ".how_to_help.title" %>

            -
            -
            -

            <%= t ".how_to_help.join_the_community.title" %>

            - <%= t ".how_to_help.join_the_community.explanation_html" %> -
            - +
            +
            +
            +
            <%= t ".how_to_help.join_the_community.title" %>
            +

            <%= t ".how_to_help.join_the_community.explanation_html" %>

            +

            + +

            +
            +
            +
            <%= t "site.welcome.add_a_note.title" %>
            +

            <%= t "site.welcome.add_a_note.paragraph_1_html" %>

            +

            <%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %>

            -
            -
            -

            <%= t "site.welcome.add_a_note.title" %>

            -

            <%= t "site.welcome.add_a_note.paragraph_1_html" %>

            -

            <%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %>

            <%= t ".other_concerns.title" %>

            <%= t ".other_concerns.explanation_html" %>

            -
            -

            <%= t "site.welcome.questions.title" %>

            - -

            <%= t "site.welcome.questions.paragraph_1_html", :help_url => help_path %>

            -
            +

            <%= t "site.welcome.questions.title" %>

            + +

            <%= t "site.welcome.questions.paragraph_1_html", :help_url => help_path %>

            diff --git a/app/views/site/welcome.html.erb b/app/views/site/welcome.html.erb index dc6a519df..4617935e7 100644 --- a/app/views/site/welcome.html.erb +++ b/app/views/site/welcome.html.erb @@ -10,15 +10,15 @@

            <%= t ".whats_on_the_map.title" %>

            -
            -
            -
            +
            +
            +

            <%= t ".whats_on_the_map.on_html" %>

            -
            -
            +
            +

            <%= t ".whats_on_the_map.off_html" %>

            @@ -29,7 +29,7 @@

            <%= t ".basic_terms.paragraph_1_html" %>

            -
            +

            <%= t ".basic_terms.editor_html" %>

            @@ -48,26 +48,24 @@
            -
            +

            <%= t ".rules.title" %>

            <%= t ".rules.paragraph_1_html" %>

            -
            +

            <%= t ".questions.title" %>

            <%= t ".questions.paragraph_1_html", :help_url => help_path %>

            -
            -
            -

            <%= t ".add_a_note.title" %>

            -

            <%= t ".add_a_note.paragraph_1_html" %>

            -

            <%= t ".add_a_note.paragraph_2_html", :map_url => root_path %>

            -
            +
            +

            <%= t ".add_a_note.title" %>

            +

            <%= t ".add_a_note.paragraph_1_html" %>

            +

            <%= t ".add_a_note.paragraph_2_html", :map_url => root_path %>

            diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb index 8b754a591..47860d50d 100644 --- a/app/views/traces/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -30,7 +30,7 @@ <%= t ".by" %> <%= link_to h(trace.user.display_name), user_path(trace.user) %> <% if !trace.tags.empty? %> <%= t ".in" %> - <%= raw(trace.tags.collect { |tag| link_to_tag tag.tag }.join(", ")) %> + <%= safe_join(trace.tags.collect { |tag| link_to_tag tag.tag }, ", ") %> <% end %> diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index 728b29c45..e049797a8 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -40,7 +40,7 @@ <%= t ".tags" %> <% unless @trace.tags.empty? %> - <%= raw(@trace.tags.collect { |tag| link_to tag.tag, :controller => "traces", :action => "index", :tag => tag.tag, :id => nil }.join(", ")) %> + <%= safe_join(@trace.tags.collect { |tag| link_to tag.tag, :controller => "traces", :action => "index", :tag => tag.tag, :id => nil }, ", ") %> <% else %> <%= t ".none" %> <% end %> diff --git a/app/views/user_blocks/blocks_by.html.erb b/app/views/user_blocks/blocks_by.html.erb index 284052a7b..6b4e60daa 100644 --- a/app/views/user_blocks/blocks_by.html.erb +++ b/app/views/user_blocks/blocks_by.html.erb @@ -1,6 +1,6 @@ <% @title = t(".title", :name => h(@user.display_name)) %> <% content_for :heading do %> -

            <%= raw(t(".heading", :name => link_to(h(@user.display_name), user_path(@user)))) %>

            +

            <%= t(".heading_html", :name => link_to(@user.display_name, user_path(@user))) %>

            <% end %> <% unless @user_blocks.empty? %> diff --git a/app/views/user_blocks/blocks_on.html.erb b/app/views/user_blocks/blocks_on.html.erb index bb71d48c8..cfdc9abf1 100644 --- a/app/views/user_blocks/blocks_on.html.erb +++ b/app/views/user_blocks/blocks_on.html.erb @@ -1,6 +1,6 @@ <% @title = t(".title", :name => h(@user.display_name)) %> <% content_for :heading do %> -

            <%= raw(t(".heading", :name => link_to(h(@user.display_name), user_path(@user)))) %>

            +

            <%= t(".heading_html", :name => link_to(@user.display_name, user_path(@user))) %>

            <% end %> <% unless @user_blocks.empty? %> <%= render :partial => "blocks", :locals => { :show_revoke_link => can?(:revoke, UserBlock), :show_user_name => false, :show_creator_name => true } %> diff --git a/app/views/user_blocks/edit.html.erb b/app/views/user_blocks/edit.html.erb index 88d7e4f23..69ab5f9f3 100644 --- a/app/views/user_blocks/edit.html.erb +++ b/app/views/user_blocks/edit.html.erb @@ -1,8 +1,8 @@ <% @title = t ".title", :name => h(@user_block.user.display_name) %> <% content_for :heading do %> -

            <%= raw t(".title", - :name => link_to(h(@user_block.user.display_name), - user_path(@user_block.user))) %>

            +

            <%= t(".heading_html", + :name => link_to(@user_block.user.display_name, + user_path(@user_block.user))) %>

            • <%= link_to t(".show"), @user_block %>
            • <%= link_to t(".back"), user_blocks_path %>
            • diff --git a/app/views/user_blocks/new.html.erb b/app/views/user_blocks/new.html.erb index bd492a354..18b03eda9 100644 --- a/app/views/user_blocks/new.html.erb +++ b/app/views/user_blocks/new.html.erb @@ -1,8 +1,8 @@ <% @title = t ".title", :name => h(@user.display_name) %> <% content_for :heading do %> -

              <%= raw t(".heading", - :name => link_to(h(@user.display_name), - user_path(@user))) %>

              +

              <%= t(".heading_html", + :name => link_to(@user.display_name, + user_path(@user))) %>

              <% end %> <%= form_for(@user_block) do |f| %> <%= f.error_messages %> diff --git a/app/views/user_blocks/revoke.html.erb b/app/views/user_blocks/revoke.html.erb index 9bd7df5ae..df48747dd 100644 --- a/app/views/user_blocks/revoke.html.erb +++ b/app/views/user_blocks/revoke.html.erb @@ -3,11 +3,11 @@ :block_by => h(@user_block.creator.display_name)) %> <% content_for :heading do %> -

              <%= raw t(".heading", - :block_on => link_to(h(@user_block.user.display_name), - user_path(@user_block.user)), - :block_by => link_to(h(@user_block.creator.display_name), - user_path(@user_block.creator))) %>

              +

              <%= t(".heading_html", + :block_on => link_to(@user_block.user.display_name, + user_path(@user_block.user)), + :block_by => link_to(@user_block.creator.display_name, + user_path(@user_block.creator))) %>

              <% end %> <% if @user_block.ends_at > Time.now %> diff --git a/app/views/user_blocks/show.html.erb b/app/views/user_blocks/show.html.erb index 7e225bf14..6bfb412ef 100644 --- a/app/views/user_blocks/show.html.erb +++ b/app/views/user_blocks/show.html.erb @@ -3,11 +3,11 @@ :block_by => @user_block.creator.display_name) %> <% content_for :heading do %> -

              <%= raw t(".heading", - :block_on => link_to(h(@user_block.user.display_name), - user_path(@user_block.user)), - :block_by => link_to(h(@user_block.creator.display_name), - user_path(@user_block.creator))) %>

              +

              <%= t(".heading_html", + :block_on => link_to(@user_block.user.display_name, + user_path(@user_block.user)), + :block_by => link_to(@user_block.creator.display_name, + user_path(@user_block.creator))) %>

                <% if @user_block.ends_at > Time.now.getutc %> <% if current_user and current_user.id == @user_block.creator_id %> diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index beff4b0ae..c8fd4ac9e 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb @@ -7,14 +7,14 @@

                <% if user.creation_ip %> - <%= raw t "users.index.summary", - :name => link_to(h(user.display_name), user_path(user)), - :ip_address => link_to(user.creation_ip, :ip => user.creation_ip), - :date => l(user.creation_time, :format => :friendly) %> + <%= t "users.index.summary_html", + :name => link_to(h(user.display_name), user_path(user)), + :ip_address => link_to(user.creation_ip, :ip => user.creation_ip), + :date => l(user.creation_time, :format => :friendly) %> <% else %> - <%= raw t "users.index.summary_no_ip", - :name => link_to(h(user.display_name), user_path(user)), - :date => l(user.creation_time, :format => :friendly) %> + <%= t "users.index.summary_no_ip_html", + :name => link_to(h(user.display_name), user_path(user)), + :date => l(user.creation_time, :format => :friendly) %> <% end %>

                <%= user.description.to_html %>
                diff --git a/app/views/users/account.html.erb b/app/views/users/account.html.erb index 7fd6929ca..4021e5c08 100644 --- a/app/views/users/account.html.erb +++ b/app/views/users/account.html.erb @@ -175,6 +175,6 @@ <% unless current_user.data_public? %>

                <%= t ".public editing note.heading" %>

                -<%= raw t ".public editing note.text" %> +<%= t ".public editing note.html" %> <%= button_to t(".make edits public button"), :action => :go_public %> <% end %> diff --git a/app/views/users/blocked.html.erb b/app/views/users/blocked.html.erb index 2b2ff06f6..5e6505cac 100644 --- a/app/views/users/blocked.html.erb +++ b/app/views/users/blocked.html.erb @@ -6,5 +6,5 @@

                <%= t "users.new.no_auto_account_create" %>

                -

                <%= raw t "users.new.contact_webmaster", :webmaster => "mailto:#{Settings.support_email}" %>

                +

                <%= t "users.new.contact_webmaster_html", :webmaster => "mailto:#{Settings.support_email}" %>

                diff --git a/app/views/users/login.html.erb b/app/views/users/login.html.erb index 9bfa23cbc..b10a2b291 100644 --- a/app/views/users/login.html.erb +++ b/app/views/users/login.html.erb @@ -74,7 +74,7 @@
              - + <%= hidden_field_tag("openid_referer", params[:referer]) if params[:referer] %> <%= text_field_tag("openid_url", "", :tabindex => 3, :class => "openid_url") %> (" target="_new"><%= t "users.account.openid.link text" %>) diff --git a/app/views/users/logout.html.erb b/app/views/users/logout.html.erb index 273c7e1b9..5d8e2de49 100644 --- a/app/views/users/logout.html.erb +++ b/app/views/users/logout.html.erb @@ -4,6 +4,5 @@ <%= form_tag :action => "logout" do %> <%= hidden_field_tag("referer", h(params[:referer])) %> - <%= hidden_field_tag("session", session.id) %> <%= submit_tag t(".logout_button") %> <% end %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 0cb70d2d5..5acaa4e95 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -8,75 +8,79 @@
              <% end %> -<%= form_for current_user, :url => { :action => "create" }, :html => { :class => "standard-form fillL col6 inner22" } do |f| %> - <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %> +
              +
              +

              <%= t ".about.header" %>

              + <%= t ".about.html" %> +
              -
              -
              - - <%= f.email_field(:email, :tabindex => 1) %> - <%= f.error_message_on(:email) %> -
              -
              - - <%= f.email_field(:email_confirmation, :tabindex => 2) %> - <%= f.error_message_on(:email_confirmation) %> -
              - <%= raw(t(".not displayed publicly")) %> -
              +
              + <%= form_for current_user, :url => { :action => "create" }, :html => { :class => "standard-form" } do |f| %> + <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %> -
              -
              - - <%= f.text_field(:display_name, :tabindex => 3) %> - <%= f.error_message_on(:display_name) %> -
              - <%= t ".display name description" %> -
              +
              +
              + + <%= f.email_field(:email, :tabindex => 1) %> + <%= f.error_message_on(:email) %> +
              +
              + + <%= f.email_field(:email_confirmation, :tabindex => 2) %> + <%= f.error_message_on(:email_confirmation) %> +
              + <%= t(".not_displayed_publicly_html") %> +
              -
              -
              - - <%= f.select(:auth_provider, Auth::PROVIDERS, :default => "", :tabindex => 4) %> - <%= f.text_field(:auth_uid, :tabindex => 5) %> - <%= f.error_message_on(:auth_uid) %> -
              - <%= t ".auth no password" %> -
              +
              +
              + + <%= f.text_field(:display_name, :tabindex => 3) %> + <%= f.error_message_on(:display_name) %> +
              + <%= t ".display name description" %> +
              -
              -
              - - <%= f.password_field(:pass_crypt, :tabindex => 6) %> - <%= f.error_message_on(:pass_crypt) %> -
              -
              - - <%= f.password_field(:pass_crypt_confirmation, :tabindex => 7) %> - <%= f.error_message_on(:pass_crypt_confirmation) %> -
              -
              +
              +
              + + <%= f.select(:auth_provider, Auth::PROVIDERS, :default => "", :tabindex => 4) %> + <%= f.text_field(:auth_uid, :tabindex => 5) %> + <%= f.error_message_on(:auth_uid) %> +
              + <%= t ".auth no password" %> +
              -
              - <%= link_to raw(t(".use external auth")), "#", :id => "auth_enable" %> -
              +
              +
              + + <%= f.password_field(:pass_crypt, :tabindex => 6) %> + <%= f.error_message_on(:pass_crypt) %> +
              +
              + + <%= f.password_field(:pass_crypt_confirmation, :tabindex => 7) %> + <%= f.error_message_on(:pass_crypt_confirmation) %> +
              +
              - <%= submit_tag t(".continue"), :tabindex => 8 %> -<% end %> +
              + <%= link_to t(".use external auth"), "#", :id => "auth_enable" %> +
              -
              -

              <%= t ".about.header" %>

              - <%= t ".about.html" %> + <%= submit_tag t(".continue"), :tabindex => 8 %> + <% end %> +
              diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 7e8b45185..011226109 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -183,7 +183,7 @@ <% if current_user and @user.id == current_user.id %> <% if @user.home_lat.nil? or @user.home_lon.nil? %>
              -

              <%= raw(t(".if set location", :settings_link => (link_to t(".settings_link_text"), :controller => "users", :action => "account", :display_name => current_user.display_name))) %>

              +

              <%= t(".if_set_location_html", :settings_link => (link_to t(".settings_link_text"), :controller => "users", :action => "account", :display_name => current_user.display_name)) %>

              <% else %> <% content_for :head do %> diff --git a/app/views/users/suspended.html.erb b/app/views/users/suspended.html.erb index 3a2df498a..002c632dd 100644 --- a/app/views/users/suspended.html.erb +++ b/app/views/users/suspended.html.erb @@ -4,4 +4,4 @@

              <%= t ".heading" %>

              <% end %> -<%= raw t ".body", :webmaster => link_to(t(".webmaster"), "mailto:#{Settings.support_email}") %> +<%= t ".body_html", :webmaster => link_to(t(".webmaster"), "mailto:#{Settings.support_email}") %> diff --git a/app/views/users/terms.html.erb b/app/views/users/terms.html.erb index d4a9fa0bd..243ce2863 100644 --- a/app/views/users/terms.html.erb +++ b/app/views/users/terms.html.erb @@ -7,13 +7,13 @@
              <% end %> -<%= form_tag({ :action => "save" }, { :class => " inner22 standard-form fillL" }) do %> +<%= form_tag({ :action => "save" }, { :class => "standard-form fillL" }) do %>

              <%= t ".read and accept with tou" %>

              -