projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e27c612
)
Render errors in HTML, not with JS.
author
Phil Hagelberg
<phil@hagelb.org>
Wed, 6 Nov 2019 06:00:19 +0000
(22:00 -0800)
committer
Phil Hagelberg
<phil@hagelb.org>
Sun, 10 Nov 2019 02:08:08 +0000
(18:08 -0800)
lib/pleroma/web/static_fe/static_fe_controller.ex
patch
|
blob
|
history
lib/pleroma/web/templates/layout/static_fe.html.eex
patch
|
blob
|
history
lib/pleroma/web/templates/static_fe/static_fe/error.html.eex
[new file with mode: 0644]
patch
|
blob
diff --git
a/lib/pleroma/web/static_fe/static_fe_controller.ex
b/lib/pleroma/web/static_fe/static_fe_controller.ex
index 10bd3fecd4ed8ac4ef3420d91c0bebd1c810f352..0be47d6b350a8c2db72a2d821e149baa649b414f 100644
(file)
--- 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)
_ ->
conn
|> put_status(404)
- |> render
_error(:not_found, "Notice not found"
)
+ |> render
("error.html", %{message: "Post not found.", meta: ""}
)
end
end
end
end
@@
-108,7
+108,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEController do
_ ->
conn
|> put_status(404)
_ ->
conn
|> put_status(404)
- |> render
_error(:not_found, "User not found"
)
+ |> render
("error.html", %{message: "User not found.", meta: ""}
)
end
end
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 5d820bb4bf36a2df8fc75d97a406937ef1d97d61..819632cec27c7e2c01003cf8139b4c5d94497df1 100644
(file)
--- 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>
<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>
<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
(file)
index 0000000..
d98a1eb
--- /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>