From 7e589deaf51dc68ffad9fb4f4ea8fb22a373febe Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Mon, 27 Nov 2023 14:15:26 +0100 Subject: [PATCH] Convert waiting_first_pageview to heex and stop relying on env vars --- .../stats/waiting_first_pageview.html.eex | 37 ------------ .../stats/waiting_first_pageview.html.heex | 59 +++++++++++++++++++ lib/plausible_web/views/stats_view.ex | 1 + 3 files changed, 60 insertions(+), 37 deletions(-) delete mode 100644 lib/plausible_web/templates/stats/waiting_first_pageview.html.eex create mode 100644 lib/plausible_web/templates/stats/waiting_first_pageview.html.heex diff --git a/lib/plausible_web/templates/stats/waiting_first_pageview.html.eex b/lib/plausible_web/templates/stats/waiting_first_pageview.html.eex deleted file mode 100644 index 7a297b84a..000000000 --- a/lib/plausible_web/templates/stats/waiting_first_pageview.html.eex +++ /dev/null @@ -1,37 +0,0 @@ - - -
- <%= if @site.locked do %> - - <% end %> -
-

Waiting for first pageview

-

on <%= @site.domain %>

-
-
-

- Need to see the snippet again? <%= link("Click here", to: "/#{URI.encode_www_form(@site.domain)}/snippet", class: "text-indigo-600 dark:text-indigo-500 text-underline")%>
- Not working? <%= link("Troubleshoot the integration", to: "https://plausible.io/docs/troubleshoot-integration#check-for-the-plausible-snippet-in-your-source-code", class: "text-indigo-600 dark:text-indigo-500 text-underline", rel: "noreferrer") %> with our guide - <%= if Application.get_env(:plausible, :is_selfhost) do %> - first
Still not working? Ask on our <%= link("community-supported forum", to: "https://github.com/plausible/analytics/discussions", class: "text-indigo-600 dark:text-indigo-500 text-underline" ) %> - <% else %> - first
Still not working? <%= link("Contact us", to: "https://plausible.io/contact", class: "text-indigo-600 dark:text-indigo-500 text-underline" ) %> and we will help you with your setup - <% end %> -

-
-
-
diff --git a/lib/plausible_web/templates/stats/waiting_first_pageview.html.heex b/lib/plausible_web/templates/stats/waiting_first_pageview.html.heex new file mode 100644 index 000000000..98d2dcfa6 --- /dev/null +++ b/lib/plausible_web/templates/stats/waiting_first_pageview.html.heex @@ -0,0 +1,59 @@ + + +
+ <%= if @site.locked do %> + + <% end %> +
+

Waiting for first pageview

+

on <%= @site.domain %>

+
+
+

+ Need to see the snippet again? + <.styled_link href={"/#{URI.encode_www_form(@site.domain)}/snippet"}> + Click here + + +
Not working? + <.styled_link + new_tab + href="https://plausible.io/docs/troubleshoot-integration#check-for-the-plausible-snippet-in-your-source-code" + > + Troubleshoot the integration + + +
+ + Still not working? + <.styled_link new_tab href="https://plausible.io/contact">Contact us + and we will help you with your setup + + + Still not working? Ask on our + <.styled_link new_tab href="https://github.com/plausible/analytics/discussions"> + community-supported forum + + +

+
+
+
diff --git a/lib/plausible_web/views/stats_view.ex b/lib/plausible_web/views/stats_view.ex index a8babcd2e..70e5e10bd 100644 --- a/lib/plausible_web/views/stats_view.ex +++ b/lib/plausible_web/views/stats_view.ex @@ -1,5 +1,6 @@ defmodule PlausibleWeb.StatsView do use PlausibleWeb, :view + use Plausible def base_domain do PlausibleWeb.Endpoint.host()