diff --git a/app/controllers/admin/comments_controller.rb b/app/controllers/admin/comments_controller.rb
index bbed32298..b404618bf 100644
--- a/app/controllers/admin/comments_controller.rb
+++ b/app/controllers/admin/comments_controller.rb
@@ -19,6 +19,10 @@ module Admin
end
end
+ def show
+ @comment = Comment.includes(:user, :commentable).find(params[:id])
+ end
+
private
def authorize_admin
diff --git a/app/views/admin/comments/_comment.html.erb b/app/views/admin/comments/_comment.html.erb
new file mode 100644
index 000000000..ee180ff21
--- /dev/null
+++ b/app/views/admin/comments/_comment.html.erb
@@ -0,0 +1,38 @@
+
+
+ <% if comment.commentable %>
+
+ <% end %>
+
+ <%= sanitize comment.processed_html,
+ tags: %w[strong em p h1 h2 h3 h4 h5 h6 i u b code pre br ul ol li small sup img a span hr blockquote],
+ attributes: %w[href strong em ref rel src title alt class] %>
+
+
+
+
diff --git a/app/views/admin/comments/index.html.erb b/app/views/admin/comments/index.html.erb
index 2b5b4a228..d27c1086b 100644
--- a/app/views/admin/comments/index.html.erb
+++ b/app/views/admin/comments/index.html.erb
@@ -1,58 +1,8 @@
Comments
-
<%= paginate @comments %>
- <% @comments.each do |comment| %>
-
- <% if comment.commentable %>
-
- <% end %>
-
- <%= sanitize comment.processed_html,
- tags: %w[strong em p h1 h2 h3 h4 h5 h6 i u b code pre br ul ol li small sup img a span hr blockquote],
- attributes: %w[href strong em ref rel src title alt class] %>
-
-
- ❤️ <%= pluralize(comment.public_reactions_count, "like") %>
- <% if comment.reactions.where(user_id: current_user.id).empty? %>
- <%= form_tag(reactions_path, remote: true) do %>
- <%= hidden_field_tag(:reactable_type, "Comment") %>
- <%= hidden_field_tag(:reactable_id, comment.id) %>
-
- <%= crayons_icon_tag(:heart, class: "c-btn__icon", width: 18, height: 18) %>
- Like
-
- <% end %>
- <% end %>
-
-
-
- <% end %>
+ <%= render partial: "comment", collection: @comments, locals: { is_individual_comment: false } %>
<%= paginate @comments %>
-
-
diff --git a/app/views/admin/comments/show.html.erb b/app/views/admin/comments/show.html.erb
new file mode 100644
index 000000000..9e2ffcf89
--- /dev/null
+++ b/app/views/admin/comments/show.html.erb
@@ -0,0 +1,2 @@
+Comment
+<%= render partial: "comment", locals: { comment: @comment, is_individual_comment: true } %>
diff --git a/config/locales/views/moderations/en.yml b/config/locales/views/moderations/en.yml
index 63d178c8d..9a05561ca 100644
--- a/config/locales/views/moderations/en.yml
+++ b/config/locales/views/moderations/en.yml
@@ -162,6 +162,9 @@ en:
terms_and_conditions: Terms & Conditions
trusted: Trusted User Guide
author: Author
+ comments:
+ view_comment: View Comment
+ view_details: View Details
date: Date
notice:
subtitle: '%{community} Mods'
diff --git a/config/locales/views/moderations/fr.yml b/config/locales/views/moderations/fr.yml
index 22989a6c1..f20aa89e3 100644
--- a/config/locales/views/moderations/fr.yml
+++ b/config/locales/views/moderations/fr.yml
@@ -161,6 +161,9 @@ fr:
terms_and_conditions: Conditions générales d'utilisation
trusted: Guide de l'utilisateur de confiance
author: Auteur
+ comments:
+ view_comment: Voir le commentaire
+ view_details: Voir les détails
date: Date
notice:
subtitle: '%{community} Mods'
diff --git a/config/routes/admin.rb b/config/routes/admin.rb
index 199683aae..ec6ba0729 100644
--- a/config/routes/admin.rb
+++ b/config/routes/admin.rb
@@ -82,7 +82,7 @@ namespace :admin do
resources :badge_achievements, only: %i[index destroy]
get "/badge_achievements/award_badges", to: "badge_achievements#award"
post "/badge_achievements/award_badges", to: "badge_achievements#award_badges"
- resources :comments, only: [:index]
+ resources :comments, only: %i[index show]
resources :organizations, only: %i[index show] do
member do
patch "update_org_credits"