2023.12.19.09.12
This commit is contained in:
10
views/categories/categories.pug
Normal file
10
views/categories/categories.pug
Normal file
@@ -0,0 +1,10 @@
|
||||
extends ../layout/base.pug
|
||||
|
||||
block nav
|
||||
a(href="/categories") Categories
|
||||
a(href="/categories/addCategory") + Category
|
||||
|
||||
block headline
|
||||
h1 Categories
|
||||
|
||||
block content
|
||||
13
views/categories/formCategory.pug
Normal file
13
views/categories/formCategory.pug
Normal file
@@ -0,0 +1,13 @@
|
||||
extends ./categories.pug
|
||||
|
||||
block content
|
||||
form(action="/categories/addCategory",method="POST")
|
||||
.form-group
|
||||
.text Name
|
||||
.input
|
||||
input(type="text", name="categoryName")
|
||||
.form-group
|
||||
.text Description
|
||||
.input
|
||||
textarea(name="categoryDescription", cols="30", rows="10")
|
||||
button(type="submit") Add Category
|
||||
20
views/categories/listCategories.pug
Normal file
20
views/categories/listCategories.pug
Normal file
@@ -0,0 +1,20 @@
|
||||
extends ./categories.pug
|
||||
|
||||
block content
|
||||
table
|
||||
thead
|
||||
th.center ID
|
||||
th Name
|
||||
th Description
|
||||
th Transactions
|
||||
th Modify Category
|
||||
tbody
|
||||
each category in categories
|
||||
tr
|
||||
td=category.CategoryID
|
||||
td=category.Name
|
||||
td=category.Description
|
||||
td
|
||||
a(href=`/transactions/cat/${category.CategoryID}`) Transactions by Category
|
||||
td
|
||||
a(href=`/categories/ModifyCategory/${category.CategoryID}`) ###
|
||||
13
views/categories/modifyCategory.pug
Normal file
13
views/categories/modifyCategory.pug
Normal file
@@ -0,0 +1,13 @@
|
||||
extends ./categories.pug
|
||||
|
||||
block content
|
||||
form(action=`/categories/modifyCategory/${categoryObj.CategoryID}`,method="POST")
|
||||
.form-group
|
||||
.text Name
|
||||
.input
|
||||
input(type="text", name="categoryName",value=categoryObj.Name)
|
||||
.form-group
|
||||
.text Description
|
||||
.input
|
||||
textarea(name="categoryDescription", cols="30", rows="10")=categoryObj.Description
|
||||
button(type="submit") Modify Category
|
||||
5
views/layout/_navbar.pug
Normal file
5
views/layout/_navbar.pug
Normal file
@@ -0,0 +1,5 @@
|
||||
nav
|
||||
a(href="/") Home
|
||||
a(href="/transactions") Transactions
|
||||
a(href="/categories") Categories
|
||||
a(href="/accounts") Accounts
|
||||
@@ -7,6 +7,11 @@ html
|
||||
block additionalAssets
|
||||
|
||||
body
|
||||
div.nav
|
||||
include ./_navbar.pug
|
||||
div.nav
|
||||
block nav
|
||||
|
||||
div.container
|
||||
block headline
|
||||
|
||||
|
||||
41
views/transactions/_addTransactions.pug
Normal file
41
views/transactions/_addTransactions.pug
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
details
|
||||
summary Create new transaction
|
||||
|
||||
form(action="/transactions",method="POST")
|
||||
div.form-group
|
||||
.text Description
|
||||
.input
|
||||
textarea(name="description", cols="30", rows="5") Test
|
||||
div.form-group.half
|
||||
.text Date
|
||||
.input
|
||||
input(type="date",name="date")
|
||||
div.form-group.half
|
||||
.text Time
|
||||
.input
|
||||
input(type="time",name="time")
|
||||
div.form-group.half
|
||||
.text Type
|
||||
.input
|
||||
select(name="type")
|
||||
option(value="income") Income
|
||||
option(value="expense",select) Expense
|
||||
option(value="transfer") Transfer
|
||||
div.form-group.half
|
||||
.text Amount
|
||||
.input
|
||||
input(type="text",name="amount",required)
|
||||
div.form-group
|
||||
.text Account
|
||||
.input
|
||||
select(name="account")
|
||||
each account in accounts
|
||||
option(value=account.AccountID)=account.Name
|
||||
div.form-group
|
||||
.text Category
|
||||
.input
|
||||
select(name="category")
|
||||
each category in categories
|
||||
option(value=category.CategoryID,title=category.Description)=category.Name
|
||||
button(type="submit") Add Transaction
|
||||
39
views/transactions/formTransaction.pug
Normal file
39
views/transactions/formTransaction.pug
Normal file
@@ -0,0 +1,39 @@
|
||||
extends ./transactions.pug
|
||||
block content
|
||||
form(action="/transactions/addTransaction",method="POST")
|
||||
div.form-group
|
||||
.text Description
|
||||
.input
|
||||
textarea(name="description", cols="30", rows="5")
|
||||
div.form-group.half
|
||||
.text Date
|
||||
.input
|
||||
input(type="date",name="date")
|
||||
div.form-group.half
|
||||
.text Time
|
||||
.input
|
||||
input(type="time",name="time")
|
||||
div.form-group.half
|
||||
.text Type
|
||||
.input
|
||||
select(name="type")
|
||||
option(value="income") Income
|
||||
option(value="expense",select) Expense
|
||||
option(value="transfer") Transfer
|
||||
div.form-group.half
|
||||
.text Account
|
||||
.input
|
||||
select(name="account")
|
||||
each account in accounts
|
||||
option(value=account.AccountID)=account.Name
|
||||
div.form-group.half
|
||||
.text Amount
|
||||
.input
|
||||
input(type="number",min="0",step="0.01",name="amount",required)
|
||||
div.form-group.half
|
||||
.text Category
|
||||
.input
|
||||
select(name="category")
|
||||
each category in categories
|
||||
option(value=category.CategoryID,title=category.Description)=category.Name
|
||||
button(type="submit") Add Transaction
|
||||
40
views/transactions/formTransfer.pug
Normal file
40
views/transactions/formTransfer.pug
Normal file
@@ -0,0 +1,40 @@
|
||||
extends ./transactions.pug
|
||||
|
||||
block content
|
||||
form(action="/transactions/addTransfer",method="POST")
|
||||
div.form-group
|
||||
.text Description
|
||||
.input
|
||||
textarea(name="description", cols="30", rows="5")
|
||||
div.form-group.half
|
||||
.text Date
|
||||
.input
|
||||
input(type="date",name="date")
|
||||
div.form-group.half
|
||||
.text Time
|
||||
.input
|
||||
input(type="time",name="time")
|
||||
|
||||
div.form-group.half
|
||||
.text from Account
|
||||
.input
|
||||
select(name="fromAccount")
|
||||
each account in accounts
|
||||
option(value=account.AccountID)=account.Name
|
||||
div.form-group.half
|
||||
.text to Account
|
||||
.input
|
||||
select(name="toAccount")
|
||||
each account in accounts
|
||||
option(value=account.AccountID)=account.Name
|
||||
div.form-group.half
|
||||
.text Amount
|
||||
.input
|
||||
input(type="number",min="0",step="0.01",name="amount",required)
|
||||
div.form-group.half
|
||||
.text Category
|
||||
.input
|
||||
select(name="category")
|
||||
each category in categories
|
||||
option(value=category.CategoryID,title=category.Description)=category.Name
|
||||
button(type="submit") Add Transaction
|
||||
22
views/transactions/listTransactions.pug
Normal file
22
views/transactions/listTransactions.pug
Normal file
@@ -0,0 +1,22 @@
|
||||
extends ./transactions.pug
|
||||
|
||||
block content
|
||||
table(class=`${cssClass}`)
|
||||
thead
|
||||
th ID
|
||||
th Date
|
||||
th Description
|
||||
th Category
|
||||
th Account
|
||||
th.right Amount
|
||||
tbody
|
||||
each transaction in transactions
|
||||
tr(class=`${transaction.Type}`)
|
||||
td=transaction.TransactionID
|
||||
td=transaction.Date2
|
||||
td=transaction.Description
|
||||
td
|
||||
a(href=`/transactions/cat/${transaction.Category.CategoryID}`)=transaction.Category.Name
|
||||
td
|
||||
a(href=`/transactions/acc/${transaction.Account.AccountID}`)=transaction.Account.Name
|
||||
td(class=`${transaction.Type} amount` )=transaction.Amount
|
||||
@@ -1,24 +1,11 @@
|
||||
extends ../layout/base.pug
|
||||
|
||||
block nav
|
||||
a(href="/transactions") Transactions
|
||||
a(href="/transactions/addTransaction") + Transaction
|
||||
a(href="/transactions/addTransfer") + Transfer
|
||||
|
||||
block headline
|
||||
h1 Transactions
|
||||
|
||||
block content
|
||||
form(action="/tansactions",method="POST")
|
||||
|
||||
|
||||
table
|
||||
thead
|
||||
th ID
|
||||
th Date
|
||||
th Description
|
||||
th Account
|
||||
th Amount
|
||||
tbody
|
||||
each transaction in transactions
|
||||
tr
|
||||
td=transaction.TransactionID
|
||||
td=transaction.Date
|
||||
td=transaction.Description
|
||||
td=transaction.Account.Name
|
||||
td(class=`${transaction.Type} amount` )=transaction.Amount
|
||||
block content
|
||||
Reference in New Issue
Block a user