X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/8da80ff471f7d04984ff5abab0c5fe32920330ba..bcf75b0ae2588d38dc3d6615a0f61f044aad1223:/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 %>