<table class='standard'>
  <thead>
    <tr>
      <th title="Age in days">Age</th>
      <th title="Expedited">E</th>
      <th title="Blocked / Stalled">B/S</th>
      <th title="Priority">P</th>
      <th>Issue</th>
      <th>Status</th>
      <th>Forecast</th>
      <th>Fix versions</th>
      <% if any_scrum_boards %>
        <th>Sprints</th>
      <% end %>
      <th><%= aggregated_project? ? 'Board' : 'Who' %></th>
    </tr>
  </thead>
  <tbody>
    <% show_age_cutoff_bar_at = age_cutoff %>
    <% aging_issues.each do |issue| %>
      <% issue_age = issue.board.cycletime.age(issue, today: @today) %>
      <% if show_age_cutoff_bar_at && issue_age&.<(show_age_cutoff_bar_at) %>
        <tr><th colspan=100 style="text-align: left; padding-top: 1em;">
          The items below are less than <%= label_days age_cutoff %> old, and are only on this report
          because they're either expedited or blocked.
        </th></tr>
        <% show_age_cutoff_bar_at = nil %>
      <% end %>
      <tr>
        <td style="text-align: right;"><%= issue_age || 'Not started' %></td>
        <td><%= expedited_text(issue) %></td>
        <td><%= blocked_text(issue) %></td>
        <td><%= priority_text(issue) %></td>
        <td>
          <% parent_hierarchy(issue).each_with_index do |parent, index| %>
            <% color = parent != issue ? "var(--hierarchy-table-inactive-item-text-color)" : 'var(--default-text-color)' %>
            <div style="padding-left: <%= index %>em; color: <%= color %>">
              <span style="white-space: nowrap;">
                <img src="<%= parent.type_icon_url %>" title="<%= parent.type %>"/>
                <%= link_to_issue parent, style: "color: #{color}" %>
              </span>
              <i><%= parent.summary.strip.inspect %></i>
            </div>
          <% end %>
        </td>
        <td><%= format_status issue.status, board: issue.board %></td>
        <td><%= dates_text(issue) %></td>
        <td><%= fix_versions_text(issue) %></td>
        <% if any_scrum_boards %>
          <td><%= sprints_text(issue) %></td>
        <% end %>
        <td><%= aggregated_project? ? issue.board.name : issue.assigned_to %></td>
      </tr>
    <% end %>
  </tbody>
</table>
