From 4d62f41fbca5f5de2eec3b2dff416a26dd9c70af Mon Sep 17 00:00:00 2001 From: hosnas Date: Fri, 16 Jun 2017 15:20:20 +0430 Subject: [PATCH] RTL digest emails Allows RTL digest emails. For this to work, I have done the following major additions: 1- adding appropriate direction to body and tables 2- making text-direction compatible with rtl 3- making float, padding, and margin tags compatible with rtl --- app/views/user_notifications/digest.html.erb | 119 ++++++++++--------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb index 44c83df06c8..4c93936cc45 100644 --- a/app/views/user_notifications/digest.html.erb +++ b/app/views/user_notifications/digest.html.erb @@ -6,7 +6,8 @@ - + + - +
- -
+

<%= category_badge(t.category, inline_style: true, absolute_url: true) %>

+

<%= short_date(t.created_at) %>

@@ -118,10 +119,10 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
- +
-
+

<%= gsub_emoji_to_unicode(t.title.truncate(60, separator: /\s/)) -%> @@ -135,13 +136,13 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo

- +
- - <%- if show_image_with_url(t.image_url) && t.featured_link.nil? && !(@excerpts[t.first_post&.id]||"").include?(t.image_url) -%> - <%- end -%> @@ -159,10 +160,10 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
+ + <% if t.user %> <% if SiteSetting.enable_names? && t.user.name.present? && t.user.name.downcase != t.user.username.downcase %>
<%= t.user.name -%>
@@ -150,8 +151,8 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo <% end %>
- + +
<%- if t.first_post.present? && !t.first_post.user_deleted %> - +
- @@ -170,25 +171,25 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
+ <%= @excerpts[t.first_post.id] %>
<%- end %> - +
- - - -
- -

<%= t.like_count -%>

+
+ +

<%= t.like_count -%>

- -

<%= t.posts_count - 1 -%>

+
+ +

<%= t.posts_count - 1 -%>

+ <% t.posters_summary.each do |ps| %> <% if ps.user %> <% end %> <% end %> + <%=t 'user_notifications.digest.join_the_discussion' %> @@ -197,7 +198,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
- +
 
@@ -217,7 +218,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
- +
@@ -235,38 +236,38 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo <%=t 'user_notifications.digest.popular_posts' %> -
 
+
-
  + <% @popular_posts.each do |post| %> - +
-
+ <%= email_excerpt(post.cooked) %>
- +
-
+
- +
- -
+ @@ -277,9 +278,9 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo

<%= post.user.username -%>

<% end %>
-

- <%= gsub_emoji_to_unicode(post.topic.title.truncate(60, separator: /\s/)) -%> +

+

+ <%= gsub_emoji_to_unicode(post.topic.title.truncate(60, separator: /\s/)) -%>

<%=t 'user_notifications.digest.join_the_discussion' %> @@ -290,8 +291,8 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
- - +
 
+
 
@@ -311,43 +312,43 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo <% if @other_new_for_you.present? %>
<%=t 'user_notifications.digest.more_new' %>
- +
  - +
<% @other_new_for_you.each do |t| %> - - - - @@ -415,7 +416,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo <%= digest_custom_html("above_footer") %> -
+ <%= gsub_emoji_to_unicode(t.title.truncate(60, separator: /\s/)) -%> <%- if SiteSetting.show_topic_featured_link_in_digest && t.featured_link %> <%= raw topic_featured_link_domain(t.featured_link) %> <%- end %> -

+

<%= category_badge(t.category, inline_style: true, absolute_url: true) %>

+ <% t.posters_summary[0,2].each do |ps| %> <% if ps.user %> - + <% end %> <% end %> - -

<%= t.like_count -%>

+
+ +

<%= t.like_count -%>

- -

<%= t.posts_count - 1 -%>

+
+ +

<%= t.posts_count - 1 -%>