Skip to content

Commit

Permalink
added history button to help center & policy post pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaphi committed Dec 15, 2024
1 parent 59af663 commit 5a01c3a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/views/posts/document.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
« Back to help center
<% end %>
<% unless @post.nil? %>
<% if (moderator? && @post.post_type_id == HelpDoc.post_type_id) || (admin? && @post.post_type_id == PolicyDoc.post_type_id) %>
<%
is_hc = @post.post_type_id == HelpDoc.post_type_id
is_policy = @post.post_type_id == PolicyDoc.post_type_id
history_path = is_hc ? help_post_history_path(@post.doc_slug) : policy_post_history_path(@post.doc_slug)
%>
<% if (moderator? && is_hc) || (admin? && is_policy) %>
<%= link_to 'edit', edit_post_path(@post), class: "button is-outlined is-muted" %>
<% end %>
<%= link_to 'history', history_path, class: "button is-outlined is-muted" %>
<% end %>

<% if @post.help_category == '$Moderator' %>
Expand Down

0 comments on commit 5a01c3a

Please sign in to comment.