FEATURE: on mobile display a rollup of unread and new on latest

This commit is contained in:
Sam 2015-06-23 12:45:41 +10:00
parent 13f1f90c67
commit f101408d03
3 changed files with 18 additions and 2 deletions

View File

@ -12,7 +12,13 @@ Discourse.NavItem = Discourse.Model.extend({
displayName: function() { displayName: function() {
var categoryName = this.get('categoryName'), var categoryName = this.get('categoryName'),
name = this.get('name'), 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) { if (categoryName) {
name = 'category'; name = 'category';

View File

@ -266,6 +266,12 @@ const TopicTrackingState = Discourse.Model.extend({
}, },
lookupCount(name, category){ lookupCount(name, category){
if (name === "latest") {
return this.lookupCount("new", category) +
this.lookupCount("unread", category);
}
let categoryName = category ? Em.get(category, "name") : null; let categoryName = category ? Em.get(category, "name") : null;
if(name === "new") { if(name === "new") {
return this.countNew(categoryName); return this.countNew(categoryName);
@ -278,6 +284,7 @@ const TopicTrackingState = Discourse.Model.extend({
} }
} }
}, },
loadStates(data) { loadStates(data) {
// not exposed // not exposed
const states = this.states; const states = this.states;

View File

@ -1567,7 +1567,10 @@ en:
with_topics: "%{filter} topics" with_topics: "%{filter} topics"
with_category: "%{filter} %{category} topics" with_category: "%{filter} %{category} topics"
latest: latest:
title: "Latest" title:
zero: "Latest"
one: "Latest (1)"
other: "Latest ({{count}})"
help: "topics with recent posts" help: "topics with recent posts"
hot: hot:
title: "Hot" title: "Hot"