From 29b72aa2965a2b1b0be8e5357e18788715e62310 Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 10 Dec 2015 11:17:33 -0300 Subject: [PATCH] [notifications] Added no-notifications message #1126 --- lib/notifications-page/template.jade | 42 +++++++++++++++------------- lib/translations/lib/en.json | 1 + lib/translations/lib/es.json | 1 + 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/lib/notifications-page/template.jade b/lib/notifications-page/template.jade index 14a08f0c6e..3efe85bc8c 100644 --- a/lib/notifications-page/template.jade +++ b/lib/notifications-page/template.jade @@ -34,22 +34,26 @@ mixin message (notification) .notifications-page h1=t('notifications.title') table.table.table-hover - - each notification in notifications - - var glyphicon = '' - case notification.type - when 'reply' - - glyphicon = 'glyphicon-comment' - when 'topic' - - glyphicon = 'glyphicon-exclamation-sign' - when 'upvote' - - glyphicon = 'glyphicon-chevron-up' - when 'downvote' - - glyphicon = 'glyphicon-chevron-down' - tr(data-url=notification.url) - td.text-center - i.glyphicon(class=glyphicon) - td(colspan=notification.relatedUser ? 1 : 2) - +message(notification) - p.small.ago(data-time=notification.createdAt.toString()) - - if (notification.relatedUser) - td: img(src=notification.relatedUser.avatar) + - if (notifications.length) + - each notification in notifications + - var glyphicon = '' + case notification.type + when 'reply' + - glyphicon = 'glyphicon-comment' + when 'topic' + - glyphicon = 'glyphicon-exclamation-sign' + when 'upvote' + - glyphicon = 'glyphicon-chevron-up' + when 'downvote' + - glyphicon = 'glyphicon-chevron-down' + tr(data-url=notification.url) + td.text-center + i.glyphicon(class=glyphicon) + td(colspan=notification.relatedUser ? 1 : 2) + +message(notification) + p.small.ago(data-time=notification.createdAt.toString()) + - if (notification.relatedUser) + td: img(src=notification.relatedUser.avatar) + - else + .notifications-empty + p=t('notifications.empty') diff --git a/lib/translations/lib/en.json b/lib/translations/lib/en.json index 9fcd0b2cc6..7d3e726f8c 100644 --- a/lib/translations/lib/en.json +++ b/lib/translations/lib/en.json @@ -217,6 +217,7 @@ "notifications.upvote.verb": "upvoted your comment", "notifications.downvote.verb": "downvoted your comment", "notifications.on": "on", + "notifications.empty": "You don't have notifications", "password": "Password", "password.new": "New Password", "password.repeat": "Repeat Password", diff --git a/lib/translations/lib/es.json b/lib/translations/lib/es.json index 1c4cefd719..4611ffc83d 100644 --- a/lib/translations/lib/es.json +++ b/lib/translations/lib/es.json @@ -216,6 +216,7 @@ "notifications.upvote.verb": "votó a favor tu argumento", "notifications.downvote.verb": "votó en contra tu argumento", "notifications.on": "en", + "notifications.empty": "No hay notificaciones", "password": "Contraseña", "password.new": "Nueva contraseña", "password.repeat": "Repetir contraseña",