<div class="container">
  <p id="notice"><%= notice %></p>
  <div class="row dashboard">
    <div class="col-7">
      <div class="welcome">Welcome, <%= current_user.editor.full_name %></div>
      <div class="hero-small dashboard">
        <div class="hero-title">
          <%= image_tag "icon_papers.svg", height: "32px" %><h1>Associate-Editors-in-Chief Dashboard</h1>
        </div>
      </div>
    </div>
  </div>
</div>

<%= render partial: "menu" %>
<%
  if @track.present?
    track_label = " and <strong>#{@track.label}</strong>"
    track_label_query = "+label:\"#{url_encode(@track.label)}\""
  else
    track_label = ""
    track_label_query = ""
  end
%>
<div class="container">
  <div id="submitting" class="generic-content-item">
    <h2>Accepted and ready to publish </h2>

    <% if @recommend_accept.any? %>
      <p>Papers labeled as <strong>recommend-accept</strong> but still open:</p>
      <ul>
      <% @recommend_accept.each do |accepted_issue| %>
        <li><%= paper_track_label(accepted_issue) %> • <%= link_to "##{accepted_issue.number}", accepted_issue.html_url, :target => "_blank" %> <%= accepted_issue.title %> </li>
      <% end %>
      </ul>
      <% accepted_link_text = "List of ready to publish submissions at GitHub &rarr;".html_safe %>
    <% else %>
      <% accepted_link_text = "There are no <strong>open</strong> submissions labeled as <strong>recommend-accept</strong>#{track_label}.".html_safe %>
    <% end %>
    <p>
      <%= link_to accepted_link_text,
            "https://github.com/#{Rails.application.settings["reviews"]}/issues?utf8=%E2%9C%93&q=+label:recommend-accept#{track_label_query}+-label:published+",
            target: "_blank" %>
    </p>


    <h2>Scope query</h2>
    <% if @with_query_scope.any? %>
      <p>Open submissions flagged for editorial review (labeled as <strong>query-scope</strong>):</p>
      <ul>
      <% @with_query_scope.each do |flagged_issue| %>
        <li><%= link_to "##{flagged_issue.number}", flagged_issue.html_url, :target => "_blank" %> • <%= link_to "Vote &rarr;".html_safe, scope_link_for_issue(flagged_issue) %> • <%= flagged_issue.title %> </li>
      <% end %>
      </ul>
      <% scope_query_link_text = "List of submissions pending editorial review at GitHub &rarr;".html_safe %>
    <% else %>
      <% scope_query_link_text = "There are no <strong>open</strong> submissions flagged for editorial review (labeled as <strong>query-scope</strong>#{track_label}).".html_safe %>
    <% end %>

    <p>
      <%= link_to scope_query_link_text,
                  "https://github.com/#{Rails.application.settings["reviews"]}/issues?utf8=%E2%9C%93&q=+label:query-scope#{track_label_query}",
                  target: "_blank" %>
    </p>
  </div>

</div>
