Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
Fixed issue with no full user name
Browse files Browse the repository at this point in the history
  • Loading branch information
cliftonc committed Oct 29, 2011
1 parent a036267 commit f02ccb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions modules/core/content/content.js
Expand Up @@ -735,7 +735,7 @@ function showContent(req,res,template,block,next,err,content,format) {

if(err || !content) {

content = {title:"Not Found!",content:"Sorry, I couldn't find that content!"};
content = {title:"Not Found!",content:"Sorry, I couldn't find that content!",displayAuthor:{name:"Unknown"}};

} else {

Expand All @@ -755,7 +755,7 @@ function showContent(req,res,template,block,next,err,content,format) {
// Override of the template
template = calipso.theme.cache.contentTypes[content.contentType].view || template;
}
calipso.theme.renderItem(req,res,template,block,{content:content},next);
calipso.theme.renderItem(req,res,template,block,{content:content.toObject()},next);
}

if(format === "json") {
Expand Down
4 changes: 2 additions & 2 deletions modules/core/content/templates/show.html
@@ -1,6 +1,6 @@
<div class='content-item'>
<h2><a href='/<%= item.alias %>.html'><%- content.title %></a></h2>
<p class='by'>By <a href='/user/profile/<%- item.author %>'><%- content.displayAuthor.name %></a></small>
<h2><a href='/<%= content.alias %>.html'><%- content.title %></a></h2>
<p class='by'>By <a href='/user/profile/<%- content.author %>'><%- content.displayAuthor.name %></a></small>
<p class='status'><%- content.status %></p>
<p class='created'><%- t('Published') + ': ' + prettyDate(content.published) %> / <%- t('Last Updated') + ': ' + prettyDate(content.updated) %></p>
<p class='tags'><%- content.tags %></p>
Expand Down
5 changes: 2 additions & 3 deletions modules/core/user/user.js
Expand Up @@ -167,7 +167,7 @@ function storeRoles() {
* }
* This needs to be a synchronous call so it can be used in templates.
*/
function userDisplay(req,username,next) {
function userDisplay(req, username, next) {

var isAdmin = (req.session.user && req.session.user.isAdmin);
var isUser = (req.session.user);
Expand All @@ -186,7 +186,7 @@ function userDisplay(req,username,next) {
// Default display name
responseData.name = u.username;
if(isAdmin || (u.showName === 'registered' && isUser) || u.showName === 'public') {
responseData.name = u.fullname;
responseData.name = u.fullname || u.username;
}

// Default display name
Expand All @@ -196,7 +196,6 @@ function userDisplay(req,username,next) {
}

}

next(null,responseData);

});
Expand Down

0 comments on commit f02ccb2

Please sign in to comment.