<% content_for :title, "Moderator Flag Queue" %>

<h1>Moderator Flag Queue</h1>
<p>Below is a list of posts that users have flagged. Users are asked to provide a reason when flagging posts for
  moderator attention; use that to help you determine what needs to be done.</p>

<% @flags.each do |flag| %>
  <div class="widget">
    <div class="item-list">
      <%= render 'posts/type_agnostic', show_type_tag: true, show_category_tag: true, post: flag.post %>
    </div>
    <div class="widget--body">
      <p><strong>Flag reason:</strong> <%= flag.reason %> &mdash; <a href="/users/<%= flag.user.id %>"><%= flag.user.username %></a></p>
    </div>
    <div class="widget--footer">
      <input class="form-element flag-resolve-comment has-float-left" style="max-width: 300px;" placeholder="Optional comment for flagger">
      <div class="has-float-right has-padding-1">
        <a href="#" class="flag-resolve button" data-result='helpful' data-flag-id="<%= flag.id %>">Helpful</a>
        <a href="#" class="flag-resolve button" data-result='declined' data-flag-id="<%= flag.id %>">Decline</a>
      </div>
      <div class="has-clear-clear"></div>
    </div>
  </div>
<% end %>

<%= will_paginate @flags, renderer: BootstrapPagination::Rails %>
