GRN-11: Ability to configure room specific settings (#348)

* Added the ability to set room settings on create or update

* Added room settings alerts and made fixes to other alerts

* Small bug fixes related to rubocop and the create room modal

* Update test case and fixed issue with small edge case

* Update room.js
This commit is contained in:
farhatahmad
2019-02-06 11:08:19 -05:00
committed by Jesus Federico
parent 992c154c10
commit 2e8670a8ab
21 changed files with 284 additions and 74 deletions

View File

@ -13,13 +13,7 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
%>
<% unless flash.empty? %>
<%= render "shared/error_banner" do %>
<% flash.each do |key, value| %>
<%= content_tag :div, value, class: "flash #{key} d-inline" %>
<% end %>
<% end %>
<% end %>
<%= render 'shared/flash_messages' unless flash.empty? %>
<div class="background">
<div class="container pt-9 pb-8">

View File

@ -13,13 +13,7 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
%>
<% unless flash.empty? %>
<%= render "shared/error_banner" do %>
<% flash.each do |key, value| %>
<%= content_tag :div, value, class: "flash #{key} d-inline" %>
<% end %>
<% end %>
<% end %>
<%= render 'shared/flash_messages' unless flash.empty? %>
<div class="container">
<div class="row pt-7">
@ -47,4 +41,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -13,13 +13,7 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
%>
<% unless flash.empty? %>
<%= render "shared/error_banner" do %>
<% flash.each do |key, value| %>
<%= content_tag :div, value, class: "flash #{key} d-inline" %>
<% end %>
<% end %>
<% end %>
<%= render 'shared/flash_messages' unless flash.empty? %>
<div class="container">
<div class="row pt-7">

View File

@ -13,13 +13,7 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
%>
<% unless flash.empty? %>
<%= render "shared/error_banner" do %>
<% flash.each do |key, value| %>
<%= content_tag :div, value, class: "flash #{key} d-inline" %>
<% end %>
<% end %>
<% end %>
<%= render 'shared/flash_messages' unless flash.empty? %>
<div class="background pb-1">
<div class="container">

View File

@ -13,6 +13,14 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
%>
<% flash.each do |key, value| %>
<%= content_tag :div, value, class: "flash #{key} d-inline-block text-success" %>
<% flash.each do |key,value| %>
<% if key.eql? "success" %>
<%= render "shared/success_banner" do %>
<%= content_tag :div, value, class: "flash #{key} d-inline" %>
<% end %>
<% elsif key.eql? "alert" %>
<%= render "shared/error_banner" do %>
<%= content_tag :div, value, class: "flash #{key} d-inline" %>
<% end %>
<% end %>
<% end %>

View File

@ -22,7 +22,7 @@
<div class="d-flex ml-auto">
<% if current_user %>
<a class="px-5 ml-2 mt-1" href="" data-toggle="modal" data-target="#createRoomModal">
<a id="create-room" class="px-5 ml-2 mt-1" href="" data-toggle="modal" data-target="#createRoomModal">
<i class="fas fa-plus"></i>&nbsp; <%= t("header.create_room") %>
</a>
<div class="dropdown">

View File

@ -0,0 +1,18 @@
<%
# 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="alert alert-icon alert-success text-center mb-0">
<%= yield %>
</div>

View File

@ -13,7 +13,7 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
%>
<div id="<%= 'home_room_block' if room == current_user.main_room %>" data-room-uid=<%= room.uid %> class="card">
<div id="<%= if room == current_user.main_room then 'home_room_block' else 'room-block' end %>" data-room-uid="<%= room.uid %>" data-room-settings=<%= room.room_settings %> class="card">
<div class="card-body p-1">
<table class="table table-hover table-vcenter text-wrap table-no-border">
<tbody class="no-border-top">
@ -47,14 +47,12 @@
<i class="fas fa-ellipsis-v px-4"></i>
</a>
<div class="dropdown-menu">
<!--
<%= link_to room, class: "dropdown-item" do %>
<i class="dropdown-icon fas fa-cog"></i> <%= t("room.settings") %>
<% end %>
-->
<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">
<i class="dropdown-icon fas fa-cog"></i> <%= t("room.settings") %>
</a>
<a href="" data-toggle="modal" data-target="#deleteRoomModal_<%= room.uid %>"class="dropdown-item">
<i class="dropdown-icon far fa-trash-alt"></i> <%= t("delete") %>
</a>

View File

@ -19,7 +19,8 @@
<div class="modal-body">
<div class="card-body p-6">
<div class="card-title">
<h3><%= t("modal.create_room.title") %></h3>
<h3 class="create-only"><%= t("modal.create_room.title") %></h3>
<h3 class="update-only"><%= t("modal.room_settings.title") %></h3>
</div>
<%= form_for(:room, url: rooms_path) do |f| %>
@ -27,21 +28,45 @@
<span class="input-icon-addon">
<i class="fas fa-chalkboard-teacher"></i>
</span>
<%= f.text_field :name, id: "room-name", class: "form-control", value: "", placeholder: t("modal.create_room.name_placeholder"), autocomplete: :off %>
<%= f.text_field :name, id: "create-room-name", class: "form-control", value: "", placeholder: t("modal.create_room.name_placeholder"), autocomplete: :off %>
<div class="invalid-feedback text-left"><%= t("modal.create_room.not_blank") %></div>
</div>
<label class="custom-switch mt-5 mb-5 float-left">
<%= f.check_box :auto_join, class: "custom-switch-input", checked: false %>
<span class="custom-switch-indicator"></span>
<span class="custom-switch-description"><%= t("modal.create_room.auto_join") %></span>
<label class="mt-5 mb-3 w-100 text-left d-inline-block">
<input type="hidden" name="room[client]" id="room_client">
<span id="room-settings-dropdown-label" class="custom-switch-description"><%= t("modal.room_settings.client")%></span>
<div id="dropdown-div" class="dropdown float-right">
<button id="dropdown-trigger" type="button" class="btn btn-secondary dropdown-toggle px-4" data-toggle="dropdown">
<%= t("modal.room_settings.default")%>
</button>
<div class="dropdown-menu">
<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="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>
</label>
<div class="form-footer">
<%= f.submit t("header.create_room"), id: "create-room-submit", class: "btn btn-outline-primary btn-block btn-pill" %>
<label class="custom-switch mt-3 mb-3 w-100 text-left d-inline-block">
<span class="custom-switch-description"><%= t("modal.room_settings.mute")%></span>
<%= f.check_box :mute_on_join, class: "custom-switch-input", checked: false %>
<span class="custom-switch-indicator float-right"></span>
</label>
<label id="auto-join-label" class="create-only custom-switch mb-6 w-100 text-left d-inline-block">
<span class="custom-switch-description"><%= t("modal.create_room.auto_join") %></span>
<%= f.check_box :auto_join, class: "custom-switch-input", checked: false %>
<span class="custom-switch-indicator float-right"></span>
</label>
<div>
<%= 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" %>
</div>
<% end %>
</div>
<div class="card-footer">
<p><%= t("modal.create_room.free_delete") %></p>
<p class="create-only"><%= t("modal.create_room.free_delete") %></p>
<p class="update-only"><%= t("modal.room_settings.footer_text") %></p>
</div>
</div>
</div>