From: Andy Allan Date: Wed, 21 Mar 2018 09:14:56 +0000 (+0800) Subject: Create a report_link helper, and use text instead of a flag icon X-Git-Tag: live~2989^2~16 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/32d1afbb18ebde7fe9b5be37315fd384dadd0d6b Create a report_link helper, and use text instead of a flag icon --- diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index 21c717581..8a1bed508 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -29,7 +29,7 @@ class ReportsController < ApplicationController private def required_new_report_params_present? - create_new_report_params['reportable_id'].present? && create_new_report_params['reportable_type'].present? + create_new_report_params["reportable_id"].present? && create_new_report_params["reportable_type"].present? end def create_new_report_params diff --git a/app/helpers/reports_helper.rb b/app/helpers/reports_helper.rb new file mode 100644 index 000000000..70c9adac6 --- /dev/null +++ b/app/helpers/reports_helper.rb @@ -0,0 +1,5 @@ +module ReportsHelper + def report_link(name, reportable) + link_to name, new_report_url(:reportable_id => reportable.id, :reportable_type => reportable.class.name) + end +end diff --git a/app/views/browse/note.html.erb b/app/views/browse/note.html.erb index 075ac6462..fa9e88628 100644 --- a/app/views/browse/note.html.erb +++ b/app/views/browse/note.html.erb @@ -17,17 +17,16 @@
<%= note_event(@note.status, @note.closed_at, @note_comments.last.author) %> <% end %> - <% if current_user && current_user != @note.author %> - <%= link_to new_report_url(reportable_id: @note.id, reportable_type: @note.class.name), :title => t('browse.note.report') do %> -  ⚐ - <% end %> - <% end %> <% if @note_comments.find { |comment| comment.author.nil? } -%>

<%= t "javascripts.notes.show.anonymous_warning" %>

<% end -%> + <% if current_user && current_user != @note.author %> +

<%= report_link(t(".report"), @note) %>

+ <% end %> + <% if @note_comments.length > 1 %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index afc100dc9..f5fe7c325 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -207,7 +207,7 @@ en: reopened_by: "Reactivated by %{user} %{when} ago" reopened_by_anonymous: "Reactivated by anonymous %{when} ago" hidden_by: "Hidden by %{user} %{when} ago" - report: Report this note? + report: Report this note query: title: "Query Features" introduction: "Click on the map to find nearby features." @@ -298,12 +298,12 @@ en: edit_link: Edit this entry hide_link: Hide this entry confirm: Confirm - report: Report this entry? + report: Report this entry diary_comment: comment_from: "Comment from %{link_user} on %{comment_created_at}" hide_link: Hide this comment confirm: Confirm - report: Report this comment? + report: Report this comment location: location: "Location:" view: "View" @@ -2061,7 +2061,7 @@ en: friends_diaries: "friends' diary entries" nearby_changesets: "nearby user changesets" nearby_diaries: "nearby user diary entries" - report: "Report this user?" + report: Report this User popup: your location: "Your location" nearby mapper: "Nearby mapper"