Skip to content

Commit 39a59b1

Browse files
faria-sjoaodiasloboMarioRodrigues10
authored
feat: error pages (#74)
* feat: add error page 404 * feat: cesium.link 2.0 (#71) * ops: production environment (#72) * feat: add 404 error page * fix: revert config debug_errors * fix: capital letters * fix: fixing tests --------- Co-authored-by: João Lobo <[email protected]> Co-authored-by: Mário Rodrigues <[email protected]>
1 parent c1a317b commit 39a59b1

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

lib/cesium_link_web/controllers/error_html.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule CesiumLinkWeb.ErrorHTML do
1313
# * lib/cesium_link_web/controllers/error_html/404.html.heex
1414
# * lib/cesium_link_web/controllers/error_html/500.html.heex
1515
#
16-
# embed_templates "error_html/*"
16+
embed_templates "error_html/*"
1717

1818
# The default is to render a plain text page based on
1919
# the template name. For example, "404.html" becomes
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>404</title>
7+
<link rel="stylesheet" href="/assets/app.css" />
8+
<script defer type="text/javascript" src="/assets/app.js">
9+
</script>
10+
</head>
11+
<body>
12+
<main class="my-60 flex-auto">
13+
<section class="flex w-full flex-col items-center justify-center">
14+
<a href="/" class="items-center justify-center">
15+
<img class="my-5 w-40" src="/images/cesium.svg" alt="cesium-logo" />
16+
</a>
17+
<p class="text-center text-5xl font-medium">
18+
404 Page Not Found
19+
</p>
20+
<p class="my-3 text-center text-2xl">Oops! Looks like you are lost.</p>
21+
<p class="my-5 text-center text-lg">Click on the logo to return home</p>
22+
</section>
23+
</main>
24+
</body>
25+
</html>

test/cesium_link_web/controllers/error_html_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule CesiumLinkWeb.ErrorHTMLTest do
55
import Phoenix.Template
66

77
test "renders 404.html" do
8-
assert render_to_string(CesiumLinkWeb.ErrorHTML, "404", "html", []) == "Not Found"
8+
assert render_to_string(CesiumLinkWeb.ErrorHTML, "404", "html", []) =~ "404 Page Not Found"
99
end
1010

1111
test "renders 500.html" do

0 commit comments

Comments
 (0)