mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 03:04:43 +03:00
Add login link to 404 page (#3288)
* Add login link to 404 page * Fix 404 test * Fix another test
This commit is contained in:
parent
b9fb6fd1a7
commit
da3d4366f6
@ -22,6 +22,10 @@
|
||||
@apply text-indigo-600 bg-transparent border border-indigo-600;
|
||||
}
|
||||
|
||||
.button-outline:hover {
|
||||
@apply text-white;
|
||||
}
|
||||
|
||||
.button-sm {
|
||||
@apply px-4 py-2 text-sm;
|
||||
}
|
||||
|
9
lib/plausible_web/templates/error/404_error.html.eex
Normal file
9
lib/plausible_web/templates/error/404_error.html.eex
Normal file
@ -0,0 +1,9 @@
|
||||
<div class="container flex flex-col items-center text-center mt-24">
|
||||
<h1 class="text-5xl font-black dark:text-gray-100"><%= @status %></h1>
|
||||
<div class="mt-4 text-xl dark:text-gray-100">Oops! There's nothing here</div>
|
||||
<div class="text-xl dark:text-gray-100">Trying to access your dashboard? You may need to log in again to see it</div>
|
||||
<div class="mt-6 flex">
|
||||
<%= link("Login", to: Routes.auth_path(@conn, :login_form), class: "button") %>
|
||||
<%= link("Go to homepage", to: PlausibleWeb.LayoutView.home_dest(@conn), class: "button button-outline ml-2") %>
|
||||
</div>
|
||||
</div>
|
@ -14,7 +14,7 @@ defmodule PlausibleWeb.ErrorView do
|
||||
|> Map.put(:status, 404)
|
||||
|> Map.put_new(:message, "Oops! There's nothing here")
|
||||
|
||||
render("generic_error.html", assigns)
|
||||
render("404_error.html", assigns)
|
||||
end
|
||||
|
||||
def render(<<"5", _error_5xx::binary-size(2), ".html">>, assigns) do
|
||||
|
@ -45,7 +45,7 @@ defmodule PlausibleWeb.StatsControllerTest do
|
||||
|
||||
test "can not view stats of a private website", %{conn: conn} do
|
||||
conn = get(conn, "/test-site.com")
|
||||
assert html_response(conn, 404) =~ "There's nothing here"
|
||||
assert html_response(conn, 404) =~ "There's nothing here"
|
||||
end
|
||||
end
|
||||
|
||||
@ -67,7 +67,7 @@ defmodule PlausibleWeb.StatsControllerTest do
|
||||
test "can not view stats of someone else's website", %{conn: conn} do
|
||||
site = insert(:site)
|
||||
conn = get(conn, "/" <> site.domain)
|
||||
assert html_response(conn, 404) =~ "There's nothing here"
|
||||
assert html_response(conn, 404) =~ "There's nothing here"
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user