<% if @pending_submissions_count and @pending_submissions_count > 0 %>
  <div class="alert alert-banner">
    <button type="button" class="close" data-dismiss="alert">&times;</button>
     <h4><%= link_to t('.submissions_to_moderate', count: @pending_submissions_count),  moderate_feeds_path %></h4>
  </div>
<% end %>

<% viewable = 0 %>
<ul class="list-stacked">
  <% @feeds.each do |feed| %>
    <% if can?(:manage, :all) || can?(:read, feed) || feed.group.has_member?(current_user)%>
      <% viewable+=1 %>
      <li>
        <h3>
          <%= link_to feed_submissions_path(feed), class: "link-hl" do %>
            <span class="badge"><%= feed.approved_contents.active.count %></span> <%= feed.name %>
          <% end %>
          <small>&nbsp;&nbsp;<%= feed.description %></small>
        </h3>
        <% if feed.children.count > 0 %>
          <p class="indented">
            <%= t 'submissions.index_body.sub_feeds' %>:
            <% feed.children.each do |sub_feed| %>
              <%= link_to sub_feed.name, feed_submissions_path(sub_feed), class: "link-hl" %>
            <% end %>
          </p>
        <% end %>
      </li>
    <% end %>
  <% end %>
  </ul>
<% if viewable == 0 %>
  <div class="default-padding">
    <div class="alert alert-block alert-zero">
      <p class="alert-heading"><%=t('.no_content_heading')%></p>
        <%= t('.no_content_message')%>
        <% if !ConcertoPlugin.render_view_hook(self, :signin_hook).empty? %>
          <!-- Authentication plugins can override sign in links -->
          <%= ConcertoPlugin.render_view_hook self, :signin_hook %>
        <% else %>
          <!-- Default sign in through Devise -->
          <%= link_to t('.sign_in'), main_app.new_user_session_path %>
          <% if can? :create, User %>
            or <%= link_to t('.sign_up'), main_app.new_user_registration_path %> and submit some content!
          <% end %>
        <% end %>
    </div>
  </div>
<% end %>
