Merge pull request #232 from joshua-arts/fix-recordings

Fix recordings table.
This commit is contained in:
Joshua Arts 2018-07-30 14:58:02 -04:00 committed by GitHub
commit 40aa64f43f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 9 deletions

View File

@ -114,11 +114,9 @@ class RoomsController < ApplicationController
helper_method :recording_date
# Helper for converting BigBlueButton dates into a nice length string.
def recording_length(start_time, end_time)
len = ((end_time - start_time) * 24 * 60).to_i
def recording_length(len)
if len > 60
"#{len / 60} hrs"
"#{(len / 60).round} hrs"
elsif len == 0
"< 1 min"
else

View File

@ -113,7 +113,7 @@ class Room < ApplicationRecord
r.delete(:playback)
end
res[:recordings]
res[:recordings].sort_by { |rec| rec[:endTime] }.reverse
end
# Fetches a rooms public recordings.

View File

@ -17,7 +17,7 @@
<div class="small text-muted text-uppercase">
<%= t("recording.table.length") %>
</div>
<%= recording_length(recording[:startTime], recording[:endTime]) %>
<%= recording_length(recording[:playbacks].first[:length]) %>
</td>
<td class="text-left">
<div class="small text-muted text-uppercase">

View File

@ -17,7 +17,7 @@
<div class="small text-muted text-uppercase">
<%= t("recording.table.length") %>
</div>
<%= recording_length(recording[:startTime], recording[:endTime]) %>
<%= recording_length(recording[:playbacks].first[:length]) %>
</td>
<td class="text-left">
<div class="small text-muted text-uppercase">
@ -49,7 +49,9 @@
</td>
<td class="text-center">
<div class="item-action dropdown">
<a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fas fa-ellipsis-v"></i></a>
<a href="javascript:void(0)" data-toggle="dropdown" class="icon">
<i class="fas fa-ellipsis-v px-4"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item email-link" data-pres-link="<%= p[:url] %>"><i class="dropdown-icon far fa-envelope"></i> <%= t("recording.email") %></a>
<div class="dropdown-divider"></div>

View File

@ -23,7 +23,9 @@
</td>
<td class="text-right">
<div class="item-action dropdown">
<a href="javascript:void(0)" data-toggle="dropdown" class="icon <%= 'invisible' if room == current_user.main_room %>"><i class="fas fa-ellipsis-v px-4"></i></a>
<a href="javascript:void(0)" data-toggle="dropdown" class="icon <%= 'invisible' if room == current_user.main_room %>">
<i class="fas fa-ellipsis-v px-4"></i>
</a>
<div class="dropdown-menu">
<!--
<%= link_to room, class: "dropdown-item" do %>