Skip to content

Commit

Permalink
FIX: local post onebox was always pointing to 1st post
Browse files Browse the repository at this point in the history
  • Loading branch information
ZogStriP committed Feb 26, 2018
1 parent ac70169 commit 3be0294
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/onebox/templates/discourse_topic_onebox.hbs
@@ -1,4 +1,4 @@
<aside class='quote' data-post="1" data-topic="{{topic_id}}">
<aside class='quote' data-post="{{post_number}}" data-topic="{{topic_id}}">
<div class='title'>
<div class='quote-controls'></div>
{{{avatar}}}
Expand Down
1 change: 1 addition & 0 deletions lib/oneboxer.rb
Expand Up @@ -202,6 +202,7 @@ def self.local_topic_html(url, route, opts)
else
args = {
topic_id: topic.id,
post_number: post.post_number,
avatar: PrettyText.avatar_img(post.user.avatar_template, "tiny"),
original_url: url,
title: PrettyText.unescape_emoji(CGI::escapeHTML(topic.title)),
Expand Down
1 change: 1 addition & 0 deletions spec/components/oneboxer_spec.rb
Expand Up @@ -54,6 +54,7 @@ def preview(url, user = nil, category = nil, topic = nil)

onebox = preview(public_reply.url, user, public_category)
expect(onebox).to include(public_reply.excerpt)
expect(onebox).to include(%{data-post="2"})
expect(onebox).to include(PrettyText.avatar_img(replier.avatar_template, "tiny"))

onebox = preview(public_reply.url, user, public_category, public_topic)
Expand Down

1 comment on commit 3be0294

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/also-referenced-in-links/81519/6

Please sign in to comment.