<div class="news admin home">
  <% if policy(@admin_posts).can_post? %>
    <%= render "admin_index" %>
  <% else %>
    <div class="primary header module">
      <!--Descriptive page name, messages and instructions-->
      <h2 class="heading"><%= link_to ts("Site Updates"), admin_posts_path %></h2>
      <div class="icon"></div>
      <!--/descriptions-->

      <!--subnav-->
      <ul class="navigation actions" role="navigation">
        <li><%= render 'filters' %></li>
        <li><%= link_to_rss admin_posts_path(:rss, language_id: @language&.short) %></li>
      </ul>
      <!--/subnav-->
    </div>
    <!--main content-->
    <% @admin_posts.each do |admin_post| %>

      <div class="news module group" role="article">
        <%= render "admin_post", admin_post: admin_post %>
        <!-- BEGIN comment section -->
        <h3 class="landmark heading"><%= ts("Comment") %></h3>
        <ul class="actions" role="navigation">
          <% if admin_post.count_visible_comments > 0 %>
            <li><%= link_to (admin_post.count_visible_comments == 1 ? 
                            ts("Read %{comment_count} Comment", comment_count: admin_post.count_visible_comments.to_s) : 
                            ts("Read %{comment_count} Comments", comment_count: admin_post.count_visible_comments.to_s)),
                            admin_post_path(id: admin_post.id, anchor: "comments", show_comments: true) %></li>
          <% end %>
        </ul>
        <!-- END comment section -->
      </div>
    <% end %>
    <!--/content-->
    <hr class="clear" />

    <!--subnav-->
    <%= will_paginate @admin_posts %>
    <!--/subnav-->
  <% end %>
</div>
