Link embeded topic to second post. They've already read the first.
This commit is contained in:
parent
15faa01178
commit
01be681a95
|
@ -11,6 +11,7 @@ class EmbedController < ApplicationController
|
|||
|
||||
if topic_id
|
||||
@topic_view = TopicView.new(topic_id, current_user, {best: 5})
|
||||
@second_post_url = "#{@topic_view.topic.url}/2"
|
||||
else
|
||||
Jobs.enqueue(:retrieve_topic, user_id: current_user.try(:id), embed_url: embed_url)
|
||||
render 'loading'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<header>
|
||||
<%- if @topic_view.posts.present? %>
|
||||
<%= link_to(I18n.t('embed.title'), @topic_view.topic.url, class: 'button', target: '_blank') %>
|
||||
<%= link_to(I18n.t('embed.title'), @second_post_url, class: 'button', target: '_blank') %>
|
||||
<%- else %>
|
||||
<%= link_to(I18n.t('embed.start_discussion'), @topic_view.topic.url, class: 'button', target: '_blank') %>
|
||||
<%- end if %>
|
||||
|
@ -22,7 +22,7 @@
|
|||
<%- end %>
|
||||
|
||||
<footer>
|
||||
<%= link_to(I18n.t('embed.continue'), @topic_view.topic.url, class: 'button', target: '_blank') %>
|
||||
<%= link_to(I18n.t('embed.continue'), @second_post_url, class: 'button', target: '_blank') %>
|
||||
<%= link_to(image_tag(SiteSetting.logo_url, class: 'logo'), Discourse.base_url, target: '_blank') %>
|
||||
</footer>
|
||||
|
||||
|
|
Loading…
Reference in New Issue