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"));
|
||||
},
|
||||
|
||||
@computed('resultCount', 'noSortQ')
|
||||
resultCountLabel(count, term) {
|
||||
const plus = (count % 50 === 0 ? "+" : "");
|
||||
return I18n.t('search.result_count', {count, plus, term});
|
||||
},
|
||||
|
||||
@observes('model.posts.length')
|
||||
resultCountChanged() {
|
||||
this.set("resultCount", this.get("model.posts.length"));
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<div class='search-title clearfix'>
|
||||
<div class='result-count'>
|
||||
<span>
|
||||
{{{i18n "search.result_count" count=resultCount term=noSortQ}}}
|
||||
{{{resultCountLabel}}}
|
||||
</span>
|
||||
</div>
|
||||
<div class='sort-by'>
|
||||
|
|
|
@ -1381,7 +1381,7 @@ en:
|
|||
too_short: "Your search term is too short."
|
||||
result_count:
|
||||
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"
|
||||
no_results: "No results found."
|
||||
no_more_results: "No more results found."
|
||||
|
|
Loading…
Reference in New Issue