UX: display correct replies count in embedded comments view. (#14175)

Previosuly, the reply count included the "small_action" posts too. It also caused the broken embed HTML issue.
This commit is contained in:
Vinoth Kannan
2021-08-30 10:37:53 +05:30
committed by GitHub
parent 55b22af3b6
commit 465774cf2c
4 changed files with 19 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
<header class='discourse' data-embed-state='loaded'>
<% if @topic_view.topic.posts_count < 2 %>
<% if @reply_count < 1 %>
<%= link_to(I18n.t('embed.start_discussion'), @topic_view.topic.url, class: 'button', target: '_blank') %>
<% elsif @topic_view.topic.posts_count > 10 %>
<% elsif @reply_count >= 10 %>
<%= link_to(I18n.t('embed.continue'), @second_post_url, class: 'button', target: '_blank') %>
<% end %>
<span class='replies'><%= I18n.t('embed.replies', count: @reply_count) %></span>