forked from External/greenlight
minor fixes
This commit is contained in:
parent
bc9c2c1232
commit
83642f22c1
|
@ -1,20 +1,20 @@
|
|||
class RoomsController < ApplicationController
|
||||
|
||||
before_action :find_room, except: :create
|
||||
before_action :verify_room_ownership, only: [:start, :destroy, :home]
|
||||
before_action :verify_room_ownership, except: [:create, :show, :join, :logout]
|
||||
|
||||
META_LISTED = "gl-listed"
|
||||
|
||||
# POST /r
|
||||
def create
|
||||
room = Room.new(name: room_params[:name])
|
||||
room.owner = current_user
|
||||
@room = Room.new(name: room_params[:name])
|
||||
@room.owner = current_user
|
||||
|
||||
if room.save
|
||||
if @room.save
|
||||
if room_params[:auto_join] == "1"
|
||||
redirect_to start_room_path(room)
|
||||
start
|
||||
else
|
||||
redirect_to room
|
||||
redirect_to @room
|
||||
end
|
||||
else
|
||||
# Handle room didn't save.
|
||||
|
@ -28,7 +28,6 @@ class RoomsController < ApplicationController
|
|||
@recordings = @room.recordings
|
||||
@is_running = @room.is_running?
|
||||
else
|
||||
@recordings = @room.public_recordings
|
||||
render :join
|
||||
end
|
||||
end
|
||||
|
@ -38,9 +37,9 @@ class RoomsController < ApplicationController
|
|||
opts = default_meeting_options
|
||||
|
||||
# Assign join name if passed.
|
||||
if params[@room.invite_path][:join_name]
|
||||
if params[@room.invite_path]
|
||||
@join_name = params[@room.invite_path][:join_name]
|
||||
else
|
||||
elsif !params[:join_name]
|
||||
# Join name not passed.
|
||||
return
|
||||
end
|
||||
|
@ -49,7 +48,7 @@ class RoomsController < ApplicationController
|
|||
if current_user
|
||||
redirect_to @room.join_path(current_user.name, opts, current_user.uid)
|
||||
else
|
||||
join_name = params[@room.invite_path][:join_name]
|
||||
join_name = params[:join_name] || params[@room.invite_path][:join_name]
|
||||
redirect_to @room.join_path(join_name, opts)
|
||||
end
|
||||
else
|
||||
|
@ -152,7 +151,7 @@ class RoomsController < ApplicationController
|
|||
def bring_to_room
|
||||
if current_user
|
||||
# Redirect authenticated users to their room.
|
||||
redirect_to room_path(current_user.room.uid)
|
||||
redirect_to room_path(current_user.room)
|
||||
else
|
||||
# Redirect unauthenticated users to root.
|
||||
redirect_to root_path
|
||||
|
|
|
@ -77,13 +77,12 @@ class User < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def subtitle
|
||||
case provider
|
||||
when "greenlight", "google", "twitter"
|
||||
"User"
|
||||
else
|
||||
"Unknown"
|
||||
end
|
||||
# Retrives a list of all a users rooms that are not the main room, sorted by last session date.
|
||||
def secondary_rooms
|
||||
secondary = (rooms - [main_room])
|
||||
no_session, session = secondary.partition do |r| r.last_session.nil? end
|
||||
sorted = session.sort_by do |r| r.last_session end
|
||||
session + no_session
|
||||
end
|
||||
|
||||
def firstname
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%= render 'shared/room_event' do %>
|
||||
<%= form_for room_path, method: :post do |f| %>
|
||||
<%= form_for room_path(@room), method: :post do |f| %>
|
||||
<div class="input-group" style="height: 48px;">
|
||||
<%= f.text_field :join_name,
|
||||
required: true,
|
||||
|
|
|
@ -37,7 +37,12 @@
|
|||
|
||||
<div class="row pt-7 pb-2">
|
||||
<% if current_user.rooms.length > 1 %>
|
||||
<% current_user.rooms.each do |room| %>
|
||||
<div class="col-lg-4 col-md-6 col-sm-12">
|
||||
<%= link_to current_user.main_room do %>
|
||||
<%= render "shared/components/room_block", room: current_user.main_room %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% current_user.secondary_rooms.each do |room| %>
|
||||
<div class="col-lg-4 col-md-6 col-sm-12">
|
||||
<%= link_to room do %>
|
||||
<%= render "shared/components/room_block", room: room %>
|
||||
|
|
|
@ -37,7 +37,7 @@ var request_to_join_meeting = function(){
|
|||
},
|
||||
error: function(){
|
||||
// The meeting is still booting (going slowly), retry shortly.
|
||||
if(join_attempts < 4){ setTimeout(request_to_join_meeting, 5000); }
|
||||
if(join_attempts < 4){ setTimeout(request_to_join_meeting, 10000); }
|
||||
join_attempts++;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,4 +25,4 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "shared/sessions", recordings: @recordings, only_public: true %>
|
||||
<%= render "shared/sessions", recordings: @room.public_recordings, only_public: true %>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<span class="input-icon-addon">
|
||||
<i class="fas fa-chalkboard-teacher"></i>
|
||||
</span>
|
||||
<%= f.text_field :name, id: "room-name", class: "form-control", placeholder: "Enter a room name...", autocomplete: :off %>
|
||||
<%= f.text_field :name, id: "room-name", class: "form-control", value: "", placeholder: "Enter a room name...", autocomplete: :off %>
|
||||
<div class="invalid-feedback text-left">Room name cannot be blank.</div>
|
||||
</div>
|
||||
<label class="custom-switch mt-5 mb-5 float-left">
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
<div class="col-6">
|
||||
<%= f.label "Fullname", class: "form-label" %>
|
||||
<div class="input-icon">
|
||||
<%= f.text_field :name, class: "form-control #{form_is_invalid?(@user, :name)}", value: @user.name, placeholder: "Fullname" %>
|
||||
<%= f.text_field :name, class: "form-control #{form_is_invalid?(@user, :name)}", placeholder: "Fullname" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<%= f.label "Email", class: "form-label" %>
|
||||
<div class="input-icon">
|
||||
<%= f.text_field :email, class: "form-control #{form_is_invalid?(@user, :email)}", value: @user.email, placeholder: "Email" %>
|
||||
<%= f.text_field :email, class: "form-control #{form_is_invalid?(@user, :email)}", placeholder: "Email" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<div class="col-10" style="transform: translateY(25%);">
|
||||
<%= f.text_field :image, class: "form-control #{form_is_invalid?(@user, :image)}", value: @user.image, placeholder: "Profile Image URL" %>
|
||||
<%= f.text_field :image, class: "form-control #{form_is_invalid?(@user, :image)}", placeholder: "Profile Image URL" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue