aboutsummaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2020-10-10 09:49:26 -0500
committerMark Powers <markppowers0@gmail.com>2020-10-10 09:49:26 -0500
commite242733deb546c2b7f00d302a96bee0c0e609a2e (patch)
tree483a772579fdb6e585a33a54f102c2a29269ccfb /src/templates
parent0345f90a7baceae507f417abe30736cc95cdc0cf (diff)
Create expected, goals, and summary pages
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/expected.html38
-rw-r--r--src/templates/goals.html50
-rw-r--r--src/templates/ledger.html51
-rw-r--r--src/templates/summary.html101
4 files changed, 208 insertions, 32 deletions
diff --git a/src/templates/expected.html b/src/templates/expected.html
new file mode 100644
index 0000000..15b9d7c
--- /dev/null
+++ b/src/templates/expected.html
@@ -0,0 +1,38 @@
+<!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>
+ <h1>{{name}}'s Budget</h1>
+ <div>
+ <a href="/ledger"><button>Ledger</button></a>
+ <a href="/summary"><button>Summary</button></a>
+ <a href="/goals"><button>Goals</button></a>
+ <a href="/expected"><button class="bold">Expected</button></a>
+ </div>
+
+ <form method="post" action="/expected">
+ <input name="name" placeholder="name" type="text">
+ <input name="total" placeholder="total" type="number">
+ <input name="days" placeholder="days" type="number">
+ <input type="submit" value="Add">
+ </form>
+ <table>
+ <tr><th></th><th>Name</th><th>Total</th><th>Period</th></tr>
+ {{#each expecteds}}
+ <tr>
+ <td class="table-index">{{this.index}}</td>
+ <td>{{this.name}}</td>
+ <td>{{this.total}}</td>
+ <td>{{this.days}}</td>
+ </tr>
+ {{/each}}
+ </table>
+</body>
+</html>
+
diff --git a/src/templates/goals.html b/src/templates/goals.html
new file mode 100644
index 0000000..b617a6e
--- /dev/null
+++ b/src/templates/goals.html
@@ -0,0 +1,50 @@
+<!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>
+ <h1>{{name}}'s Budget</h1>
+ <div>
+ <a href="/ledger"><button>Ledger</button></a>
+ <a href="/summary"><button>Summary</button></a>
+ <a href="/goals"><button class="bold">Goals</button></a>
+ <a href="/expected"><button>Expected</button></a>
+ </div>
+
+ <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>
+</body>
+</html>
+
diff --git a/src/templates/ledger.html b/src/templates/ledger.html
new file mode 100644
index 0000000..0ac9b0e
--- /dev/null
+++ b/src/templates/ledger.html
@@ -0,0 +1,51 @@
+<!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>
+ <h1>{{name}}'s Budget</h1>
+ <div>
+ <a href="/ledger"><button class="bold">Ledger</button></a>
+ <a href="/summary"><button>Summary</button></a>
+ <a href="/goals"><button>Goals</button></a>
+ <a href="/expected"><button>Expected</button></a>
+ </div>
+ <form method="post" action="/transaction">
+ <input id="datePicker" name="when" placeholder="date" type="date">
+ <input name="where" placeholder="where" type="text">
+ <input name="amount" placeholder="amount" type="number" step="0.01">
+ <input name="category" placeholder="category" type="text">
+ <input name="subcategory" placeholder="tags (csv)" type="text">
+ <input type="submit" value="Add">
+ </form>
+ <table>
+ <tr>
+ <th></th>
+ <th>When</th>
+ <th>Where</th>
+ <th>Amount</th>
+ <th>Category</th>
+ <th>Tags</th>
+ </tr>
+ {{#each ledger}}
+ <tr>
+ <td>{{this.index}}</td>
+ <td>{{this.when}}</td>
+ <td>{{this.where}}</td>
+ <td>{{this.amount}}</td>
+ <td>{{this.category}}</td>
+ <td>{{this.subcategory}}</td>
+ </tr>
+ {{/each}}
+ </table>
+ <script>
+ document.getElementById('datePicker').value = new Date().toLocaleDateString();
+ </script>
+</body>
+</html>
+
diff --git a/src/templates/summary.html b/src/templates/summary.html
index 5bf828e..bffd46b 100644
--- a/src/templates/summary.html
+++ b/src/templates/summary.html
@@ -9,37 +9,74 @@
<body>
<h1>{{name}}'s Budget</h1>
- <form method="post" action="/transaction">
- <input id="datePicker" name="when" placeholder="date" type="date">
- <input name="where" placeholder="where" type="text">
- <input name="amount" placeholder="amount" type="number" step="0.01">
- <input name="category" placeholder="category" type="text">
- <input name="subcategory" placeholder="tags (csv)" type="text">
- <input type="submit" value="Add">
- </form>
- <table>
- <tr>
- <th></th>
- <th>When</th>
- <th>Where</th>
- <th>Amount</th>
- <th>Category</th>
- <th>Tags</th>
- </tr>
- {{#each ledger}}
- <tr>
- <td>{{this.index}}</td>
- <td>{{this.when}}</td>
- <td>{{this.where}}</td>
- <td>{{this.amount}}</td>
- <td>{{this.category}}</td>
- <td>{{this.subcategory}}</td>
- </tr>
- {{/each}}
- </table>
- <script>
- document.getElementById('datePicker').value = new Date().toLocaleDateString();
- </script>
+ <div>
+ <a href="/ledger"><button>Ledger</button></a>
+ <a href="/summary"><button class="bold">Summary</button></a>
+ <a href="/goals"><button>Goals</button></a>
+ <a href="/expected"><button>Expected</button></a>
+ </div>
+
+ <div class="summary-panel">
+ <h2>Weekly</h2>
+ <table class="table">
+ <tr>
+ <th>Year</th>
+ <th>Week</th>
+ <th>In</th>
+ <th>Out</th>
+ <th>Net</th>
+ </tr>
+ {{#each week}}
+ <tr>
+ <td>{{this.y}}</td>
+ <td>{{this.w}}</td>
+ <td>{{this.in}}</td>
+ <td>{{this.out}}</td>
+ <td class="{{this.classes}}">{{this.net}}</td>
+ </tr>
+ {{/each}}
+ </table>
+ </div>
+ <div class="summary-panel">
+ <h2>Monthly</h2>
+ <table class="table">
+ <tr>
+ <th>Year</th>
+ <th>Month</th>
+ <th>In</th>
+ <th>Out</th>
+ <th>Net</th>
+ </tr>
+ {{#each month}}
+ <tr>
+ <td>{{this.y}}</td>
+ <td>{{this.m}}</td>
+ <td>{{this.in}}</td>
+ <td>{{this.out}}</td>
+ <td class="{{this.classes}}">{{this.net}}</td>
+ </tr>
+ {{/each}}
+ </table>
+ </div>
+ <div class="summary-panel">
+ <h2>Yearly</h2>
+ <table class="table">
+ <tr>
+ <th>Year</th>
+ <th>In</th>
+ <th>Out</th>
+ <th>Net</th>
+ </tr>
+ {{#each year}}
+ <tr>
+ <td>{{this.y}}</td>
+ <td>{{this.in}}</td>
+ <td>{{this.out}}</td>
+ <td class="{{this.classes}}">{{this.net}}</td>
+ </tr>
+ {{/each}}
+ </table>
+ </div>
</body>
-</html>
+</html> \ No newline at end of file