From: Herve Saint-Amand Date: Sun, 12 Feb 2017 12:04:43 +0000 (+0000) Subject: A better way to contrain the width of the message box whilst also allowing it to... X-Git-Tag: live~3546^2~2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/fcba1a9857b7a225a5540b08432be876bde8501f?hp=6964c445845831151921ed7de5222204b498f04b A better way to contrain the width of the message box whilst also allowing it to shrink on narrow displays Setting a hard "width" it very compatible, but won't squeeze on narrow screens. Setting max-width works well, except in Outlook and Hotmail. We resort to old skool table tricks: a table with width=100%, with 3 columns, only oneof which, the middle one, had content, and a fixed with. This works. --- diff --git a/app/views/layouts/notifier.html.erb b/app/views/layouts/notifier.html.erb index c0dbac842..883f1b385 100644 --- a/app/views/layouts/notifier.html.erb +++ b/app/views/layouts/notifier.html.erb @@ -5,8 +5,10 @@ -
- + <%# having width=100% on the table and then only a fixed width on the middle cell gives us a max-width that works in Outlook %> + + +
+
@@ -34,6 +36,7 @@
diff --git a/app/views/notifier/_message_body.html.erb b/app/views/notifier/_message_body.html.erb index 485cd3c44..b71c5f994 100644 --- a/app/views/notifier/_message_body.html.erb +++ b/app/views/notifier/_message_body.html.erb @@ -1,6 +1,6 @@ - +
- -
+ <%= link_to( image_tag( attachments["avatar.png"].url, @@ -14,7 +14,7 @@ :target => "_blank" ) %> + <%= body %>