From 7b93d20221d26f53d1c90c5b41f4a7ae555ed152 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Fri, 20 Nov 2020 12:05:11 +0200 Subject: [PATCH] Setup correct redirects --- lib/plausible_web/controllers/site_controller.ex | 10 +++++----- .../templates/site/custom_domain_snippet.html.eex | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/plausible_web/controllers/site_controller.ex b/lib/plausible_web/controllers/site_controller.ex index 709602606..063428fc5 100644 --- a/lib/plausible_web/controllers/site_controller.ex +++ b/lib/plausible_web/controllers/site_controller.ex @@ -230,7 +230,7 @@ defmodule PlausibleWeb.SiteController do conn |> put_flash(:success, "#{site.domain} stats will be reset in a few minutes") - |> redirect(to: "/#{URI.encode_www_form(site.domain)}/settings/general") + |> redirect(to: "/#{URI.encode_www_form(site.domain)}/settings/danger-zone") end def delete_site(conn, %{"website" => website}) do @@ -260,7 +260,7 @@ defmodule PlausibleWeb.SiteController do conn |> put_flash(:success, "Stats for #{site.domain} are now public.") - |> redirect(to: "/#{URI.encode_www_form(site.domain)}/settings/general") + |> redirect(to: "/#{URI.encode_www_form(site.domain)}/settings/visibility") end def make_private(conn, %{"website" => website}) do @@ -271,7 +271,7 @@ defmodule PlausibleWeb.SiteController do conn |> put_flash(:success, "Stats for #{site.domain} are now private.") - |> redirect(to: "/#{URI.encode_www_form(site.domain)}/settings/general") + |> redirect(to: "/#{URI.encode_www_form(site.domain)}/settings/visibility") end def enable_weekly_report(conn, %{"website" => website}) do @@ -401,7 +401,7 @@ defmodule PlausibleWeb.SiteController do case Repo.insert(changes) do {:ok, _created} -> - redirect(conn, to: "/#{URI.encode_www_form(site.domain)}/settings/general") + redirect(conn, to: "/#{URI.encode_www_form(site.domain)}/settings/visibility") {:error, changeset} -> conn @@ -420,7 +420,7 @@ defmodule PlausibleWeb.SiteController do Repo.get_by(Plausible.Site.SharedLink, slug: slug) |> Repo.delete!() - redirect(conn, to: "/#{URI.encode_www_form(site.domain)}/settings/general") + redirect(conn, to: "/#{URI.encode_www_form(site.domain)}/settings/visibility") end def new_custom_domain(conn, %{"website" => website}) do diff --git a/lib/plausible_web/templates/site/custom_domain_snippet.html.eex b/lib/plausible_web/templates/site/custom_domain_snippet.html.eex index b4b5ac756..f9835290c 100644 --- a/lib/plausible_web/templates/site/custom_domain_snippet.html.eex +++ b/lib/plausible_web/templates/site/custom_domain_snippet.html.eex @@ -18,7 +18,7 @@ - <%= link("Back to settings →", class: "button mt-4 w-full", to: "/#{URI.encode_www_form(@site.domain)}/settings#custom-domain") %> + <%= link("Back to settings →", class: "button mt-4 w-full", to: "/#{URI.encode_www_form(@site.domain)}/settings/custom-domain") %>

Problems? <%= link("Get help via email", to: "mailto:support@plausible.io", class: "text-indigo-800 underline") %>