diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 7303788a57..779ed6f35a 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -24,7 +24,7 @@ class UsersController < ApplicationController
include Recorder
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
def create
diff --git a/app/helpers/recordings_helper.rb b/app/helpers/recordings_helper.rb
index e96fcd2fcf..0ab143067e 100644
--- a/app/helpers/recordings_helper.rb
+++ b/app/helpers/recordings_helper.rb
@@ -21,7 +21,7 @@ module RecordingsHelper
# Helper for converting BigBlueButton dates into the desired format.
def recording_date(date)
- date.strftime("%B #{date.day.ordinalize}, %Y.")
+ I18n.l date, format: "%B %d, %Y"
end
# Helper for converting BigBlueButton dates into a nice length string.
@@ -32,7 +32,7 @@ def recording_length(playbacks)
len = valid_playbacks.first[:length]
if len > 60
- "#{(len / 60).to_i} hrs #{len % 60} mins"
+ "#{(len / 60).to_i} h #{len % 60} min"
elsif len.zero?
"< 1 min"
else
diff --git a/app/views/shared/components/_public_recording_row.html.erb b/app/views/shared/components/_public_recording_row.html.erb
index baec07b706..4c1536f1d3 100644
--- a/app/views/shared/components/_public_recording_row.html.erb
+++ b/app/views/shared/components/_public_recording_row.html.erb
@@ -29,7 +29,7 @@
<% if recording_thumbnails? %>
-
+ |
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
<% if p %>
<% p[:preview][:images][:image].each do |img| %>
@@ -39,15 +39,9 @@
|
<% end %>
-
- <%= t("recording.table.length") %>
-
<%= recording_length(recording[:playbacks]) %>
|
-
- <%= t("recording.table.users") %>
-
<%= recording[:participants] %>
|
diff --git a/app/views/shared/components/_recording_row.html.erb b/app/views/shared/components/_recording_row.html.erb
index 0a65bed260..deb79088dd 100644
--- a/app/views/shared/components/_recording_row.html.erb
+++ b/app/views/shared/components/_recording_row.html.erb
@@ -30,7 +30,7 @@
|
<% if recording_thumbnails? %>
-
+ |
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
<% if p %>
<% safe_recording_images(p[:preview][:images][:image]).each do |img| %>
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 4b050c6766..e309a9a8a1 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -51,13 +51,6 @@
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
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
ActionView::Base.field_error_proc = proc do |html_tag|
html_tag.html_safe
@@ -107,8 +100,12 @@
config.log_formatter = proc do |severity, _time, _progname, msg|
"#{severity}: #{msg} \n"
end
+
config.log_level = :info
+ # Prepend all log lines with the following tags.
+ config.log_tags = [:request_id]
+
if ENV["RAILS_LOG_TO_STDOUT"] == "true"
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 542123eadf..2fa42b0008 100755
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -113,6 +113,8 @@ en:
cookie_button: I Agree
copied: Copied
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 here to change it
delete: Delete
delivery_error: An error occured during email delivery. Please contact an administrator!
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index 4bcbdfb754..b0af1bfad7 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -62,6 +62,16 @@ def random_valid_user_params
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
it "renders the edit template" do
user = create(:user)
diff --git a/spec/helpers/recordings_helper_spec.rb b/spec/helpers/recordings_helper_spec.rb
index 795eeed68a..ac8690c834 100644
--- a/spec/helpers/recordings_helper_spec.rb
+++ b/spec/helpers/recordings_helper_spec.rb
@@ -22,14 +22,14 @@
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 28th, 2019.")
+ expect(helper.recording_date(date)).to eql("March 28, 2019")
end
end
describe "#recording_length" do
it "returns the time if length > 60" do
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
it "returns the time if length == 0" do
|