From 6f842b5603cd2fe1613316249c257cdc1f8f36e3 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Wed, 27 Oct 2021 11:38:24 +0200 Subject: [PATCH] Add better copy to locked page --- .../controllers/stats_controller.ex | 4 +- .../templates/stats/site_locked.html.eex | 53 ++++++++++++------- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/lib/plausible_web/controllers/stats_controller.ex b/lib/plausible_web/controllers/stats_controller.ex index bd4c02a69..ab5d71b41 100644 --- a/lib/plausible_web/controllers/stats_controller.ex +++ b/lib/plausible_web/controllers/stats_controller.ex @@ -32,9 +32,11 @@ defmodule PlausibleWeb.StatsController do |> render("waiting_first_pageview.html", site: site) site.locked -> + owner = Plausible.Sites.owner_for(site) + conn |> assign(:skip_plausible_tracking, true) - |> render("site_locked.html", site: site) + |> render("site_locked.html", owner: owner, site: site) end end diff --git a/lib/plausible_web/templates/stats/site_locked.html.eex b/lib/plausible_web/templates/stats/site_locked.html.eex index bf70cb986..38c768af2 100644 --- a/lib/plausible_web/templates/stats/site_locked.html.eex +++ b/lib/plausible_web/templates/stats/site_locked.html.eex @@ -1,31 +1,46 @@
-
+
-

+

Site locked

- <%= if @conn.assigns[:current_user_role] == :owner do %> -
-

- This site is locked because you don't have an active subscription. We are still counting stats in the background but your access to the dashboard is restricted. Subscribe with the link below to access your stats again. -

-
-
- <%= link("Manage my subscription", to: "/settings", class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm") %> -
- <% else %> -
-

+ <%= case @conn.assigns[:current_user_role] do %> + <%= :owner -> %> +

+

+ This site is locked because you don't have an active subscription. We are still counting stats in the background but your access to the dashboard is restricted. Subscribe with the link below to access your stats again. +

+
+
+ <%= link("Manage my subscription", to: "/settings", class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm") %> +
+ <%= role when role in [:admin, :viewer] -> %> +
+

+ This site is currently locked and cannot be accessed. The site owner <%= @owner.email %> must upgrage their subscription plan in order to + unlock the site. +

+
+

Want to pay for this site with the account you're logged in with?

+

Contact <%= @owner.email %> and ask them to <%= link("tranfer the ownership", class: "text-indigo-500", to: "https://plausible.io/docs/transfer-ownership", rel: "noreferrer") %> of the site over to you

+
+
+
+ <%= link("Back to my sites", to: "/sites", class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm") %> +
+ <%= _ -> %> +
+

This site is currently locked and cannot be accessed. You can check back later or contact the site owner to unlock it. -

-
-
- <%= link("Back to my sites", to: "/sites", class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm") %> -
+

+
+
+ <%= link("Back to my sites", to: "/sites", class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm") %> +
<% end %>