mirror of
https://github.com/discourse/discourse.git
synced 2025-04-27 09:24:31 +08:00
UX: show '{count}+' when not sure about exact search count
This commit is contained in:
parent
27a368bb70
commit
89d1107f81
@ -151,6 +151,12 @@ export default Ember.Controller.extend({
|
|||||||
this.set("application.showFooter", !this.get("loading"));
|
this.set("application.showFooter", !this.get("loading"));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@computed('resultCount', 'noSortQ')
|
||||||
|
resultCountLabel(count, term) {
|
||||||
|
const plus = (count % 50 === 0 ? "+" : "");
|
||||||
|
return I18n.t('search.result_count', {count, plus, term});
|
||||||
|
},
|
||||||
|
|
||||||
@observes('model.posts.length')
|
@observes('model.posts.length')
|
||||||
resultCountChanged() {
|
resultCountChanged() {
|
||||||
this.set("resultCount", this.get("model.posts.length"));
|
this.set("resultCount", this.get("model.posts.length"));
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
<div class='search-title clearfix'>
|
<div class='search-title clearfix'>
|
||||||
<div class='result-count'>
|
<div class='result-count'>
|
||||||
<span>
|
<span>
|
||||||
{{{i18n "search.result_count" count=resultCount term=noSortQ}}}
|
{{{resultCountLabel}}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='sort-by'>
|
<div class='sort-by'>
|
||||||
|
@ -1381,7 +1381,7 @@ en:
|
|||||||
too_short: "Your search term is too short."
|
too_short: "Your search term is too short."
|
||||||
result_count:
|
result_count:
|
||||||
one: "1 result for <span class='term'>{{term}}</span>"
|
one: "1 result for <span class='term'>{{term}}</span>"
|
||||||
other: "{{count}} results for <span class='term'>{{term}}</span>"
|
other: "{{count}}{{plus}} results for <span class='term'>{{term}}</span>"
|
||||||
title: "search topics, posts, users, or categories"
|
title: "search topics, posts, users, or categories"
|
||||||
no_results: "No results found."
|
no_results: "No results found."
|
||||||
no_more_results: "No more results found."
|
no_more_results: "No more results found."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user