Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Add login link to 404 page (#3288)
Uku Tahtda3d4366f693
diff --git a/assets/css/app.css b/assets/css/app.cssindex 298eaf64af..11a3951888 100644--- a/assets/css/app.css+++ b/assets/css/app.css@@ -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;}diff --git a/lib/plausible_web/templates/error/404_error.html.eex b/lib/plausible_web/templates/error/404_error.html.eexnew file mode 100644index 0000000000..648ca14777--- /dev/null+++ b/lib/plausible_web/templates/error/404_error.html.eex@@ -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>diff --git a/lib/plausible_web/views/error_view.ex b/lib/plausible_web/views/error_view.exindex 2a2f8b78bd..1299731c13 100644--- a/lib/plausible_web/views/error_view.ex+++ b/lib/plausible_web/views/error_view.ex@@ -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)enddef render(<<"5", _error_5xx::binary-size(2), ".html">>, assigns) dodiff --git a/test/plausible_web/controllers/stats_controller_test.exs b/test/plausible_web/controllers/stats_controller_test.exsindex 70330665ce..132072759a 100644--- a/test/plausible_web/controllers/stats_controller_test.exs+++ b/test/plausible_web/controllers/stats_controller_test.exs@@ -45,7 +45,7 @@ defmodule PlausibleWeb.StatsControllerTest dotest "can not view stats of a private website", %{conn: conn} doconn = get(conn, "/test-site.com")- assert html_response(conn, 404) =~ "There's nothing here"+ assert html_response(conn, 404) =~ "There's nothing here"endend@@ -67,7 +67,7 @@ defmodule PlausibleWeb.StatsControllerTest dotest "can not view stats of someone else's website", %{conn: conn} dosite = 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"endend