diff --git a/app/components/forum_post_component.rb b/app/components/forum_post_component.rb index ccf1a7577..87c4f3b71 100644 --- a/app/components/forum_post_component.rb +++ b/app/components/forum_post_component.rb @@ -3,7 +3,7 @@ class ForumPostComponent < ApplicationComponent attr_reader :forum_post, :original_forum_post_id, :dtext_data, :moderation_reports, :current_user - delegate :link_to_user, :time_ago_in_words_tagged, :format_text, :policy, to: :helpers + delegate :link_to_user, :time_ago_in_words_tagged, :format_text, :policy, :data_attributes_for, to: :helpers with_collection_parameter :forum_post diff --git a/app/components/forum_post_component/forum_post_component.html.erb b/app/components/forum_post_component/forum_post_component.html.erb index be5607d47..fe9ed547a 100644 --- a/app/components/forum_post_component/forum_post_component.html.erb +++ b/app/components/forum_post_component/forum_post_component.html.erb @@ -1,8 +1,4 @@ -
- +<%= tag.article class: "forum-post message", id: "forum_post_#{forum_post.id}", data: { "is-reported": has_moderation_reports?, **data_attributes_for(forum_post, "", forum_post.html_data_attributes) } do %>
<%= link_to_user forum_post.creator %> @@ -63,4 +59,4 @@ <% end %> <% end %>
-
+<% end %> diff --git a/app/components/forum_post_component/forum_post_component.scss b/app/components/forum_post_component/forum_post_component.scss index f6b0624d9..fb4963ec4 100644 --- a/app/components/forum_post_component/forum_post_component.scss +++ b/app/components/forum_post_component/forum_post_component.scss @@ -3,6 +3,14 @@ article.forum-post { background-color: var(--moderation-report-background-color); } + &[data-is-deleted="true"] { + opacity: 0.3; + + &:hover { + opacity: 1; + } + } + a.voted { font-weight: bold; }