forked from External/greenlight
		
	Merge pull request #29 from zach-chai/dynamic_room_content
Dynamic room content
This commit is contained in:
		@@ -2,7 +2,8 @@
 | 
			
		||||
 | 
			
		||||
  var sessionStatusRefresh = function(url) {
 | 
			
		||||
    $.get(url + "/session_status_refresh", function(html) {
 | 
			
		||||
      $(".join-form-wrapper").html(html);
 | 
			
		||||
      $(".center-panel-wrapper").html(html);
 | 
			
		||||
      displayMeetingURL();
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -20,10 +21,12 @@
 | 
			
		||||
              loopJoin();
 | 
			
		||||
            } else {
 | 
			
		||||
              sessionStatusRefresh($('.meeting-url').val());
 | 
			
		||||
              showAlert($('.meeting-started-alert').html(), 4000);
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        } else if (data.action === 'meeting_ended') {
 | 
			
		||||
          sessionStatusRefresh($('.meeting-url').val());
 | 
			
		||||
          showAlert($('.meeting-ended-alert').html(), 4000);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
@@ -15,11 +15,11 @@
 | 
			
		||||
          table.row("#"+data.record_id).data(rowData).draw();
 | 
			
		||||
 | 
			
		||||
          var publish = (data.published) ? 'publish' : 'unpublish';
 | 
			
		||||
          showAlert($('.'+publish+'-alert').html(), 4000);
 | 
			
		||||
          showAlert($('.recording-'+publish+'-alert').html(), 4000);
 | 
			
		||||
        } else if (data.action === 'delete') {
 | 
			
		||||
          row.remove().draw();
 | 
			
		||||
 | 
			
		||||
          showAlert($('.delete-alert').html(), 4000);
 | 
			
		||||
          showAlert($('.recording-delete-alert').html(), 4000);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 | 
			
		||||
  var init = function() {
 | 
			
		||||
 | 
			
		||||
    $('.center-panel').on ('click', '.meeting-join', function (event) {
 | 
			
		||||
    $('.center-panel-wrapper').on ('click', '.meeting-join', function (event) {
 | 
			
		||||
      var url = $('.meeting-url').val();
 | 
			
		||||
      var name = $('.meeting-user-name').val();
 | 
			
		||||
      Meeting.getInstance().setURL(url);
 | 
			
		||||
@@ -34,7 +34,7 @@
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    $('.center-panel').on ('click', '.meeting-end', function (event) {
 | 
			
		||||
    $('.center-panel-wrapper').on ('click', '.meeting-end', function (event) {
 | 
			
		||||
      var jqxhr = Meeting.getInstance().endMeeting();
 | 
			
		||||
      var btn = $(this);
 | 
			
		||||
      btn.prop("disabled", true);
 | 
			
		||||
@@ -46,7 +46,7 @@
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    $('.center-panel').on ('click', '.meeting-url-copy', function (event) {
 | 
			
		||||
    $('.center-panel-wrapper').on ('click', '.meeting-url-copy', function (event) {
 | 
			
		||||
      meetingURL = $('.meeting-url');
 | 
			
		||||
      meetingURL.select();
 | 
			
		||||
      document.execCommand("copy");
 | 
			
		||||
@@ -94,12 +94,7 @@
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  var initRooms = function() {
 | 
			
		||||
    meetingURL = $('.meeting-url');
 | 
			
		||||
    var link = window.location.protocol +
 | 
			
		||||
      '//' +
 | 
			
		||||
      window.location.hostname +
 | 
			
		||||
      meetingURL.data('path');
 | 
			
		||||
    meetingURL.val(link);
 | 
			
		||||
    displayMeetingURL();
 | 
			
		||||
 | 
			
		||||
    // initialize recordings datatable
 | 
			
		||||
    recordingsTable = $('#recordings').dataTable({
 | 
			
		||||
 
 | 
			
		||||
@@ -91,3 +91,12 @@ var showAlert = function(html, timeout_delay) {
 | 
			
		||||
    }, timeout_delay);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var displayMeetingURL = function() {
 | 
			
		||||
  meetingURL = $('.meeting-url');
 | 
			
		||||
  var link = window.location.protocol +
 | 
			
		||||
    '//' +
 | 
			
		||||
    window.location.hostname +
 | 
			
		||||
    meetingURL.data('path');
 | 
			
		||||
  meetingURL.val(link);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								app/views/landing/_rooms_center_panel.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								app/views/landing/_rooms_center_panel.html.erb
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
<% content_for :title do %>
 | 
			
		||||
  <div class="title">
 | 
			
		||||
    <% if admin? && !@meeting_running %>
 | 
			
		||||
      <%= t('start_new_session') %>
 | 
			
		||||
    <% elsif !admin? %>
 | 
			
		||||
      <%= t('join_session_user', name: @user.username) %>
 | 
			
		||||
    <% else %>
 | 
			
		||||
      <%= t('join_session') %>
 | 
			
		||||
    <% end %>
 | 
			
		||||
  </div>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<%= render layout: 'shared/center_panel' do %>
 | 
			
		||||
  <div class="center-block col-sm-8">
 | 
			
		||||
    <% if admin? %>
 | 
			
		||||
      <%= render 'shared/meeting_url', hidden: false %>
 | 
			
		||||
    <% else %>
 | 
			
		||||
      <%= render 'shared/meeting_url', hidden: true %>
 | 
			
		||||
    <% end %>
 | 
			
		||||
    <div class="join-form-wrapper">
 | 
			
		||||
      <%= render 'shared/join_form' %>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
<% end %>
 | 
			
		||||
@@ -18,7 +18,7 @@
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<div class="page-wrapper meetings">
 | 
			
		||||
  <div class='container-fluid'>
 | 
			
		||||
  <div class="container-fluid">
 | 
			
		||||
 | 
			
		||||
    <%= render 'shared/title', title: t('start_new_session') %>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,36 +4,13 @@
 | 
			
		||||
  <% page_title= t('greet_guest', name: @user.username) %>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<% content_for :title do %>
 | 
			
		||||
  <div class="title">
 | 
			
		||||
    <% if current_user == @user %>
 | 
			
		||||
      <%= t('start_new_session') %>
 | 
			
		||||
    <% elsif current_user && current_user != @user %>
 | 
			
		||||
      <%= t('join_session_user', name: @user.username) %>
 | 
			
		||||
    <% else %>
 | 
			
		||||
      <%= t('join_session_guest') %>
 | 
			
		||||
    <% end %>
 | 
			
		||||
  </div>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<div class="page-wrapper rooms" data-room="<%= @user.encrypted_id %>">
 | 
			
		||||
  <div class="container-fluid">
 | 
			
		||||
 | 
			
		||||
    <%= render 'shared/title', title: page_title %>
 | 
			
		||||
 | 
			
		||||
    <div class="center-panel-wrapper">
 | 
			
		||||
      <%= render layout: 'shared/center_panel' do %>
 | 
			
		||||
        <div class="center-block col-sm-8">
 | 
			
		||||
          <% if current_user == @user %>
 | 
			
		||||
            <%= render 'shared/meeting_url', hidden: false %>
 | 
			
		||||
          <% else %>
 | 
			
		||||
            <%= render 'shared/meeting_url', hidden: true %>
 | 
			
		||||
          <% end %>
 | 
			
		||||
          <div class="join-form-wrapper">
 | 
			
		||||
            <%= render 'shared/join_form' %>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      <% end %>
 | 
			
		||||
      <%= render 'rooms_center_panel' %>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="table-wrapper">
 | 
			
		||||
@@ -71,13 +48,19 @@
 | 
			
		||||
      <span class="alert-message"></span>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="publish-alert">
 | 
			
		||||
  <div class="recording-publish-alert">
 | 
			
		||||
    <%= t('recording_published') %>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="unpublish-alert">
 | 
			
		||||
  <div class="recording-unpublish-alert">
 | 
			
		||||
    <%= t('recording_unpublished') %>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="delete-alert">
 | 
			
		||||
  <div class="recording-delete-alert">
 | 
			
		||||
    <%= t('recording_deleted') %>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="meeting-ended-alert">
 | 
			
		||||
    <%= t('meeting_ended') %>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="meeting-started-alert">
 | 
			
		||||
    <%= t('meeting_started') %>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1 +1 @@
 | 
			
		||||
<%= render 'shared/join_form' %>
 | 
			
		||||
<%= render 'rooms_center_panel' %>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@
 | 
			
		||||
          </h3>
 | 
			
		||||
          <%= yield %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <%= yield :footer %>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -31,10 +31,12 @@ en-US:
 | 
			
		||||
  greet_guest: Welcome to %{name} Meeting Space
 | 
			
		||||
  hi_all: Hi Everyone
 | 
			
		||||
  join: Join
 | 
			
		||||
  join_session_guest: Join the current session
 | 
			
		||||
  join_session: Join the current session
 | 
			
		||||
  join_session_user: Join %{name} session
 | 
			
		||||
  login: login
 | 
			
		||||
  logout: logout
 | 
			
		||||
  meeting_ended: Meeting was ended
 | 
			
		||||
  meeting_started: Meeting was started
 | 
			
		||||
  my_room: my room
 | 
			
		||||
  no: No
 | 
			
		||||
  oauth_signup: Signup for customized sessions
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user