mirror of
https://github.com/discourse/discourse.git
synced 2025-04-01 16:57:24 +08:00
FEATURE: Add education text to new and unread pages when there are no results
This commit is contained in:
parent
f1486c7728
commit
0841cd2ba6
@ -145,6 +145,18 @@ var controllerOpts = {
|
|||||||
}
|
}
|
||||||
}.property('allLoaded', 'topics.length'),
|
}.property('allLoaded', 'topics.length'),
|
||||||
|
|
||||||
|
footerEducation: function() {
|
||||||
|
if (!this.get('allLoaded') || this.get('topics.length') > 0 || !Discourse.User.current()) { return; }
|
||||||
|
|
||||||
|
var split = this.get('filter').split('/');
|
||||||
|
|
||||||
|
if (split[0] !== 'new' && split[0] !== 'unread') { return; }
|
||||||
|
|
||||||
|
return I18n.t("topics.none.educate." + split[0], {
|
||||||
|
userPrefsUrl: Discourse.getURL("/users/") + (Discourse.User.currentProp("username_lower")) + "/preferences"
|
||||||
|
});
|
||||||
|
}.property('allLoaded', 'topics.length'),
|
||||||
|
|
||||||
loadMoreTopics: function() {
|
loadMoreTopics: function() {
|
||||||
return this.get('model').loadMore();
|
return this.get('model').loadMore();
|
||||||
}
|
}
|
||||||
|
@ -91,21 +91,27 @@
|
|||||||
<button class='btn dismiss-read' {{action resetNew}}>{{i18n topics.bulk.dismiss_new}}</button>
|
<button class='btn dismiss-read' {{action resetNew}}>{{i18n topics.bulk.dismiss_new}}</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<h3>
|
|
||||||
{{#if latest}}
|
{{#if latest}}
|
||||||
|
{{{footerEducation}}}
|
||||||
|
<h3>
|
||||||
{{footerMessage}}
|
{{footerMessage}}
|
||||||
{{#if can_create_topic}}<a href='#' {{action createTopic}}>{{i18n topic.suggest_create_topic}}</a>{{/if}}
|
{{#if can_create_topic}}<a href='#' {{action createTopic}}>{{i18n topic.suggest_create_topic}}</a>{{/if}}
|
||||||
|
</h3>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if top}}
|
{{#if top}}
|
||||||
|
<h3>
|
||||||
{{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}}
|
{{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}}
|
||||||
{{#unless yearly}}<a href="{{unbound showMoreYearlyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_year}}</a>{{/unless}}
|
{{#unless yearly}}<a href="{{unbound showMoreYearlyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_year}}</a>{{/unless}}
|
||||||
{{#unless monthly}}<a href="{{unbound showMoreMonthlyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_month}}</a>{{/unless}}
|
{{#unless monthly}}<a href="{{unbound showMoreMonthlyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_month}}</a>{{/unless}}
|
||||||
{{#unless weekly}}<a href="{{unbound showMoreWeeklyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_week}}</a>{{/unless}}
|
{{#unless weekly}}<a href="{{unbound showMoreWeeklyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_week}}</a>{{/unless}}
|
||||||
{{#unless daily}}<a href="{{unbound showMoreDailyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.today}}</a>{{/unless}}
|
{{#unless daily}}<a href="{{unbound showMoreDailyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.today}}</a>{{/unless}}
|
||||||
|
</h3>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
{{{footerEducation}}}
|
||||||
|
<h3>
|
||||||
{{footerMessage}}{{#link-to "discovery.categories"}} {{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}}
|
{{footerMessage}}{{#link-to "discovery.categories"}} {{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}}
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
</h3>
|
</h3>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -36,21 +36,28 @@
|
|||||||
{{#if showResetNew}}
|
{{#if showResetNew}}
|
||||||
<button class='btn dismiss-read' {{action resetNew}}>{{i18n topics.bulk.dismiss_new}}</button>
|
<button class='btn dismiss-read' {{action resetNew}}>{{i18n topics.bulk.dismiss_new}}</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<h3>
|
|
||||||
{{#if latest}}
|
{{#if latest}}
|
||||||
|
{{{footerEducation}}}
|
||||||
|
<h3>
|
||||||
{{footerMessage}}
|
{{footerMessage}}
|
||||||
{{#if can_create_topic}}<a href='#' {{action createTopic}}>{{i18n topic.suggest_create_topic}}</a>{{/if}}
|
{{#if can_create_topic}}<a href='#' {{action createTopic}}>{{i18n topic.suggest_create_topic}}</a>{{/if}}
|
||||||
|
</h3>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if top}}
|
{{#if top}}
|
||||||
|
<h3>
|
||||||
{{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}}
|
{{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}}
|
||||||
{{#unless yearly}}<a href="{{unbound showMoreYearlyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_year}}</a>{{/unless}}
|
{{#unless yearly}}<a href="{{unbound showMoreYearlyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_year}}</a>{{/unless}}
|
||||||
{{#unless monthly}}<a href="{{unbound showMoreMonthlyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_month}}</a>{{/unless}}
|
{{#unless monthly}}<a href="{{unbound showMoreMonthlyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_month}}</a>{{/unless}}
|
||||||
{{#unless weekly}}<a href="{{unbound showMoreWeeklyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_week}}</a>{{/unless}}
|
{{#unless weekly}}<a href="{{unbound showMoreWeeklyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.this_week}}</a>{{/unless}}
|
||||||
{{#unless daily}}<a href="{{unbound showMoreDailyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.today}}</a>{{/unless}}
|
{{#unless daily}}<a href="{{unbound showMoreDailyUrl}}" class='btn'><i class="fa fa-calendar-o"></i>{{i18n filters.top.today}}</a>{{/unless}}
|
||||||
|
</h3>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
{{{footerEducation}}}
|
||||||
|
<h3>
|
||||||
{{footerMessage}}{{#link-to "discovery.categories"}} {{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}}
|
{{footerMessage}}{{#link-to "discovery.categories"}} {{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}}
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
</h3>
|
</h3>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -769,6 +769,9 @@ en:
|
|||||||
hot: "There are no hot topics."
|
hot: "There are no hot topics."
|
||||||
category: "There are no {{category}} topics."
|
category: "There are no {{category}} topics."
|
||||||
top: "There are no top topics."
|
top: "There are no top topics."
|
||||||
|
educate:
|
||||||
|
new: '<p>Your <a href="%{userPrefsUrl}">preferences</a> define which topics are considered new.</p>'
|
||||||
|
unread: "<p>You have read all of the posts in the topics you are tracking or watching.</p>"
|
||||||
bottom:
|
bottom:
|
||||||
latest: "There are no more latest topics."
|
latest: "There are no more latest topics."
|
||||||
hot: "There are no more hot topics."
|
hot: "There are no more hot topics."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user