forked from External/greenlight
Merge pull request #232 from joshua-arts/fix-recordings
Fix recordings table.
This commit is contained in:
commit
40aa64f43f
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 %>
|
||||
|
|
Loading…
Reference in New Issue