From a5fbdba9d46232922f299ba18806b368d6c1da2b Mon Sep 17 00:00:00 2001 From: Kris Date: Mon, 3 Oct 2022 11:55:50 -0400 Subject: [PATCH] UX: add max-width to digest email, format erb (#18445) --- app/views/user_notifications/digest.html.erb | 752 +++++++++---------- 1 file changed, 370 insertions(+), 382 deletions(-) diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb index e7750ecbdda..b55ee1976ad 100644 --- a/app/views/user_notifications/digest.html.erb +++ b/app/views/user_notifications/digest.html.erb @@ -1,404 +1,392 @@
- - - -<%- if I18n.t('user_notifications.digest.custom.html.header').present? %> - + +
- - -
- <%= raw(t 'user_notifications.digest.custom.html.header') %> -
-<%- else %> - - - - -
- - - <%- if logo_url.blank? %> - <%= SiteSetting.title %> - <%- else %> - <%= SiteSetting.title %> - <%- end %> - - -
-<%- end %> - - - - - - -
-
- - + + - - - -
+ <%- if I18n.t('user_notifications.digest.custom.html.header').present? %> + - + + + - -
  + <%= raw(t 'user_notifications.digest.custom.html.header') %> +
- -
- - +
+ <%- else %> + + + + + + +
+ + <%- if logo_url.blank? %> + <%= SiteSetting.title %> + <%- else %> + <%= SiteSetting.title %> + <%- end %> + +
+ <%- end %> + - + + - -
+ +
+ + + + + + +
 
+
+
+ + + + + + +
+
+
<%=t 'user_notifications.digest.since_last_visit' %>
+ + + + <%- @counts.each do |count| -%> + + <%- end -%> + + + <%- @counts.each do |count| -%> + + <%- end -%> + + +
+ <%= count[:value] -%> +
+ <%=t count[:label_key] -%> +
+ +
+ + + + + + +
+
+ +
+ + + + + + +
 
+
- - - - - - -
-
- -
- - - - - -
 
-
-
+ <% if @popular_posts.present? %> + + + + + + + + +
  -<% if @popular_posts.present? %> + <% @popular_posts.each do |post| %> - + + + + + + + +
+ <%= email_excerpt(post.cooked, post) %> +
- - - - - - - -
  + + + + + + +
+
+
-<% @popular_posts.each do |post| %> + + + + + + + + + - - - - - - - -
- <%= email_excerpt(post.cooked, post) %> -
+
+ + +
 
+
+ - - - - - - -
-
-
+ <% end %> - - - - - + + + <% end %> -
-

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

- - <%=t 'user_notifications.digest.join_the_discussion' %> - -
-
- - + <%= digest_custom_html("above_popular_topics") %> + + <% if @other_new_for_you.present? %> + +
<%=t 'user_notifications.digest.more_new' %>
+ +
 
+ + + + + +
  + + + + + <% @other_new_for_you.each do |t| %> + + + + + + + + + + + + <% end %> + + +
+ + <%= gsub_emoji_to_unicode(t.title.truncate(100, 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) %> +

+
+ likes +

<%= t.like_count -%>

+
+ replies +

<%= t.posts_count - 1 -%>

+
 
+ +
 
+ + <% end %> + + <%= digest_custom_html("below_popular_topics") %> + + + + <%= digest_custom_html("above_footer") %> + + + + + + + + + + <%= digest_custom_html("below_footer") %> +
- - -<% end %> - -
 
- -<% end %> - - -<%= digest_custom_html("above_popular_topics") %> - -<% if @other_new_for_you.present? %> -
<%=t 'user_notifications.digest.more_new' %>
- - - - - - - -
  - - - - -<% @other_new_for_you.each do |t| %> - - - - - - - - - - - -<% end %> - - -
- - <%= gsub_emoji_to_unicode(t.title.truncate(100, 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) %> -

-
- likes -

<%= t.like_count -%>

-
- replies -

<%= t.posts_count - 1 -%>

-
 
- -
 
- -<% end %> - -<%= digest_custom_html("below_popular_topics") %> - - - -   - - - - - -<%= digest_custom_html("above_footer") %> - - - - - - - -<%= digest_custom_html("below_footer") %> - -