X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/43db18ae911fef3ad7b36e9ed27e5eff469ef863..72177a3f20d31e081372f5174b72354192e40a3b:/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 %>