[openstreetmap/openstreetmap-website] Use friendly_date helpers throughout the site (PR #4349)
Andy Allan
notifications at github.com
Wed Nov 15 20:05:49 UTC 2023
Refs #631 (site-wide consistency) and #4313 (use of `time` element instead of `abbr` or `span`).
This PR refactors our friendly date displays to be consistent throughout the site. I've standardised on using the `time` element (with the machine-readable datetime attribute, for anything that might need it), and removed all the (mis-)use of `abbr` elements. The highlighting of time periods which have titles (using dotted underlines), previously a side effect of `abbr`, is reimplemented in CSS.
I've kept the changesets_helper#changeset_details as the only place that doesn't use the friendly_date helpers, since it does some funky stuff with the titles. But I would consider refactoring that in future too, since I'm not convinced those titles are a good idea.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/4349
-- Commit Summary --
* Use html 'time' element for friendly date helpers
* Add missing tests for friendly_date_ago helper
* Avoid wrapping time tags in abbr for note_helper
* Use time instead of abbr element for changesets_helper
* Use the friendly_data_ago helper for contacts on the dashboard
* Use friendly_date for note disappear description
* Use friendly_date helpers for revoking user blocks
* Avoid wrapping friendly_date with abbr tags
* Simplify date display by using friendly_date helpers
* Underline time elements that have a title
-- File Changes --
M app/assets/stylesheets/common.scss (4)
M app/helpers/application_helper.rb (4)
M app/helpers/changesets_helper.rb (6)
M app/helpers/note_helper.rb (11)
M app/views/browse/_common_details.html.erb (3)
M app/views/browse/changeset.html.erb (6)
M app/views/dashboards/_contact.html.erb (2)
M app/views/diary_entries/comments.html.erb (4)
M app/views/issues/index.html.erb (6)
M app/views/notes/show.html.erb (2)
M app/views/traces/_trace.html.erb (4)
M app/views/user_blocks/revoke.html.erb (4)
M config/locales/en.yml (6)
M test/helpers/application_helper_test.rb (27)
M test/helpers/changesets_helper_test.rb (4)
M test/helpers/note_helper_test.rb (13)
M test/helpers/user_blocks_helper_test.rb (4)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/4349.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4349.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4349
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4349 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231115/19af9bb8/attachment-0001.htm>
More information about the rails-dev
mailing list