From 2f273011b12b2ebb727a5432360a66c635bae357 Mon Sep 17 00:00:00 2001 From: Sacha Greif Date: Mon, 15 Dec 2014 09:52:37 +0900 Subject: [PATCH] adding title and description to profile pages --- i18n/en.i18n.json | 2 ++ lib/router/users.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index e82ce2e29..4eb7474ee 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -284,6 +284,8 @@ "newest_posts": "The newest posts.", "highest_ranked_posts_ever": "The all-time highest-ranked posts.", + "the_profile_of": "The profile of", + "posts_awaiting_moderation": "Posts awaiting moderation.", "future_scheduled_posts": "Future scheduled posts.", "users_dashboard": "Users dashboard.", diff --git a/lib/router/users.js b/lib/router/users.js index 46ed7d007..c47f3c19c 100644 --- a/lib/router/users.js +++ b/lib/router/users.js @@ -1,11 +1,17 @@ // Controller for user pages UserPageController = RouteController.extend({ + waitOn: function() { return [ coreSubscriptions.subscribe('singleUser', this.params._idOrSlug) ] }, + + getUser: function () { + return Meteor.users.findOne({slug: this.params._idOrSlug}); + }, + data: function() { var findById = Meteor.users.findOne(this.params._idOrSlug); var findBySlug = Meteor.users.findOne({slug: this.params._idOrSlug}); @@ -18,7 +24,17 @@ UserPageController = RouteController.extend({ }; } }, + + getTitle: function () { + return getDisplayName(this.getUser()) + ' - ' + getSetting('title'); + }, + + getDescription: function () { + return i18n.t('the_profile_of') + ' ' + getDisplayName(this.getUser()); + }, + fastRender: true + }); // Controller for user account editing