From 4f281f5837c0d41ad57a7b5ff7eddd14453d88be Mon Sep 17 00:00:00 2001 From: Mike Larsson Date: Tue, 25 Jun 2013 15:30:01 -0400 Subject: [PATCH] Use getDisplayName consistently as user's name on site --- controllers/auth.js | 3 ++- models/learner.js | 2 +- views/user/backpack.html | 2 +- views/user/myplaylist.html | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/controllers/auth.js b/controllers/auth.js index 70c9b42..89e1515 100644 --- a/controllers/auth.js +++ b/controllers/auth.js @@ -131,7 +131,8 @@ function extractUserData (user) { favorites: [], dependents: [], home: userHome, - underage: user.underage + underage: user.underage, + displayName: user.getDisplayName() }; } diff --git a/models/learner.js b/models/learner.js index 90547e6..4aeef8a 100644 --- a/models/learner.js +++ b/models/learner.js @@ -108,7 +108,7 @@ module.exports = { return this.firstName + ' ' + this.lastName; }, getDisplayName: function () { - return this.firstName || this.username; + return this.username; }, getActivities: function (options, callback) { var learner = this; diff --git a/views/user/backpack.html b/views/user/backpack.html index de355ac..f07a671 100644 --- a/views/user/backpack.html +++ b/views/user/backpack.html @@ -32,7 +32,7 @@ {% endblock %} {% block no_data %} -

Welcome! It doesn't look like you've earned any Chicago Summer of Learning badges yet. Have no fear! You can check out cool projects in science, technology, engineering, art and math now on the Earn page.

+

Welcome {{ user.displayName }}! It doesn't look like you've earned any Chicago Summer of Learning badges yet. Have no fear! You can check out cool projects in science, technology, engineering, art and math now on the Earn page.

{% endblock %} {% block finally %} diff --git a/views/user/myplaylist.html b/views/user/myplaylist.html index 4212eec..5006cfd 100644 --- a/views/user/myplaylist.html +++ b/views/user/myplaylist.html @@ -1,5 +1,5 @@ {% extends 'layout.html' %} -{% set pageTitle = user.username + '’s Playlist' %} +{% set pageTitle = user.displayName + '’s Playlist' %} {% set bodyClass = 'myplaylist' %} {% set navItem = 'backpack' %} {% set subNavItem = 'playlist' %}