]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/layouts/notifier.html.erb
Fix styling of email notifications in RTL languages
[rails.git] / app / views / layouts / notifier.html.erb
index 883f1b385acaeaa73fab4a3bebcd8723ebe16532..a5a8420f0fc25ab543259978e45dc57cae8f3e31 100644 (file)
@@ -1,4 +1,4 @@
-<html>
+<html lang="<%= I18n.locale %>" dir="<%= I18n.t("html.dir") %>">
   <head>
     <meta charset="UTF-8"></meta>
   </head>
@@ -8,18 +8,18 @@
         <%# 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 %>
         <td rowspan="2"></td>
         <td width="600" style="text-align: center; padding: 0px 7px">
-          <table style="width: 100%; color: #222; margin-left: auto; margin-right: auto">
+          <table style="width: 100%; color: #222; margin-<%= style_left %>: auto; margin-<%= style_right %>: auto">
             <tr>
               <td style="width: 30px; padding: 10px 10px 10px 0px">
                 <a href="<%= @root_url %>" target="_blank">
-                  <%= image_tag attachments["logo.png"].url, alt: "OpenStreetMap", title: "OpenStreetMap", height: "30", width: "30", border: "0" %>
+                  <%= image_tag attachments["logo.png"].url, :alt => "OpenStreetMap", :title => "OpenStreetMap", :height => "30", :width => "30", :border => "0" %>
                 </a>
               </td>
               <%# the "width: 100%" here looks wrong, but I couldn't find a better way of making Outlook give this cell full width %>
-              <td style="width: 100%; padding: 0px; text-align: left">
+              <td style="width: 100%; padding: 0px; text-align: <%= style_left %>">
                 <%# NB we need "text-decoration: none" twice: GMail only honours it on the <a> but Outlook only on the <strong> %>
                 <a href="<%= @root_url %>" target="_blank" style="text-decoration: none; color: #000">
-                  <strong style="text-decoration: none; font-size: 18px; font-weight: 600; margin: 0; text-align: left; font-family: 'Helvetica Neue', Arial, sans-serif">OpenStreetMap</strong>
+                  <strong style="text-decoration: none; font-size: 18px; font-weight: 600; margin: 0; text-align: <%= style_left %>; font-family: 'Helvetica Neue', Arial, sans-serif">OpenStreetMap</strong>
                 </a>
               </td>
             </tr>
@@ -27,7 +27,7 @@
               <td colspan="2">
                 <table style="background-color: #fff; color: #222; border: solid 1px #ccc; border-collapse: separate">
                   <tr>
-                    <td style="text-align: left; padding: 0px 15px 5px 15px">
+                    <td style="text-align: <%= style_left %>; padding: 0px 15px 5px 15px">
                       <%= raw style_message(yield) %>
                     </td>
                   </tr>