noesya/osuny

View on GitHub
app/views/admin/communication/extranets/contacts/index.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, Communication::Extranet.human_attribute_name(:feature_contacts) %>

<% action = link_to t('export'),
                  export_people_admin_communication_extranet_contacts_path(extranet_id: @extranet.id, format: :xlsx),
                  class: button_classes('ms-1') if can?(:show, University::Person) %>
<%= osuny_panel University::Person.model_name.human(count: 2), action: action do %>
  <div class="table-responsive">
    <table class="<%= table_classes %>">
      <tbody>
        <% @people.each do |person| %>
          <tr>
            <td><%= osuny_link_localized person,
                                         [:admin, person],
                                         label_method: :to_s_alphabetical %></td>
            <td><%= person.email %></td>
            <td><%= render 'toggle', about: person %></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
  <%= paginate @people, param_name: :persons_page %>
<% end %>
<% action = link_to t('export'),
                  export_organizations_admin_communication_extranet_contacts_path(extranet_id: @extranet.id, format: :xlsx),
                  class: button_classes('ms-1') if can?(:show, University::Person) %>
<%= osuny_panel University::Organization.model_name.human(count: 2), action: action do %>
  <div class="table-responsive">
    <table class="<%= table_classes %>">
      <tbody>
        <% @organizations.each do |organization| %>
          <tr>
            <td><%= osuny_link_localized organization,
                                         [:admin, organization] %></td>
            <td><%= render 'toggle', about: organization %></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
  <%= paginate @organizations, param_name: :organizations_page %>
<% end %>