<% if User.current.admin? %>
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>

<%= l(:label_user_plural)%>

<%= form_tag(:controller => 'admin', :action => 'search') do %>
<%= l(:label_filter_plural) %> <%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> <% if @groups.present? %> <%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %> <% end %> <%= select "search_by", "id", { l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" }, :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 30 %> <%= submit_tag l(:label_search), :class => "small", :name => nil %>
<% end %>  
<%= sort_header_tag('login', :caption => l(:field_login)) %> <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %> <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %> <%= sort_header_tag('mail', :caption => l(:field_mail)) %> <%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %> <%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %> <%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %> <%#= sort_header_tag('user_occupation', :caption => l(:field_occupation), :default_order => 'desc') %> <% for user in @users -%> "> <% occupation = user.user_extensions.identity == 0 ? School.where("id=?",user.user_extensions.school_id).first.try(:name) : user.user_extensions.occupation %> <% end -%>
用户单位
<%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %> <%= h(user.firstname) %> <%= h(user.lastname) %> <%= checked_image user.admin? %> <%= format_time(user.created_on) %> <%= truncate( occupation, :length => 12 ) %> <%= change_status_link(user) %> <%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %>
<% html_title(l(:label_user_plural)) -%> <%else %> <% end%>