[openstreetmap/openstreetmap-website] Remove right sidebar, use left sidebar for map key, layers, share (PR #4335)

Anton Khorev notifications at github.com
Sun Nov 12 05:57:40 UTC 2023


![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/838697fa-fe2d-4821-b20b-511f27aaa787)

It would make sense to have two different sidebars if you need them both open at the same time. I don't think this is the case.

Having only one sidebar might be better because:
- no extra code for sidebar on the right
- buttons on the right side don't move anywhere when pressed
- urls for opened layers/key/share sidebars
- allows to move most of the layers/key/share html construction code to erb templates

and might be worse because:
- layers/key/share sidebar is opened on the opposite side to the buttons (but *add note* and *query features* already use left sidebar)
- have to add and maintain routes for layers/key/share (possible to avoid, but need to decide how back/forward navigation is going to work)

Most of the changes are moving code from `app/assets/javascripts/leaflet.*.js` to `app/assets/javascripts/index/*.js` and `app/views/site/*.html.erb`.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4335

-- Commit Summary --

  * Move map key to left sidebar
  * Move layers ui to left sidebar
  * Write layer sections in erb template
  * Write overlay layer inputs in erb template
  * Enable/disable overlay layer event handlers in page.load/unload
  * Remove base layer switch listeners on page unload
  * Move share pane to left sidebar
  * Remove unused right sidebar pane module
  * Remove share map event handlers on page unload
  * Update sidebar section styles
  * Remove unused right sidebar code
  * Write share sections in erb template
  * Write share controls in erb template

-- File Changes --

    M app/abilities/ability.rb (3)
    M app/assets/javascripts/index.js (40)
    A app/assets/javascripts/index/layers.js (192)
    A app/assets/javascripts/index/mapkey.js (44)
    A app/assets/javascripts/index/share.js (229)
    M app/assets/javascripts/leaflet.key.js (48)
    M app/assets/javascripts/leaflet.layers.js (167)
    M app/assets/javascripts/leaflet.share.js (407)
    D app/assets/javascripts/leaflet.sidebar-pane.js (52)
    D app/assets/javascripts/leaflet.sidebar.js (55)
    M app/assets/stylesheets/common.scss (24)
    M app/assets/stylesheets/print.scss (4)
    M app/controllers/site_controller.rb (8)
    M app/views/layouts/map.html.erb (3)
    A app/views/site/layers.html.erb (34)
    A app/views/site/mapkey.html.erb (11)
    A app/views/site/share.html.erb (86)
    M config/locales/en.yml (2)
    M config/routes.rb (3)
    M test/system/index_test.rb (4)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4335.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4335.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4335
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4335 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231111/e0359677/attachment.htm>


More information about the rails-dev mailing list