Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: error pages #74

Merged
merged 8 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ config :cesium_link, CesiumLinkWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4000],
check_origin: false,
code_reloader: true,
debug_errors: true,
debug_errors: false,
ruilopesm marked this conversation as resolved.
Show resolved Hide resolved
secret_key_base: "6u3rGnb0UXmh9e8TXewRiiEYUFNvzvvgHTrDY0EqxJq7t44sm8gVtVO9+7AfQtQV",
watchers: [
esbuild: {Esbuild, :install_and_run, [:cesium_link, ~w(--sourcemap=inline --watch)]},
Expand Down
2 changes: 1 addition & 1 deletion lib/cesium_link_web/controllers/error_html.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule CesiumLinkWeb.ErrorHTML do
# * lib/cesium_link_web/controllers/error_html/404.html.heex
# * lib/cesium_link_web/controllers/error_html/500.html.heex
#
# embed_templates "error_html/*"
embed_templates "error_html/*"

# The default is to render a plain text page based on
# the template name. For example, "404.html" becomes
Expand Down
25 changes: 25 additions & 0 deletions lib/cesium_link_web/controllers/error_html/404.html.heex
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>404</title>
<link rel="stylesheet" href="/assets/app.css" />
<script defer type="text/javascript" src="/assets/app.js">
</script>
</head>
<body>
<main class="my-60 flex-auto">
<section class="flex w-full flex-col items-center justify-center">
<a href="/" class="items-center justify-center">
<img class="my-5 w-40" src="/images/cesium.svg" alt="Cesium-Logo" />
ruilopesm marked this conversation as resolved.
Show resolved Hide resolved
</a>
<p class="text-center text-5xl font-medium">
404 Page not found
ruilopesm marked this conversation as resolved.
Show resolved Hide resolved
</p>
<p class="my-3 text-center text-2xl">Oops! Looks like you are lost.</p>
<p class="my-5 text-center text-lg">Click on the logo to turn back.</p>
ruilopesm marked this conversation as resolved.
Show resolved Hide resolved
</section>
</main>
</body>
</html>
2 changes: 1 addition & 1 deletion test/cesium_link_web/controllers/error_html_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule CesiumLinkWeb.ErrorHTMLTest do
import Phoenix.Template

test "renders 404.html" do
assert render_to_string(CesiumLinkWeb.ErrorHTML, "404", "html", []) == "Not Found"
assert render_to_string(CesiumLinkWeb.ErrorHTML, "404", "html", []) =~ "404 Page not found"
ruilopesm marked this conversation as resolved.
Show resolved Hide resolved
end

test "renders 500.html" do
Expand Down
Loading