<div class="resultsContainer">
<!-- USERS -->
<% unless @users.empty? %>
  <section class="searchResult">
    <header><%= h t("search.search_result.title_user") %></header>
    <table class="list">
      <thead>
        <tr class="stickyInline">
          <th><%= t("activeldap.attributes.user.displayName") %></th>
          <th><%= t("activeldap.attributes.user.uid") %></th>
          <th><%= t('activeldap.attributes.school.displayName') %></th>
        </tr>
      </thead>
      <tbody>
        <% @users.each do |u| %>
        <tr>
          <td><a href="<%= u[:link] %>"><%= h u[:name] %></a></td>
          <td><%= h u[:uid] %></td>
          <td><%= h @schools_cache[u[:school_id]][:name] %></td>
        </tr>
        <% end %>
      </tbody>
    </table>
  </section>
<% end %>
<!-- GROUPS -->
<% unless @groups.empty? %>
  <section class="searchResult">
    <header><%= h t("search.search_result.title_group") %></header>
    <table class="list">
      <thead>
        <tr class="stickyInline">
          <th><%= t("activeldap.attributes.group.displayName") %></th>
          <th><%= t("activeldap.attributes.group.cn") %></th>
          <th><%= t('activeldap.attributes.school.displayName') %></th>
        </tr>
      </thead>
      <tbody>
        <% @groups.each do |g| %>
        <tr>
          <td><a href="<%= g[:link] %>"><%= h g[:name] %></a></td>
          <td><%= h g[:abbreviation] %></td>
          <td><%= h @schools_cache[g[:school_id]][:name] %></td>
        </tr>
        <% end %>
      </tbody>
    </table>
  </section>
<% end %>
<!-- DEVICES -->
<% unless @devices.empty? %>
  <section class="searchResult">
    <header><%= h t("search.search_result.title_device") %></header>
    <table class="list">
      <thead>
        <tr class="stickyInline">
          <th><%= t("activeldap.attributes.device.puavoHostname") %></th>
          <th><%= t("activeldap.attributes.device.puavoDisplayName") %></th>
          <th><%= t('activeldap.attributes.school.displayName') %></th>
        </tr>
      </thead>
      <tbody>
        <% @devices.each do |d| %>
        <tr>
          <td><a href="<%= d[:link] %>"><%= h d[:name] %></a></td>
          <td><%= h d[:display_name] %></td>
          <td><%= h @schools_cache[d[:school_id]][:name] %></td>
        </tr>
        <% end %>
      </tbody>
    </table>
  </section>
<% end %>
<!-- SERVERS -->
<% unless @servers.empty? %>
  <section class="searchResult">
    <header><%= h t("search.search_result.title_server") %></header>
    <table class="list">
      <thead>
        <tr class="stickyInline">
          <th><%= t("activeldap.attributes.server.puavoHostname") %></th>
        </tr>
      </thead>
      <tbody>
        <% @servers.each do |s| %>
        <tr>
          <td><a href="<%= s[:link] %>"><%= h s[:name] %></a></td>
        </tr>
        <% end %>
      </tbody>
    </table>
  </section>
<% end %>
</div>
