aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-24 10:10:40 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-24 10:10:40 +0200
commit8f6f3af7abb73abf8f2af1006331a37cf98aa76e (patch)
treecfdc9786d5f8eb24ee71d46c5a2139fce1c0fd10
parentderp (diff)
downloadDivid-8f6f3af7abb73abf8f2af1006331a37cf98aa76e.tar.gz
gave invited users a standard name, so we don't have to check for it continously
-rw-r--r--controllers/users.js1
-rw-r--r--views/project.ejs6
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 + ' <span class="muted">(ikke registrert)</span>';
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 @@
</div>
<div class="span10">
<% access.forEach(function(participants) { %>
- <% if (participants.user.status === 1) { %><span class="muted"><%= participants.user.email %> (ikke registrert)</span><br>
- <% } else { %><%= participants.user.name %><% if (participants.permissions >= 6) { %> <span class="muted">(<%= participants.permissions === 9 ? 'eier' : 'admin' %>)</span><% } %><br>
- <% } %>
+ <%- participants.user.name %><% if (participants.permissions >= 6) { %> <span class="muted">(<%= participants.permissions === 9 ? 'eier' : 'admin' %>)</span><% } %><br>
<% }); %>
<small><a href="/project/<%= req.params.short %>/participants">Legg til flere deltakere</a></small>
</div>
@@ -108,7 +106,7 @@
<div class="span6">
<div class="row-fluid">
<div class="span2 info text-right smallfullwidth">av</div>
- <div class="span10 smallfullwidth"><%= post.user.name === undefined ? post.user.email + ' <span class="muted">(ikke registrert)</span>' : post.user.name %></div>
+ <div class="span10 smallfullwidth"><%- post.user.name %></div>
</div>
<div class="row-fluid">
<div class="span2 info text-right smallfullwidth">hva</div>