mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 03:29:31 +08:00
UX: Display message when user has no notifications instead of a blank page.
This commit is contained in:
parent
6684e4ab87
commit
2b651b20cf
|
@ -1,4 +1,4 @@
|
||||||
import { observes } from 'ember-addons/ember-computed-decorators';
|
import { default as computed, observes } from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
export default Ember.ArrayController.extend({
|
export default Ember.ArrayController.extend({
|
||||||
needs: ['application'],
|
needs: ['application'],
|
||||||
|
@ -8,6 +8,11 @@ export default Ember.ArrayController.extend({
|
||||||
this.set("controllers.application.showFooter", !this.get("model.canLoadMore"));
|
this.set("controllers.application.showFooter", !this.get("model.canLoadMore"));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@computed('model.content.length')
|
||||||
|
hasNotifications(length) {
|
||||||
|
return length > 0;
|
||||||
|
},
|
||||||
|
|
||||||
currentPath: Em.computed.alias('controllers.application.currentPath'),
|
currentPath: Em.computed.alias('controllers.application.currentPath'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -8,16 +8,9 @@
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class='notification-buttons'>
|
{{#if hasNotifications}}
|
||||||
<button title="{{i18n 'user.dismiss_notifications_tooltip'}}" id='dismiss-notifications-top' class='btn notifications-read' {{action "resetNew"}}>{{i18n 'user.dismiss_notifications'}}</button>
|
{{user-notifications-large notifications=model}}
|
||||||
</div>
|
{{conditional-loading-spinner condition=loading}}
|
||||||
|
{{else}}
|
||||||
{{user-notifications-large notifications=model}}
|
<div class='alert alert-info'>{{i18n 'notifications.empty'}}</div>
|
||||||
|
{{/if}}
|
||||||
{{#conditional-loading-spinner condition=loading}}
|
|
||||||
{{#unless model.canLoadMore}}
|
|
||||||
<div class='notification-buttons'>
|
|
||||||
<button title="{{i18n 'user.dismiss_notifications_tooltip'}}" id='dismiss-notifications' class='btn notifications-read' {{action "resetNew"}}>{{i18n 'user.dismiss_notifications'}}</button>
|
|
||||||
</div>
|
|
||||||
{{/unless}}
|
|
||||||
{{/conditional-loading-spinner}}
|
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
<section class='user-navigation'>
|
<section class='user-navigation'>
|
||||||
{{#mobile-nav class='notifications-nav' desktopClass='notification-list action-list nav-stacked' currentPath=currentPath}}
|
{{#mobile-nav class='notifications-nav' desktopClass='notification-list action-list nav-stacked' currentPath=currentPath}}
|
||||||
{{#if model}}
|
|
||||||
<li class='no-glyph'>
|
<li class='no-glyph'>
|
||||||
{{#link-to 'userNotifications.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
|
{{#link-to 'userNotifications.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
|
||||||
<li>
|
<li>
|
||||||
{{#link-to 'userNotifications.responses'}}
|
{{#link-to 'userNotifications.responses'}}
|
||||||
<i class="glyph fa fa-reply"></i>
|
<i class="glyph fa fa-reply"></i>
|
||||||
|
@ -18,7 +16,13 @@
|
||||||
</li>
|
</li>
|
||||||
<li>{{#link-to 'userNotifications.mentions'}}<i class="glyph fa fa-at"></i>{{i18n 'user_action_groups.7'}}{{/link-to}}</li>
|
<li>{{#link-to 'userNotifications.mentions'}}<i class="glyph fa fa-at"></i>{{i18n 'user_action_groups.7'}}{{/link-to}}</li>
|
||||||
<li>{{#link-to 'userNotifications.edits'}}<i class="glyph fa fa-pencil"></i>{{i18n 'user_action_groups.11'}}{{/link-to}}</li>
|
<li>{{#link-to 'userNotifications.edits'}}<i class="glyph fa fa-pencil"></i>{{i18n 'user_action_groups.11'}}{{/link-to}}</li>
|
||||||
{{/mobile-nav}}
|
{{/mobile-nav}}
|
||||||
|
|
||||||
|
{{#if model}}
|
||||||
|
<div class='notification-buttons'>
|
||||||
|
<button title="{{i18n 'user.dismiss_notifications_tooltip'}}" id='dismiss-notifications-top' class='btn notifications-read' {{action "resetNew"}}>{{i18n 'user.dismiss_notifications'}}</button>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class='user-right'>
|
<section class='user-right'>
|
||||||
|
|
|
@ -59,7 +59,6 @@
|
||||||
|
|
||||||
.notification-buttons {
|
.notification-buttons {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
text-align: right;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-navigation {
|
.user-navigation {
|
||||||
|
|
|
@ -681,9 +681,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-main .nav-stacked {
|
.user-main .nav-stacked {
|
||||||
&.notification-list {
|
|
||||||
padding-top: 40px;
|
|
||||||
}
|
|
||||||
&.activity-list {
|
&.activity-list {
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,6 +134,7 @@
|
||||||
.user-navigation {
|
.user-navigation {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
min-height: 20px;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
color: $primary;
|
color: $primary;
|
||||||
|
|
|
@ -1092,6 +1092,7 @@ en:
|
||||||
notifications:
|
notifications:
|
||||||
title: "notifications of @name mentions, replies to your posts and topics, messages, etc"
|
title: "notifications of @name mentions, replies to your posts and topics, messages, etc"
|
||||||
none: "Unable to load notifications at this time."
|
none: "Unable to load notifications at this time."
|
||||||
|
empty: "No notifications found."
|
||||||
more: "view older notifications"
|
more: "view older notifications"
|
||||||
total_flagged: "total flagged posts"
|
total_flagged: "total flagged posts"
|
||||||
mentioned: "<i title='mentioned' class='fa fa-at'></i><p><span>{{username}}</span> {{description}}</p>"
|
mentioned: "<i title='mentioned' class='fa fa-at'></i><p><span>{{username}}</span> {{description}}</p>"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user