flags: only show current flag on flagged posts.

* Only show the current pending flag on flagged posts. Don't show old flags.

* Don't show both the "This post was flagged for review" and the "This
  post was flagged and is pending" notices.
This commit is contained in:
evazion
2020-08-16 11:09:48 -05:00
parent 7eb9f0b75e
commit 317cfe19b4
5 changed files with 30 additions and 44 deletions

View File

@@ -1,13 +1,11 @@
<ul class="post-flag-reasons list-bulleted">
<% flags.each do |flag| %>
<li class="post-flag-reason">
<span class="prose"><%= format_text(flag.reason, inline: true) %></span>
<ul class="post-flag-reason list-bulleted">
<li>
<span class="prose"><%= format_text(flag.reason, inline: true) %></span>
<% if policy(flag).can_view_flagger? %>
- <%= link_to_user(flag.creator) %>
<% end %>
- <%= time_ago_in_words_tagged(flag.created_at) %>
</li>
<% end %>
<% if policy(flag).can_view_flagger? %>
(<%= link_to_user(flag.creator) %>, <%= time_ago_in_words_tagged(flag.created_at) %>)
<% else %>
(<%= time_ago_in_words_tagged(flag.created_at) %>)
<% end %>
</li>
</ul>