Setup correct redirects

This commit is contained in:
Uku Taht 2020-11-20 12:05:11 +02:00
parent cb8424b441
commit 7b93d20221
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -18,7 +18,7 @@
</a>
</div>
</div>
<%= 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") %>
<p class="mt-4 text-gray-600 text-sm">
Problems? <%= link("Get help via email", to: "mailto:support@plausible.io", class: "text-indigo-800 underline") %>
</p>