This commit is contained in:
joshua-arts 2018-05-31 22:15:18 -04:00
parent 39414e269b
commit 1bcd176285
14 changed files with 137 additions and 77 deletions

View File

@ -41,6 +41,8 @@
$background-color: #F5F7FB;
$rule-color: lightblue;
$footer-height: 70px;
.video-container {
position: relative;
width: 100%;
@ -98,12 +100,13 @@ html, body {
}
.wrapper {
min-height: 100%;
min-height: calc(100% - $footer-height);
position: relative;
}
.footer {
width: 100%;
height: 70px;
text-align: center;
}

View File

@ -4,7 +4,6 @@ class MainController < ApplicationController
# GET /
def index
@user = User.new
end
private

View File

@ -8,7 +8,7 @@ class RoomsController < ApplicationController
# POST /r
def create
room = Room.new(name: room_params[:name])
room.user = current_user
room.owner = current_user
if room.save
if room_params[:auto_join] == "1"
@ -38,10 +38,15 @@ class RoomsController < ApplicationController
render :join
end
else
# If the meeting isn't running and you don't own the room, go to the waiting page.
# If the room isn't running, go to join page to enter a name.
if !@room.owned_by?(current_user)
redirect_to wait_room_path(@room)
render :join
end
# If the meeting isn't running and you don't own the room, go to the waiting page.
#if !@room.owned_by?(current_user)
# redirect_to wait_room_path(@room)
#end
end
end

View File

@ -4,7 +4,7 @@ class Room < ApplicationRecord
validates :name, presence: true
belongs_to :user
belongs_to :owner, class_name: 'User', foreign_key: :user_id
has_one :meeting
ROOM_ICONS = %w(circle star certificate play cloud heart square bookmark cog)
@ -111,7 +111,7 @@ class Room < ApplicationRecord
def bbb
@bbb = BigBlueButton::BigBlueButtonApi.new(remove_slash(bbb_endpoint), bbb_secret, "0.8")
#@bbb ||= if Rails.configuration.loadbalanced_configuration
# lb_user = retrieve_loadbalanced_credentials(self.room.user.provider)
# lb_user = retrieve_loadbalanced_credentials(self.room.owner.provider)
# BigBlueButton::BigBlueButtonApi.new(remove_slash(lb_user["apiURL"]), lb_user["secret"], "0.8")
#else
# BigBlueButton::BigBlueButtonApi.new(remove_slash(bbb_endpoint), bbb_secret, "0.8")
@ -120,7 +120,7 @@ class Room < ApplicationRecord
# Generates a uid for the room and BigBlueButton.
def setup
self.uid = [user.firstname, (0...8).map { (65 + rand(26)).chr }.join].join('-').downcase
self.uid = [owner.firstname, (0...9).map { (65 + rand(26)).chr }.join].join('-').downcase
self.bbb_id = Digest::SHA1.hexdigest(Rails.application.secrets[:secret_key_base] + Time.now.to_i.to_s).to_s
self.icon = ROOM_ICONS.sample

View File

@ -90,7 +90,7 @@ class User < ApplicationRecord
# Initializes a room for the user.
def initialize_main_room
self.main_room = Room.create!(user: self, name: firstname + "'s Room")
self.main_room = Room.create!(owner: self, name: firstname + "'s Room")
self.save
end
end

View File

@ -1,7 +1,30 @@
<p>The join the meeting, enter a name.</p>
<div class="room-section pb-9">
<div class="container">
<div class="row pt-9">
<div class="col-lg-12 col-sm-12">
<h4 class="text-left text-primary">You have been invited to join</h4>
<h1 class="display-3 text-left text-primary mb-3"><%= @room.name %></h1>
<hr class="mt-2 float-left bg-azure" style="width: 20%;">
</div>
</div>
<p>Enter a name to start a session.</p>
<%= form_tag room_path(@room) do %>
<%= text_field_tag "join_name" %>
<%= submit_tag "Join" %>
<% end %>
<div class="row">
<div class="col-lg-6 col-md-8 col-sm-12 form-inline mb-5">
<% if @room.owner.image.nil? %>
<span class="avatar"><%= @room.owner.name.first %></span>
<% else %>
<span class="avatar" style="background-image: url(<%= @room.owner.image %>)"></span>
<% end %>
<h5 class="font-weight-normal ml-4 mt-3 text-primary"><%= @room.owner.name %> (Owner)</h5>
</div>
<div class="col-lg-6 col-md-4 col-sm-12">
<div class="input-group" style="height: 60px;">
<input type="text" id="name-input" class="form-control main-large" placeholder="Enter your name!"></input>
<span class="input-group-append">
<button class="btn btn-primary px-7 main-large">Join</button>
</span>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,8 +1,12 @@
<div class="room-section">
<div class="room-section pb-1">
<div class="container">
<div class="row pt-9">
<div class="row pt-8">
<div class="col-lg-9 col-sm-12">
<h1 id="user-text" class="display-3 text-left text-primary mb-3"><%= @room.name %></h1>
<h1 id="user-text" class="display-3 text-left text-primary mb-3"><%= @room.name %>
<% if current_user.main_room == @room %>
<i class="fas fa-home align-top" style="font-size: 22px;"></i>
<% end %>
</h1>
<h4 class="text-left text-primary mb-6">0 Sessions | 0 Recordings</h4>
<label class="form-label text-primary">Invite Participants</label>
<form class="form-inline">
@ -29,7 +33,7 @@
<div class="row mt-7 mb-2">
<% (current_user.rooms - [@room]).each do |room| %>
<div class="col-4">
<div class="col-lg-4 col-md-6 col-sm-12">
<%= link_to room do %>
<%= render "shared/components/room_block", room: room %>
<% end %>
@ -39,7 +43,7 @@
</div>
</div>
<%= render "shared/sessions" %>
<%= render "shared/sessions", recordings: @room.recordings %>
<script>
var invite_url;

View File

@ -11,13 +11,13 @@
<% end %>
<% end %>
<div class="d-flex order-lg-2 ml-auto">
<div class="d-flex ml-auto">
<% if current_user %>
<a class="px-5" href="" data-toggle="modal" data-target="#createRoomModal">
<a class="px-5 ml-2 mt-1" href="" data-toggle="modal" data-target="#createRoomModal">
<i class="fas fa-plus"></i> Create Room
</a>
<div class="dropdown">
<a href="#" class="nav-link pr-0 leading-none" data-toggle="dropdown">
<a href="#" class="nav-link pr-0" data-toggle="dropdown">
<% if current_user.image.nil? %>
<span class="avatar"><%= current_user.name.first %></span>
<% else %>
@ -28,6 +28,9 @@
</span>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow" x-placement="bottom-end" style="position: absolute; transform: translate3d(-56px, 32px, 0px); top: 0px; left: 0px; will-change: transform;">
<%= link_to current_user.main_room, class: "dropdown-item" do %>
<i class="dropdown-icon fas fa-home"></i> Home Room
<% end %>
<%= link_to settings_path, class: "dropdown-item" do %>
<i class="dropdown-icon fe fe-settings"></i> Settings
<% end %>

View File

@ -1,7 +1,7 @@
<div class="sessions pb-5">
<div class="container pt-6">
<%= render "shared/components/subtitle", subtitle: "Recordings" %>
<%= render "shared/components/subtitle", subtitle: "Recordings", search: true %>
<div class="col-12">
<div class="card">
@ -19,53 +19,61 @@
</tr>
</thead>
<tbody>
<% 3.times do %>
<% if recordings.empty? %>
<tr>
<td>
<div>Example Meeting</div>
<div class="small text-muted">
June 21, 2017 <i>(about 3 hours ago)</i>
</div>
</td>
<td>
<img class="thumbnail px-2" src="http://test-install.blindsidenetworks.com/presentation/b622495d927cd99e9898b0601c2b18a5424a0627-1527259102285/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1527259102298/thumbnails/thumb-1.png">
<img class="thumbnail px-2" src="http://test-install.blindsidenetworks.com/presentation/b622495d927cd99e9898b0601c2b18a5424a0627-1527259102285/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1527259102298/thumbnails/thumb-1.png">
<img class="thumbnail px-2" src="http://test-install.blindsidenetworks.com/presentation/b622495d927cd99e9898b0601c2b18a5424a0627-1527259102285/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1527259102298/thumbnails/thumb-1.png">
</td>
<td class="text-left">
<div class="small text-muted text-uppercase">
Length
</div>
1 hr
</td>
<td class="text-left">
<div class="small text-muted text-uppercase">
Users
</div>
4
</td>
<td class="text-left">
<div class="small text-muted text-uppercase">
Visibility
</div>
Unlisted
</td>
<td>
<a href="#" class="btn btn-secondary">Presentation</a>
<a href="#" class="btn btn-secondary">Podcast</a>
</td>
<td class="text-center">
<div class="item-action dropdown">
<a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fe fe-more-vertical"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon far fa-eye"></i> Change Visibility</a>
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon far fa-envelope"></i> Email Recording</a>
<div class="dropdown-divider"></div>
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fe fe-trash"></i> Delete</a>
</div>
</div>
<td colspan="7" class="text-center h4 p-6 font-weight-normal">
This room has no recordings.
</td>
</tr>
<% else %>
<% 3.times do %>
<tr>
<td>
<div>Example Meeting</div>
<div class="small text-muted">
June 21, 2017 <i>(about 3 hours ago)</i>
</div>
</td>
<td>
<img class="thumbnail px-2" src="http://test-install.blindsidenetworks.com/presentation/b622495d927cd99e9898b0601c2b18a5424a0627-1527259102285/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1527259102298/thumbnails/thumb-1.png">
<img class="thumbnail px-2" src="http://test-install.blindsidenetworks.com/presentation/b622495d927cd99e9898b0601c2b18a5424a0627-1527259102285/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1527259102298/thumbnails/thumb-1.png">
<img class="thumbnail px-2" src="http://test-install.blindsidenetworks.com/presentation/b622495d927cd99e9898b0601c2b18a5424a0627-1527259102285/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1527259102298/thumbnails/thumb-1.png">
</td>
<td class="text-left">
<div class="small text-muted text-uppercase">
Length
</div>
1 hr
</td>
<td class="text-left">
<div class="small text-muted text-uppercase">
Users
</div>
4
</td>
<td class="text-left">
<div class="small text-muted text-uppercase">
Visibility
</div>
Unlisted
</td>
<td>
<a href="#" class="btn btn-secondary">Presentation</a>
<a href="#" class="btn btn-secondary">Podcast</a>
</td>
<td class="text-center">
<div class="item-action dropdown">
<a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fe fe-more-vertical"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon far fa-eye"></i> Change Visibility</a>
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon far fa-envelope"></i> Email Recording</a>
<div class="dropdown-divider"></div>
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon far fa-trash-alt"></i> Delete</a>
</div>
</div>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

View File

@ -3,14 +3,18 @@
<table class="table table-hover table-outline table-vcenter text-nowrap card-table">
<tbody>
<td>
<span class="stamp stamp-md bg-primary mr-3">
<i class="fas fa-<%= room.icon %>"></i>
<span class="stamp stamp-md bg-primary">
<% if room == current_user.main_room %>
<i class="fas fa-home"></i>
<% else %>
<i class="fas fa-<%= room.icon %>"></i>
<% end %>
</span>
</td>
<td>
<div><%= room.name %></div>
<div class="small text-muted">
<i>Created on <%= room.created_at.strftime("%B #{room.created_at.day.ordinalize}, %Y.") %></i>
<i>Last Session on <%= room.created_at.strftime("%B #{room.created_at.day.ordinalize}, %Y.") %></i>
</div>
</td>
<td class="text-right">
@ -18,11 +22,11 @@
<a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fe fe-more-vertical"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<%= button_to root_path, class: "dropdown-item" do %>
<i class="dropdown-icon fe fe-home"></i> Make Home Room
<i class="dropdown-icon fas fa-home"></i> Make Home Room
<% end %>
<% if room != current_user.main_room %>
<%= button_to room, method: :delete, data: { confirm: 'Are you sure?' }, class: "dropdown-item" do %>
<i class="dropdown-icon fe fe-trash"></i> Delete
<i class="dropdown-icon far fa-trash-alt"></i> Delete
<% end %>
<% end %>
</div>

View File

@ -1,6 +1,16 @@
<div class="row">
<div class="col-12">
<div class="col-9">
<p class="subtitle"><%= subtitle %></p>
<hr>
</div>
<% if search %>
<div class="col-3">
<div class="input-icon">
<span class="input-icon-addon">
<i class="fas fa-search"></i>
</span>
<input type="text" class="form-control btn-pill" placeholder="Search...">
</div>
</div>
<% end %>
</div>
<hr class="mt-0">

View File

@ -9,7 +9,7 @@
<hr class="small-rule">
<%= form_for(@user, url: signup_path) do |f| %>
<%= form_for(User.new, url: signup_path) do |f| %>
<div class="form-group">
<%= f.label :name, "Full Name", class: "form-label text-left" %>
<%= f.text_field :name, class: "form-control", placeholder: "Full Name" %>

View File

@ -1,6 +1,6 @@
<div class="container mt-8">
<%= render "shared/components/subtitle", subtitle: "Settings" %>
<%= render "shared/components/subtitle", subtitle: "Settings", search: false %>
<div class="row">
<div class="col-lg-3 mb-4">

View File

@ -6,6 +6,7 @@ class CreateRooms < ActiveRecord::Migration[5.0]
t.string :uid, index: true
t.string :bbb_id, index: true
t.string :icon, index: true
t.integer :sessions, index: true
t.timestamps
end