Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/bank_app/Styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ header {

.card_record {
border:1px solid #04003f;
background-color: rgb(188, 188, 188);
background-color: rgb(237, 237, 237);

}
.card_record h1 {
Expand All @@ -84,7 +84,7 @@ header {

.card_records {
border:1px solid #04003f;
background-color: rgb(188, 188, 188);
background-color: rgb(237, 237, 237);

}
.card_records h1 {
Expand Down
12 changes: 6 additions & 6 deletions cmd/bank_app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func main() {

r.GET("/account", func(c *gin.Context) {
authentication(c)
c.HTML(200, "account.tmpl", map[string]string{"title": "register_page"})
c.HTML(200, "account.tmpl", map[string]string{"title": "account_page"})
})

r.GET("/AccountRedir", func(c *gin.Context) {
Expand All @@ -153,7 +153,7 @@ func main() {

r.GET("/createcard", func(c *gin.Context) {
authentication(c)
c.HTML(200, "createcard.tmpl", map[string]string{"title": "register_page"})
c.HTML(200, "createcard.tmpl", map[string]string{"title": "createcard_page"})
})

r.GET("/CreateCardRedir", func(c *gin.Context) {
Expand Down Expand Up @@ -224,7 +224,7 @@ func main() {

r.GET("/transaction", func(c *gin.Context) {
authentication(c)
c.HTML(200, "transaction.tmpl", map[string]string{"title": "register_page"})
c.HTML(200, "transaction.tmpl", map[string]string{"title": "transaction_page"})
})

r.GET("/MakeTransactionRedir", func(c *gin.Context) {
Expand All @@ -234,7 +234,7 @@ func main() {

r.GET("/maketransaction", func(c *gin.Context) {
authentication(c)
c.HTML(200, "maketransaction.tmpl", map[string]string{"title": "register_page"})
c.HTML(200, "maketransaction.tmpl", map[string]string{"title": "maketransaction_page"})
})

r.POST("/create_transaction", func(c *gin.Context) {
Expand Down Expand Up @@ -308,7 +308,7 @@ func main() {

r.GET("/record", func(c *gin.Context) {
authentication(c)
c.HTML(200, "record.tmpl", map[string]string{"title": "register_page"})
c.HTML(200, "record.tmpl", map[string]string{"title": "record_page"})
})

r.GET("/RecordsRedir", func(c *gin.Context) {
Expand All @@ -318,7 +318,7 @@ func main() {

r.GET("/viewrecord", func(c *gin.Context) {
authentication(c)
c.HTML(200, "viewrecord.tmpl", map[string]string{"title": "register_page"})
c.HTML(200, "viewrecord.tmpl", map[string]string{"title": "viewrecord_page"})
})

r.GET("/transaction_history", func(c *gin.Context) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/bank_app/templates/account.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: Account</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down
2 changes: 1 addition & 1 deletion cmd/bank_app/templates/createcard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: Create Card</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down
2 changes: 1 addition & 1 deletion cmd/bank_app/templates/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: Home</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down
2 changes: 1 addition & 1 deletion cmd/bank_app/templates/login.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down
2 changes: 1 addition & 1 deletion cmd/bank_app/templates/maketransaction.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: Make Transaction</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down
6 changes: 3 additions & 3 deletions cmd/bank_app/templates/record.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: Record</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down Expand Up @@ -54,13 +54,13 @@
function cardiv(card_json_data){
var card_container = document.getElementById("card_container");

if (card_json_data.length !== 0){
if (card_json_data !== null){

card_json_data.forEach(function(record){
const carddiv = document.createElement("div");
carddiv.className = "card_record";
carddiv.id = record.card_code;
carddiv.innerHTML = "<h1>" + "Card Code: " + record.card_code + "</h1>" + "<h2>" + "Card Balance: " + record.card_balance + "</h2>"
carddiv.innerHTML = "<h1>" + "Card Code: " + record.card_code + "</h1>" + "<h2>" + "Card Balance: £" + record.card_balance + "</h2>"
carddiv.addEventListener('click', () => click_card(record.card_code));
card_container.appendChild(carddiv);
});
Expand Down
4 changes: 2 additions & 2 deletions cmd/bank_app/templates/register.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: Register</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down Expand Up @@ -63,7 +63,7 @@
} else if (account_email.length > 50){
alert("Email Cannot Be Larger Than 50 characters");
return;
} else if (account_name > 25) {
} else if (account_name.length > 25) {
alert("Account Name Cannot Be Larger Than 25 Characters");
return;
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/bank_app/templates/transaction.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: Transaction</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down Expand Up @@ -55,13 +55,13 @@
function cardiv(card_json_data){
var card_container = document.getElementById("card_container");

if (card_json_data.length !== 0){
if (card_json_data !== null){

card_json_data.forEach(function(record){
const carddiv = document.createElement("div");
carddiv.className = "card_record";
carddiv.id = record.card_code;
carddiv.innerHTML = "<h1>" + "Card Code: " + record.card_code + "</h1>" + "<h2>" + "Card Balance: " + record.card_balance + "</h2>"
carddiv.innerHTML = "<h1>" + "Card Code: " + record.card_code + "</h1>" + "<h2>" + "Card Balance: £" + record.card_balance + "</h2>"
carddiv.addEventListener('click', () => click_card(record.card_code));
card_container.appendChild(carddiv);
});
Expand Down
5 changes: 2 additions & 3 deletions cmd/bank_app/templates/viewrecord.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EASB</title>
<title>EASB: View Record</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./Styles/style.css">
</head>
Expand Down Expand Up @@ -64,7 +64,6 @@
carddiv.innerHTML = "<h1>" + "Payments Out" + "</h1>"
card_container.appendChild(carddiv);

console.log(outgoing_payments.length)

if (outgoing_payments !== null){

Expand Down Expand Up @@ -95,7 +94,7 @@
let carddiv2 = document.createElement("div");
carddiv2.className = "card_records";
carddiv2.id = records.card_code;
carddiv2.innerHTML = "<h1>" + "Your Card: " + record.SenderCode + " <== " + " £" + record.TransactionAmount + " Recipient Card: " + record.RecipientCode + "</h1>" + "<h3>" + "Made At: " + records.transaction_timestamp + "</h3>"
carddiv2.innerHTML = "<h1>" + "Your Card: " + records.RecipientCode + " <== " + " £" + records.TransactionAmount + " Sender Card: " + records.SenderCode + "</h1>" + "<h3>" + "Made At: " + records.TransactionTimestamp + "</h3>"
card_container.appendChild(carddiv2);
});
}
Expand Down