From 8f6f3af7abb73abf8f2af1006331a37cf98aa76e Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 24 May 2013 10:10:40 +0200 Subject: gave invited users a standard name, so we don't have to check for it continously --- controllers/users.js | 1 + views/project.ejs | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/controllers/users.js b/controllers/users.js index 22a1cc6..b91317b 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -168,6 +168,7 @@ exports.postProjectParticipants = function(req, res) { console.log('fant ingen brukere med den eposten. må invitere og stasj'); var newUser = new User(); newUser.email = mailAddress; + newUser.name = mailAddress + ' (ikke registrert)'; newUser.status = 1; newUser.password = newUser.generateRandomToken(32); newUser.randomToken = newUser.generateRandomToken(10, true); diff --git a/views/project.ejs b/views/project.ejs index cd78500..caa6fd2 100644 --- a/views/project.ejs +++ b/views/project.ejs @@ -34,9 +34,7 @@
<% access.forEach(function(participants) { %> - <% if (participants.user.status === 1) { %><%= participants.user.email %> (ikke registrert)
- <% } else { %><%= participants.user.name %><% if (participants.permissions >= 6) { %> (<%= participants.permissions === 9 ? 'eier' : 'admin' %>)<% } %>
- <% } %> + <%- participants.user.name %><% if (participants.permissions >= 6) { %> (<%= participants.permissions === 9 ? 'eier' : 'admin' %>)<% } %>
<% }); %> Legg til flere deltakere
@@ -108,7 +106,7 @@
av
-
<%= post.user.name === undefined ? post.user.email + ' (ikke registrert)' : post.user.name %>
+
<%- post.user.name %>
hva
-- cgit v1.2.3