From e582c3b84c6090b08f33d599c354968fcd868d14 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Sat, 25 May 2013 11:17:42 +0200 Subject: moved and renamed files to match the filesetup we want. havebeen using a dev-setup till now. --- app/views/project/project.ejs | 220 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 app/views/project/project.ejs (limited to 'app/views/project/project.ejs') diff --git a/app/views/project/project.ejs b/app/views/project/project.ejs new file mode 100644 index 0000000..7e06dad --- /dev/null +++ b/app/views/project/project.ejs @@ -0,0 +1,220 @@ +<% include ../templates/header %> + + + + <% include ../templates/navbar %> + + +
+
+
+
+
+ prosjekt +
+
+

<%= project.name %>

+
+
+
+
+ opprettet +
+
+

+ <% var d = new Date(project.created); %> + <%= d.getFullYear() + '-' + ('0' + (d.getMonth()+1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2) + ' ' + d.toLocaleTimeString().slice(0, 5) %> +

+
+
+
+
+ deltakere +
+
+ <% access.forEach(function(participants) { %> + <%- participants.user.name %><% if (participants.permissions >= 6) { %> (<%= participants.permissions === 9 ? 'eier' : 'admin' %>)<% } %>
+ <% }); %> + Legg til flere deltakere +
+
+
+ +
+
+ + + + + + + + +
+
+
+
+

Status total

+
+
+
+ + + + + + +
<%= pro.user[req.user._id].total %><%= pro.total %><%= pro.user[req.user._id].diff %>
+
+
+
+
+

Det er til sammen brukt <%= (pro.total).toFixed(2) %> <%= project.currency %>. Deltakerne skal altså betale <%= (pro.each).toFixed(2) %> <%= project.currency %> hver.

+ <% for (var i in pro.user) { %> + <%- pro.user[i].name %> har betalt <%= pro.user[i].total %> <%= project.currency %>, og <%- pro.user[i].diff >= 0 ? 'skyldes ' + pro.user[i].diff : 'skylder ' + Math.abs(pro.user[i].diff) %> <%= project.currency %>
+ <% } %> +

Eksempel på hvordan oppgjøret kan gjøres

+
+
+ + <% + // FUGLY LAST-MINUTE CODE + var i = 1; + for (var u in pro.user) { + if (pro.user[u].coeff === 0) { + if (i === 1) {%> + + + <% for (var p in pro.user) { %> + <%- pro.user[p].coeff > 0 ? '' : '' %> + <% } %> + + <% } %> + + + <% for (var p in pro.user) { %> + <%- pro.user[p].coeff > 0 ? '' : '' %> + <% } %> + +<% i++; + }} %> +
' + pro.user[p].name + '
<%- pro.user[u].name %>' + (Math.abs(pro.user[u].diff) * pro.user[p].coeff).toFixed(2) + '
+ +
+
+ +
+
+
+
+ + + + + + + + +
+
+
+

Siste aktivitet

+
+ <% posts.forEach(function(post) { %> +
+
+
+ <% + var d = new Date(post.when); + var month = ['JAN', 'FEB', 'MAR', 'APR', 'MAI', 'JUN', 'JUL', 'AUG', 'SEP', 'OKT', 'NOV', 'DES']; + %> +
<%= d.getDate() %>
+
<%= month[d.getMonth()] %>
+ +
+
+
+
av
+
<%- post.user.name %>
+
+
+
hva
+
<%= post.what %>
+
+
+
+
+   +
+
+
+
+ sum + <%= post.value %> <%= post.currency %> +
+
+ +
+
+
+
+
+
+
kommentar
+
+ <%= post.comment %> +
+
+
+ <% if (String(post.user._id) === String(req.user._id) || req.user.permissions >= 6) { %> +
+ [edit] +
+
+ [delete] +
+ <% } %> +
+
+ + <% }); %> +
+
+
+ + +
+
+ + +<% include ../templates/footer %> + + + + -- cgit v1.2.3