<%- 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] -%>
<%=t 'user_notifications.digest.popular_topics' %>
<% @popular_topics.each_with_index do |t, i| %>

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

<%= short_date(t.created_at) %>

<%= 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 %>
<%- if show_image_with_url(t.image_url) && t.featured_link.nil? -%> <%- end -%>
<% if t.user %> <% if SiteSetting.enable_names? && t.user.name.present? && t.user.name.downcase != t.user.username.downcase %>
<%= t.user.name -%>
<% end %>

<%= t.user.username -%>

<% end %>
<%- if t.first_post.present? && !t.first_post.user_deleted %>
<%= email_excerpt(t.first_post.cooked) %>
<%- end %>

<%= t.like_count -%>

<%= t.posts_count - 1 -%>

<% t.posters_summary.each do |ps| %> <% if ps.user %> <% end %> <% end %> <%=t 'user_notifications.digest.join_the_discussion' %>
 
<% if i < 5 %> <%= digest_custom_html("below_post_#{i+1}") %> <% end %> <% end %>
 
<% if @popular_posts.present? %>

<%=t 'user_notifications.digest.popular_posts' %>

  <% @popular_posts.each do |post| %>
<%= email_excerpt(post.cooked) %>
<% if post.user %> <% if SiteSetting.enable_names? && post.user.name && post.user.name.downcase != post.user.username.downcase %>
<%= post.user.name -%>
<% end %>

<%= post.user.username -%>

<% end %>

<%=t 'user_notifications.digest.from_topic_label' %> <%= post.topic.title.truncate(60, separator: /\s/) -%>

<%=t 'user_notifications.digest.join_the_discussion' %>
 
<% 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 %>

<%= t.user_data ? (t.highest_post_number - (t.user_data.last_read_post_number || 0)) : t.highest_post_number %>

<%= 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.posts_count - 1 -%>

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