[openstreetmap/openstreetmap-website] Provide a summary view of recent diaries (PR #5103)

David Tsiklauri notifications at github.com
Mon Aug 26 08:47:29 UTC 2024


@mmd-osm I updated PR so that now `10 rem` (about 7.5 paragraph lines) of content is shown when the entry is collapsed. If entry is shorter, it doesn't leave any redundant gaps. I needed to add 2 lines of custom CSS as Bootstrap Accordion doesn't support behavior of showing any content when collapsed (it sets `display: none`). The only downside of the current solution is that when entry is less than 7 lines, accordion button is still shown but clicking it doesn't change anything. The only fix (based on limited functionality of Bootstrap Accordion) can be made by adding custom JS code. From my experience, we try to avoid adding additional JS code. If it is okay to add one for this functionality, I can add it too.

@tomhughes I implemented solution suggested by you. I found some issues opened about Bootstrap CSP errors (https://github.com/twbs/bootstrap/issues/25394), but even [Bootstrap 5 mentions](https://getbootstrap.com/docs/5.0/customize/overview/#csps-and-embedded-svgs) that some of their functionality uses `data:` in image urls. As mentioned in [Stackexchange](https://security.stackexchange.com/questions/94993/is-including-the-data-scheme-in-your-content-security-policy-safe/167244#167244) and [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/SVG_as_an_Image#restrictions) adding `data:` as `background-image` or other image source doesn't raise any risks. Therefore, if we don't have extremely strict CSP policy, we can use solution suggested by you.

Thank you for reviewing

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

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


More information about the rails-dev mailing list