X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6290405336817cd282ad5062ce3fc3774ccf61e4..8990de156fba39383532bca59db4d907306ff5d3:/app/views/user_blocks/edit.html.erb diff --git a/app/views/user_blocks/edit.html.erb b/app/views/user_blocks/edit.html.erb index a5b165e9a..88441a15d 100644 --- a/app/views/user_blocks/edit.html.erb +++ b/app/views/user_blocks/edit.html.erb @@ -15,7 +15,8 @@ <%= f.form_group do %> <%= label_tag "user_block_period", t(".period"), :class => "form-label" %> <%= 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]), + options_for_select(UserBlock::PERIODS.collect { |h| [block_duration_in_words(h.hours), h.to_s] }, + UserBlock::PERIODS.min_by { |h| (params[:user_block_period].to_i - h).abs }), :class => "form-select") %> <% end %>