From de9cac04064d4ad36db533b320d040ac57e43f9f Mon Sep 17 00:00:00 2001 From: verg Date: Thu, 13 Feb 2014 14:43:07 -0500 Subject: [PATCH] Add Private Message count to User Dropdown --- .../discourse/templates/user_dropdown.js.handlebars | 6 +++++- app/assets/stylesheets/desktop/header.scss | 2 +- app/assets/stylesheets/mobile/header.scss | 2 +- config/locales/client.en.yml | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/user_dropdown.js.handlebars b/app/assets/javascripts/discourse/templates/user_dropdown.js.handlebars index 4791a2f5d..b68c80523 100644 --- a/app/assets/javascripts/discourse/templates/user_dropdown.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user_dropdown.js.handlebars @@ -4,7 +4,11 @@ {{#if showAdminLinks}}
  • {{#link-to 'adminUser' currentUser.username }}{{i18n admin_title}}{{/link-to}}
  • {{/if}} -
  • {{#link-to 'userPrivateMessages.index' currentUser}}{{i18n user.private_messages}}{{/link-to}}
  • +
  • + {{#link-to 'userPrivateMessages.index' currentUser class='user-messages-link'}} + {{i18n user.unread_message_count count=currentUser.unread_private_messages}} + {{/link-to}} +
  • {{#link-to 'preferences' currentUser}}{{i18n user.preferences}}{{/link-to}}
  • diff --git a/app/assets/stylesheets/desktop/header.scss b/app/assets/stylesheets/desktop/header.scss index 7cdd0fde4..b0b241c49 100644 --- a/app/assets/stylesheets/desktop/header.scss +++ b/app/assets/stylesheets/desktop/header.scss @@ -239,7 +239,7 @@ } &#user-dropdown { - width: 154px; + width: 155px; } .btn { diff --git a/app/assets/stylesheets/mobile/header.scss b/app/assets/stylesheets/mobile/header.scss index 791625111..b585efb34 100644 --- a/app/assets/stylesheets/mobile/header.scss +++ b/app/assets/stylesheets/mobile/header.scss @@ -241,7 +241,7 @@ } &#user-dropdown { - width: 154px; + width: 155px; } .btn { diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 221f0a813..4f6bc3d5a 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -256,6 +256,10 @@ en: delete_account_confirm: "Are you sure you want to permanently delete your account? This action cannot be undone!" deleted_yourself: "Your account has been deleted successfully." delete_yourself_not_allowed: "You cannot delete your account right now. Contact an admin to do delete your account for you." + unread_message_count: + one: "Messages (1)" + other: "Messages ({{count}})" + zero: "Messages" messages: all: "All"