Allow user_blocks to be created for longer periods

This avoids admins from having to manually change end periods in the database
This commit is contained in:
Andy Allan 2019-05-15 11:30:28 +02:00
parent da66044021
commit 90ac07d071
5 changed files with 34 additions and 6 deletions

View file

@ -18,7 +18,7 @@
</p>
<p>
<%= 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>
<%= f.check_box :needs_view %>

View file

@ -13,7 +13,7 @@
</p>
<p>
<%= 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>
<%= f.check_box :needs_view %>