forked from External/greenlight
GRN2-180: First stages of refactoring code for v2.4 (#748)
* Email rescues and authenticator concern * Application controller and helper clean up * Moved controller code out of helpers * More helper and email clean up * Cleaned up remaining helpers and create omniauth_options * Controller code clean up * restructured views structure * Restructured role code * Restructured profile and code clean up * Master merge * Added bbb server concern to deal with bbb calls * Bug fixes and changes after changes * rspec * More rubocop fixes
This commit is contained in:
@ -19,36 +19,17 @@
|
||||
module AdminsHelper
|
||||
include Pagy::Frontend
|
||||
|
||||
# Returns the action method of the current page
|
||||
def active_page
|
||||
route = Rails.application.routes.recognize_path(request.env['PATH_INFO'])
|
||||
|
||||
route[:action]
|
||||
end
|
||||
|
||||
# Gets the email of the room owner to which the recording belongs to
|
||||
def recording_owner_email(room_id)
|
||||
Room.find_by(bbb_id: room_id).owner.email
|
||||
end
|
||||
|
||||
def display_invite
|
||||
current_page?(admins_path) && invite_registration
|
||||
end
|
||||
|
||||
def registration_method
|
||||
Setting.find_or_create_by!(provider: user_settings_provider).get_value("Registration Method")
|
||||
end
|
||||
|
||||
def invite_registration
|
||||
registration_method == Rails.configuration.registration_methods[:invite]
|
||||
end
|
||||
|
||||
def approval_registration
|
||||
registration_method == Rails.configuration.registration_methods[:approval]
|
||||
@settings.get_value("Registration Method") == Rails.configuration.registration_methods[:invite]
|
||||
end
|
||||
|
||||
def room_authentication_string
|
||||
if Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Authentication") == "true"
|
||||
if @settings.get_value("Room Authentication") == "true"
|
||||
I18n.t("administrator.site_settings.authentication.enabled")
|
||||
else
|
||||
I18n.t("administrator.site_settings.authentication.disabled")
|
||||
@ -56,8 +37,7 @@ module AdminsHelper
|
||||
end
|
||||
|
||||
def recording_default_visibility_string
|
||||
if Setting.find_or_create_by!(provider: user_settings_provider)
|
||||
.get_value("Default Recording Visibility") == "public"
|
||||
if @settings.get_value("Default Recording Visibility") == "public"
|
||||
I18n.t("recording.visibility.public")
|
||||
else
|
||||
I18n.t("recording.visibility.unlisted")
|
||||
@ -65,7 +45,7 @@ module AdminsHelper
|
||||
end
|
||||
|
||||
def registration_method_string
|
||||
case registration_method
|
||||
case @settings.get_value("Registration Method")
|
||||
when Rails.configuration.registration_methods[:open]
|
||||
I18n.t("administrator.site_settings.registration.methods.open")
|
||||
when Rails.configuration.registration_methods[:invite]
|
||||
@ -76,7 +56,7 @@ module AdminsHelper
|
||||
end
|
||||
|
||||
def room_limit_number
|
||||
Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Limit").to_i
|
||||
@settings.get_value("Room Limit").to_i
|
||||
end
|
||||
|
||||
def edit_disabled
|
||||
|
Reference in New Issue
Block a user