forked from External/greenlight
GRN2-217: Fixes issues with recording rows and localization (fixed #703-#705) (#707)
* Fixes issues with recording rows * Fixed small typo related to logs
This commit is contained in:
parent
d123d5add0
commit
02b342b157
|
@ -24,7 +24,7 @@ class UsersController < ApplicationController
|
||||||
include Recorder
|
include Recorder
|
||||||
|
|
||||||
before_action :find_user, only: [:edit, :update, :destroy]
|
before_action :find_user, only: [:edit, :update, :destroy]
|
||||||
before_action :ensure_unauthenticated, only: [:new, :create]
|
before_action :ensure_unauthenticated, only: [:new, :create, :signin]
|
||||||
|
|
||||||
# POST /u
|
# POST /u
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -21,7 +21,7 @@ module RecordingsHelper
|
||||||
|
|
||||||
# Helper for converting BigBlueButton dates into the desired format.
|
# Helper for converting BigBlueButton dates into the desired format.
|
||||||
def recording_date(date)
|
def recording_date(date)
|
||||||
date.strftime("%B #{date.day.ordinalize}, %Y.")
|
I18n.l date, format: "%B %d, %Y"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Helper for converting BigBlueButton dates into a nice length string.
|
# Helper for converting BigBlueButton dates into a nice length string.
|
||||||
|
@ -32,7 +32,7 @@ module RecordingsHelper
|
||||||
|
|
||||||
len = valid_playbacks.first[:length]
|
len = valid_playbacks.first[:length]
|
||||||
if len > 60
|
if len > 60
|
||||||
"#{(len / 60).to_i} hrs #{len % 60} mins"
|
"#{(len / 60).to_i} h #{len % 60} min"
|
||||||
elsif len.zero?
|
elsif len.zero?
|
||||||
"< 1 min"
|
"< 1 min"
|
||||||
else
|
else
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<% if recording_thumbnails? %>
|
<% if recording_thumbnails? %>
|
||||||
<td>
|
<td class="overflow-hidden">
|
||||||
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
|
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
|
||||||
<% if p %>
|
<% if p %>
|
||||||
<% p[:preview][:images][:image].each do |img| %>
|
<% p[:preview][:images][:image].each do |img| %>
|
||||||
|
@ -39,15 +39,9 @@
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td id="recording-length" class="text-left" data-full-length="<%=recording[:playbacks].first[:length]%>">
|
<td id="recording-length" class="text-left" data-full-length="<%=recording[:playbacks].first[:length]%>">
|
||||||
<div class="small text-muted text-uppercase">
|
|
||||||
<%= t("recording.table.length") %>
|
|
||||||
</div>
|
|
||||||
<%= recording_length(recording[:playbacks]) %>
|
<%= recording_length(recording[:playbacks]) %>
|
||||||
</td>
|
</td>
|
||||||
<td id="recording-users" class="text-left">
|
<td id="recording-users" class="text-left">
|
||||||
<div class="small text-muted text-uppercase">
|
|
||||||
<%= t("recording.table.users") %>
|
|
||||||
</div>
|
|
||||||
<%= recording[:participants] %>
|
<%= recording[:participants] %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-left">
|
<td class="text-left">
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<% if recording_thumbnails? %>
|
<% if recording_thumbnails? %>
|
||||||
<td>
|
<td class="overflow-hidden">
|
||||||
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
|
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
|
||||||
<% if p %>
|
<% if p %>
|
||||||
<% safe_recording_images(p[:preview][:images][:image]).each do |img| %>
|
<% safe_recording_images(p[:preview][:images][:image]).each do |img| %>
|
||||||
|
|
|
@ -51,13 +51,6 @@ Rails.application.configure do
|
||||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
config.force_ssl = (ENV["ENABLE_SSL"] == "true")
|
config.force_ssl = (ENV["ENABLE_SSL"] == "true")
|
||||||
|
|
||||||
# Use the lowest log level to ensure availability of diagnostic information
|
|
||||||
# when problems arise.
|
|
||||||
config.log_level = :debug
|
|
||||||
|
|
||||||
# Prepend all log lines with the following tags.
|
|
||||||
config.log_tags = [:request_id]
|
|
||||||
|
|
||||||
# Don't wrap form components in field_with_error divs
|
# Don't wrap form components in field_with_error divs
|
||||||
ActionView::Base.field_error_proc = proc do |html_tag|
|
ActionView::Base.field_error_proc = proc do |html_tag|
|
||||||
html_tag.html_safe
|
html_tag.html_safe
|
||||||
|
@ -107,8 +100,12 @@ Rails.application.configure do
|
||||||
config.log_formatter = proc do |severity, _time, _progname, msg|
|
config.log_formatter = proc do |severity, _time, _progname, msg|
|
||||||
"#{severity}: #{msg} \n"
|
"#{severity}: #{msg} \n"
|
||||||
end
|
end
|
||||||
|
|
||||||
config.log_level = :info
|
config.log_level = :info
|
||||||
|
|
||||||
|
# Prepend all log lines with the following tags.
|
||||||
|
config.log_tags = [:request_id]
|
||||||
|
|
||||||
if ENV["RAILS_LOG_TO_STDOUT"] == "true"
|
if ENV["RAILS_LOG_TO_STDOUT"] == "true"
|
||||||
logger = ActiveSupport::Logger.new(STDOUT)
|
logger = ActiveSupport::Logger.new(STDOUT)
|
||||||
logger.formatter = config.log_formatter
|
logger.formatter = config.log_formatter
|
||||||
|
|
|
@ -113,6 +113,8 @@ en:
|
||||||
cookie_button: I Agree
|
cookie_button: I Agree
|
||||||
copied: Copied
|
copied: Copied
|
||||||
copy: Copy
|
copy: Copy
|
||||||
|
date:
|
||||||
|
month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
|
||||||
default_admin: You are still using the default password for this account. Please click <a href="%{edit_link}">here</a> to change it
|
default_admin: You are still using the default password for this account. Please click <a href="%{edit_link}">here</a> to change it
|
||||||
delete: Delete
|
delete: Delete
|
||||||
delivery_error: An error occured during email delivery. Please contact an administrator!
|
delivery_error: An error occured during email delivery. Please contact an administrator!
|
||||||
|
|
|
@ -62,6 +62,16 @@ describe UsersController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "GET #signin" do
|
||||||
|
it "redirects to main room if already authenticated" do
|
||||||
|
user = create(:user)
|
||||||
|
@request.session[:user_id] = user.id
|
||||||
|
|
||||||
|
post :signin
|
||||||
|
expect(response).to redirect_to(room_path(user.main_room))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "GET #edit" do
|
describe "GET #edit" do
|
||||||
it "renders the edit template" do
|
it "renders the edit template" do
|
||||||
user = create(:user)
|
user = create(:user)
|
||||||
|
|
|
@ -22,14 +22,14 @@ describe RecordingsHelper do
|
||||||
describe "#recording_date" do
|
describe "#recording_date" do
|
||||||
it "formats the date" do
|
it "formats the date" do
|
||||||
date = DateTime.parse("2019-03-28 19:35:15 UTC")
|
date = DateTime.parse("2019-03-28 19:35:15 UTC")
|
||||||
expect(helper.recording_date(date)).to eql("March 28th, 2019.")
|
expect(helper.recording_date(date)).to eql("March 28, 2019")
|
||||||
end
|
end
|
||||||
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 }]
|
||||||
expect(helper.recording_length(playbacks)).to eql("1 hrs 25 mins")
|
expect(helper.recording_length(playbacks)).to eql("1 h 25 min")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns the time if length == 0" do
|
it "returns the time if length == 0" do
|
||||||
|
|
Loading…
Reference in New Issue