]> git.openstreetmap.org Git - rails.git/blob - app/controllers/users/issued_blocks_controller.rb
Merge remote-tracking branch 'upstream/pull/5457'
[rails.git] / app / controllers / users / issued_blocks_controller.rb
1 module Users
2   class IssuedBlocksController < ApplicationController
3     include UserMethods
4     include PaginationMethods
5
6     layout "site"
7
8     before_action :authorize_web
9     before_action :set_locale
10
11     authorize_resource :class => UserBlock
12
13     before_action :lookup_user
14     before_action :check_database_readable
15
16     ##
17     # shows a list of all the blocks by the given user.
18     def show
19       @params = params.permit(:user_display_name)
20
21       user_blocks = UserBlock.where(:creator => @user)
22
23       @user_blocks, @newer_user_blocks_id, @older_user_blocks_id = get_page_items(user_blocks, :includes => [:user, :creator, :revoker])
24
25       @show_user_name = true
26       @show_creator_name = false
27
28       render :partial => "user_blocks/page" if turbo_frame_request_id == "pagination"
29     end
30   end
31 end