blob: 80ed6d81cd13621b90eb39f2261be78f23812dc4 (
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
|
<% include header %>
</head>
<body>
<% include navbar %>
<!-- Wrapper
================================================== -->
<div class="container" id="wrapper">
<div class="row-fluid">
<form class="form-horizontal" method="post">
<input type="hidden" name="project" value="<%= project._id %>">
<fieldset>
<h1><legend><%= title %></legend></h1>
<p>Ta på meg!</p>
<div class="control-group">
<label for="username" class="control-label">Av</label>
<div class="controls">
<span class="input-medium uneditable-input"><%= req.user.username %></span>
<span class="help-block"><small><a href="#forSomeone" data-toggle="collapse">Klikk her</a> for å føre utgiften <em>for</em> noen andre</small></span>
</div>
</div>
<div class="control-group collapse" id="forSomeone">
<label for="for" class="control-label">For</label>
<div class="controls">
<input type="text" name="for" id="for">
</div>
</div>
<div class="control-group">
<label for="what" class="control-label">Hva <strong class="text-error">*</strong></label>
<div class="controls">
<input type="text" name="what" id="what" placeholder="Hva ble kjøpt" required>
</div>
</div>
<%
// we need to populate the date- and timefield with the current time and date
var d = new Date();
var n = d.getFullYear() + '-' + ('0' + (d.getMonth()+1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2);
var t = d.toLocaleTimeString().slice(0, 5);
%>
<!-- <%= d %> -->
<div class="control-group">
<label for="date" class="control-label">Når</label>
<div class="controls">
<input type="date" name="date" value="<%= n %>" class="input-medium">
<input type="time" name="time" value="<%= t %>" class="input-medium">
</div>
</div>
<div class="control-group">
<label for="cost" class="control-label">Hvor mye <strong class="text-error">*</strong></label>
<div class="controls">
<input type="number" name="value" id="value" class="input-small" placeholder="0" required>
</div>
</div>
<div class="control-group">
<label for="split_between" class="control-label">Delt på</label>
<div class="controls">
<span class="selectAll">Select all</span>
<select name="participants[]" id="participants" multiple="multiple">
<option value="5180e11b0074a8b029000001" selected="selected">Dennis</option>
<option value="51814b792c94cc5346000001" selected="selected">Kurt</option>
</select>
</div>
</div>
<div class="control-group">
<label for="file" class="control-label">Kvittering</label>
<div class="controls">
<input type="file" name="file" id="file">
</div>
</div>
<div class="control-group">
<label for="comment" class="control-label">Kommentar</label>
<div class="controls">
<textarea id="comment" name="comment" class="span6"></textarea>
</div>
</div>
<div class="control-group">
<div class="form-actions">
<button type="submit" id="button1id" name="button1id" class="btn btn-primary">Post</button>
<button type="reset" id="button2id" name="button2id" class="btn">Nullstill</button>
</div>
</div>
</fieldset>
</form>
</div><!-- /div.row -->
</div><!-- /div.#wrapper -->
<% include footer %>
<script>
$(".selectAll").click(function() {
$('#participants').children().attr('selected','selected');
//$(this).parent().find('option').attr('selected','selected');
});
</script>
</body>
</html>
|