2009-08-02 19:01:45 +02:00
|
|
|
class Foodcoop::UsersController < ApplicationController
|
|
|
|
def index
|
2022-05-27 17:06:25 +02:00
|
|
|
@users = User.undeleted.sort_by_param(params["sort"])
|
2011-05-15 23:43:23 +02:00
|
|
|
|
|
|
|
# if somebody uses the search field:
|
2013-09-20 23:18:06 +02:00
|
|
|
@users = @users.natural_search(params[:user_name]) unless params[:user_name].blank?
|
2011-05-15 23:43:23 +02:00
|
|
|
|
2012-10-08 15:24:32 +02:00
|
|
|
if params[:ordergroup_name]
|
|
|
|
@users = @users.joins(:groups).where("groups.type = 'Ordergroup' AND groups.name LIKE ?", "%#{params[:ordergroup_name]}%")
|
|
|
|
end
|
|
|
|
|
2013-09-20 23:18:06 +02:00
|
|
|
@users = @users.page(params[:page]).per(@per_page)
|
2009-08-02 19:01:45 +02:00
|
|
|
|
2011-05-15 23:43:23 +02:00
|
|
|
respond_to do |format|
|
|
|
|
format.html # index.html.haml
|
|
|
|
format.js { render :layout => false } # index.js.erb
|
2009-08-02 19:01:45 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|