forked from External/greenlight
Merge pull request #1222 from farhatahmad/room-settings
GRN2-xx: Added room configuration tab to allow admins to set room settings as always enabled, optional or disabled
This commit is contained in:
commit
2ab0c7e067
|
@ -144,10 +144,11 @@ function showCreateRoom(target) {
|
||||||
$("#room_access_code").val(null)
|
$("#room_access_code").val(null)
|
||||||
|
|
||||||
$("#createRoomModal form").attr("action", $("body").data('relative-root'))
|
$("#createRoomModal form").attr("action", $("body").data('relative-root'))
|
||||||
$("#room_mute_on_join").prop("checked", false)
|
|
||||||
$("#room_require_moderator_approval").prop("checked", false)
|
$("#room_mute_on_join").prop("checked", $("#room_mute_on_join").data("default"))
|
||||||
$("#room_anyone_can_start").prop("checked", false)
|
$("#room_require_moderator_approval").prop("checked", $("#room_require_moderator_approval").data("default"))
|
||||||
$("#room_all_join_moderator").prop("checked", false)
|
$("#room_anyone_can_start").prop("checked", $("#room_anyone_can_start").data("default"))
|
||||||
|
$("#room_all_join_moderator").prop("checked", $("#room_all_join_moderator").data("default"))
|
||||||
|
|
||||||
//show all elements & their children with a create-only class
|
//show all elements & their children with a create-only class
|
||||||
$(".create-only").each(function() {
|
$(".create-only").each(function() {
|
||||||
|
@ -203,11 +204,11 @@ function showDeleteRoom(target) {
|
||||||
function updateCurrentSettings(settings_path){
|
function updateCurrentSettings(settings_path){
|
||||||
// Get current room settings and set checkbox
|
// Get current room settings and set checkbox
|
||||||
$.get(settings_path, function(room_settings) {
|
$.get(settings_path, function(room_settings) {
|
||||||
var settings = JSON.parse(room_settings)
|
var settings = JSON.parse(room_settings)
|
||||||
$("#room_mute_on_join").prop("checked", settings.muteOnStart)
|
$("#room_mute_on_join").prop("checked", $("#room_mute_on_join").data("default") || settings.muteOnStart)
|
||||||
$("#room_require_moderator_approval").prop("checked", settings.requireModeratorApproval)
|
$("#room_require_moderator_approval").prop("checked", $("#room_require_moderator_approval").data("default") || settings.requireModeratorApproval)
|
||||||
$("#room_anyone_can_start").prop("checked", settings.anyoneCanStart)
|
$("#room_anyone_can_start").prop("checked", $("#room_anyone_can_start").data("default") || settings.anyoneCanStart)
|
||||||
$("#room_all_join_moderator").prop("checked", settings.joinModerator)
|
$("#room_all_join_moderator").prop("checked", $("#room_all_join_moderator").data("default") || settings.joinModerator)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,3 +109,7 @@
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.enabled-setting {
|
||||||
|
background: lightgray;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
|
@ -73,6 +73,10 @@ class AdminsController < ApplicationController
|
||||||
@pagy, @rooms = pagy_array(server_rooms_list)
|
@pagy, @rooms = pagy_array(server_rooms_list)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# GET /admins/room_configuration
|
||||||
|
def room_configuration
|
||||||
|
end
|
||||||
|
|
||||||
# MANAGE USERS
|
# MANAGE USERS
|
||||||
|
|
||||||
# GET /admins/edit/:user_uid
|
# GET /admins/edit/:user_uid
|
||||||
|
@ -241,6 +245,16 @@ class AdminsController < ApplicationController
|
||||||
redirect_to admin_site_settings_path, flash: { success: I18n.t("administrator.flash.settings") }
|
redirect_to admin_site_settings_path, flash: { success: I18n.t("administrator.flash.settings") }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# ROOM CONFIGURATION
|
||||||
|
# POST /admins/update_room_configuration
|
||||||
|
def update_room_configuration
|
||||||
|
@settings.update_value(params[:setting], params[:value])
|
||||||
|
|
||||||
|
flash_message = I18n.t("administrator.flash.room_configuration")
|
||||||
|
|
||||||
|
redirect_to admin_room_configuration_path, flash: { success: flash_message }
|
||||||
|
end
|
||||||
|
|
||||||
# ROLES
|
# ROLES
|
||||||
|
|
||||||
# GET /admins/roles
|
# GET /admins/roles
|
||||||
|
|
|
@ -48,15 +48,15 @@ module Joiner
|
||||||
end
|
end
|
||||||
|
|
||||||
def join_room(opts)
|
def join_room(opts)
|
||||||
room_settings = JSON.parse(@room[:room_settings])
|
@room_settings = JSON.parse(@room[:room_settings])
|
||||||
|
|
||||||
if room_running?(@room.bbb_id) || @room.owned_by?(current_user) || room_settings["anyoneCanStart"]
|
if room_running?(@room.bbb_id) || @room.owned_by?(current_user) || room_setting_with_config("anyoneCanStart")
|
||||||
|
|
||||||
# Determine if the user needs to join as a moderator.
|
# Determine if the user needs to join as a moderator.
|
||||||
opts[:user_is_moderator] = @room.owned_by?(current_user) || room_settings["joinModerator"] || @shared_room
|
opts[:user_is_moderator] = @room.owned_by?(current_user) || room_setting_with_config("joinModerator") || @shared_room
|
||||||
|
|
||||||
opts[:require_moderator_approval] = room_settings["requireModeratorApproval"]
|
opts[:require_moderator_approval] = room_setting_with_config("requireModeratorApproval")
|
||||||
opts[:mute_on_start] = room_settings["muteOnStart"]
|
opts[:mute_on_start] = room_setting_with_config("muteOnStart")
|
||||||
|
|
||||||
if current_user
|
if current_user
|
||||||
redirect_to join_path(@room, current_user.name, opts, current_user.uid)
|
redirect_to join_path(@room, current_user.name, opts, current_user.uid)
|
||||||
|
@ -94,6 +94,29 @@ module Joiner
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Gets the room setting based on the option set in the room configuration
|
||||||
|
def room_setting_with_config(name)
|
||||||
|
config = case name
|
||||||
|
when "muteOnStart"
|
||||||
|
"Room Configuration Mute On Join"
|
||||||
|
when "requireModeratorApproval"
|
||||||
|
"Room Configuration Require Moderator"
|
||||||
|
when "joinModerator"
|
||||||
|
"Room Configuration All Join Moderator"
|
||||||
|
when "anyoneCanStart"
|
||||||
|
"Room Configuration Allow Any Start"
|
||||||
|
end
|
||||||
|
|
||||||
|
case @settings.get_value(config)
|
||||||
|
when "enabled"
|
||||||
|
true
|
||||||
|
when "optional"
|
||||||
|
@room_settings[name]
|
||||||
|
when "disabled"
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def fetch_guest_id
|
def fetch_guest_id
|
||||||
|
|
|
@ -62,7 +62,8 @@ class RoomsController < ApplicationController
|
||||||
|
|
||||||
# GET /:room_uid
|
# GET /:room_uid
|
||||||
def show
|
def show
|
||||||
@anyone_can_start = JSON.parse(@room[:room_settings])["anyoneCanStart"]
|
@room_settings = @room[:room_settings]
|
||||||
|
@anyone_can_start = room_setting_with_config("anyoneCanStart")
|
||||||
@room_running = room_running?(@room.bbb_id)
|
@room_running = room_running?(@room.bbb_id)
|
||||||
@shared_room = room_shared_with_user
|
@shared_room = room_shared_with_user
|
||||||
|
|
||||||
|
@ -160,9 +161,9 @@ class RoomsController < ApplicationController
|
||||||
opts[:user_is_moderator] = true
|
opts[:user_is_moderator] = true
|
||||||
|
|
||||||
# Include the user's choices for the room settings
|
# Include the user's choices for the room settings
|
||||||
room_settings = JSON.parse(@room[:room_settings])
|
@room_settings = JSON.parse(@room[:room_settings])
|
||||||
opts[:mute_on_start] = room_settings["muteOnStart"]
|
opts[:mute_on_start] = room_setting_with_config("muteOnStart")
|
||||||
opts[:require_moderator_approval] = room_settings["requireModeratorApproval"]
|
opts[:require_moderator_approval] = room_setting_with_config("requireModeratorApproval")
|
||||||
|
|
||||||
begin
|
begin
|
||||||
redirect_to join_path(@room, current_user.name, opts, current_user.uid)
|
redirect_to join_path(@room, current_user.name, opts, current_user.uid)
|
||||||
|
|
|
@ -19,11 +19,20 @@
|
||||||
module AdminsHelper
|
module AdminsHelper
|
||||||
include Pagy::Frontend
|
include Pagy::Frontend
|
||||||
|
|
||||||
|
# Server Rooms
|
||||||
|
|
||||||
# Gets the email of the room owner to which the recording belongs to
|
# Gets the email of the room owner to which the recording belongs to
|
||||||
def recording_owner_email(room_id)
|
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
|
Room.find_by(bbb_id: room_id).owner.email.presence || Room.find_by(bbb_id: room_id).owner.username
|
||||||
end
|
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
|
def admin_invite_registration
|
||||||
controller_name == "admins" && action_name == "index" &&
|
controller_name == "admins" && action_name == "index" &&
|
||||||
@settings.get_value("Registration Method") == Rails.configuration.registration_methods[:invite]
|
@settings.get_value("Registration Method") == Rails.configuration.registration_methods[:invite]
|
||||||
|
@ -85,12 +94,22 @@ module AdminsHelper
|
||||||
@settings.get_value("Room Limit").to_i
|
@settings.get_value("Room Limit").to_i
|
||||||
end
|
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
|
def edit_disabled
|
||||||
@edit_disabled ||= @selected_role.priority <= current_user.highest_priority_role.priority
|
@edit_disabled ||= @selected_role.priority <= current_user.highest_priority_role.priority
|
||||||
end
|
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
|
end
|
||||||
|
|
|
@ -37,4 +37,8 @@ module RoomsHelper
|
||||||
@diff = current_user.rooms.count - limit
|
@diff = current_user.rooms.count - limit
|
||||||
@diff.positive? && current_user.rooms.pluck(:id).index(room.id) + 1 > limit
|
@diff.positive? && current_user.rooms.pluck(:id).index(room.id) + 1 > limit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def room_configuration(name)
|
||||||
|
@settings.get_value(name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,7 +27,8 @@ class Ability
|
||||||
else
|
else
|
||||||
highest_role = user.highest_priority_role
|
highest_role = user.highest_priority_role
|
||||||
if highest_role.get_permission("can_edit_site_settings")
|
if highest_role.get_permission("can_edit_site_settings")
|
||||||
can [:site_settings, :update_settings, :coloring, :registration_method], :admin
|
can [:site_settings, :room_configuration, :update_settings,
|
||||||
|
:update_room_configuration, :coloring, :registration_method], :admin
|
||||||
end
|
end
|
||||||
|
|
||||||
if highest_role.get_permission("can_edit_roles")
|
if highest_role.get_permission("can_edit_roles")
|
||||||
|
|
|
@ -58,6 +58,23 @@ class Setting < ApplicationRecord
|
||||||
Rails.configuration.number_of_rooms_default
|
Rails.configuration.number_of_rooms_default
|
||||||
when "Shared Access"
|
when "Shared Access"
|
||||||
Rails.configuration.shared_access_default
|
Rails.configuration.shared_access_default
|
||||||
|
when "Room Configuration Mute On Join"
|
||||||
|
room_config_setting("mute-on-join")
|
||||||
|
when "Room Configuration Require Moderator"
|
||||||
|
room_config_setting("require-moderator-approval")
|
||||||
|
when "Room Configuration Allow Any Start"
|
||||||
|
room_config_setting("anyone-can-start")
|
||||||
|
when "Room Configuration All Join Moderator"
|
||||||
|
room_config_setting("all-join-moderator")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check if the room setting is currently enabled in .env, return disabled if not and return optional if it is
|
||||||
|
def room_config_setting(name)
|
||||||
|
if Rails.configuration.room_features.include?(name)
|
||||||
|
"optional"
|
||||||
|
else
|
||||||
|
"disabled"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,6 +33,9 @@
|
||||||
<%= link_to admin_site_settings_path, class: "list-group-item list-group-item-action dropdown-item #{"active" if active_page == "site_settings"}" do %>
|
<%= link_to admin_site_settings_path, class: "list-group-item list-group-item-action dropdown-item #{"active" if active_page == "site_settings"}" do %>
|
||||||
<span class="icon mr-4"><i class="fas fa-cogs"></i></span><%= t("administrator.site_settings.title") %>
|
<span class="icon mr-4"><i class="fas fa-cogs"></i></span><%= t("administrator.site_settings.title") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= link_to admin_room_configuration_path, class: "list-group-item list-group-item-action dropdown-item #{"active" if active_page == "room_configuration"}" do %>
|
||||||
|
<span class="icon mr-4"><i class="fas fa-sliders-h"></i></span><%= t("administrator.room_configuration.title") %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if highest_role.get_permission("can_edit_roles") || highest_role.name == "super_admin" %>
|
<% if highest_role.get_permission("can_edit_roles") || highest_role.name == "super_admin" %>
|
||||||
<%= link_to admin_roles_path, class: "list-group-item list-group-item-action dropdown-item #{"active" if active_page == "roles"}" do %>
|
<%= link_to admin_roles_path, class: "list-group-item list-group-item-action dropdown-item #{"active" if active_page == "roles"}" do %>
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
<div>
|
||||||
|
<div class="mb-6 row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label"><%= t("modal.room_settings.mute") %></label>
|
||||||
|
<label class="form-label text-muted"><%= t("administrator.room_configuration.mute.info") %></label>
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
<%= room_configuration_string("Room Configuration Mute On Join") %>
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Mute On Join", value: "enabled"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.enabled") %>
|
||||||
|
<% end %>
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Mute On Join", value: "optional"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.optional") %>
|
||||||
|
<% end %>
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Mute On Join", value: "disabled"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.disabled") %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-6 row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label"><%= t("modal.room_settings.require_approval") %></label>
|
||||||
|
<label class="form-label text-muted"><%= t("administrator.room_configuration.require_moderator.info") %></label>
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
<%= room_configuration_string("Room Configuration Require Moderator") %>
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Require Moderator", value: "enabled"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.enabled") %>
|
||||||
|
<% end %>
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Require Moderator", value: "optional"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.optional") %>
|
||||||
|
<% end %>
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Require Moderator", value: "disabled"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.disabled") %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-6 row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label"><%= t("modal.room_settings.start") %></label>
|
||||||
|
<label class="form-label text-muted"><%= t("administrator.room_configuration.allow_any.info") %></label>
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
<%= room_configuration_string("Room Configuration Allow Any Start") %>
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Allow Any Start", value: "enabled"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.enabled") %>
|
||||||
|
<% end %>
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Allow Any Start", value: "optional"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.optional") %>
|
||||||
|
<% end %>
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration Allow Any Start", value: "disabled"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.disabled") %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-6 row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label"><%= t("modal.room_settings.join_moderator") %></label>
|
||||||
|
<label class="form-label text-muted"><%= t("administrator.room_configuration.all_moderator.info") %></label>
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
<%= room_configuration_string("Room Configuration All Join Moderator") %>
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration All Join Moderator", value: "enabled"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.enabled") %>
|
||||||
|
<% end %>
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration All Join Moderator", value: "optional"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.optional") %>
|
||||||
|
<% end %>
|
||||||
|
<%= button_to admin_update_room_configuration_path(setting: "Room Configuration All Join Moderator", value: "disabled"), class: "dropdown-item", "data-disable": "" do %>
|
||||||
|
<%= t("administrator.room_configuration.options.disabled") %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,27 @@
|
||||||
|
<%
|
||||||
|
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
|
||||||
|
# Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under the
|
||||||
|
# terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 3.0 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
# You should have received a copy of the GNU Lesser General Public License along
|
||||||
|
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
%>
|
||||||
|
|
||||||
|
<div class="container pt-6">
|
||||||
|
<%= render "shared/components/subtitle", subtitle: t("administrator.title"), search: false %>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-3 mb-4">
|
||||||
|
<%= render "admins/components/menu_buttons" %>
|
||||||
|
</div>
|
||||||
|
<div id="room_configuration" class="col-lg-9">
|
||||||
|
<%= render "admins/components/setting_view", setting_id: "room_settings", setting_title: t("administrator.room_configuration.title"), search: false %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -43,34 +43,38 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if Rails.configuration.room_features.include? "mute-on-join" %>
|
<% mute = room_configuration("Room Configuration Mute On Join") %>
|
||||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block">
|
<% if mute != "disabled" %>
|
||||||
|
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%= "enabled-setting" if mute == "enabled" %>">
|
||||||
<span class="custom-switch-description"><%= t("modal.room_settings.mute")%></span>
|
<span class="custom-switch-description"><%= t("modal.room_settings.mute")%></span>
|
||||||
<%= f.check_box :mute_on_join, class: "custom-switch-input", checked: false %>
|
<%= f.check_box :mute_on_join, class: "custom-switch-input", data: { default: mute == "enabled" }, checked: false %>
|
||||||
<span class="custom-switch-indicator float-right cursor-pointer"></span>
|
<span class="custom-switch-indicator float-right cursor-pointer"></span>
|
||||||
</label>
|
</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if Rails.configuration.room_features.include? "require-moderator-approval" %>
|
<% require_approval = room_configuration("Room Configuration Require Moderator") %>
|
||||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block">
|
<% if require_approval != "disabled" %>
|
||||||
|
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%= "enabled-setting" if require_approval == "enabled" %>">
|
||||||
<span class="custom-switch-description"><%= t("modal.room_settings.require_approval")%></span>
|
<span class="custom-switch-description"><%= t("modal.room_settings.require_approval")%></span>
|
||||||
<%= f.check_box :require_moderator_approval, class: "custom-switch-input", checked: false %>
|
<%= f.check_box :require_moderator_approval, class: "custom-switch-input", data: { default: require_approval == "enabled" }, checked: false %>
|
||||||
<span class="custom-switch-indicator float-right cursor-pointer"></span>
|
<span class="custom-switch-indicator float-right cursor-pointer"></span>
|
||||||
</label>
|
</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if Rails.configuration.room_features.include? "anyone-can-start" %>
|
<% any_start = room_configuration("Room Configuration Allow Any Start") %>
|
||||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block">
|
<% if any_start != "disabled" %>
|
||||||
|
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%= "enabled-setting" if any_start == "enabled" %>">
|
||||||
<span class="custom-switch-description"><%= t("modal.room_settings.start")%></span>
|
<span class="custom-switch-description"><%= t("modal.room_settings.start")%></span>
|
||||||
<%= f.check_box :anyone_can_start, class: "custom-switch-input", checked: false %>
|
<%= f.check_box :anyone_can_start, class: "custom-switch-input", data: { default: any_start == "enabled" }, checked: false %>
|
||||||
<span class="custom-switch-indicator float-right cursor-pointer"></span>
|
<span class="custom-switch-indicator float-right cursor-pointer"></span>
|
||||||
</label>
|
</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if Rails.configuration.room_features.include? "all-join-moderator" %>
|
<% moderator = room_configuration("Room Configuration All Join Moderator") %>
|
||||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block">
|
<% if moderator != "disabled" %>
|
||||||
|
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%= "enabled-setting" if moderator == "enabled" %>">
|
||||||
<span class="custom-switch-description"><%= t("modal.room_settings.join_moderator")%></span>
|
<span class="custom-switch-description"><%= t("modal.room_settings.join_moderator")%></span>
|
||||||
<%= f.check_box :all_join_moderator, class: "custom-switch-input", checked: false %>
|
<%= f.check_box :all_join_moderator, class: "custom-switch-input", data: { default: moderator == "enabled" }, checked: false %>
|
||||||
<span class="custom-switch-indicator float-right cursor-pointer"></span>
|
<span class="custom-switch-indicator float-right cursor-pointer"></span>
|
||||||
</label>
|
</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -101,6 +101,7 @@ en:
|
||||||
registration_method_updated: Registration method successfully updated
|
registration_method_updated: Registration method successfully updated
|
||||||
reset_password: The user has been sent an email to reset their password. (Please ask them to check their spam folder if they haven't received it)
|
reset_password: The user has been sent an email to reset their password. (Please ask them to check their spam folder if they haven't received it)
|
||||||
restored: User has been successfully restored
|
restored: User has been successfully restored
|
||||||
|
room_configuration: Room Configuration successfully changed
|
||||||
settings: Site Settings successfully changed
|
settings: Site Settings successfully changed
|
||||||
unauthorized: You are not authorized to perform actions on this user
|
unauthorized: You are not authorized to perform actions on this user
|
||||||
recordings:
|
recordings:
|
||||||
|
@ -127,6 +128,20 @@ en:
|
||||||
colour:
|
colour:
|
||||||
title: Role Colour
|
title: Role Colour
|
||||||
info: Set the colour that will be associated with the role
|
info: Set the colour that will be associated with the role
|
||||||
|
room_configuration:
|
||||||
|
title: Room Configuration
|
||||||
|
mute:
|
||||||
|
info: Automatically mutes the user when they join the BigBlueButton meeting
|
||||||
|
require_moderator:
|
||||||
|
info: Prompts the moderator of the BigBlueButton meeting when a user tries to join. If the user is approved, they will be able to join the meeting.
|
||||||
|
allow_any:
|
||||||
|
info: Allows any user to start the meeting at any time. By default, only the room owner can start the meeting.
|
||||||
|
all_moderator:
|
||||||
|
info: Gives all users moderator priveleges in BigBlueButton when they join the meeting.
|
||||||
|
options:
|
||||||
|
disabled: Disabled
|
||||||
|
enabled: Always Enabled
|
||||||
|
optional: Optional
|
||||||
rooms:
|
rooms:
|
||||||
title: Server Rooms
|
title: Server Rooms
|
||||||
table:
|
table:
|
||||||
|
|
|
@ -41,6 +41,7 @@ Rails.application.routes.draw do
|
||||||
get '/rooms', to: 'admins#server_rooms', as: :admin_rooms
|
get '/rooms', to: 'admins#server_rooms', as: :admin_rooms
|
||||||
get '/recordings', to: 'admins#server_recordings', as: :admin_recordings
|
get '/recordings', to: 'admins#server_recordings', as: :admin_recordings
|
||||||
get '/site_settings', to: 'admins#site_settings', as: :admin_site_settings
|
get '/site_settings', to: 'admins#site_settings', as: :admin_site_settings
|
||||||
|
get '/room_configuration', to: 'admins#room_configuration', as: :admin_room_configuration
|
||||||
get '/roles', to: 'admins#roles', as: :admin_roles
|
get '/roles', to: 'admins#roles', as: :admin_roles
|
||||||
# Manage Users
|
# Manage Users
|
||||||
get '/edit/:user_uid', to: 'admins#edit_user', as: :admin_edit_user
|
get '/edit/:user_uid', to: 'admins#edit_user', as: :admin_edit_user
|
||||||
|
@ -58,6 +59,8 @@ Rails.application.routes.draw do
|
||||||
post '/clear_cache', to: 'admins#clear_cache', as: :admin_clear_cache
|
post '/clear_cache', to: 'admins#clear_cache', as: :admin_clear_cache
|
||||||
post '/clear_auth', to: 'admins#clear_auth', as: :admin_clear_auth
|
post '/clear_auth', to: 'admins#clear_auth', as: :admin_clear_auth
|
||||||
post '/log_level', to: 'admins#log_level', as: :admin_log_level
|
post '/log_level', to: 'admins#log_level', as: :admin_log_level
|
||||||
|
# Room Configuration
|
||||||
|
post '/update_room_configuration', to: 'admins#update_room_configuration', as: :admin_update_room_configuration
|
||||||
# Roles
|
# Roles
|
||||||
post '/role', to: 'admins#new_role', as: :admin_new_role
|
post '/role', to: 'admins#new_role', as: :admin_new_role
|
||||||
patch 'roles/order', to: 'admins#change_role_order', as: :admin_roles_order
|
patch 'roles/order', to: 'admins#change_role_order', as: :admin_roles_order
|
||||||
|
|
|
@ -262,6 +262,7 @@ describe RoomsController, type: :controller do
|
||||||
|
|
||||||
it "should join the room if the room has the anyone_can_start setting" do
|
it "should join the room if the room has the anyone_can_start setting" do
|
||||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(false)
|
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(false)
|
||||||
|
allow_any_instance_of(Setting).to receive(:get_value).and_return("optional")
|
||||||
|
|
||||||
room = Room.new(name: "test")
|
room = Room.new(name: "test")
|
||||||
room.room_settings = "{\"muteOnStart\":false,\"joinViaHtml5\":false,\"anyoneCanStart\":true}"
|
room.room_settings = "{\"muteOnStart\":false,\"joinViaHtml5\":false,\"anyoneCanStart\":true}"
|
||||||
|
@ -274,7 +275,38 @@ describe RoomsController, type: :controller do
|
||||||
expect(response).to redirect_to(join_path(room, @user.name, { user_is_moderator: false }, @user.uid))
|
expect(response).to redirect_to(join_path(room, @user.name, { user_is_moderator: false }, @user.uid))
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should join the room as moderator if room has the all_join_moderator setting" do
|
it "doesn't join the room if the room has the anyone_can_start setting but config is disabled" do
|
||||||
|
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(false)
|
||||||
|
allow_any_instance_of(Setting).to receive(:get_value).and_return("disabled")
|
||||||
|
|
||||||
|
room = Room.new(name: "test")
|
||||||
|
room.room_settings = "{\"muteOnStart\":false,\"joinViaHtml5\":false,\"anyoneCanStart\":true}"
|
||||||
|
room.owner = @owner
|
||||||
|
room.save
|
||||||
|
|
||||||
|
@request.session[:user_id] = @user.id
|
||||||
|
post :join, params: { room_uid: room, join_name: @user.name }
|
||||||
|
|
||||||
|
expect(response).to render_template(:wait)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "joins the room if the room doesn't have the anyone_can_start setting but config is set to enabled" do
|
||||||
|
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(false)
|
||||||
|
allow_any_instance_of(Setting).to receive(:get_value).and_return("enabled")
|
||||||
|
|
||||||
|
room = Room.new(name: "test")
|
||||||
|
room.room_settings = "{\"anyoneCanStart\":false}"
|
||||||
|
room.owner = @owner
|
||||||
|
room.save
|
||||||
|
|
||||||
|
@request.session[:user_id] = @user.id
|
||||||
|
post :join, params: { room_uid: room, join_name: @user.name }
|
||||||
|
|
||||||
|
expect(response).to redirect_to(join_path(room, @user.name, { user_is_moderator: true }, @user.uid))
|
||||||
|
end
|
||||||
|
|
||||||
|
it "joins the room as moderator if room has the all_join_moderator setting" do
|
||||||
|
allow_any_instance_of(Setting).to receive(:get_value).and_return("optional")
|
||||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(true)
|
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(true)
|
||||||
|
|
||||||
room = Room.new(name: "test")
|
room = Room.new(name: "test")
|
||||||
|
@ -288,6 +320,36 @@ describe RoomsController, type: :controller do
|
||||||
expect(response).to redirect_to(join_path(room, @user.name, { user_is_moderator: true }, @user.uid))
|
expect(response).to redirect_to(join_path(room, @user.name, { user_is_moderator: true }, @user.uid))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "joins the room as moderator if room doesn't have all_join_moderator but config is set to enabled" do
|
||||||
|
allow_any_instance_of(Setting).to receive(:get_value).and_return("enabled")
|
||||||
|
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(true)
|
||||||
|
|
||||||
|
room = Room.new(name: "test")
|
||||||
|
room.room_settings = "{ }"
|
||||||
|
room.owner = @owner
|
||||||
|
room.save
|
||||||
|
|
||||||
|
@request.session[:user_id] = @user.id
|
||||||
|
post :join, params: { room_uid: room, join_name: @user.name }
|
||||||
|
|
||||||
|
expect(response).to redirect_to(join_path(room, @user.name, { user_is_moderator: true }, @user.uid))
|
||||||
|
end
|
||||||
|
|
||||||
|
it "doesn't join the room as moderator if room has the all_join_moderator setting but config is set to disabled" do
|
||||||
|
allow_any_instance_of(Setting).to receive(:get_value).and_return("disabled")
|
||||||
|
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(true)
|
||||||
|
|
||||||
|
room = Room.new(name: "test")
|
||||||
|
room.room_settings = "{\"joinModerator\":true}"
|
||||||
|
room.owner = @owner
|
||||||
|
room.save
|
||||||
|
|
||||||
|
@request.session[:user_id] = @user.id
|
||||||
|
post :join, params: { room_uid: room, join_name: @user.name }
|
||||||
|
|
||||||
|
expect(response).to redirect_to(join_path(room, @user.name, { user_is_moderator: false }, @user.uid))
|
||||||
|
end
|
||||||
|
|
||||||
it "should render wait if the correct access code is supplied" do
|
it "should render wait if the correct access code is supplied" do
|
||||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(false)
|
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(false)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue