[openstreetmap/openstreetmap-website] Truncate usernames in profile links (PR #4445)

Andy Allan notifications at github.com
Wed Jan 10 16:18:57 UTC 2024


@gravitystorm requested changes on this pull request.

I think this is a valid problem, so it's worth solving. But I'm surprised that the solution is only for a couple of places (changeset discussions, user messages and user blocks) and not everywhere else on the site too.

Also the tests fail, so those need fixing too.

> @@ -50,6 +50,16 @@ def user_image_url(user, options = {})
     end
   end
 
+  def truncated_user_link(user, **options)
+    classes = %w[d-inline-block align-bottom text-truncate]
+    if options[:width]
+      style = "max-width: #{options[:width]}"

I'm fairly sure that inline styles aren't allowed by our Content Security Policy.

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

Message ID: <openstreetmap/openstreetmap-website/pull/4445/review/1813605260 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240110/83f19b40/attachment.htm>


More information about the rails-dev mailing list