Merge remote-tracking branch 'upstream/pull/2225'
This commit is contained in:
commit
f99c383318
5 changed files with 34 additions and 6 deletions
|
@ -22,4 +22,19 @@ module UserBlocksHelper
|
||||||
I18n.t("user_blocks.helper.time_past", :time => friendly_date(last_time)).html_safe
|
I18n.t("user_blocks.helper.time_past", :time => friendly_date(last_time)).html_safe
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def block_duration_in_words(duration)
|
||||||
|
parts = ActiveSupport::Duration.build(duration).parts
|
||||||
|
if duration < 1.day
|
||||||
|
I18n.t("user_blocks.helper.block_duration.hours", :count => parts[:hours])
|
||||||
|
elsif duration < 1.week
|
||||||
|
I18n.t("user_blocks.helper.block_duration.days", :count => parts[:days])
|
||||||
|
elsif duration < 1.month
|
||||||
|
I18n.t("user_blocks.helper.block_duration.weeks", :count => parts[:weeks])
|
||||||
|
elsif duration < 1.year
|
||||||
|
I18n.t("user_blocks.helper.block_duration.months", :count => parts[:months])
|
||||||
|
else
|
||||||
|
I18n.t("user_blocks.helper.block_duration.years", :count => parts[:years])
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag "user_block_period", t(".period") %><br />
|
<%= label_tag "user_block_period", t(".period") %><br />
|
||||||
<%= 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])) %>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= f.check_box :needs_view %>
|
<%= f.check_box :needs_view %>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag "user_block_period", t(".period") %><br />
|
<%= label_tag "user_block_period", t(".period") %><br />
|
||||||
<%= 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])) %>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= f.check_box :needs_view %>
|
<%= f.check_box :needs_view %>
|
||||||
|
|
|
@ -2321,14 +2321,27 @@ en:
|
||||||
confirm: "Are you sure you wish to revoke this block?"
|
confirm: "Are you sure you wish to revoke this block?"
|
||||||
revoke: "Revoke!"
|
revoke: "Revoke!"
|
||||||
flash: "This block has been revoked."
|
flash: "This block has been revoked."
|
||||||
period:
|
|
||||||
one: "1 hour"
|
|
||||||
other: "%{count} hours"
|
|
||||||
helper:
|
helper:
|
||||||
time_future: "Ends in %{time}."
|
time_future: "Ends in %{time}."
|
||||||
until_login: "Active until the user logs in."
|
until_login: "Active until the user logs in."
|
||||||
time_future_and_until_login: "Ends in %{time} and after the user has logged in."
|
time_future_and_until_login: "Ends in %{time} and after the user has logged in."
|
||||||
time_past: "Ended %{time} ago."
|
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:
|
blocks_on:
|
||||||
title: "Blocks on %{name}"
|
title: "Blocks on %{name}"
|
||||||
heading: "List of blocks on %{name}"
|
heading: "List of blocks on %{name}"
|
||||||
|
|
|
@ -42,7 +42,7 @@ api_timeout: 300
|
||||||
# Timeout for web pages in seconds
|
# Timeout for web pages in seconds
|
||||||
web_timeout: 30
|
web_timeout: 30
|
||||||
# Periods (in hours) which are allowed for user blocks
|
# 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
|
# Rate limit for message sending
|
||||||
max_messages_per_hour: 60
|
max_messages_per_hour: 60
|
||||||
# Domain for handling message replies
|
# Domain for handling message replies
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue