diff options
author | Phil Hagelberg <phil@hagelb.org> | 2019-11-05 22:00:19 -0800 |
---|---|---|
committer | Phil Hagelberg <phil@hagelb.org> | 2019-11-09 18:08:08 -0800 |
commit | b0080fa73010cda34215baeee230481b5c56dbca (patch) | |
tree | e273f383bea04dd1de00a321023c9a0ddeefbdc2 /lib | |
parent | e27c61218d292c5fbf268f27e81dbe22f93ba90f (diff) | |
download | pleroma-b0080fa73010cda34215baeee230481b5c56dbca.tar.gz |
Render errors in HTML, not with JS.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/static_fe/static_fe_controller.ex | 4 | ||||
-rw-r--r-- | lib/pleroma/web/templates/layout/static_fe.html.eex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/templates/static_fe/static_fe/error.html.eex | 7 |
3 files changed, 10 insertions, 3 deletions
diff --git a/lib/pleroma/web/static_fe/static_fe_controller.ex b/lib/pleroma/web/static_fe/static_fe_controller.ex index 10bd3fecd..0be47d6b3 100644 --- a/lib/pleroma/web/static_fe/static_fe_controller.ex +++ b/lib/pleroma/web/static_fe/static_fe_controller.ex @@ -78,7 +78,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do _ -> conn |> put_status(404) - |> render_error(:not_found, "Notice not found") + |> render("error.html", %{message: "Post not found.", meta: ""}) end end @@ -108,7 +108,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do _ -> conn |> put_status(404) - |> render_error(:not_found, "User not found") + |> render("error.html", %{message: "User not found.", meta: ""}) end end diff --git a/lib/pleroma/web/templates/layout/static_fe.html.eex b/lib/pleroma/web/templates/layout/static_fe.html.eex index 5d820bb4b..819632cec 100644 --- a/lib/pleroma/web/templates/layout/static_fe.html.eex +++ b/lib/pleroma/web/templates/layout/static_fe.html.eex @@ -4,7 +4,7 @@ <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1,minimal-ui" /> <title><%= Pleroma.Config.get([:instance, :name]) %></title> - <%= Phoenix.HTML.raw(@meta || "") %> + <%= Phoenix.HTML.raw(assigns[:meta] || "") %> <link rel="stylesheet" href="/static/static-fe.css"> </head> <body> diff --git a/lib/pleroma/web/templates/static_fe/static_fe/error.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/error.html.eex new file mode 100644 index 000000000..d98a1eba7 --- /dev/null +++ b/lib/pleroma/web/templates/static_fe/static_fe/error.html.eex @@ -0,0 +1,7 @@ +<header> + <h1><%= gettext("Oops") %></h1> +</header> + +<main> + <p><%= @message %></p> +</main> |