From 8367326e769312a9c2ada15c000cae11fe42c889 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 10 Jul 2013 16:35:06 +1000 Subject: [PATCH] glyphs on the user stream, rename responses to replies --- .../views/user/activity_filter_view.js | 43 ++++++++++++++++--- .../stylesheets/components/navs.css.scss | 7 ++- config/locales/client.en.yml | 2 +- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/views/user/activity_filter_view.js b/app/assets/javascripts/discourse/views/user/activity_filter_view.js index 87b1a98750f..d64cee80ac6 100644 --- a/app/assets/javascripts/discourse/views/user/activity_filter_view.js +++ b/app/assets/javascripts/discourse/views/user/activity_filter_view.js @@ -26,21 +26,54 @@ Discourse.ActivityFilterView = Discourse.View.extend({ }.property('stream.filter', 'content.action_type'), render: function(buffer) { - var content = this.get('content'); + var content = this.get("content"); var count, description; if (content) { - count = Em.get(content, 'count'); - description = Em.get(content, 'description'); + count = Em.get(content, "count"); + description = Em.get(content, "description"); } else { - count = this.get('count'); + count = this.get("count"); description = I18n.t("user.filters.all"); } buffer.push("" + description + - " (" + count + ")"); + " (" + count + ")"); + + var icon = this.get('icon'); + if(icon) { + buffer.push(""); + } + + buffer.push(""); + }, + icon: function(){ + var action_type = parseInt(this.get("content.action_type"),10); + var icon; + + switch(action_type){ + case Discourse.UserAction.WAS_LIKED: + icon = "heart"; + break; + case Discourse.UserAction.BOOKMARK: + icon = "bookmark"; + break; + case Discourse.UserAction.EDIT: + icon = "pencil"; + break; + case Discourse.UserAction.RESPONSE: + icon = "reply"; + break; + case Discourse.UserAction.STAR: + icon = "star"; + break; + } + + return icon; + }.property("content.action_type"), + click: function() { this.set('stream.filter', this.get('content.action_type')); return false; diff --git a/app/assets/stylesheets/components/navs.css.scss b/app/assets/stylesheets/components/navs.css.scss index d49b2e36988..86afc424629 100644 --- a/app/assets/stylesheets/components/navs.css.scss +++ b/app/assets/stylesheets/components/navs.css.scss @@ -93,4 +93,9 @@ font-size: 14px; line-height: 20px; } -} \ No newline at end of file + + .glyph { + font-size: 12px; + margin-left: 8px; + } +} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index fdc9eb154f1..54a351247d0 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -147,7 +147,7 @@ en: "3": "Bookmarks" "4": "Topics" "5": "Posts" - "6": "Responses" + "6": "Replies" "7": "Mentions" "9": "Quotes" "10": "Favorites"