2 class ListsController < ApplicationController
3 include PaginationMethods
7 before_action :authorize_web
8 before_action :set_locale
9 before_action :check_database_readable
11 authorize_resource :class => :users_list
14 # display a list of users matching specified criteria
16 @params = params.permit(:status, :ip, :before, :after)
19 users = users.where(:status => @params[:status]) if @params[:status]
20 users = users.where(:creation_address => @params[:ip]) if @params[:ip]
22 @users_count = users.limit(501).count
23 @users_count = I18n.t("count.at_least_pattern", :count => 500) if @users_count > 500
25 @users, @newer_users_id, @older_users_id = get_page_items(users, :limit => 50)
27 render :partial => "page" if turbo_frame_request_id == "pagination"
31 # update status of selected users
33 ids = params[:user].keys.collect(&:to_i)
35 User.where(:id => ids).update_all(:status => "confirmed") if params[:confirm]
36 User.where(:id => ids).update_all(:status => "deleted") if params[:hide]
38 redirect_to url_for(params.permit(:status, :ip, :before, :after))