From 01be681a95e3d3d4d57d8fd284cbbd6a37e8de0b Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 2 Jan 2014 11:59:20 -0500 Subject: [PATCH] Link embeded topic to second post. They've already read the first. --- app/controllers/embed_controller.rb | 1 + app/views/embed/best.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/embed_controller.rb b/app/controllers/embed_controller.rb index 260c0076de3..be4ef56a8dd 100644 --- a/app/controllers/embed_controller.rb +++ b/app/controllers/embed_controller.rb @@ -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' diff --git a/app/views/embed/best.html.erb b/app/views/embed/best.html.erb index 6b8f38de3a6..162a3aeeed2 100644 --- a/app/views/embed/best.html.erb +++ b/app/views/embed/best.html.erb @@ -1,6 +1,6 @@
<%- 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 %>