forked from External/greenlight
GRN2-129: Added server recordings and refactored adminsitrator panel (#662)
* Added server recordings and refactored adminsitrator panel * Fixed some issues * Fixed issue with owner email search * Fixed issue with edit user
This commit is contained in:
committed by
Jesus Federico
parent
8c63f793a5
commit
a055b88eb7
@ -20,6 +20,7 @@ class AdminsController < ApplicationController
|
||||
include Pagy::Backend
|
||||
include Themer
|
||||
include Emailer
|
||||
include Recorder
|
||||
|
||||
manage_users = [:edit_user, :promote, :demote, :ban_user, :unban_user, :approve]
|
||||
site_settings = [:branding, :coloring, :coloring_lighten, :coloring_darken,
|
||||
@ -40,11 +41,27 @@ class AdminsController < ApplicationController
|
||||
@pagy, @users = pagy(user_list)
|
||||
end
|
||||
|
||||
# GET /admins/site_settings
|
||||
def site_settings
|
||||
end
|
||||
|
||||
# GET /admins/server_recordings
|
||||
def server_recordings
|
||||
server_rooms = if Rails.configuration.loadbalanced_configuration
|
||||
Room.includes(:owner).where(users: { provider: user_settings_provider }).pluck(:bbb_id)
|
||||
else
|
||||
Room.pluck(:bbb_id)
|
||||
end
|
||||
|
||||
@search, @order_column, @order_direction, recs =
|
||||
all_recordings(server_rooms, @user_domain, params.permit(:search, :column, :direction), true, true)
|
||||
@pagy, @recordings = pagy_array(recs)
|
||||
end
|
||||
|
||||
# MANAGE USERS
|
||||
|
||||
# GET /admins/edit/:user_uid
|
||||
def edit_user
|
||||
render "admins/index", locals: { setting_id: "account" }
|
||||
end
|
||||
|
||||
# POST /admins/promote/:user_uid
|
||||
@ -111,7 +128,7 @@ class AdminsController < ApplicationController
|
||||
# POST /admins/branding
|
||||
def branding
|
||||
@settings.update_value("Branding Image", params[:url])
|
||||
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
redirect_to admin_site_settings_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
end
|
||||
|
||||
# POST /admins/color
|
||||
@ -119,23 +136,23 @@ class AdminsController < ApplicationController
|
||||
@settings.update_value("Primary Color", params[:color])
|
||||
@settings.update_value("Primary Color Lighten", color_lighten(params[:color]))
|
||||
@settings.update_value("Primary Color Darken", color_darken(params[:color]))
|
||||
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
redirect_to admin_site_settings_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
end
|
||||
|
||||
def coloring_lighten
|
||||
@settings.update_value("Primary Color Lighten", params[:color])
|
||||
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
redirect_to admin_site_settings_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
end
|
||||
|
||||
def coloring_darken
|
||||
@settings.update_value("Primary Color Darken", params[:color])
|
||||
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
redirect_to admin_site_settings_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
end
|
||||
|
||||
# POST /admins/room_authentication
|
||||
def room_authentication
|
||||
@settings.update_value("Room Authentication", params[:value])
|
||||
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
redirect_to admin_site_settings_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
end
|
||||
|
||||
# POST /admins/registration_method/:method
|
||||
@ -144,11 +161,11 @@ class AdminsController < ApplicationController
|
||||
|
||||
# Only allow change to Join by Invitation if user has emails enabled
|
||||
if !Rails.configuration.enable_email_verification && new_method == Rails.configuration.registration_methods[:invite]
|
||||
redirect_to admins_path,
|
||||
redirect_to admin_site_settings_path,
|
||||
flash: { alert: I18n.t("administrator.flash.invite_email_verification") }
|
||||
else
|
||||
@settings.update_value("Registration Method", new_method)
|
||||
redirect_to admins_path,
|
||||
redirect_to admin_site_settings_path,
|
||||
flash: { success: I18n.t("administrator.flash.registration_method_updated") }
|
||||
end
|
||||
end
|
||||
@ -156,7 +173,7 @@ class AdminsController < ApplicationController
|
||||
# POST /admins/room_limit
|
||||
def room_limit
|
||||
@settings.update_value("Room Limit", params[:limit])
|
||||
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
redirect_to admin_site_settings_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||
end
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user