From 65f1d40c113263426b144afa16261bbea995409c Mon Sep 17 00:00:00 2001 From: Korbs Date: Sat, 24 Feb 2024 21:53:25 -0500 Subject: [PATCH] Update error pages --- html/404.ejs | 82 ++---------------------- html/502.ejs | 4 ++ html/error.ejs | 94 ++++++++++++++++++++++++++++ src/libpoketube/init/pages-static.js | 4 ++ 4 files changed, 106 insertions(+), 78 deletions(-) create mode 100644 html/502.ejs create mode 100644 html/error.ejs diff --git a/html/404.ejs b/html/404.ejs index 0e988c07..e9a1a1ce 100644 --- a/html/404.ejs +++ b/html/404.ejs @@ -1,78 +1,4 @@ - - - - 1984!!1 - PokeTube - - - - - - - - - - - - -
- - -
- - -

- 404!!1 -

-

- Very 1984 Innit? I dont think that this webpage exist :p u can search for something else~ -

-
- - - -
- - - - - \ No newline at end of file +<%- include('error.ejs', { + error: "404", + description: "Very 1984 Innit? I dont think this webpage exist :p u can search for something else~ " +}) %> \ No newline at end of file diff --git a/html/502.ejs b/html/502.ejs new file mode 100644 index 00000000..fe9d095f --- /dev/null +++ b/html/502.ejs @@ -0,0 +1,4 @@ +<%- include('error.ejs', { + error: "502", + description: "An error has occurred. Try again or come back later." +}) %> \ No newline at end of file diff --git a/html/error.ejs b/html/error.ejs new file mode 100644 index 00000000..9f0d6183 --- /dev/null +++ b/html/error.ejs @@ -0,0 +1,94 @@ + + + + PokeTube + + + + + + + +

<%=error%>

+
+

<%=error%>

+

<%=description%>

+
+ + + + + \ No newline at end of file diff --git a/src/libpoketube/init/pages-static.js b/src/libpoketube/init/pages-static.js index 429f5eb3..ed01ddf4 100644 --- a/src/libpoketube/init/pages-static.js +++ b/src/libpoketube/init/pages-static.js @@ -48,6 +48,10 @@ module.exports = function (app, config, renderTemplate) { } }); + app.get("/502", function (req, res) { + renderTemplate(res, req, "502.ejs"); + }); + app.get("/143", function (req, res) { var number_easteregg = getRandomArbitrary(0, 143);