manage_organizations_status.html.erb 2.54 KB
<h1><%= _('Manage organizations') %></h1>

<%= form_tag( { :action => 'manage_organizations_status' }, :method => 'get', :class => 'users-search' ) do %>

  <div class="search-field">
    <span class="formfield">
      <%= text_field_tag 'q', @q, :title => _("Find profiles"), :style=>"width:85%" %>
    </span>

    <%= submit_button(:search, _('Search')) %>
  </div>

  <div class="environment-users-results-header">
    <div id='environment-users-filter-title'><%= @title %></div>

    <div id="environment-users-filter-filter">
      <strong><%= _("Filter by: ") %></strong>

      <select id="profile_filter_select">
        <%= options_for_select([['Any', 'any'],["Disabled profiles", "disabled"], ["Enabled profiles", "enabled"]], @filter) %>
      </select>
    </div>
    <div style="clear: both"></div>
  </div>

  <table>
    <colgroup>
      <col width="80%">
      <col width="20%">
    </colgroup>

    <tr>
      <th><%= _('Member') %></th>
      <th><%= _('Actions') %></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">
            <% if p.visible %>
              <%= button_without_text :'deactivate-user', _('Deactivate'), {:controller => "profile_editor", :action => 'deactivate_profile', :profile => p.identifier, :id => p.id}, :confirm => _("Do you want to deactivate this profile ?") %>
            <% else %>
              <%= button_without_text :'activate-user', _('Activate'), {:controller => "profile_editor", :action => 'activate_profile', :profile => p.identifier, :id => p.id}, :confirm => _("Do you want to activate this profile ?") %>
            <% end %>
              <%= button_without_text :'delete', _('Remove'), {:controller => "profile_editor", :action => 'destroy_profile', :profile => p.identifier, :id => p.id, :return_to => "/admin/admin_panel/manage_organizations_status"}, :method => :post, :confirm => _("Do you want to deactivate this profile ?") %>
         </div>
        </td>
      </tr>
    <% end %>
  </table>

<% end %>

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

<% button_bar do %>
  <%= button :back, _('Back'), :controller => 'admin_panel' %>
<% end %>

<script type="text/javascript">
  jQuery(document).ready(function(){
    jQuery("#profile_filter_select").change(function(){
      document.location.href = '/admin/admin_panel/manage_organizations_status?filter='+this.value;
    });
  });
</script>