aboutsummaryrefslogtreecommitdiff
path: root/src/templates/goals.html
blob: e30aa621d99ddf6c11c58289594dd270bb7bae15 (plain)
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
<!DOCTYPE html>
<html lang="en">

<head>
    <title>{{name}}'s Budget</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="static/styles.css">
</head>

<body>
    <div class="main">
        <h1>{{name}}'s Budget</h1>
        <form method="post" action="/goals">
            <input name="name" placeholder="name">
            <input name="total" placeholder="total" type="number" step="0.01">
            <input type="submit" value="Add">
        </form>
        <form method="post" action="/allocate">
            <span>Allocate funds</span>
            <select name="name">
                {{#each goals}}
                <option value="{{this.name}}">
                    {{ this.name }}
                </option>
                {{/each}}
            </select>
            <input name="amount" placeholder="amount" type="number">
            <input type="submit" value="Add">
        </form>
        <table>
            <tr>
                <th></th>
                <th>Name</th>
                <th>Amount</th>
                <th>Total</th>
                <th>Remaining</th>
            </tr>
            {{#each goals}}
            <tr>
                <td class="table-index">{{this.index}}</td>
                <td>{{this.name}}</td>
                <td>{{this.amount}}</td>
                <td>{{this.total}}</td>
                <td>{{this.remaining}}</td>
            </tr>
            {{/each}}
        </table>
    </div>
    {{>navigation}}
</body>

</html>