[openstreetmap/openstreetmap-website] Move html from javascript to views (Issue #5616)
Andy Allan
notifications at github.com
Wed Feb 5 17:25:35 UTC 2025
We have an amount of html building being created using JavaScript code. For example, in `leaflet.share.js` there is a substantial amount of html construction:
https://github.com/openstreetmap/openstreetmap-website/blob/7cf9bf0e553a141acab2afea53842f97eddd0a40/app/assets/javascripts/leaflet.share.js#L37-L53
This makes it harder to find, and much harder to maintain, than having the html in a view like the rest of the site. It's also mostly unnecessary, since html like this isn't dynamic, it's the same for every user.
We should move all of this html into views, and use the javascript only for interactivity like changing content (e.g. taking results of an ajax query and putting them into the html) or to show/hide certain elements after UI interactions.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5616
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/5616 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250205/4a4dd86e/attachment-0001.htm>
More information about the rails-dev
mailing list