Noosfero/noosfero

View on GitHub
app/views/organizations/_results.html.erb

Summary

Maintainability
Test Coverage
<div class='results'>
  <table id='organizations-list'>
    <colgroup>
      <col width="50%">
      <col width="30%">
      <col width="20%">
    </colgroup>

    <tr>
      <th><%= _('Profile') %></th>
      <th><%= _('Actions') %></th>
      <th><%= _('Type') %>
        <span><%= select_tag(:type, options_for_select(@types_filter, @type)) %></span>
      </th>
    </tr>

    <% @collection.each do |p| %>
      <tr title="<%= p.name %>">
        <td><%= link_to_profile p.short_name, p.identifier, :title => p.name %> </td>

        <td class='actions'>
          <div class="members-buttons-cell" style="display: inline;">
            <% if p.visible %>
              <%= button_without_text :ban, _('Deactivate'), {:action => 'deactivate', :id => p.id}, :class => 'action organization_button', data: {confirm: _("Do you want to deactivate this organization?")} %>
            <% else %>
              <%= button_without_text :ok, _('Activate'), {:action => 'activate', :id => p.id}, :class => 'action organization_button', data: {confirm: _("Do you want to activate this organization?")} %>
            <% end %>
            <%= button_without_text :trash, _('Remove'), {:action => 'destroy', :id => p.id}, :class => 'action organization_button', 'data-method' => :post, data: {confirm: _("Do you want to destroy this organization?")} %>
         </div>
        </td>

        <td> <%= @types_hash[p.type] %> </td>
      </tr>
    <% end %>
  </table>

  <div>
    <%= pagination_links @collection, {:param_name => 'npage', :page_links => true} %>
  </div>
</div>