<h2><%= l(:label_ux_toolkit_favorite_issue_filters) %></h2>

<% if @favorite_queries.any? %>
  <table class="list queries ux-toolkit-favorite-queries">
    <thead>
      <tr>
        <th><%= l(:field_name) %></th>
        <th><%= l(:label_project) %></th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <% @favorite_queries.each do |query| %>
        <tr class="<%= cycle('odd', 'even') %>">
          <td class="name">
            <% query_path = query.project ? project_issues_path(query.project, query_id: query.id) : issues_path(query_id: query.id) %>
            <%= link_to query.name, query_path %>
          </td>
          <td class="project"><%= query.project ? link_to_project(query.project) : '' %></td>
          <td class="buttons">
            <%= button_to l(:label_ux_toolkit_remove_query_from_favorites),
                          remove_ux_toolkit_favorite_query_path(query),
                          method: :delete,
                          class: 'button-small' %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <p class="nodata"><%= l(:text_ux_toolkit_no_favorite_queries) %></p>
<% end %>

<% html_title(l(:label_ux_toolkit_favorite_issue_filters)) %>
