forked from External/greenlight
		
	master #1
							
								
								
									
										2
									
								
								Gemfile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Gemfile
									
									
									
									
									
								
							@@ -83,6 +83,8 @@ gem 'google-cloud-storage', '~> 1.26'
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
gem 'pluck_to_hash', '~> 1.0.2'
 | 
					gem 'pluck_to_hash', '~> 1.0.2'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gem 'local_time', '~> 2.1.0'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
group :production do
 | 
					group :production do
 | 
				
			||||||
  # Use a postgres database in production.
 | 
					  # Use a postgres database in production.
 | 
				
			||||||
  gem 'pg', '~> 0.18'
 | 
					  gem 'pg', '~> 0.18'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -202,6 +202,7 @@ GEM
 | 
				
			|||||||
    listen (3.0.8)
 | 
					    listen (3.0.8)
 | 
				
			||||||
      rb-fsevent (~> 0.9, >= 0.9.4)
 | 
					      rb-fsevent (~> 0.9, >= 0.9.4)
 | 
				
			||||||
      rb-inotify (~> 0.9, >= 0.9.7)
 | 
					      rb-inotify (~> 0.9, >= 0.9.7)
 | 
				
			||||||
 | 
					    local_time (2.1.0)
 | 
				
			||||||
    lograge (0.11.2)
 | 
					    lograge (0.11.2)
 | 
				
			||||||
      actionpack (>= 4)
 | 
					      actionpack (>= 4)
 | 
				
			||||||
      activesupport (>= 4)
 | 
					      activesupport (>= 4)
 | 
				
			||||||
@@ -479,6 +480,7 @@ DEPENDENCIES
 | 
				
			|||||||
  jquery-rails (~> 4.4)
 | 
					  jquery-rails (~> 4.4)
 | 
				
			||||||
  jquery-ui-rails
 | 
					  jquery-ui-rails
 | 
				
			||||||
  listen (~> 3.0.5)
 | 
					  listen (~> 3.0.5)
 | 
				
			||||||
 | 
					  local_time (~> 2.1.0)
 | 
				
			||||||
  lograge
 | 
					  lograge
 | 
				
			||||||
  net-ldap
 | 
					  net-ldap
 | 
				
			||||||
  omniauth
 | 
					  omniauth
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,4 +35,5 @@
 | 
				
			|||||||
//= require jquery-ui/widgets/sortable
 | 
					//= require jquery-ui/widgets/sortable
 | 
				
			||||||
//= require pickr.min.js
 | 
					//= require pickr.min.js
 | 
				
			||||||
//= require bootstrap-select.min.js
 | 
					//= require bootstrap-select.min.js
 | 
				
			||||||
 | 
					//= require local-time
 | 
				
			||||||
//= require_tree .
 | 
					//= require_tree .
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,13 +31,6 @@ module AdminsHelper
 | 
				
			|||||||
    @running_room_bbb_ids.include?(id)
 | 
					    @running_room_bbb_ids.include?(id)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Returns a more friendly/readable date time object
 | 
					 | 
				
			||||||
  def friendly_time(date)
 | 
					 | 
				
			||||||
    return "" if date.nil? # Handle invalid dates
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    I18n.l date, format: "%B %d, %Y %H:%M UTC"
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Site Settings
 | 
					  # Site Settings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def admin_invite_registration
 | 
					  def admin_invite_registration
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -135,4 +135,10 @@ module ApplicationHelper
 | 
				
			|||||||
  def show_signin
 | 
					  def show_signin
 | 
				
			||||||
    !@hide_signin.present?
 | 
					    !@hide_signin.present?
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Returns a more friendly/readable date time object
 | 
				
			||||||
 | 
					  def view_date(date)
 | 
				
			||||||
 | 
					    return "" if date.nil? # Handle invalid dates
 | 
				
			||||||
 | 
					    local_time(date)
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,11 +17,6 @@
 | 
				
			|||||||
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 | 
					# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module RecordingsHelper
 | 
					module RecordingsHelper
 | 
				
			||||||
  # Helper for converting BigBlueButton dates into the desired format.
 | 
					 | 
				
			||||||
  def recording_date(date)
 | 
					 | 
				
			||||||
    I18n.l date, format: "%B %d, %Y"
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Helper for converting BigBlueButton dates into a nice length string.
 | 
					  # Helper for converting BigBlueButton dates into a nice length string.
 | 
				
			||||||
  def recording_length(playbacks)
 | 
					  def recording_length(playbacks)
 | 
				
			||||||
    # Looping through playbacks array and returning first non-zero length value
 | 
					    # Looping through playbacks array and returning first non-zero length value
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,7 @@
 | 
				
			|||||||
                      <div><%= user.email %></div>
 | 
					                      <div><%= user.email %></div>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                      <div><%= friendly_time(user.updated_at) %></div>
 | 
					                      <div><%= view_date(user.updated_at) %></div>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                      <div>
 | 
					                      <div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,7 +48,7 @@
 | 
				
			|||||||
                  <tr data-user-uid="<%= user.uid %>">
 | 
					                  <tr data-user-uid="<%= user.uid %>">
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                      <div><%= user.name %></div>
 | 
					                      <div><%= user.name %></div>
 | 
				
			||||||
                      <div class="small text-muted"><%= [t("administrator.users.table.created"), ": ", user.created_at].join %></div>
 | 
					                      <div class="small text-muted"><%= [t("administrator.users.table.created"), ": ", view_date(user.created_at)].join.html_safe %></div>
 | 
				
			||||||
                    </td>
 | 
					                    </td>
 | 
				
			||||||
                    <td class="user-email"><%= user.email && user.email != "" ? user.email : user.username%></td>
 | 
					                    <td class="user-email"><%= user.email && user.email != "" ? user.email : user.username%></td>
 | 
				
			||||||
                    <td><%= user.provider %></td>
 | 
					                    <td><%= user.provider %></td>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,7 +26,7 @@
 | 
				
			|||||||
      <a><i id="edit-record" class="fa fa-edit align-top ml-2" data-edit-recordid="<%= recording[:recordID] %>"></i></a>
 | 
					      <a><i id="edit-record" class="fa fa-edit align-top ml-2" data-edit-recordid="<%= recording[:recordID] %>"></i></a>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="small text-muted">
 | 
					    <div class="small text-muted">
 | 
				
			||||||
      <%= t("recording.recorded_on", date: recording_date(recording[:startTime])) %>
 | 
					      <%= t("recording.recorded_on", date: view_date(recording[:startTime])).html_safe %>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="small text-muted">
 | 
					    <div class="small text-muted">
 | 
				
			||||||
      <%= recording_owner_email(recording[:meetingID]) %>
 | 
					      <%= recording_owner_email(recording[:meetingID]) %>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,11 +26,11 @@
 | 
				
			|||||||
    <div class="small text-muted">
 | 
					    <div class="small text-muted">
 | 
				
			||||||
      <% running = room_is_running(room.bbb_id) %>
 | 
					      <% running = room_is_running(room.bbb_id) %>
 | 
				
			||||||
      <% if running %>
 | 
					      <% if running %>
 | 
				
			||||||
         <%= t("administrator.rooms.table.started", session: friendly_time(room.last_session)) %>
 | 
					         <%= t("administrator.rooms.table.started", session: view_date(room.last_session)).html_safe %>
 | 
				
			||||||
      <% elsif room.last_session.present? %>
 | 
					      <% elsif room.last_session.present? %>
 | 
				
			||||||
        <%= t("administrator.rooms.table.ended", session: friendly_time(room.last_session)) %>
 | 
					        <%= t("administrator.rooms.table.ended", session: view_date(room.last_session)).html_safe %>
 | 
				
			||||||
      <% else %>
 | 
					      <% else %>
 | 
				
			||||||
        <%= [t("administrator.users.table.created"), ": ", friendly_time(room.created_at)].join %>
 | 
					        <%= [t("administrator.users.table.created"), ": ", view_date(room.created_at)].join.html_safe %>
 | 
				
			||||||
      <% end %>
 | 
					      <% end %>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  </td>
 | 
					  </td>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,7 +35,7 @@
 | 
				
			|||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <div class="small text-muted">
 | 
					          <div class="small text-muted">
 | 
				
			||||||
            <% if room.sessions > 0 %>
 | 
					            <% if room.sessions > 0 %>
 | 
				
			||||||
              <i><%= t("room.last_session", session: recording_date(room.last_session)) %></i>
 | 
					              <i><%= t("room.last_session", session: view_date(room.last_session)).html_safe %></i>
 | 
				
			||||||
            <% else %>
 | 
					            <% else %>
 | 
				
			||||||
              <i><%= t("room.no_sessions") %></i>
 | 
					              <i><%= t("room.no_sessions") %></i>
 | 
				
			||||||
            <% end %>
 | 
					            <% end %>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,7 +26,7 @@
 | 
				
			|||||||
        </span>
 | 
					        </span>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="small text-muted">
 | 
					    <div class="small text-muted">
 | 
				
			||||||
      <%= t("recording.recorded_on", date: recording_date(recording[:startTime])) %>
 | 
					      <%= t("recording.recorded_on", date: view_date(recording[:startTime])).html_safe %>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  </td>
 | 
					  </td>
 | 
				
			||||||
  <% if recording_thumbnails? %>
 | 
					  <% if recording_thumbnails? %>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,7 +27,7 @@
 | 
				
			|||||||
      <a><i id="edit-record" class="fa fa-edit align-top ml-2" data-edit-recordid="<%= recording[:recordID] %>"></i></a>
 | 
					      <a><i id="edit-record" class="fa fa-edit align-top ml-2" data-edit-recordid="<%= recording[:recordID] %>"></i></a>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="small text-muted">
 | 
					    <div class="small text-muted">
 | 
				
			||||||
      <%= t("recording.recorded_on", date: recording_date(recording[:startTime])) %>
 | 
					      <%= t("recording.recorded_on", date: view_date(recording[:startTime])).html_safe %>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  </td>
 | 
					  </td>
 | 
				
			||||||
  <% if recording_thumbnails? %>
 | 
					  <% if recording_thumbnails? %>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,13 +19,6 @@
 | 
				
			|||||||
require "rails_helper"
 | 
					require "rails_helper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
describe RecordingsHelper do
 | 
					describe RecordingsHelper do
 | 
				
			||||||
  describe "#recording_date" do
 | 
					 | 
				
			||||||
    it "formats the date" do
 | 
					 | 
				
			||||||
      date = DateTime.parse("2019-03-28 19:35:15 UTC")
 | 
					 | 
				
			||||||
      expect(helper.recording_date(date)).to eql("March 28, 2019")
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  describe "#recording_length" do
 | 
					  describe "#recording_length" do
 | 
				
			||||||
    it "returns the time if length > 60" do
 | 
					    it "returns the time if length > 60" do
 | 
				
			||||||
      playbacks = [{ type: "test", length: 85 }]
 | 
					      playbacks = [{ type: "test", length: 85 }]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user