From: Tom Hughes Date: Wed, 18 Mar 2020 20:15:06 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/2548' X-Git-Tag: live~3284 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/e89742928ddccbe127955f94be4be61e13f1faed?hp=c70e919b472732fd3cf0ae340af28f2624278f6d Merge remote-tracking branch 'upstream/pull/2548' --- diff --git a/.rubocop.yml b/.rubocop.yml index 77f26d863..1c41c027a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -61,9 +61,6 @@ Rails/SkipsModelValidations: - 'db/migrate/*.rb' - 'app/controllers/users_controller.rb' -Style/BracesAroundHashParameters: - EnforcedStyle: context_dependent - Style/Documentation: Enabled: false @@ -76,12 +73,21 @@ Style/IfInsideElse: Style/GuardClause: Enabled: false +Style/HashEachMethods: + Enabled: true + Style/HashSyntax: EnforcedStyle: hash_rockets Exclude: - 'lib/tasks/testing.rake' - 'config/initializers/wrap_parameters.rb' +Style/HashTransformKeys: + Enabled: true + +Style/HashTransformValues: + Enabled: true + Style/MixinUsage: Exclude: - 'bin/setup' diff --git a/Gemfile b/Gemfile index 9a3fb1f6b..95144d438 100644 --- a/Gemfile +++ b/Gemfile @@ -138,7 +138,6 @@ end # Gems needed for running tests group :test do - gem "fakefs", :require => "fakefs/safe" gem "minitest", "~> 5.1", :platforms => [:ruby_19, :ruby_20] gem "rails-controller-testing" gem "rubocop" diff --git a/Gemfile.lock b/Gemfile.lock index 7761ee733..95fdf3569 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ GEM remote: https://rubygems.org/ specs: SystemTimer (1.2.3) - aasm (5.0.6) + aasm (5.0.8) concurrent-ruby (~> 1.0) actioncable (6.0.2.1) actionpack (= 6.0.2.1) @@ -67,29 +67,29 @@ GEM zeitwerk (~> 2.2) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - annotate (3.0.3) + annotate (3.1.0) activerecord (>= 3.2, < 7.0) rake (>= 10.4, < 14.0) ast (2.4.0) autoprefixer-rails (9.7.4) execjs aws-eventstream (1.0.3) - aws-partitions (1.272.0) - aws-sdk-core (3.90.0) + aws-partitions (1.281.0) + aws-sdk-core (3.91.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.29.0) + aws-sdk-kms (1.30.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.60.2) + aws-sdk-s3 (1.61.0) aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.0) + aws-sigv4 (1.1.1) aws-eventstream (~> 1.0, >= 1.0.2) - better_errors (2.5.1) + better_errors (2.6.0) coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) @@ -104,13 +104,13 @@ GEM bigdecimal (1.1.0) binding_of_caller (0.8.0) debug_inspector (>= 0.0.1) - bootsnap (1.4.5) + bootsnap (1.4.6) msgpack (~> 1.0) bootstrap (4.3.1) autoprefixer-rails (>= 9.1.0) popper_js (>= 1.14.3, < 2) sassc-rails (>= 2.0.0) - browser (3.0.3) + browser (4.0.0) builder (3.2.4) bzip2-ffi (1.0.0) ffi (~> 1.0) @@ -152,9 +152,10 @@ GEM activerecord (>= 3.0, < 6.1) delayed_job (>= 3.0, < 5) docile (1.3.2) - dry-configurable (0.9.0) + dry-configurable (0.11.3) concurrent-ruby (~> 1.0) dry-core (~> 0.4, >= 0.4.7) + dry-equalizer (~> 0.2) dry-container (0.7.2) concurrent-ruby (~> 1.0) dry-configurable (~> 0.1, >= 0.1.3) @@ -167,35 +168,35 @@ GEM concurrent-ruby (~> 1.0) dry-core (~> 0.2) dry-equalizer (~> 0.2) - dry-schema (1.4.3) + dry-schema (1.5.0) concurrent-ruby (~> 1.0) dry-configurable (~> 0.8, >= 0.8.3) dry-core (~> 0.4) dry-equalizer (~> 0.2) dry-initializer (~> 3.0) dry-logic (~> 1.0) - dry-types (~> 1.2) - dry-types (1.3.0) + dry-types (~> 1.4) + dry-types (1.4.0) concurrent-ruby (~> 1.0) dry-container (~> 0.3) dry-core (~> 0.4, >= 0.4.4) dry-equalizer (~> 0.3) dry-inflector (~> 0.1, >= 0.1.2) dry-logic (~> 1.0, >= 1.0.2) - dry-validation (1.4.2) + dry-validation (1.5.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.4, >= 1.4.3) + dry-schema (~> 1.5) dynamic_form (1.1.4) - erb_lint (0.0.31) + erb_lint (0.0.30) activesupport better_html (~> 1.0.7) html_tokenizer rainbow - rubocop (~> 0.79.0) + rubocop (~> 0.51) smart_properties erubi (1.9.0) execjs (2.7.0) @@ -205,7 +206,6 @@ GEM factory_bot_rails (5.1.1) factory_bot (~> 5.1.0) railties (>= 4.2.0) - fakefs (1.0.0) faraday (1.0.0) multipart-post (>= 1.2, < 3) ffi (1.12.2) @@ -216,14 +216,14 @@ GEM ffi (>= 1.0.0) globalid (0.4.2) activesupport (>= 4.2.0) - hashdiff (1.0.0) - hashie (3.6.0) + hashdiff (1.0.1) + hashie (4.1.0) html_tokenizer (0.0.7) htmlentities (4.3.4) http_accept_language (2.0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) - i18n-js (3.5.1) + i18n-js (3.6.0) i18n (>= 0.6.6) image_optim (0.26.5) exifr (~> 1.2, >= 1.2.2) @@ -277,7 +277,7 @@ GEM multi_xml (0.6.0) multipart-post (2.1.1) nio4r (2.5.2) - nokogiri (1.10.8) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) nokogumbo (2.0.2) nokogiri (~> 1.8, >= 1.8.4) @@ -293,8 +293,8 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - omniauth (1.9.0) - hashie (>= 3.4.6, < 3.7.0) + omniauth (1.9.1) + hashie (>= 3.4.6) rack (>= 1.6.2, < 3) omniauth-facebook (6.0.0) omniauth-oauth2 (~> 1.2) @@ -322,7 +322,7 @@ GEM omniauth-oauth2 (~> 1.4) openstreetmap-deadlock_retry (1.3.0) parallel (1.19.1) - parser (2.7.0.2) + parser (2.7.0.4) ast (~> 2.4.0) pg (1.2.2) poltergeist (1.18.1) @@ -333,7 +333,7 @@ GEM progress (3.5.2) psych (3.1.0) public_suffix (4.0.3) - puma (3.12.2) + puma (3.12.4) quad_tile (1.0.1) r2 (0.2.7) rack (2.2.2) @@ -383,17 +383,19 @@ GEM rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) - regexp_parser (1.6.0) + regexp_parser (1.7.0) request_store (1.5.0) rack (>= 1.4) + rexml (3.2.4) rinku (2.0.6) rotp (5.1.0) addressable (~> 2.5) - rubocop (0.79.0) + rubocop (0.80.1) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.7.0.1) rainbow (>= 2.2.2, < 4.0) + rexml ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) rubocop-performance (1.5.2) @@ -452,7 +454,7 @@ GEM validates_email_format_of (1.6.3) i18n vendorer (0.2.0) - webmock (3.8.2) + webmock (3.8.3) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -461,7 +463,7 @@ GEM websocket-extensions (0.1.4) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.2.2) + zeitwerk (2.3.0) PLATFORMS ruby @@ -493,7 +495,6 @@ DEPENDENCIES dynamic_form erb_lint factory_bot_rails - fakefs faraday ffi-libarchive gd2-ffij (>= 0.4.0) diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index 80fb68444..ddb454c13 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -40,12 +40,14 @@ OSM.History = function (map) { }; function highlightChangeset(id) { - group.getLayer(id).setStyle({ fillOpacity: 0.3, color: "#FF6600", weight: 3 }); + var layer = group.getLayer(id); + if (layer) layer.setStyle({ fillOpacity: 0.3, color: "#FF6600", weight: 3 }); $("#changeset_" + id).addClass("selected"); } function unHighlightChangeset(id) { - group.getLayer(id).setStyle({ fillOpacity: 0, color: "#FF9500", weight: 2 }); + var layer = group.getLayer(id); + if (layer) layer.setStyle({ fillOpacity: 0, color: "#FF9500", weight: 2 }); $("#changeset_" + id).removeClass("selected"); } diff --git a/app/assets/stylesheets/_bootstrap-custom.scss b/app/assets/stylesheets/_bootstrap-custom.scss deleted file mode 100644 index d3072d2b5..000000000 --- a/app/assets/stylesheets/_bootstrap-custom.scss +++ /dev/null @@ -1,44 +0,0 @@ -/*! - * Bootstrap v4.3.1 (https://getbootstrap.com/) - * Copyright 2011-2019 The Bootstrap Authors - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - -@import "bootstrap/functions"; -@import "bootstrap/variables"; -@import "bootstrap/mixins"; -@import "bootstrap/root"; -@import "bootstrap/reboot"; -@import "bootstrap/type"; -// @import "bootstrap/images"; -// @import "bootstrap/code"; -@import "bootstrap/grid"; -// @import "bootstrap/tables"; -// @import "bootstrap/forms"; -@import "bootstrap/buttons"; -// @import "bootstrap/transitions"; -@import "bootstrap/dropdown"; -@import "bootstrap/button-group"; -// @import "bootstrap/input-group"; -// @import "bootstrap/custom-forms"; -@import "bootstrap/nav"; -@import "bootstrap/navbar"; -@import "bootstrap/card"; -// @import "bootstrap/breadcrumb"; -// @import "bootstrap/pagination"; -@import "bootstrap/badge"; -// @import "bootstrap/jumbotron"; -@import "bootstrap/alert"; -// @import "bootstrap/progress"; -// @import "bootstrap/media"; -@import "bootstrap/list-group"; -// @import "bootstrap/close"; -// @import "bootstrap/toasts"; -// @import "bootstrap/modal"; -@import "bootstrap/tooltip"; -// @import "bootstrap/popover"; -// @import "bootstrap/carousel"; -// @import "bootstrap/spinners"; -@import "bootstrap/utilities"; -// @import "bootstrap/print"; diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index d3382eb3f..9b6b69db7 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1,5 +1,5 @@ @import "parameters"; -@import "bootstrap-custom"; +@import "bootstrap"; /* Styles common to large and small screens */ @@ -773,6 +773,7 @@ header .search_forms, input[type=text].overflow { border-right: none; + border-radius: 3px 0px 0px 3px; } input:focus { @@ -2047,16 +2048,11 @@ a.button { } } -/* Rules for doing distinct colour of alternate table rows */ +/* Customise the background colour of striped tables */ -.table0, -.item0 { - background: $offwhite; -} - -.table1, -.item1 { - background: #fff; +.table-striped > tbody > tr:nth-child(2n+1) > td, +.table-striped > tbody > tr:nth-child(2n+1) > th { + background-color: $offwhite; } /* Rules for OpenID logo */ diff --git a/app/controllers/api/map_controller.rb b/app/controllers/api/map_controller.rb index 113554c72..1b5150537 100644 --- a/app/controllers/api/map_controller.rb +++ b/app/controllers/api/map_controller.rb @@ -5,7 +5,7 @@ module Api before_action :check_api_readable around_action :api_call_handle_error, :api_call_timeout - before_action :set_default_request_format + before_action :set_request_formats # This is probably the most common call of all. It is used for getting the # OSM data for a specified bounding box, usually for editing. First the diff --git a/app/controllers/api/nodes_controller.rb b/app/controllers/api/nodes_controller.rb index 336aebc91..9204d96c0 100644 --- a/app/controllers/api/nodes_controller.rb +++ b/app/controllers/api/nodes_controller.rb @@ -13,7 +13,7 @@ module Api before_action :check_api_readable, :except => [:create, :update, :delete] around_action :api_call_handle_error, :api_call_timeout - before_action :set_default_request_format, :except => [:create, :update, :delete] + before_action :set_request_formats, :except => [:create, :update, :delete] # Create a node from XML. def create diff --git a/app/controllers/api/old_controller.rb b/app/controllers/api/old_controller.rb index f672e7c49..f8e42476f 100644 --- a/app/controllers/api/old_controller.rb +++ b/app/controllers/api/old_controller.rb @@ -16,7 +16,7 @@ module Api before_action :lookup_old_element, :except => [:history] before_action :lookup_old_element_versions, :only => [:history] - before_action :set_default_request_format, :except => [:redact] + before_action :set_request_formats, :except => [:redact] def history # the .where() method used in the lookup_old_element_versions diff --git a/app/controllers/api/relations_controller.rb b/app/controllers/api/relations_controller.rb index 329c5e29c..28e4a026b 100644 --- a/app/controllers/api/relations_controller.rb +++ b/app/controllers/api/relations_controller.rb @@ -11,7 +11,7 @@ module Api before_action :check_api_readable, :except => [:create, :update, :delete] around_action :api_call_handle_error, :api_call_timeout - before_action :set_default_request_format, :except => [:create, :update, :delete] + before_action :set_request_formats, :except => [:create, :update, :delete] def create assert_method :put diff --git a/app/controllers/api/ways_controller.rb b/app/controllers/api/ways_controller.rb index a7c876710..3b58f208b 100644 --- a/app/controllers/api/ways_controller.rb +++ b/app/controllers/api/ways_controller.rb @@ -11,7 +11,7 @@ module Api before_action :check_api_readable, :except => [:create, :update, :delete] around_action :api_call_handle_error, :api_call_timeout - before_action :set_default_request_format, :except => [:create, :update, :delete] + before_action :set_request_formats, :except => [:create, :update, :delete] def create assert_method :put diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 64514a432..478810dfc 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -4,52 +4,45 @@ class ApiController < ApplicationController private ## - # Set default request format to xml unless a client requests a specific format, - # which can be done via (a) URL suffix and/or (b) HTTP Accept header, where - # the URL suffix always takes precedence over the Accept header. - def set_default_request_format + # Set allowed request formats if no explicit format has been + # requested via a URL suffix. Allowed formats are taken from + # any HTTP Accept header with XML as the default. + def set_request_formats unless params[:format] accept_header = request.headers["HTTP_ACCEPT"] - if accept_header.nil? - # e.g. unit tests don't set an Accept: header by default, force XML in this case - request.format = "xml" - return - end - - req_mimetypes = [] - - # Some clients (JOSM) send Accept headers which cannot be parsed by Rails, example: *; q=.2 - # To be fair, JOSM's Accept header doesn't adhere to RFC 7231, section 5.3.1, et al. either - # As a workaround for backwards compatibility, we're assuming XML format - begin - req_mimetypes = Mime::Type.parse(accept_header) - rescue Mime::Type::InvalidMimeType - request.format = "xml" - return - end - - # req_mimetypes contains all Accept header MIME types with descending priority - req_mimetypes.each do |mime| - if mime.symbol == :xml - request.format = "xml" - break - end - - if mime.symbol == :json - request.format = "json" - break - end - # Any format, not explicitly requesting XML or JSON -> assume XML as default - if mime == "*/*" - request.format = "xml" - break + if accept_header + # Some clients (such asJOSM) send Accept headers which cannot be + # parse by Rails, for example: + # + # Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 + # + # where both "*" and ".2" as a quality do not adhere to the syntax + # described in RFC 7231, section 5.3.1, etc. + # + # As a workaround, and for back compatibility, default to XML format. + mimetypes = begin + Mime::Type.parse(accept_header) + rescue Mime::Type::InvalidMimeType + Array(Mime[:xml]) + end + + # Allow XML and JSON formats, and treat an all formats wildcard + # as XML for backwards compatibility - all other formats are discarded + # which will result in a 406 Not Acceptable response being sent + formats = mimetypes.map do |mime| + if mime.symbol == :xml then :xml + elsif mime.symbol == :json then :json + elsif mime == "*/*" then :xml + end end - - # In case the client requests some other format besides XML, JSON and */*, - # we deliberately don't set request.format. The framework will return an - # ActionController::UnknownFormat error to the client later on in this case. + else + # Default to XML if no accept header was sent - this includes + # the unit tests which don't set one by default + formats = Array(:xml) end + + request.formats = formats.compact end end diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 61f466f62..d136e7230 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -80,6 +80,8 @@ class IssuesController < ApplicationController private def find_issue - @issue = Issue.find(params[:id]) + @issue = Issue.visible_to(current_user).find(params[:id]) + rescue ActiveRecord::RecordNotFound + head :not_found end end diff --git a/app/views/browse/_common_details.html.erb b/app/views/browse/_common_details.html.erb index 1c8f1c5da..669e0fe6d 100644 --- a/app/views/browse/_common_details.html.erb +++ b/app/views/browse/_common_details.html.erb @@ -1,6 +1,6 @@

<% if common_details.changeset.tags['comment'].present? %> - <%= linkify(h(common_details.changeset.tags["comment"])) %> + <%= linkify(common_details.changeset.tags["comment"]) %> <% else %> <%= t "browse.no_comment" %> <% end %> @@ -15,7 +15,7 @@
<%= t "browse.version" %> - #<%= h(common_details.version) %> + #<%= common_details.version %> · <%= t "browse.in_changeset" %> #<%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %> diff --git a/app/views/browse/_containing_relation.html.erb b/app/views/browse/_containing_relation.html.erb index ba05c1fe4..06220a97d 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 +
  • <%= linked_name = link_to printable_name(containing_relation.relation), :action => "relation", :id => containing_relation.relation.id.to_s if containing_relation.member_role.blank? t ".entry_html", :relation_name => linked_name else - t ".entry_role_html", :relation_name => linked_name, :relation_role => h(containing_relation.member_role) + t ".entry_role_html", :relation_name => linked_name, :relation_role => containing_relation.member_role end %>
  • diff --git a/app/views/browse/_relation_member.html.erb b/app/views/browse/_relation_member.html.erb index fe0f36357..51b2bb3e6 100644 --- a/app/views/browse/_relation_member.html.erb +++ b/app/views/browse/_relation_member.html.erb @@ -5,6 +5,6 @@ <%= if relation_member.member_role.blank? t ".entry_html", :type => type_str, :name => linked_name else - t ".entry_role_html", :type => type_str, :name => linked_name, :role => h(relation_member.member_role) + t ".entry_role_html", :type => type_str, :name => linked_name, :role => relation_member.member_role end %> diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index 9b68a03e7..3c41dd83f 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(@changeset.tags["comment"].to_s.presence || t("browse.no_comment")) %>
    <%= changeset_details(@changeset) %>
    <%= render :partial => "tag_details", :object => @changeset.tags.except("comment") %> @@ -38,7 +38,7 @@ <%= t(".commented_by", :when => friendly_date_ago(comment.created_at), :exact_time => l(comment.created_at), - :user => link_to(h(comment.author.display_name), user_path(comment.author))).html_safe %> + :user => link_to(comment.author.display_name, user_path(comment.author))).html_safe %> <% if current_user and current_user.moderator? %> — <%= t("javascripts.changesets.show.hide_comment") %> <% end %> @@ -51,7 +51,7 @@ <%= t(".hidden_commented_by", :when => friendly_date_ago(comment.created_at), :exact_time => l(comment.created_at), - :user => link_to(h(comment.author.display_name), user_path(comment.author))).html_safe %> + :user => link_to(comment.author.display_name, user_path(comment.author))).html_safe %> — <%= t("javascripts.changesets.show.unhide_comment") %> <%= comment.body.to_html %> diff --git a/app/views/changesets/index.atom.builder b/app/views/changesets/index.atom.builder index b1fbd6992..2bbae2cc2 100644 --- a/app/views/changesets/index.atom.builder +++ b/app/views/changesets/index.atom.builder @@ -24,9 +24,9 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, :type => "application/osmChange+xml" if !changeset.tags.empty? && changeset.tags.key?("comment") - entry.title t("browse.changeset.feed.title_comment", :id => h(changeset.id), :comment => h(changeset.tags["comment"])), :type => "html" + entry.title t("browse.changeset.feed.title_comment", :id => changeset.id, :comment => changeset.tags["comment"]), :type => "html" else - entry.title t("browse.changeset.feed.title", :id => h(changeset.id)) + entry.title t("browse.changeset.feed.title", :id => changeset.id) end if changeset.user.data_public? @@ -51,7 +51,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, table.tr do |tr| tr.th t("browse.changeset.belongs_to") tr.td do |td| - td.a h(changeset.user.display_name), :href => user_url(changeset.user, :only_path => false) + td.a changeset.user.display_name, :href => user_url(changeset.user, :only_path => false) end end end @@ -62,7 +62,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, td.table :cellpadding => "0" do |tag_table| changeset.tags.sort.each do |tag| tag_table.tr do |tag_tr| - tag_tr.td << "#{h(tag[0])} = #{linkify(h(tag[1]))}" + tag_tr.td << "#{tag[0]} = #{linkify(tag[1])}" end end end diff --git a/app/views/diary_entries/_diary_comment.html.erb b/app/views/diary_entries/_diary_comment.html.erb index 3893072ad..db4847826 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 %> -

    <%= 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}")) %> +

    <%= t(".comment_from_html", :link_user => (link_to 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 5508817a8..b0c464718 100644 --- a/app/views/diary_entries/_diary_entry.html.erb +++ b/app/views/diary_entries/_diary_entry.html.erb @@ -4,10 +4,10 @@ <%= user_thumbnail diary_entry.user %> <% end %> -

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

    +

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

    - <%= 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)) %> + <%= t(".posted_by_html", :link_user => (link_to 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/comments.html.erb b/app/views/diary_entries/comments.html.erb index 00045efc0..ec8c3dfda 100644 --- a/app/views/diary_entries/comments.html.erb +++ b/app/views/diary_entries/comments.html.erb @@ -2,7 +2,7 @@

    <%= t(".has_commented_on", :display_name => @user.display_name) %>

    <% end %> - +
    @@ -11,8 +11,7 @@ <% @comments.each do |comment| -%> - <% cl = cycle("table0", "table1") %> - "> + "> diff --git a/app/views/diary_entries/index.html.erb b/app/views/diary_entries/index.html.erb index a599aea17..32a4e1e0f 100644 --- a/app/views/diary_entries/index.html.erb +++ b/app/views/diary_entries/index.html.erb @@ -3,7 +3,7 @@ <% if @user %> <%= user_image @user %> <% end %> -

    <%= h(@title) %>

    +

    <%= @title %>

    "> - - + + diff --git a/app/views/messages/_sent_message_summary.html.erb b/app/views/messages/_sent_message_summary.html.erb index d3f3227e5..ba18ca875 100644 --- a/app/views/messages/_sent_message_summary.html.erb +++ b/app/views/messages/_sent_message_summary.html.erb @@ -1,6 +1,6 @@ - - + + diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index ea4f5e40d..7cf674fef 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -1,11 +1,11 @@ <% if current_user == @message.recipient %> <% content_for :heading do %> -

    <%= h(@message.title) %>

    +

    <%= @message.title %>

    <% end %>
    <%= user_thumbnail_tiny @message.sender %> - <%= link_to h(@message.sender.display_name), user_path(@message.sender) %> + <%= link_to @message.sender.display_name, user_path(@message.sender) %>
    <%= l @message.sent_on, :format => :friendly %>
    @@ -22,11 +22,11 @@ <% else %> -

    <%= h(@message.title) %>

    +

    <%= @message.title %>

    <%= user_thumbnail_tiny @message.recipient %> - <%= link_to h(@message.recipient.display_name), user_path(@message.recipient) %> + <%= link_to @message.recipient.display_name, user_path(@message.recipient) %>
    <%= l @message.sent_on, :format => :friendly %>
    diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb index 47860d50d..8c662ef87 100644 --- a/app/views/traces/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -1,6 +1,5 @@
    - <% cl = cycle("table0", "table1") %> - -
    <%= t ".post" %>
    <%= link_to comment.diary_entry.title, diary_entry_path(comment.diary_entry.user, comment.diary_entry) %> <%= time_ago_in_words(comment.created_at, :scope => :'datetime.distance_in_words_ago') %> <%= comment.body.to_html %>
    <%= link_to h(message_summary.sender.display_name), user_path(message_summary.sender) %><%= link_to h(message_summary.title), message_path(message_summary) %><%= link_to message_summary.sender.display_name, user_path(message_summary.sender) %><%= link_to message_summary.title, message_path(message_summary) %> <%= l message_summary.sent_on, :format => :friendly %> <%= button_to t(".unread_button"), message_mark_path(message_summary, :mark => "unread"), :remote => true %> <%= button_to t(".read_button"), message_mark_path(message_summary, :mark => "read"), :remote => true %>
    <%= link_to h(sent_message_summary.recipient.display_name), user_path(sent_message_summary.recipient) %><%= link_to h(sent_message_summary.title), message_path(sent_message_summary) %><%= link_to sent_message_summary.recipient.display_name, user_path(sent_message_summary.recipient) %><%= link_to sent_message_summary.title, message_path(sent_message_summary) %> <%= l sent_message_summary.sent_on, :format => :friendly %> <%= button_to t(".destroy_button"), message_path(sent_message_summary, :referer => request.fullpath), :method => :delete, :remote => true %>
    + <% if Settings.status != "gpx_offline" %> <% if trace.inserted %> "show", :id => trace.id, :display_name => trace.user.display_name %>"> "icon", :id => trace.id, :display_name => trace.user.display_name %>" border="0" alt="" /> @@ -9,7 +8,7 @@ <% end %> <% end %> <%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %> + <%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %> ... <% if trace.inserted %> (<%= t ".count_points", :count => trace.size %>) @@ -27,7 +26,7 @@
    <%= trace.description %>
    - <%= t ".by" %> <%= link_to h(trace.user.display_name), user_path(trace.user) %> + <%= t ".by" %> <%= link_to trace.user.display_name, user_path(trace.user) %> <% if !trace.tags.empty? %> <%= t ".in" %> <%= safe_join(trace.tags.collect { |tag| link_to_tag tag.tag }, ", ") %> diff --git a/app/views/traces/edit.html.erb b/app/views/traces/edit.html.erb index 6583e32f1..e3771bac0 100644 --- a/app/views/traces/edit.html.erb +++ b/app/views/traces/edit.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

    <%= t ".heading", :name => h(@trace.name) %>

    +

    <%= t ".heading", :name => @trace.name %>

    <% end %> "picture", :id => @trace.id, :display_name => @trace.user.display_name %>"> @@ -32,7 +32,7 @@ <% end %>
    -

    <%= link_to h(@trace.user.display_name), user_path(@trace.user) %>

    +

    <%= link_to @trace.user.display_name, user_path(@trace.user) %>

    diff --git a/app/views/traces/index.html.erb b/app/views/traces/index.html.erb index fff62ba55..86ac37f00 100644 --- a/app/views/traces/index.html.erb +++ b/app/views/traces/index.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

    <%= h(@title) %>

    +

    <%= @title %>