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
|
||||
Reference in New Issue
Block a user