<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>
<%= actions_dropdown do %>
<% if User.current.allowed_to?(:import_users, nil, :global => true) %>
<%= link_to l(:button_import), new_users_import_path, :class => 'icon icon-import' %>
<% end %>
<% end %>
<%=l(:label_user_plural)%>
<%= form_tag(users_path, { :method => :get, :id => 'users_form' }) do %>
<%= hidden_field_tag 'encoding', l(:general_csv_encoding) unless l(:general_csv_encoding).casecmp('UTF-8') == 0 %>
<% end %>
<% if @users.any? %>
<% other_formats_links do |f| %>
<%= f.link_to_with_query_parameters 'CSV', {}, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
<% end %>
<%= l(:label_export_options, :export_format => 'CSV') %>
<%= export_csv_encoding_select_tag %>
<%= submit_tag l(:button_export), :name => nil, :id => 'csv-export-button' %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => 'hideModal(this);', :type => 'button' %>
<%= javascript_tag do %>
$(document).ready(function(){
$('input#csv-export-button').click(function(){
$('form input#encoding').val($('select#encoding option:selected').val());
$('form#users_form').attr('action', "<%= users_path(:format => 'csv') %>").submit();
$('form#users_form').attr('action', '<%= users_path %>');
hideModal(this);
});
});
<% end %>
<% else %>
<%= l(:label_no_data) %>
<% end %>
<% html_title(l(:label_user_plural)) -%>