forked from External/greenlight
		
	Merge pull request #21 from zach-chai/join_form_changes
Join form changes
This commit is contained in:
		@@ -3,7 +3,7 @@
 | 
			
		||||
  var initRooms = function() {
 | 
			
		||||
    App.messages = App.cable.subscriptions.create({
 | 
			
		||||
      channel: 'ModeratorJoinsChannel',
 | 
			
		||||
      username: window.location.pathname.split('/').pop()
 | 
			
		||||
      username: getRoomName()
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      received: function(data) {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
  var initRooms = function() {
 | 
			
		||||
    App.messages = App.cable.subscriptions.create({
 | 
			
		||||
      channel: 'RecordingUpdatesChannel',
 | 
			
		||||
      username: window.location.pathname.split('/').pop()
 | 
			
		||||
      username: getRoomName()
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      received: function(data) {
 | 
			
		||||
 
 | 
			
		||||
@@ -112,7 +112,7 @@
 | 
			
		||||
          targets: -1,
 | 
			
		||||
          render: function(data, type, row) {
 | 
			
		||||
            if (type === 'display') {
 | 
			
		||||
              var roomName = window.location.pathname.split('/').pop();
 | 
			
		||||
              var roomName = getRoomName();
 | 
			
		||||
              var published = row.published;
 | 
			
		||||
              var eye = getPublishClass(published);
 | 
			
		||||
              return '<button type="button" class="btn btn-default recording-update" data-id="'+data+'" data-room="'+roomName+'" data-published="'+published+'">' +
 | 
			
		||||
@@ -162,7 +162,7 @@
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    table = recordingsTable.api();
 | 
			
		||||
    $.get("/rooms/"+window.location.pathname.split('/').pop()+"/recordings", function(data) {
 | 
			
		||||
    $.get("/rooms/"+getRoomName()+"/recordings", function(data) {
 | 
			
		||||
      if (!data.is_owner) {
 | 
			
		||||
        table.column(-1).visible( false );
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,10 @@ $.ajaxSetup({
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
var getRoomName = function() {
 | 
			
		||||
  return $(".page-wrapper.rooms").data('room');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var PUBLISHED_CLASSES = ['fa-eye-slash', 'fa-eye']
 | 
			
		||||
 | 
			
		||||
var getPublishClass = function(published) {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,10 @@
 | 
			
		||||
// They will automatically be included in application.css.
 | 
			
		||||
// You can use Sass (SCSS) here: http://sass-lang.com/
 | 
			
		||||
 | 
			
		||||
.join-form {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.rooms {
 | 
			
		||||
  .table-wrapper {
 | 
			
		||||
    padding: 40px 50px 10px 50px;
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ class LandingController < ApplicationController
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def admin?
 | 
			
		||||
    @user == current_user
 | 
			
		||||
    @user && @user == current_user
 | 
			
		||||
  end
 | 
			
		||||
  helper_method :admin?
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@
 | 
			
		||||
  </small>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<% if !@meeting_id %>
 | 
			
		||||
  <% content_for :footer do %>
 | 
			
		||||
    <div class="panel-footer">
 | 
			
		||||
      <div class="text-center">
 | 
			
		||||
@@ -14,6 +15,7 @@
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  <% end %>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<div class="page-wrapper meetings">
 | 
			
		||||
  <div class='container-fluid'>
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
  </div>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<div class="page-wrapper rooms">
 | 
			
		||||
<div class="page-wrapper rooms" data-room="<%= @user.username %>">
 | 
			
		||||
  <div class="container-fluid">
 | 
			
		||||
 | 
			
		||||
    <%= render 'shared/title', title: page_title %>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,23 @@
 | 
			
		||||
<div class="input-group input-spacing">
 | 
			
		||||
<div class="join-form input-group input-spacing">
 | 
			
		||||
  <% if current_user %>
 | 
			
		||||
    <% @current_user = user %>
 | 
			
		||||
  <%= text_field :current_user, :name, class: 'form-control meeting-user-name', placeholder: 'Enter your name' %>
 | 
			
		||||
    <%= text_field :current_user, :name, class: 'form-control meeting-user-name', type: 'hidden' %>
 | 
			
		||||
  <% else %>
 | 
			
		||||
    <%= text_field :nil, :nil, class: 'form-control meeting-user-name', placeholder: 'Enter your name' %>
 | 
			
		||||
  <% end %>
 | 
			
		||||
  <% if admin? %>
 | 
			
		||||
    <button type="button" class="btn btn-primary center-block meeting-join">
 | 
			
		||||
      Start
 | 
			
		||||
    </button>
 | 
			
		||||
  <% elsif current_user %>
 | 
			
		||||
    <button type="button" class="btn btn-primary center-block meeting-join">
 | 
			
		||||
      Join
 | 
			
		||||
    </button>
 | 
			
		||||
  <% else %>
 | 
			
		||||
    <span class="input-group-btn">
 | 
			
		||||
      <button type="button" class="btn btn-primary meeting-join">
 | 
			
		||||
        Join
 | 
			
		||||
      </button>
 | 
			
		||||
    </span>
 | 
			
		||||
  <% end %>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user