Skip to content

Commit

Permalink
Setup correct redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
ukutaht committed Nov 20, 2020
1 parent cb8424b commit 7b93d20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/plausible_web/controllers/site_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]", class: "text-indigo-800 underline") %>
</p>
Expand Down

0 comments on commit 7b93d20

Please sign in to comment.