Add report abuse link to listings (#2684)
* add report abuse link * add listings category on abuse form * include listings category
This commit is contained in:
parent
575dd6d287
commit
a6d92c702b
4 changed files with 7 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ export const SingleListing = ({listing, onAddTag, currentUserId, onChangeCategor
|
|||
const tagLinks = listing.tag_list.map(tag => (
|
||||
<a href={`/listings?t=${tag}`} onClick={e => onAddTag(e, tag)} data-no-instant>{tag}</a>
|
||||
));
|
||||
const editButton = currentUserId === listing.user_id ? <a href={`/listings/${listing.id}/edit`} className="classified-listing-edit-button">edit</a> : '';
|
||||
const editButton = currentUserId === listing.user_id ? <a href={`/listings/${listing.id}/edit`} className="classified-listing-edit-button">・edit</a> : <a href={`/report-abuse?url=https://dev.to/listings/${listing.category}/${listing.slug}`}>・report abuse</a>;
|
||||
return (
|
||||
<div className="single-classified-listing">
|
||||
<div className="listing-content">
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class FeedbackMessage < ApplicationRecord
|
|||
validates :reported_url, :category, presence: { if: :abuse_report? }
|
||||
validates :category,
|
||||
inclusion: {
|
||||
in: ["spam", "other", "rude or vulgar", "harassment", "bug"]
|
||||
in: ["spam", "other", "rude or vulgar", "harassment", "bug", "listings"]
|
||||
}
|
||||
validates :status,
|
||||
inclusion: {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<div class="home">
|
||||
<div class="classifieds-container" id="classifieds-index-container"
|
||||
data-category="<%= params[:category] %>" data-listings="<%= @classified_listings.to_json(
|
||||
only: %i[title processed_html tag_list category id user_id],
|
||||
only: %i[title processed_html tag_list category id user_id slug],
|
||||
include: {
|
||||
author: { only: %i[username name], methods: %i[username profile_image_90] },
|
||||
},
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@
|
|||
<%= f.radio_button :category, "spam" %>
|
||||
<%= label_tag(:category_spam, "Spam or copyright issue") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= f.radio_button :category, "listings" %>
|
||||
<%= label_tag(:category_listing, "Inappropriate listings message/category") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= f.radio_button :category, "other" %>
|
||||
<%= label_tag(:category_other, "Other") %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue