<div class="table-responsive">
  <table class="table table-hover" id="my-plans">
    <thead>
      <tr>
        <th scope="col"><%= _('Project Title') %>&nbsp;<%= paginable_sort_link('plans.title') %></th>
        <th scope="col"><%= d_('dmpopidor', 'Template') %>&nbsp;<%= paginable_sort_link('templates.title') %></th>
        <th scope="col"><%= _('Organisation') %></th>
        <th scope="col"><%= _('Owner') %></th>
        <th scope="col" class="date-column"><%= _('Updated') %>&nbsp;<%= paginable_sort_link('plans.updated_at') %></th>
        <th scope="col"><%= _('Visibility') %></th>
      </tr>
    </thead>
    <tbody>
      <% scope.each do |plan| %>
        <tr>
          <td>
            <% if plan.readable_by?(current_user.id) %>
              <%= link_to "#{plan.title.length > 60 ? "#{plan.title[0..59]} ..." : plan.title}", plan_path(plan) %>
            <% else %>
              <%= plan.title.truncate(60) %>
            <% end %>
          </td>
          <td><%= plan.template.title %></td>
          <td><%= plan.owner ? plan.owner.org.name : current_user.org.name %></td>
          <td><%= plan.owner ? plan.owner.name(false) : _('Unknown') %></td>
          <td><%= l(plan.updated_at.to_date, formats: :short) %></td>
          <td class="plan-visibility">
            <%= plan.visibility === 'is_test' ? _('Test') : sanitize(display_visibility(plan.visibility)) %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>
