forked from External/greenlight
Added room configuration tab to admin panel
This commit is contained in:
@ -19,11 +19,20 @@
|
||||
module AdminsHelper
|
||||
include Pagy::Frontend
|
||||
|
||||
# Server Rooms
|
||||
|
||||
# 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.presence || Room.find_by(bbb_id: room_id).owner.username
|
||||
end
|
||||
|
||||
# Get the room status to display in the Server Rooms table
|
||||
def room_is_running(id)
|
||||
@running_room_bbb_ids.include?(id)
|
||||
end
|
||||
|
||||
# Site Settings
|
||||
|
||||
def admin_invite_registration
|
||||
controller_name == "admins" && action_name == "index" &&
|
||||
@settings.get_value("Registration Method") == Rails.configuration.registration_methods[:invite]
|
||||
@ -85,12 +94,22 @@ module AdminsHelper
|
||||
@settings.get_value("Room Limit").to_i
|
||||
end
|
||||
|
||||
# Room Configuration
|
||||
|
||||
def room_configuration_string(name)
|
||||
case @settings.get_value(name)
|
||||
when "enabled"
|
||||
t("administrator.room_configuration.options.enabled")
|
||||
when "optional"
|
||||
t("administrator.room_configuration.options.optional")
|
||||
when "disabled"
|
||||
t("administrator.room_configuration.options.disabled")
|
||||
end
|
||||
end
|
||||
|
||||
# Roles
|
||||
|
||||
def edit_disabled
|
||||
@edit_disabled ||= @selected_role.priority <= current_user.highest_priority_role.priority
|
||||
end
|
||||
|
||||
# Get the room status to display in the Server Rooms table
|
||||
def room_is_running(id)
|
||||
@running_room_bbb_ids.include?(id)
|
||||
end
|
||||
end
|
||||
|
@ -37,4 +37,8 @@ module RoomsHelper
|
||||
@diff = current_user.rooms.count - limit
|
||||
@diff.positive? && current_user.rooms.pluck(:id).index(room.id) + 1 > limit
|
||||
end
|
||||
|
||||
def room_configuration(name)
|
||||
@settings.get_value(name)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user