mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FEATURE: on mobile display a rollup of unread and new on latest
This commit is contained in:
parent
13f1f90c67
commit
f101408d03
3 changed files with 18 additions and 2 deletions
|
@ -12,7 +12,13 @@ Discourse.NavItem = Discourse.Model.extend({
|
|||
displayName: function() {
|
||||
var categoryName = this.get('categoryName'),
|
||||
name = this.get('name'),
|
||||
extra = { count: this.get('count') || 0 };
|
||||
count = this.get('count') || 0;
|
||||
|
||||
if (name === 'latest' && !Discourse.Mobile.mobileView) {
|
||||
count = 0;
|
||||
}
|
||||
|
||||
var extra = { count: count };
|
||||
|
||||
if (categoryName) {
|
||||
name = 'category';
|
||||
|
|
|
@ -266,6 +266,12 @@ const TopicTrackingState = Discourse.Model.extend({
|
|||
},
|
||||
|
||||
lookupCount(name, category){
|
||||
|
||||
if (name === "latest") {
|
||||
return this.lookupCount("new", category) +
|
||||
this.lookupCount("unread", category);
|
||||
}
|
||||
|
||||
let categoryName = category ? Em.get(category, "name") : null;
|
||||
if(name === "new") {
|
||||
return this.countNew(categoryName);
|
||||
|
@ -278,6 +284,7 @@ const TopicTrackingState = Discourse.Model.extend({
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
loadStates(data) {
|
||||
// not exposed
|
||||
const states = this.states;
|
||||
|
|
|
@ -1567,7 +1567,10 @@ en:
|
|||
with_topics: "%{filter} topics"
|
||||
with_category: "%{filter} %{category} topics"
|
||||
latest:
|
||||
title: "Latest"
|
||||
title:
|
||||
zero: "Latest"
|
||||
one: "Latest (1)"
|
||||
other: "Latest ({{count}})"
|
||||
help: "topics with recent posts"
|
||||
hot:
|
||||
title: "Hot"
|
||||
|
|
Loading…
Reference in a new issue