增加功能<管理员在用户列表中通过用户的“名字”和“邮件地址”来搜索用户>
Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
parent
1d76d559dd
commit
2ac9456201
|
@ -126,7 +126,7 @@ class AdminController < ApplicationController
|
||||||
|
|
||||||
@status = params[:status] || 1
|
@status = params[:status] || 1
|
||||||
scope = User.logged.status(@status)
|
scope = User.logged.status(@status)
|
||||||
scope = scope.like(params[:name]) if params[:name].present?
|
scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
|
||||||
@user_count = scope.count
|
@user_count = scope.count
|
||||||
@user_pages = Paginator.new @user_count, @limit, params['page']
|
@user_pages = Paginator.new @user_count, @limit, params['page']
|
||||||
@user_base_tag = params[:id] ? 'base_users':'base'
|
@user_base_tag = params[:id] ? 'base_users':'base'
|
||||||
|
|
|
@ -17,7 +17,10 @@
|
||||||
<label for='group_id'><%= l(:label_group) %>:</label>
|
<label for='group_id'><%= l(:label_group) %>:</label>
|
||||||
<%= 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;" %>
|
<%= 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 %>
|
<% end %>
|
||||||
|
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
|
||||||
|
<%= select "search_by", "id",
|
||||||
|
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
|
||||||
|
:size => 20 %>
|
||||||
<label for='name'><%= l(:label_user) %>:</label>
|
<label for='name'><%= l(:label_user) %>:</label>
|
||||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||||
<%= submit_tag l(:label_search), :class => "small", :name => nil %>
|
<%= submit_tag l(:label_search), :class => "small", :name => nil %>
|
||||||
|
|
|
@ -17,7 +17,10 @@
|
||||||
<label for='group_id'><%= l(:label_group) %>:</label>
|
<label for='group_id'><%= l(:label_group) %>:</label>
|
||||||
<%= 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;" %>
|
<%= 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 %>
|
<% end %>
|
||||||
|
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
|
||||||
|
<%= select "search_by", "id",
|
||||||
|
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
|
||||||
|
:size => 20 %>
|
||||||
<label for='name'><%= l(:label_user) %>:</label>
|
<label for='name'><%= l(:label_user) %>:</label>
|
||||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||||
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->
|
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->
|
||||||
|
|
Loading…
Reference in New Issue