<div class="container">
  <div class="col-7">
    <div class="welcome">Hi, <%= current_user.editor.full_name %></div>
    <div class="hero-small dashboard">
      <div class="hero-title">
        <%= image_tag "icon_papers.svg", height: "32px" %><h1>Tracks</h1>
      </div>
    </div>
  </div>
</div>

<div class="container">
  <%= link_to 'New Track', new_track_path, class: 'btn action-btn float-right' %>

  <table class="dashboard-table sortable eic">
    <thead>
      <tr class="text-nowrap">
        <th scope="col" width="8%" class="text-center">Code</th>
        <th scope="col">Short name</th>
        <th scope="col">Track</th>
        <th scope="col" class="sorttable_nosort">AEiC(s)</th>
        <th scope="col" class="sorttable_nosort"></th>
      </tr>
    </thead>

    <tbody>
      <%- @tracks.each do |track| %>
      <tr id="<%= dom_id track %>">
        <td class="text-center"><%= track.code %></td>
        <td><%= track.short_name %></td>
        <td sorttable_customkey=<%= track.name.downcase %>><%= link_to track.name, track_path(track) %></td>
        <td><%= track.aeics.map(&:full_name).join(', ') %></td>
        <td><%= link_to 'Edit', edit_track_path(track), title: 'Edit' %></td>
      </tr>
      <%- end %>
    </tbody>
  </table>
</div>
