aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/views/project.ejs
blob: b4db87b1302bf6a77290fc5e951b844644b3b074 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<% include header %>

</head>
<body>
    <% include navbar %>

    <!-- Wrapper
    ================================================== -->
    <div class="container" id="wrapper">
    <div class="row-fluid">
        <div class="span6 smallfullwidth">
            <div class="row-fluid">
                <div class="span2 info text-right">
                    prosjekt
                </div>
                <div class="span10">
                    <h1><%= project.name %></h1>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span2 info text-right">
                    opprettet
                </div>
                <div class="span10">
                    <p>
                        <% var d = new Date(project.created); %>
                        <%= d.getFullYear() + '-' + ('0' + (d.getMonth()+1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2) + ' ' + d.toLocaleTimeString().slice(0, 5) %>
                    </p>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span2 info text-right">
                    deltakere
                </div>
                <div class="span10">
                    <% access.forEach(function(participants) { %>
                        <%- participants.user.name %><% if (participants.permissions >= 6) { %> <span class="muted">(<%= participants.permissions === 9 ? 'eier' : 'admin' %>)</span><% } %><br>
                    <% }); %>
                    <small><a href="/project/<%= project.shortURL %>/participants">Legg til flere deltakere</a></small>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span10 offset2">
                    <a class="btn btn-large" href="/project/<%= project.shortURL %>/post">Før utgift</a>
                </div>
            </div>
        </div><!-- /div.span6 -->








        <div class="span6 smallfullwidth">
            <section class="status">
                <div class="row-fluid">
                    <div class="span6 smallfullwidth">
                        <h2>Status total</h2>
                    </div>
                    <div class="span6 smallfullwidth">
                        <div class="row-fluid">
                                <table class="table table-bordered table-condensed">
                                    <tr>
                                        <td class="success">3000</td>
                                        <td class="error">4000</td>
                                        <td>1000</td>
                                    </tr>
                                </table><a href="#table-info" class="accordion-toggle" data-toggle="collapse"><i class="icon-info-sign"></i></a>
                        </div>
                        <div class="row-fluid accordion collapse" id="table-info">
                            <p class="text-info"><small>Her vises hvor mye andre skylder deg totalt, hvor mye du skylder andre totalt, og differansen mellom disse to tallene</small></p>
                        </div>
                    </div>
                </div>
                <canvas id="myChart" width="450" height="200"></canvas>
            </section>
        </div>
    </div>








    <div class="row-fluid">
        <div class="span12 smallfullwidth">
            <section class="overview">
                <h2>Siste aktivitet</h2>
                <div class="lastactivity" id="lastactivity">
                    <% posts.forEach(function(post) { %>
                        <div class="row-fluid post-<%= post._id %> activity">
                            <div class="row-fluid">
                                <div class="span1 date">
                                    <%
                                        var d = new Date(post.when);
                                        var month = ['JAN', 'FEB', 'MAR', 'APR', 'MAI', 'JUN', 'JUL', 'AUG', 'SEP', 'OKT', 'NOV', 'DES'];
                                    %>
                                    <div class="row-fluid"><%= d.getDate() %></div>
                                    <div class="row-fluid info"><%= month[d.getMonth()] %></div>
                                    <div class="row-fluid"><a href="#details-<%= post._id %>" data-toggle="collapse" class="no-text-decoration" data-parent="#lastactivity">&#9660;</a></div>
                                </div>
                                <div class="span6">
                                    <div class="row-fluid">
                                        <div class="span2 info text-right smallfullwidth">av</div>
                                        <div class="span10 smallfullwidth"><%- post.user.name %></div>
                                    </div>
                                    <div class="row-fluid">
                                        <div class="span2 info text-right smallfullwidth">hva</div>
                                        <div class="span10 smallfullwidth"><%= post.what %></div>
                                    </div>
                                </div>
                                <div class="span2">
                                    <div class="row-fluid">
                                        <div class="span4 info text-right smallfullwidth">
                                            delt på
                                        </div>
                                        <div class="span8 text-small smallfullwidth">
                                            Helene, Robert
                                        </div>
                                    </div>
                                </div>
                                <div class="span2">
                                   <div class="row-fluid text-right">
                                        <span class="info">sum</span> 
                                        <strong><%= post.value %> <%= post.currency %></strong>
                                    </div>
                                    <div class="row-fluid text-right">
                                        <i class="icon-picture"></i>
                                    </div>
                                </div>
                            </div>
                            <div class="fluid-row collapse details" id="details-<%= post._id %>">
                                <div class="span7">
                                    <div class="row-fluid">
                                        <div class="span2 info text-right smallfullwidth">kommentar</div>
                                        <div class="span10">
                                            <%= post.comment %>
                                        </div>
                                    </div>
                                </div>
                                <% if (String(post.user._id) === String(req.user._id) || req.user.permissions >= 6) { %>
                                    <div class="span1">
                                        <small><a href="/project/<%= project.shortURL %>/edit/<%= post._id %>">[edit]</a></small>
                                    </div>
                                    <div class="span1">
                                        <small><a href="/project/<%= project.shortURL %>/delete/<%= post._id %>">[delete]</a></small>
                                    </div>
                                <% } %>
                            </div>
                        </div>

                    <% }); %>
                </div>
            </section>
        </div><!-- /div.span7 -->


    </div><!-- /div.row -->
    </div><!-- /div.#wrapper -->


<% include footer %>
    <script src="/js/Chart.min.js"></script>
    <script>
        var data = {
            labels : ["January","February","March","April","May","June","July"],
            datasets : [
                {
                    fillColor : "rgba(220,220,220,0.5)",
                    strokeColor : "rgba(220,220,220,1)",
                    pointColor : "rgba(220,220,220,1)",
                    pointStrokeColor : "#fff",
                    data : [65,59,90,81,56,55,40]
                },
                {
                    fillColor : "rgba(151,187,205,0.5)",
                    strokeColor : "rgba(151,187,205,1)",
                    pointColor : "rgba(151,187,205,1)",
                    pointStrokeColor : "#fff",
                    data : [0,25,10,100,10,25,0]
                }
            ]
        }
        //var myLine = new Chart(document.getElementById("myChart").getContext("2d")).Line(data);
        var ctx = $("#myChart").get(0).getContext("2d");
        var myNewChart = new Chart(ctx).Line(data);
    </script>
</body>
</html>