forked from External/greenlight
Add paging to Recordings Table (GRN2-26) (#512)
* Add translations for the validation messages * Add translations for next/prev button * Add paging to recordings * sync * Fix line endings
This commit is contained in:
committed by
Jesus Federico
parent
d8f6c3f872
commit
23abdb52ee
@ -18,6 +18,7 @@
|
||||
|
||||
class RoomsController < ApplicationController
|
||||
include RecordingsHelper
|
||||
include Pagy::Backend
|
||||
|
||||
before_action :validate_accepted_terms, unless: -> { !Rails.configuration.terms }
|
||||
before_action :validate_verified_email, except: [:show, :join],
|
||||
@ -52,9 +53,11 @@ class RoomsController < ApplicationController
|
||||
# GET /:room_uid
|
||||
def show
|
||||
if current_user && @room.owned_by?(current_user)
|
||||
recs = @room.recordings
|
||||
@search, @order_column, @order_direction, recs =
|
||||
@room.recordings(params.permit(:search, :column, :direction), true)
|
||||
|
||||
@pagy, @recordings = pagy_array(recs)
|
||||
|
||||
@recordings = recs
|
||||
@is_running = @room.running?
|
||||
else
|
||||
# Get users name
|
||||
@ -66,6 +69,11 @@ class RoomsController < ApplicationController
|
||||
""
|
||||
end
|
||||
|
||||
@search, @order_column, @order_direction, pub_recs =
|
||||
@room.public_recordings(params.permit(:search, :column, :direction), true)
|
||||
|
||||
@pagy, @public_recordings = pagy_array(pub_recs)
|
||||
|
||||
render :join
|
||||
end
|
||||
end
|
||||
@ -119,6 +127,13 @@ class RoomsController < ApplicationController
|
||||
redirect_to @room.join_path(join_name, opts)
|
||||
end
|
||||
else
|
||||
|
||||
search_params = params[@room.invite_path] || params
|
||||
@search, @order_column, @order_direction, pub_recs =
|
||||
@room.public_recordings(search_params.permit(:search, :column, :direction), true)
|
||||
|
||||
@pagy, @public_recordings = pagy_array(pub_recs)
|
||||
|
||||
# They need to wait until the meeting begins.
|
||||
render :wait
|
||||
end
|
||||
|
Reference in New Issue
Block a user