[openstreetmap/openstreetmap-website] Select closest value to remaining duration when editing a block (PR #5011)
Anton Khorev
notifications at github.com
Mon Jul 22 16:10:33 UTC 2024
Let's suppose you create a block and you set its duration to 12 hours. Then you realize you need to edit this block. You go to `/user_blocks/:id/edit` and you see among other things a duration select set to 12 hours as expected:

But what if you come an hour later? Now the remaining duration is 11 hours which is not one of the available select options. The select will look like this, defaulting to 0 hours, probably not the best choice:

Here I set the select to the closest available value.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/5011
-- Commit Summary --
* Select closest value to remaining duration when editing a block
-- File Changes --
M app/views/user_blocks/edit.html.erb (3)
M test/controllers/user_blocks_controller_test.rb (28)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/5011.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5011.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5011
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5011 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240722/f2781164/attachment.htm>
More information about the rails-dev
mailing list