From 90ac07d071ed8dbfdea6214419e1b5205a529b2f Mon Sep 17 00:00:00 2001
From: Andy Allan
<%= label_tag "user_block_period", t(".period") %>
- <%= select_tag("user_block_period", options_for_select(UserBlock::PERIODS.collect { |h| [t("user_blocks.period", :count => h), h.to_s] }, params[:user_block_period])) %>
+ <%= select_tag("user_block_period", options_for_select(UserBlock::PERIODS.collect { |h| [block_duration_in_words(h.hours), h.to_s] }, params[:user_block_period])) %>
<%= f.check_box :needs_view %> diff --git a/app/views/user_blocks/new.html.erb b/app/views/user_blocks/new.html.erb index c92fe74ec..aa4bf7132 100644 --- a/app/views/user_blocks/new.html.erb +++ b/app/views/user_blocks/new.html.erb @@ -13,7 +13,7 @@
<%= label_tag "user_block_period", t(".period") %>
- <%= select_tag("user_block_period", options_for_select(UserBlock::PERIODS.collect { |h| [t("user_blocks.period", :count => h), h.to_s] }, params[:user_block_period])) %>
+ <%= select_tag("user_block_period", options_for_select(UserBlock::PERIODS.collect { |h| [block_duration_in_words(h.hours), h.to_s] }, params[:user_block_period])) %>
<%= f.check_box :needs_view %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 569992599..bc852600c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2311,14 +2311,27 @@ en: confirm: "Are you sure you wish to revoke this block?" revoke: "Revoke!" flash: "This block has been revoked." - period: - one: "1 hour" - other: "%{count} hours" helper: time_future: "Ends in %{time}." until_login: "Active until the user logs in." time_future_and_until_login: "Ends in %{time} and after the user has logged in." time_past: "Ended %{time} ago." + block_duration: + hours: + one: "1 hour" + other: "%{count} hours" + days: + one: "1 day" + other: "%{count} days" + weeks: + one: "1 week" + other: "%{count} weeks" + months: + one: "1 month" + other: "%{count} months" + years: + one: "1 year" + other: "%{count} years" blocks_on: title: "Blocks on %{name}" heading: "List of blocks on %{name}" diff --git a/config/settings.yml b/config/settings.yml index 6031f0654..988b55a63 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -42,7 +42,7 @@ api_timeout: 300 # Timeout for web pages in seconds web_timeout: 30 # Periods (in hours) which are allowed for user blocks -user_block_periods: [0, 1, 3, 6, 12, 24, 48, 96] +user_block_periods: [0, 1, 3, 6, 12, 24, 48, 96, 168, 336, 731, 4383, 8766, 87660] # Rate limit for message sending max_messages_per_hour: 60 # Domain for handling message replies -- 2.39.5