mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 18:02:46 +08:00
FIX: correct template for search in post (regression)
This commit is contained in:
parent
870fd70525
commit
d4f08f442c
|
@ -91,12 +91,15 @@ export default Em.Controller.extend(Discourse.Presence, {
|
|||
if(results[name].length > 0) {
|
||||
results.resultTypes.push({
|
||||
results: results[name],
|
||||
displayType: (context && Em.get(context, 'type') === 'topic' && type === 'topic') ? 'post' : type,
|
||||
type: type,
|
||||
more: r['more_' + name]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
results.displayType = self.get('searchContext') === 'topic' ? 'post' : results.type;
|
||||
|
||||
var noResults = urls.length === 0;
|
||||
self.setProperties({ noResults: noResults,
|
||||
resultCount: urls.length,
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
</li>
|
||||
{{view 'search-results-type' type=resultType.type content=resultType.results}}
|
||||
{{view 'search-results-type' type=resultType.type displayType=resultType.displayType content=resultType.results}}
|
||||
</ul>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<a class='search-link' href='{{unbound url}}'>
|
||||
<span class='topic'>
|
||||
{{i18n search.post_format post_number=post_number username=username}}
|
||||
</span>
|
||||
{{#unless Discourse.Mobile.mobileView}}
|
||||
<span class='blurb'>
|
||||
{{{unbound blurb}}}
|
||||
</span>
|
||||
{{/unless}}
|
||||
</a>
|
|
@ -3,6 +3,6 @@ export default Ember.CollectionView.extend({
|
|||
itemViewClass: Discourse.GroupedView.extend({
|
||||
tagName: 'li',
|
||||
classNameBindings: ['selected'],
|
||||
templateName: Discourse.computed.fmt('parentView.type', "search/%@_result")
|
||||
templateName: Discourse.computed.fmt('parentView.displayType', "search/%@_result")
|
||||
})
|
||||
});
|
||||
|
|
|
@ -732,6 +732,7 @@ en:
|
|||
title: "search topics, posts, users, or categories"
|
||||
no_results: "No results found."
|
||||
searching: "Searching ..."
|
||||
post_format: "#{{post_number}} by {{username}}"
|
||||
|
||||
context:
|
||||
user: "Search posts by @{{username}}"
|
||||
|
|
Loading…
Reference in New Issue
Block a user