report abuse dropdown link (#19247)

* report abuse dropdown link

* Update app/controllers/pages_controller.rb

* Update app/views/shared/_display_ad.html.erb

* remove billboard url check

---------
This commit is contained in:
Lawrence 2023-03-28 14:02:31 -05:00 committed by GitHub
parent 42b392906b
commit e4e1f4d96d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 1 deletions

View file

@ -0,0 +1,3 @@
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.16667 11.3333V16.3333H0.5V0.5H8.31833C8.47305 0.500083 8.62469 0.543236 8.75627 0.624627C8.88785 0.706018 8.99417 0.822433 9.06333 0.960833L9.66667 2.16667H14.6667C14.8877 2.16667 15.0996 2.25446 15.2559 2.41074C15.4122 2.56703 15.5 2.77899 15.5 3V12.1667C15.5 12.3877 15.4122 12.5996 15.2559 12.7559C15.0996 12.9122 14.8877 13 14.6667 13H9.34833C9.19361 12.9999 9.04197 12.9568 8.91039 12.8754C8.77882 12.794 8.67249 12.6776 8.60333 12.5392L8 11.3333H2.16667ZM2.16667 2.16667V9.66667H9.03L9.86333 11.3333H13.8333V3.83333H8.63667L7.80333 2.16667H2.16667Z" fill="#404040"/>
</svg>

After

Width:  |  Height:  |  Size: 690 B

View file

@ -82,9 +82,10 @@ class PagesController < ApplicationController
end
def report_abuse
billboard_url = admin_display_ad_path(params[:billboard]) if params[:billboard].present?
reported_url = params[:reported_url] || params[:url] || request.referer.presence
@feedback_message = FeedbackMessage.new(
reported_url: reported_url&.chomp("?i=i"),
reported_url: billboard_url || reported_url&.chomp("?i=i"),
)
render "pages/report_abuse"
end

View file

@ -39,6 +39,13 @@
<%= I18n.t("display_ad.menu.manage_preferences") %>
</a>
</li>
<hr />
<li>
<a class="crayons-link crayons-link--block" href="/report-abuse?billboard=<%= display_ad.id %>">
<%= crayons_icon_tag("flag", aria_hidden: true, class: "c-btn__icon") %>
<%= I18n.t("display_ad.menu.report_billboard") %>
</a>
</li>
</ul>
</div>
</div>

View file

@ -141,6 +141,7 @@ en:
icon: Dropdown menu
manage_preferences: Manage preferences
what_is_a_billboard: What's a billboard?
report_billboard: Report billboard
errors:
messages:
accepted: must be accepted

View file

@ -156,6 +156,7 @@ fr:
icon: Menu déroulant
manage_preferences: Gérer les préférences
what_is_a_billboard: Qu'est-ce qu'un panneau publicitaire?
report_billboard: Report billboard
errors:
messages:
accepted: doit être accepté