osunyorg/admin

View on GitHub
app/views/extranet/contacts/search/index.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, t('extranet.contacts.search.title') %>

<%= render 'extranet/contacts/search/form' %>

<h2 class="mt-5"><%= University::Person.model_name.human(count: 2) %></h2>
<% if @people.any? %>
  <div class="row">
    <% @people.each do |person| %>
      <div class="col-md-2">
        <%= render 'extranet/contacts/persons/person', person: person %>
      </div>
    <% end %>
  </div>
<% else %>
  <p>Pas de résultat</p>
<% end %>

<h2 class="mt-5"><%= University::Organization.model_name.human(count: 2) %></h2>
<% if @organizations.any? %>
  <div class="row">
    <% @organizations.each do |organization| %>
      <%
      l10n = organization.best_localization_for(current_language)
      %>
      <div class="col-6 col-lg-3 col-xxl-2">
        <div class="position-relative mb-5">
          <%= kamifusen_tag l10n.logo, 
                            width: 400, 
                            class: 'img-fluid organization__logo mb-2' if l10n.logo.attached? %>
          <%= link_to l10n, 
                      contacts_organization_path(organization), 
                      class: 'stretched-link' %>
        </div>
      </div>
    <% end %>
  </div>
<% else %>
  <p>Pas de résultat</p>
<% end %>