forked from External/greenlight
Added the ability to choose which room settings are available using env variable (#363)
This commit is contained in:
parent
5a7c3133da
commit
d24e8fad14
|
@ -20,31 +20,6 @@ $(document).on('turbolinks:load', function(){
|
||||||
|
|
||||||
if(controller == "rooms" && action == "show" || controller == "rooms" && action == "update"){
|
if(controller == "rooms" && action == "show" || controller == "rooms" && action == "update"){
|
||||||
|
|
||||||
// Set a room block rename event
|
|
||||||
var configure_room_block = function(room_block){
|
|
||||||
if(!room_block.is('#home_room_block')){
|
|
||||||
|
|
||||||
// Register a click event on each room_block rename dropdown
|
|
||||||
room_block.find('#rename-room-button').on('click', function(e){
|
|
||||||
|
|
||||||
room_block.find('#room-name-editable-input').on('focusout', function(){
|
|
||||||
submit_rename_request(room_block.find('.card'));
|
|
||||||
$(window).off('mousedown keydown');
|
|
||||||
});
|
|
||||||
|
|
||||||
room_block.click(function(linkEvent) { linkEvent.preventDefault(); });
|
|
||||||
room_block.find('#room-name').hide();
|
|
||||||
room_block.find('#room-name-editable').show();
|
|
||||||
room_block.find('#room-name-editable-input').select()
|
|
||||||
|
|
||||||
// Stop automatic refresh
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
register_window_event(room_block.find('.card'), 'room-name-editable-input', null);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set a room header rename event
|
// Set a room header rename event
|
||||||
var configure_room_header = function(room_title){
|
var configure_room_header = function(room_title){
|
||||||
|
|
||||||
|
@ -61,10 +36,10 @@ $(document).on('turbolinks:load', function(){
|
||||||
room_title.find('#user-text').fadeTo('medium', 0.7);
|
room_title.find('#user-text').fadeTo('medium', 0.7);
|
||||||
room_title.find('#user-text').attr("contenteditable", true);
|
room_title.find('#user-text').attr("contenteditable", true);
|
||||||
room_title.find('#user-text').focus();
|
room_title.find('#user-text').focus();
|
||||||
|
|
||||||
// Stop automatic refresh
|
// Stop automatic refresh
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
register_window_event(room_title, 'user-text', '#edit-room', 'edit-room');
|
register_window_event(room_title, 'user-text', '#edit-room', 'edit-room');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,18 +65,18 @@ $(document).on('turbolinks:load', function(){
|
||||||
submit_rename_request(recording_title);
|
submit_rename_request(recording_title);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
recording_title.addClass("dotted_underline");
|
recording_title.addClass("dotted_underline");
|
||||||
recording_title.fadeTo('medium', 0.7);
|
recording_title.fadeTo('medium', 0.7);
|
||||||
recording_title.find('text').attr("contenteditable", true);
|
recording_title.find('text').attr("contenteditable", true);
|
||||||
recording_title.find('text').focus();
|
recording_title.find('text').focus();
|
||||||
|
|
||||||
// Stop automatic refresh
|
// Stop automatic refresh
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
register_window_event(recording_title, 'recording-text', '#edit-record', 'edit-recordid');
|
register_window_event(recording_title, 'recording-text', '#edit-record', 'edit-recordid');
|
||||||
}
|
}
|
||||||
|
|
||||||
recording_title.find('a').on('click focusout', function(e){
|
recording_title.find('a').on('click focusout', function(e){
|
||||||
register_recording_title_event(e);
|
register_recording_title_event(e);
|
||||||
});
|
});
|
||||||
|
@ -126,12 +101,12 @@ $(document).on('turbolinks:load', function(){
|
||||||
$(clickEvent.target).data(edit_button_data) === element.find(edit_button_id).data(edit_button_data)){
|
$(clickEvent.target).data(edit_button_data) === element.find(edit_button_id).data(edit_button_data)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if event is keydown and enter key is not pressed
|
// Check if event is keydown and enter key is not pressed
|
||||||
if(clickEvent.type == "keydown" && clickEvent.which !== 13){
|
if(clickEvent.type == "keydown" && clickEvent.which !== 13){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
submit_rename_request(element);
|
submit_rename_request(element);
|
||||||
|
|
||||||
|
@ -182,15 +157,9 @@ $(document).on('turbolinks:load', function(){
|
||||||
// Configure renaming for room header
|
// Configure renaming for room header
|
||||||
configure_room_header(room_title);
|
configure_room_header(room_title);
|
||||||
|
|
||||||
// Configure renaming for room blocks
|
|
||||||
room_blocks.each(function(){
|
|
||||||
var room_block = $(this)
|
|
||||||
configure_room_block(room_block)
|
|
||||||
});
|
|
||||||
|
|
||||||
// Configure renaming for recording rows
|
// Configure renaming for recording rows
|
||||||
recording_rows.each(function(){
|
recording_rows.each(function(){
|
||||||
var recording_title = $(this).find('#recording-title');
|
var recording_title = $(this).find('#recording-title');
|
||||||
configure_recording_row(recording_title);
|
configure_recording_row(recording_title);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,6 @@ $(document).on('turbolinks:load', function(){
|
||||||
$("#createRoomModal form").attr("action", "/")
|
$("#createRoomModal form").attr("action", "/")
|
||||||
updateDropdown($(".dropdown-item[value='default']"))
|
updateDropdown($(".dropdown-item[value='default']"))
|
||||||
$("#room_mute_on_join").prop("checked", false)
|
$("#room_mute_on_join").prop("checked", false)
|
||||||
$("#auto-join-label").addClass("mt-3 mb-6")
|
|
||||||
|
|
||||||
//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() {
|
||||||
|
@ -68,8 +67,8 @@ $(document).on('turbolinks:load', function(){
|
||||||
|
|
||||||
//hide all elements & their children with a update-only class
|
//hide all elements & their children with a update-only class
|
||||||
$(".update-only").each(function() {
|
$(".update-only").each(function() {
|
||||||
$(this).hide()
|
$(this).attr('style',"display:none !important")
|
||||||
if($(this).children().length > 0) $(this).children().hide()
|
if($(this).children().length > 0) $(this).children().attr('style',"display:none !important")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -78,7 +77,6 @@ $(document).on('turbolinks:load', function(){
|
||||||
var room_block_uid = $(this).closest("#room-block").data("room-uid")
|
var room_block_uid = $(this).closest("#room-block").data("room-uid")
|
||||||
$("#create-room-name").val($(this).closest("tbody").find("#room-name h4").text())
|
$("#create-room-name").val($(this).closest("tbody").find("#room-name h4").text())
|
||||||
$("#createRoomModal form").attr("action", "/" + room_block_uid + "/update_settings")
|
$("#createRoomModal form").attr("action", "/" + room_block_uid + "/update_settings")
|
||||||
$("#auto-join-label").removeClass("mt-3 mb-6")
|
|
||||||
|
|
||||||
//show all elements & their children with a update-only class
|
//show all elements & their children with a update-only class
|
||||||
$(".update-only").each(function() {
|
$(".update-only").each(function() {
|
||||||
|
@ -88,8 +86,8 @@ $(document).on('turbolinks:load', function(){
|
||||||
|
|
||||||
//hide all elements & their children with a create-only class
|
//hide all elements & their children with a create-only class
|
||||||
$(".create-only").each(function() {
|
$(".create-only").each(function() {
|
||||||
$(this).hide()
|
$(this).attr('style',"display:none !important")
|
||||||
if($(this).children().length > 0) $(this).children().hide()
|
if($(this).children().length > 0) $(this).children().attr('style',"display:none !important")
|
||||||
})
|
})
|
||||||
|
|
||||||
updateCurrentSettings($(this).closest("#room-block").data("room-settings"))
|
updateCurrentSettings($(this).closest("#room-block").data("room-settings"))
|
||||||
|
|
|
@ -47,9 +47,6 @@
|
||||||
<i class="fas fa-ellipsis-v px-4"></i>
|
<i class="fas fa-ellipsis-v px-4"></i>
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a href="" id="rename-room-button" class="dropdown-item">
|
|
||||||
<i class="dropdown-icon far fa-edit"></i> <%= t("rename") %>
|
|
||||||
</a>
|
|
||||||
<a href="" data-toggle="modal" data-target="#createRoomModal" class="update-room dropdown-item">
|
<a href="" data-toggle="modal" data-target="#createRoomModal" class="update-room dropdown-item">
|
||||||
<i class="dropdown-icon fas fa-cog"></i> <%= t("room.settings") %>
|
<i class="dropdown-icon fas fa-cog"></i> <%= t("room.settings") %>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= form_for(:room, url: rooms_path) do |f| %>
|
<%= form_for(:room, url: rooms_path) do |f| %>
|
||||||
<div class="input-icon">
|
<div class="input-icon mb-2">
|
||||||
<span class="input-icon-addon">
|
<span class="input-icon-addon">
|
||||||
<i class="fas fa-chalkboard-teacher"></i>
|
<i class="fas fa-chalkboard-teacher"></i>
|
||||||
</span>
|
</span>
|
||||||
|
@ -32,33 +32,37 @@
|
||||||
<div class="invalid-feedback text-left"><%= t("modal.create_room.not_blank") %></div>
|
<div class="invalid-feedback text-left"><%= t("modal.create_room.not_blank") %></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="mt-5 mb-3 w-100 text-left d-inline-block">
|
<% if Rails.configuration.room_features.include? "default-client" %>
|
||||||
<input type="hidden" name="room[client]" id="room_client">
|
<label class="mt-3 mb-3 w-100 text-left d-inline-block">
|
||||||
<span id="room-settings-dropdown-label" class="custom-switch-description"><%= t("modal.room_settings.client")%></span>
|
<input type="hidden" name="room[client]" id="room_client">
|
||||||
<div id="dropdown-div" class="dropdown float-right">
|
<span id="room-settings-dropdown-label" class="custom-switch-description"><%= t("modal.room_settings.client")%></span>
|
||||||
<button id="dropdown-trigger" type="button" class="btn btn-secondary dropdown-toggle px-4" data-toggle="dropdown">
|
<div id="dropdown-div" class="dropdown float-right">
|
||||||
<%= t("modal.room_settings.default")%>
|
<button id="dropdown-trigger" type="button" class="btn btn-secondary dropdown-toggle px-4" data-toggle="dropdown">
|
||||||
</button>
|
<%= t("modal.room_settings.default")%>
|
||||||
<div class="dropdown-menu">
|
</button>
|
||||||
<button type=button class="dropdown-item" onclick="updateDropdown($(this))" value="default"><%= t("modal.room_settings.default")%></button>
|
<div class="dropdown-menu">
|
||||||
<button type=button class="dropdown-item" onclick="updateDropdown($(this))" value="html5"><%= t("modal.room_settings.html")%></button>
|
<button type=button class="dropdown-item" onclick="updateDropdown($(this))" value="default"><%= t("modal.room_settings.default")%></button>
|
||||||
<button type=button class="dropdown-item" onclick="updateDropdown($(this))" value="flash"><%= t("modal.room_settings.flash")%></button>
|
<button type=button class="dropdown-item" onclick="updateDropdown($(this))" value="html5"><%= t("modal.room_settings.html")%></button>
|
||||||
|
<button type=button class="dropdown-item" onclick="updateDropdown($(this))" value="flash"><%= t("modal.room_settings.flash")%></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</label>
|
||||||
</label>
|
<% end %>
|
||||||
|
|
||||||
<label class="custom-switch mt-3 mb-3 w-100 text-left d-inline-block">
|
<% if Rails.configuration.room_features.include? "mute-on-join" %>
|
||||||
<span class="custom-switch-description"><%= t("modal.room_settings.mute")%></span>
|
<label class="custom-switch mt-3 mb-3 w-100 text-left d-inline-block">
|
||||||
<%= f.check_box :mute_on_join, class: "custom-switch-input", checked: false %>
|
<span class="custom-switch-description"><%= t("modal.room_settings.mute")%></span>
|
||||||
<span class="custom-switch-indicator float-right"></span>
|
<%= f.check_box :mute_on_join, class: "custom-switch-input", checked: false %>
|
||||||
</label>
|
<span class="custom-switch-indicator float-right"></span>
|
||||||
|
</label>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<label id="auto-join-label" class="create-only custom-switch mb-6 w-100 text-left d-inline-block">
|
<label id="auto-join-label" class="create-only custom-switch mt-3 mb-3 w-100 text-left d-inline-block">
|
||||||
<span class="custom-switch-description"><%= t("modal.create_room.auto_join") %></span>
|
<span class="custom-switch-description"><%= t("modal.create_room.auto_join") %></span>
|
||||||
<%= f.check_box :auto_join, class: "custom-switch-input", checked: false %>
|
<%= f.check_box :auto_join, class: "custom-switch-input", checked: false %>
|
||||||
<span class="custom-switch-indicator float-right"></span>
|
<span class="custom-switch-indicator float-right"></span>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div class="mt-4">
|
||||||
<%= f.submit t("header.create_room"), id: "create-room-submit", class: "create-only btn btn-outline-primary btn-block btn-pill" %>
|
<%= f.submit t("header.create_room"), id: "create-room-submit", class: "create-only btn btn-outline-primary btn-block btn-pill" %>
|
||||||
<%= f.submit t("modal.room_settings.update"), id: "create-room-submit", class: "update-only btn btn-outline-primary btn-block btn-pill" %>
|
<%= f.submit t("modal.room_settings.update"), id: "create-room-submit", class: "update-only btn btn-outline-primary btn-block btn-pill" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -83,5 +83,8 @@ module Greenlight
|
||||||
|
|
||||||
# Enable/disable recording thumbnails.
|
# Enable/disable recording thumbnails.
|
||||||
config.recording_thumbnails = (ENV['RECORDING_THUMBNAILS'] != "false")
|
config.recording_thumbnails = (ENV['RECORDING_THUMBNAILS'] != "false")
|
||||||
|
|
||||||
|
# Configure which settings are available to user on room creation/edit after creation
|
||||||
|
config.room_features = ENV['ROOM_FEATURES'] || ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
11
sample.env
11
sample.env
|
@ -23,7 +23,7 @@ BIGBLUEBUTTON_SECRET=
|
||||||
# http://docs.bigbluebutton.org/install/greenlight-v2.html#google-oauth2
|
# http://docs.bigbluebutton.org/install/greenlight-v2.html#google-oauth2
|
||||||
#
|
#
|
||||||
# The GOOGLE_OAUTH2_HD variable is used to limit sign-ins to a particular set of Google Apps hosted
|
# The GOOGLE_OAUTH2_HD variable is used to limit sign-ins to a particular set of Google Apps hosted
|
||||||
# domains. This can be a string with separating commas such as, 'domain.com, example.com' or
|
# domains. This can be a string with separating commas such as, 'domain.com, example.com' or
|
||||||
# a string that specifies a single domain restriction such as, 'domain.com'.
|
# a string that specifies a single domain restriction such as, 'domain.com'.
|
||||||
# If left blank, GreenLight will allow sign-in from all Google Apps hosted domains.
|
# If left blank, GreenLight will allow sign-in from all Google Apps hosted domains.
|
||||||
GOOGLE_OAUTH2_ID=
|
GOOGLE_OAUTH2_ID=
|
||||||
|
@ -111,6 +111,15 @@ RELATIVE_URL_ROOT=/b
|
||||||
# By default, this is the BigBlueButton logo.
|
# By default, this is the BigBlueButton logo.
|
||||||
BRANDING_IMAGE=
|
BRANDING_IMAGE=
|
||||||
|
|
||||||
|
# Specify which settings you would like the users to configure on room creation
|
||||||
|
# or edit after the room has been created
|
||||||
|
# By default, all settings are turned OFF.
|
||||||
|
#
|
||||||
|
# Current settings available:
|
||||||
|
# default-client: Room owners can decide between the Flash Client and the HTML5 Client for a room
|
||||||
|
# mute-on-join: Automatically mute users by default when they join a room
|
||||||
|
ROOM_FEATURES=default-client,mute-on-join
|
||||||
|
|
||||||
# Comment this out to send logs to STDOUT in production instead of log/production.log .
|
# Comment this out to send logs to STDOUT in production instead of log/production.log .
|
||||||
#
|
#
|
||||||
# RAILS_LOG_TO_STDOUT=true
|
# RAILS_LOG_TO_STDOUT=true
|
||||||
|
|
Loading…
Reference in New Issue