From 97d87acb4de8cf2c8b6978827d77661b070876d2 Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Mon, 27 Nov 2023 14:50:40 +0100 Subject: [PATCH] Update templates relying on app env --- .../templates/auth/user_settings.html.heex | 2 +- .../templates/layout/_footer.html.heex | 308 ++++++++++++++++++ .../templates/layout/_header.html.heex | 31 +- .../templates/layout/_tracking.html.heex | 2 +- 4 files changed, 326 insertions(+), 17 deletions(-) create mode 100644 lib/plausible_web/templates/layout/_footer.html.heex diff --git a/lib/plausible_web/templates/auth/user_settings.html.heex b/lib/plausible_web/templates/auth/user_settings.html.heex index ac373d707..6ede880e4 100644 --- a/lib/plausible_web/templates/auth/user_settings.html.heex +++ b/lib/plausible_web/templates/auth/user_settings.html.heex @@ -1,4 +1,4 @@ -<%= if !Application.get_env(:plausible, :is_selfhost) do %> +<%= if full_build?() do %>

Subscription Plan

diff --git a/lib/plausible_web/templates/layout/_footer.html.heex b/lib/plausible_web/templates/layout/_footer.html.heex new file mode 100644 index 000000000..802d9079c --- /dev/null +++ b/lib/plausible_web/templates/layout/_footer.html.heex @@ -0,0 +1,308 @@ +
+
+
+
+

+ + Plausible Analytics +

+

+ <%= if full_build?() do %> + Made and hosted in the EU 🇪🇺
+ <% end %> + Solely funded by our subscribers.
+

+ <%= if not full_build?() do %> + + <% end %> +
+ +
+
+
diff --git a/lib/plausible_web/templates/layout/_header.html.heex b/lib/plausible_web/templates/layout/_header.html.heex index 753f746f8..450a5daa7 100644 --- a/lib/plausible_web/templates/layout/_header.html.heex +++ b/lib/plausible_web/templates/layout/_header.html.heex @@ -24,15 +24,16 @@ <%= cond do %> <% @conn.assigns[:current_user] -> %>
    - <%= if Plausible.Billing.on_trial?(@conn.assigns[:current_user]) && !Application.get_env(:plausible, :is_selfhost) do %> - - <% end %> +
  • <.dropdown> <:button class="flex items-center gap-3 px-3 py-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800"> @@ -57,17 +58,17 @@ <.dropdown_link new_tab href="https://plausible.io/docs"> Help Center - <%= if Application.get_env(:plausible, :is_selfhost) do %> - <.dropdown_link new_tab href="https://github.com/plausible/analytics"> - Github Repo - - <% else %> + <%= if full_build?() do %> <.dropdown_link new_tab href="https://plausible.io/contact"> Contact Support <.dropdown_link new_tab href={feedback_link(@conn.assigns[:current_user])}> Feature Requests + <% else %> + <.dropdown_link new_tab href="https://github.com/plausible/analytics"> + Github Repo + <% end %>
@@ -76,7 +77,7 @@ - <%= if @conn.assigns[:current_user] && !Application.get_env(:plausible, :is_selfhost) do %> + <%= if @conn.assigns[:current_user] && full_build?() do %>
  • <% end %> diff --git a/lib/plausible_web/templates/layout/_tracking.html.heex b/lib/plausible_web/templates/layout/_tracking.html.heex index 9e3cc9b1c..2d1ea894a 100644 --- a/lib/plausible_web/templates/layout/_tracking.html.heex +++ b/lib/plausible_web/templates/layout/_tracking.html.heex @@ -1,4 +1,4 @@ -<%= if !Application.get_env(:plausible, :is_selfhost) && !@conn.assigns[:skip_plausible_tracking] do %> +<%= if full_build?() && !@conn.assigns[:skip_plausible_tracking] do %>