feat(account): add comments and edit

This commit is contained in:
dualfroz committed 2026-09-04 18:31:38 +02:00
1 parent 4160704b23
commit 8660046b42
3 files changed
+73

No files matched your search

@@ -0,0 +1,27 @@
<h1><%= t('account.moderation_heading') %></h1>
<% if comments.none? %>
<p><%= t('account.moderation_empty') %></p>
<% else %>
<ul class="comments moderation">
<% comments.each do |comment| %>
<li class="comment" id="comment-<%= comment.id %>">
<p>
<% if comment_post_linkable?(comment) %>
<%== link_to(comment_post_label(comment), url_for(:post, slug: comment_post_slug(comment))) %>
<% else %>
<%= comment_post_label(comment) %>
<% end %>
</p>
<p><strong><%= comment.author %></strong></p>
<p><%= comment.body %></p>
<%== button_to(t('comments.approve'), "/posts/#{comment_post_slug(comment)}/comments/#{comment.id}/approve", method: :patch) %>
<%== button_to(t('comments.reject'), "/posts/#{comment_post_slug(comment)}/comments/#{comment.id}/reject", method: :patch) %>
</li>
<% end %>
</ul>
<% end %>
<%== paginate(comments, path: ->(page) { "#{url_for(:account_moderation)}?page=#{page}" }) %>
<p><%== link_to(t('posts.back_to_list'), url_for(:posts)) %></p>