FIX: Don't reload a topic when clicking the first post search result

This commit is contained in:
Robin Ward 2015-06-30 14:14:45 -04:00
parent 0ff25a379c
commit 951d6ac28f
2 changed files with 8 additions and 1 deletions

View File

@ -50,6 +50,12 @@ const Post = RestModel.extend({
return Discourse.Utilities.postUrl(this.get('topic.slug') || this.get('topic_slug'), this.get('topic_id'), this.get('post_number'));
}.property('post_number', 'topic_id', 'topic.slug'),
// Don't drop the /1
urlWithNumber: function() {
const url = this.get('url');
return (this.get('post_number') === 1) ? url + "/1" : url;
}.property('post_number', 'url'),
usernameUrl: Discourse.computed.url('username', '/users/%@'),
showUserReplyTab: function() {

View File

@ -1,5 +1,6 @@
{{#each results as |result|}}
<a class='search-link' href='{{unbound result.url}}'>
{{log result}}
<a class='search-link' href='{{unbound result.urlWithNumber}}'>
<span class='topic'>
{{i18n 'search.post_format' post_number=result.post_number username=result.username}}
</span>