Change text at the bottom of embedded comments to be (x more replies)

This commit is contained in:
Robin Ward 2014-01-03 14:55:37 -05:00
parent c762e3c4b1
commit 25caec0e62
3 changed files with 12 additions and 2 deletions

View File

@ -12,6 +12,10 @@ class EmbedController < ApplicationController
if topic_id
@topic_view = TopicView.new(topic_id, current_user, limit: SiteSetting.embed_post_limit, exclude_first: true)
@second_post_url = "#{@topic_view.topic.url}/2" if @topic_view
@posts_left = 0
if @topic_view && @topic_view.posts.size == SiteSetting.embed_post_limit
@posts_left = @topic_view.topic.posts_count - SiteSetting.embed_post_limit
end
else
Jobs.enqueue(:retrieve_topic, user_id: current_user.try(:id), embed_url: embed_url)
render 'loading'

View File

@ -39,8 +39,10 @@
<%- end %>
<footer>
<%= link_to(I18n.t('embed.continue'), @topic_view.topic.last_post_url, class: 'button', target: '_blank') %>
<span class='replies'><%= I18n.t('embed.replies', count: @topic_view.topic.posts_count) %></span>
<%= link_to(I18n.t('embed.continue'), @topic_view.posts.last.url, class: 'button', target: '_blank') %>
<%- if @posts_left > 0 %>
<span class='replies'><%= I18n.t('embed.more_replies', count: @posts_left) %></span>
<%- end %>
<%= link_to(image_tag(SiteSetting.logo_url, class: 'logo'), Discourse.base_url, target: '_blank') %>
</footer>

View File

@ -32,6 +32,10 @@ en:
embed:
start_discussion: "Begin the Discussion"
continue: "Continue the Discussion"
more_replies:
one: "1 more reply"
other: "%{count} more replies"
loading: "Loading Discussion..."
permalink: "Permalink"
imported_from: "Imported from: %{link}"