diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/html/email-success.html | 22 | ||||
-rw-r--r-- | src/html/email.html | 13 | ||||
-rw-r--r-- | src/server.js | 4 |
3 files changed, 24 insertions, 15 deletions
diff --git a/src/html/email-success.html b/src/html/email-success.html new file mode 100644 index 0000000..db2dee2 --- /dev/null +++ b/src/html/email-success.html @@ -0,0 +1,22 @@ +<!doctype html> +<html lang="en"> + +<head> + <title>Mark's Kitchen - Email</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" type="text/css" href="/css/styles.css"> +</head> + +<body> + <div> + <h1> + <a class="navigation" href="/" title="marks.kitchen"><</a> + Email + </h1> + <h2 id="status" v-if='show'>Success, thank you!</h2> + </div> + </div> +</body> + +</html>
\ No newline at end of file diff --git a/src/html/email.html b/src/html/email.html index 13f34d5..cdf1030 100644 --- a/src/html/email.html +++ b/src/html/email.html @@ -6,18 +6,6 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" type="text/css" href="/css/styles.css"> - <!-- <script src="https://cdn.jsdelivr.net/npm/vue"></script> --> - <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> - <script> - window.onload = function(){ - var feed = new Vue({ - el: '#status', - data: { - show: window.location.hash == '#success' - }, - }); - } - </script> </head> <body> @@ -27,7 +15,6 @@ Email </h1> <p>Sign up to receive Mark's email newsletter</p> - <h2 id="status" v-if='show'>Success, thank you!</h2> <div class="form"> <form action="/email" method="post" enctype="application/x-www-form-urlencoded"> <input type="text" placeholder="Your name" name="name" required> diff --git a/src/server.js b/src/server.js index e62094b..d254722 100644 --- a/src/server.js +++ b/src/server.js @@ -203,7 +203,7 @@ function setUpRoutes(models, jwtFunctions, database) { server.get('/admin', (req, res) => res.sendFile(__dirname + "/html/admin.html")); server.get('/login', (req, res) => res.sendFile(__dirname + "/html/login.html")) server.get('/email', (req, res) => res.sendFile(__dirname + "/html/email.html")) - // server.get('/tags', (req, res) => res.sendFile(__dirname + "/html/tags.html")); + server.get('/email-success', (req, res) => res.sendFile(__dirname + "/html/email-success.html")) server.get('/feed', (req, res) => res.sendFile(__dirname + "/html/feed.html")); server.get('/essay', (req, res) => res.sendFile(__dirname + "/html/essay.html")); server.get('/misc', (req, res) => res.sendFile(__dirname + "/html/misc.html")); @@ -317,7 +317,7 @@ function setUpRoutes(models, jwtFunctions, database) { const email = req.body.email; if (name && email) { models.emails.create({"name": name, "address": email}) - res.redirect('/email#success'); + res.redirect('/email-success'); } else { console.debug("Error with email submission") } |