Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Reduce Phoenix.HTML usage (#4675)
hq170997abfc741
diff --git a/extra/lib/plausible_web/live/funnel_settings.ex b/extra/lib/plausible_web/live/funnel_settings.exindex 61d0988782..1a5a801bdc 100644--- a/extra/lib/plausible_web/live/funnel_settings.ex+++ b/extra/lib/plausible_web/live/funnel_settings.ex@@ -3,7 +3,6 @@ defmodule PlausibleWeb.Live.FunnelSettings doLiveView allowing listing, creating and deleting funnels."""use PlausibleWeb, :live_view- use Phoenix.HTMLuse Plausible.Funnel@@ -64,13 +63,15 @@ defmodule PlausibleWeb.Live.FunnelSettings do</div><div :if={@goal_count < Funnel.min_steps()}>- <PlausibleWeb.Components.Generic.notice class="mt-4" title="Not enough goals">- You need to define at least two goals to create a funnel. Go ahead and <%= link(- "add goals",- to: PlausibleWeb.Router.Helpers.site_path(@socket, :settings_goals, @domain),- class: "text-indigo-500 w-full text-center"- ) %> to proceed.- </PlausibleWeb.Components.Generic.notice>+ <.notice class="mt-4" title="Not enough goals">+ You need to define at least two goals to create a funnel. Go ahead and+ <.styled_link href={+ PlausibleWeb.Router.Helpers.site_path(@socket, :settings_goals, @domain)+ }>+ add goals+ </.styled_link>+ to proceed.+ </.notice></div></div>"""diff --git a/extra/lib/plausible_web/live/funnel_settings/form.ex b/extra/lib/plausible_web/live/funnel_settings/form.exindex ea794eb55a..4a98bc23d2 100644--- a/extra/lib/plausible_web/live/funnel_settings/form.ex+++ b/extra/lib/plausible_web/live/funnel_settings/form.ex@@ -123,7 +123,7 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do</p></div>- <PlausibleWeb.Components.Generic.button+ <.buttonid="save"type="submit"class="w-full"@@ -133,7 +133,7 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do}><span><%= if @funnel, do: "Update", else: "Add" %> Funnel</span>- </PlausibleWeb.Components.Generic.button>+ </.button></div></.form></div>diff --git a/extra/lib/plausible_web/live/funnel_settings/list.ex b/extra/lib/plausible_web/live/funnel_settings/list.exindex 5103048145..ee76732bc8 100644--- a/extra/lib/plausible_web/live/funnel_settings/list.ex+++ b/extra/lib/plausible_web/live/funnel_settings/list.ex@@ -7,9 +7,7 @@ defmodule PlausibleWeb.Live.FunnelSettings.List domessage before deleting the funnel from the UI. If there are no funnelsconfigured for the site, a message is displayed indicating so."""- use Phoenix.LiveComponent- use Phoenix.HTML- import PlausibleWeb.Components.Generic+ use PlausibleWeb, :live_componentdef render(assigns) do~H"""diff --git a/lib/plausible_web.ex b/lib/plausible_web.exindex 9044b258a9..d7650aac30 100644--- a/lib/plausible_web.ex+++ b/lib/plausible_web.ex@@ -15,6 +15,27 @@ defmodule PlausibleWeb doalias Phoenix.LiveView.JSimport PlausibleWeb.Components.Generic+ import PlausibleWeb.Live.Components.Form+ end+ end++ def live_component do+ quote do+ use Phoenix.LiveComponent, global_prefixes: ~w(x-)+ import PlausibleWeb.Components.Generic+ import PlausibleWeb.Live.Components.Form+ alias Phoenix.LiveView.JS+ alias PlausibleWeb.Router.Helpers, as: Routes+ end+ end++ def component do+ quote do+ use Phoenix.Component, global_prefixes: ~w(x-)+ import PlausibleWeb.Components.Generic+ import PlausibleWeb.Live.Components.Form+ alias Phoenix.LiveView.JS+ alias PlausibleWeb.Router.Helpers, as: Routesendend@@ -37,12 +58,9 @@ defmodule PlausibleWeb do# Import convenience functions from controllersimport Phoenix.Controller, only: [view_module: 1]- # Use all HTML functionality (forms, tags, etc)- use Phoenix.HTMLuse Phoenix.Componentimport PlausibleWeb.ErrorHelpers- import PlausibleWeb.FormHelpersimport PlausibleWeb.Components.Genericimport PlausibleWeb.Live.Components.Formalias PlausibleWeb.Router.Helpers, as: Routesdiff --git a/lib/plausible_web/components/billing/billing.ex b/lib/plausible_web/components/billing/billing.exindex 5adeef3dee..74ce1544af 100644--- a/lib/plausible_web/components/billing/billing.ex+++ b/lib/plausible_web/components/billing/billing.ex@@ -1,10 +1,9 @@defmodule PlausibleWeb.Components.Billing do@moduledoc false- use Phoenix.Component- import PlausibleWeb.Components.Generic+ use PlausibleWeb, :component+require Plausible.Billing.Subscription.Status- alias PlausibleWeb.Router.Helpers, as: Routesalias Plausible.Billing.{Subscription, Subscriptions}def render_monthly_pageview_usage(%{usage: usage} = assigns)@@ -267,12 +266,9 @@ defmodule PlausibleWeb.Components.Billing dodef upgrade_link(assigns) do~H"""- <PlausibleWeb.Components.Generic.button_link- id="upgrade-link-2"- href={Routes.billing_path(PlausibleWeb.Endpoint, :choose_plan)}- >+ <.button_link id="upgrade-link-2" href={Routes.billing_path(PlausibleWeb.Endpoint, :choose_plan)}>Upgrade- </PlausibleWeb.Components.Generic.button_link>+ </.button_link>"""enddiff --git a/lib/plausible_web/components/billing/notice.ex b/lib/plausible_web/components/billing/notice.exindex c4b9a18537..409d4b4bcf 100644--- a/lib/plausible_web/components/billing/notice.ex+++ b/lib/plausible_web/components/billing/notice.ex@@ -1,10 +1,9 @@defmodule PlausibleWeb.Components.Billing.Notice do@moduledoc false- use Phoenix.Component+ use PlausibleWeb, :component+require Plausible.Billing.Subscription.Status- import PlausibleWeb.Components.Generic- alias PlausibleWeb.Router.Helpers, as: Routesalias Plausible.Auth.Useralias Plausible.Billing.{Subscription, Plans, Subscriptions, Feature}diff --git a/lib/plausible_web/components/billing/pageview_slider.ex b/lib/plausible_web/components/billing/pageview_slider.exindex f997cc0e88..10ee1ba887 100644--- a/lib/plausible_web/components/billing/pageview_slider.ex+++ b/lib/plausible_web/components/billing/pageview_slider.ex@@ -1,8 +1,7 @@defmodule PlausibleWeb.Components.Billing.PageviewSlider do@moduledoc false- use Phoenix.Component- use Phoenix.HTML+ use PlausibleWeb, :componentdef render(assigns) do~H"""@@ -71,7 +70,7 @@ defmodule PlausibleWeb.Components.Billing.PageviewSlider do</form><script>- const SLIDER_LABELS = <%= raw Jason.encode!(@slider_labels) %>+ const SLIDER_LABELS = <%= Phoenix.HTML.raw Jason.encode!(@slider_labels) %>function repositionBubble() {const input = document.getElementById("slider")diff --git a/lib/plausible_web/components/billing/plan_box.ex b/lib/plausible_web/components/billing/plan_box.exindex 479720f967..7b2e3ce2ad 100644--- a/lib/plausible_web/components/billing/plan_box.ex+++ b/lib/plausible_web/components/billing/plan_box.ex@@ -1,11 +1,11 @@defmodule PlausibleWeb.Components.Billing.PlanBox do@moduledoc false- use Phoenix.Component+ use PlausibleWeb, :component+require Plausible.Billing.Subscription.Statusalias PlausibleWeb.Components.Billing.{PlanBenefits, Notice}alias Plausible.Billing.{Plan, Quota, Subscription}- alias PlausibleWeb.Router.Helpers, as: Routesdef standard(assigns) dohighlight =@@ -231,7 +231,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox doUpgrade</PlausibleWeb.Components.Billing.paddle_button><% end %>- <PlausibleWeb.Components.Generic.tooltip :if={@exceeded_plan_limits != [] && @disabled_message}>+ <.tooltip :if={@exceeded_plan_limits != [] && @disabled_message}><div class="pt-2 text-sm w-full flex items-center text-red-700 dark:text-red-500 justify-center"><%= @disabled_message %><Heroicons.information_circle class="hidden sm:block w-5 h-5 sm:ml-2" />@@ -242,7 +242,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do<%= Phoenix.Naming.humanize(limit) %><br /></p></:tooltip_content>- </PlausibleWeb.Components.Generic.tooltip>+ </.tooltip><div:if={@disabled_message && @exceeded_plan_limits == []}class="pt-2 text-sm w-full text-red-700 dark:text-red-500 text-center"diff --git a/lib/plausible_web/components/first_dashboard_launch_banner.ex b/lib/plausible_web/components/first_dashboard_launch_banner.exindex f4ed01c43c..a336c909d2 100644--- a/lib/plausible_web/components/first_dashboard_launch_banner.ex+++ b/lib/plausible_web/components/first_dashboard_launch_banner.ex@@ -2,8 +2,8 @@ defmodule PlausibleWeb.Components.FirstDashboardLaunchBanner do@moduledoc """A banner that appears on the first dashboard launch"""- use Phoenix.Component- use Phoenix.HTML++ use PlausibleWeb, :componentattr(:site, Plausible.Site, required: true)@@ -28,10 +28,9 @@ defmodule PlausibleWeb.Components.FirstDashboardLaunchBanner dox-bind:class="! show ? 'hidden' : ''"x-init={x_init(@site)}>- <%= link("Team members, email reports and GA import. Explore more →",- to: "/#{URI.encode_www_form(@site.domain)}/settings/email-reports",- class: "py-2 block"- ) %>+ <.styled_link href={"/#{URI.encode_www_form(@site.domain)}/settings/email-reports"}>+ Team members, email reports and GA import. Explore more →+ </.styled_link></div>"""enddiff --git a/lib/plausible_web/components/generic.ex b/lib/plausible_web/components/generic.exindex cf741eadf2..9aadcdf72c 100644--- a/lib/plausible_web/components/generic.ex+++ b/lib/plausible_web/components/generic.ex@@ -40,7 +40,7 @@ defmodule PlausibleWeb.Components.Generic doattr(:class, :string, default: "")attr(:disabled, :boolean, default: false)attr(:mt?, :boolean, default: true)- attr(:rest, :global)+ attr(:rest, :global, include: ~w(name))slot(:inner_block)@@ -285,7 +285,7 @@ defmodule PlausibleWeb.Components.Generic doattr(:href, :string, required: true)attr(:new_tab, :boolean, default: false)- attr(:class, :string, default: "")+ attr(:class, :string, default: nil)attr(:rest, :global)attr(:method, :string, default: "get")slot(:inner_block)@@ -325,9 +325,7 @@ defmodule PlausibleWeb.Components.Generic do"""else~H"""- <.link class={@class} href={@href} {@extra} {@rest}>- <%= render_slot(@inner_block) %>- </.link>+ <.link class={@class} href={@href} {@extra} {@rest}><%= render_slot(@inner_block) %></.link>"""endenddiff --git a/lib/plausible_web/components/google.ex b/lib/plausible_web/components/google.exindex c8067e00f6..ee750ffef4 100644--- a/lib/plausible_web/components/google.ex+++ b/lib/plausible_web/components/google.ex@@ -2,15 +2,18 @@ defmodule PlausibleWeb.Components.Google do@moduledoc """Google-related components"""- use Phoenix.Component- use Phoenix.HTML+ use PlausibleWeb, :componentattr(:to, :string, required: true)attr(:id, :string, required: true)def button(assigns) do~H"""- <%= button(id: @id, to: @to, class: "inline-flex pr-4 items-center border border-gray-100 shadow rounded-md focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-gray-200 mt-8 hover:bg-gray-50 dark:hover:bg-gray-700") do %>+ <.unstyled_link+ id={@id}+ href={@to}+ class="inline-flex pr-4 items-center border border-gray-100 shadow rounded-md focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-gray-200 mt-8 hover:bg-gray-50 dark:hover:bg-gray-700"+ ><.logo /><spanstyle="font-family: Roboto, system-ui"@@ -18,7 +21,7 @@ defmodule PlausibleWeb.Components.Google do>Continue with Google</span>- <% end %>+ </.unstyled_link>"""enddiff --git a/lib/plausible_web/components/settings.ex b/lib/plausible_web/components/settings.exindex 8ace66f044..11528ca6cd 100644--- a/lib/plausible_web/components/settings.ex+++ b/lib/plausible_web/components/settings.ex@@ -2,11 +2,7 @@ defmodule PlausibleWeb.Components.Settings do@moduledoc """An umbrella module for the Integrations settings section"""- use Phoenix.Component- use Phoenix.HTML-- import PlausibleWeb.Components.Generic- alias PlausibleWeb.Router.Helpers, as: Routes+ use PlausibleWeb, :componentembed_templates("../templates/site/settings_search_console.html")enddiff --git a/lib/plausible_web/components/site/feature.ex b/lib/plausible_web/components/site/feature.exindex 7606016437..79f0fb4913 100644--- a/lib/plausible_web/components/site/feature.ex+++ b/lib/plausible_web/components/site/feature.ex@@ -25,12 +25,9 @@ defmodule PlausibleWeb.Components.Site.Feature dofor={nil}class={@class}>- <PlausibleWeb.Components.Generic.toggle_submit- set_to={@current_setting}- disabled?={@disabled?}- >+ <.toggle_submit set_to={@current_setting} disabled?={@disabled?}>Show <%= @feature_mod.display_name() %> in the Dashboard- </PlausibleWeb.Components.Generic.toggle_submit>+ </.toggle_submit></.form><div :if={@current_setting}>diff --git a/lib/plausible_web/components/two_factor.ex b/lib/plausible_web/components/two_factor.exindex 66965ef3ff..b0e3915843 100644--- a/lib/plausible_web/components/two_factor.ex+++ b/lib/plausible_web/components/two_factor.ex@@ -2,8 +2,7 @@ defmodule PlausibleWeb.Components.TwoFactor do@moduledoc """Reusable components specific to 2FA"""- use Phoenix.Component, global_prefixes: ~w(x-)- import PlausibleWeb.Components.Generic+ use PlausibleWeb, :componentattr :text, :string, required: trueattr :scale, :integer, default: 4@@ -58,7 +57,7 @@ defmodule PlausibleWeb.Components.TwoFactor dovalue: "",required: "required") %>- <PlausibleWeb.Components.Generic.button+ <.button:if={@show_button?}type="submit"id={@id}@@ -70,10 +69,9 @@ defmodule PlausibleWeb.Components.TwoFactor do</span><span class="label-disabled">- <PlausibleWeb.Components.Generic.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" />- Verifying...+ <.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" /> Verifying...</span>- </PlausibleWeb.Components.Generic.button>+ </.button></div>"""end@@ -130,7 +128,7 @@ defmodule PlausibleWeb.Components.TwoFactor dox-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"class="inline-block align-bottom bg-white dark:bg-gray-900 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full">- <%= Phoenix.HTML.Form.form_for @form_data, @form_target, [onsubmit: @onsubmit], fn f -> %>+ <.form :let={f} for={@form_data} action={@form_target} onsubmit={@onsubmit}><div class="bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"><div class="hidden sm:block absolute top-0 right-0 pt-4 pr-4"><a@@ -166,7 +164,7 @@ defmodule PlausibleWeb.Components.TwoFactor doCancel</.button></div>- <% end %>+ </.form></div></div></div>diff --git a/lib/plausible_web/live/components/combo_box.ex b/lib/plausible_web/live/components/combo_box.exindex 38411e1389..de3c409be0 100644--- a/lib/plausible_web/live/components/combo_box.ex+++ b/lib/plausible_web/live/components/combo_box.ex@@ -36,8 +36,7 @@ defmodule PlausibleWeb.Live.Components.ComboBox doComboBox own test suite, so there is no need for additionalverification."""- use Phoenix.LiveComponent, global_prefixes: ~w(x-)- alias Phoenix.LiveView.JS+ use PlausibleWeb, :live_component@default_suggestions_limit 15@@ -115,11 +114,8 @@ defmodule PlausibleWeb.Live.Components.ComboBox dorequired={@required}/>- <PlausibleWeb.Components.Generic.spinner class="spinner hidden absolute inset-y-3 right-8" />- <PlausibleWeb.Components.Generic.spinner- x-show="selectionInProgress"- class="spinner absolute inset-y-3 right-8"- />+ <.spinner class="spinner hidden absolute inset-y-3 right-8" />+ <.spinner x-show="selectionInProgress" class="spinner absolute inset-y-3 right-8" /><.dropdown_anchor id={@id} />@@ -133,7 +129,7 @@ defmodule PlausibleWeb.Live.Components.ComboBox do/></div>- <.dropdown+ <.combo_dropdownref={@id}suggest_fun={@suggest_fun}suggestions={@suggestions}@@ -176,7 +172,7 @@ defmodule PlausibleWeb.Live.Components.ComboBox doattr(:creatable, :boolean, required: true)attr(:display_value, :string, required: true)- def dropdown(assigns) do+ def combo_dropdown(assigns) do~H"""<ultabindex="-1"diff --git a/lib/plausible_web/live/components/form.ex b/lib/plausible_web/live/components/form.exindex 7a1e3ddced..2fec26aec1 100644--- a/lib/plausible_web/live/components/form.ex+++ b/lib/plausible_web/live/components/form.ex@@ -23,6 +23,7 @@ defmodule PlausibleWeb.Live.Components.Form doattr(:id, :any, default: nil)attr(:name, :any)attr(:label, :string, default: nil)+ attr(:help_text, :string, default: nil)attr(:value, :any)attr(:width, :string, default: "w-full")@@ -44,7 +45,7 @@ defmodule PlausibleWeb.Live.Components.Form doattr(:rest, :global,include: ~w(accept autocomplete capture cols disabled form list max maxlength min minlength- multiple pattern placeholder readonly required rows size step)+ multiple pattern placeholder readonly required rows size step x-model))attr(:class, :any, default: @default_input_class)@@ -72,6 +73,10 @@ defmodule PlausibleWeb.Live.Components.Form do~H"""<div phx-feedback-for={@name} class={@mt? && "mt-2"}><.label for={@id} class="mb-2"><%= @label %></.label>++ <p :if={@help_text} class="text-gray-500 dark:text-gray-400 mb-2 text-sm">+ <%= @help_text %>+ </p><select id={@id} name={@name} multiple={@multiple} class={[@class, @width]} {@rest}><option :if={@prompt} value=""><%= @prompt %></option><%= Phoenix.HTML.Form.options_for_select(@options, @value) %>@@ -81,6 +86,24 @@ defmodule PlausibleWeb.Live.Components.Form do"""end+ def input(%{type: "checkbox"} = assigns) do+ ~H"""+ <div+ phx-feedback-for={@name}+ class={["flex flex-inline items-center sm:justify-start justify-center gap-x-2", @mt? && "mt-2"]}+ >+ <input+ type="checkbox"+ value={@value || "true"}+ id={@id}+ name={@name}+ class="block h-5 w-5 rounded dark:bg-gray-700 border-gray-300 text-indigo-600 focus:ring-indigo-600"+ />+ <.label for={@id}><%= @label %></.label>+ </div>+ """+ end+# All other inputs text, datetime-local, url, password, etc. are handled here...def input(assigns) doerrors =@@ -97,6 +120,9 @@ defmodule PlausibleWeb.Live.Components.Form do<.label :if={@label != nil and @label != ""} for={@id} class="mb-2"><%= @label %></.label>+ <p :if={@help_text} class="text-gray-500 dark:text-gray-400 mb-2 text-sm">+ <%= @help_text %>+ </p><inputtype={@type}name={@name}diff --git a/lib/plausible_web/live/components/modal.ex b/lib/plausible_web/live/components/modal.exindex 53437d3426..89af4b3432 100644--- a/lib/plausible_web/live/components/modal.ex+++ b/lib/plausible_web/live/components/modal.ex@@ -101,10 +101,9 @@ defmodule PlausibleWeb.Live.Components.Modal do"""- use Phoenix.LiveComponent, global_prefixes: ~w(x-)+ use PlausibleWeb, :live_componentalias Phoenix.LiveView- alias Phoenix.LiveView.JS, as: LiveViewJSdefmodule JS do@moduledoc false@@ -120,14 +119,14 @@ defmodule PlausibleWeb.Live.Components.Modal doendend- @spec open(Phoenix.LiveView.Socket.t(), String.t()) :: Phoenix.LiveView.Socket.t()+ @spec open(LiveView.Socket.t(), String.t()) :: LiveView.Socket.t()def open(socket, id) do- Phoenix.LiveView.push_event(socket, "open-modal", %{id: id})+ LiveView.push_event(socket, "open-modal", %{id: id})end- @spec close(Phoenix.LiveView.Socket.t(), String.t()) :: Phoenix.LiveView.Socket.t()+ @spec close(LiveView.Socket.t(), String.t()) :: LiveView.Socket.t()def close(socket, id) do- Phoenix.LiveView.push_event(socket, "close-modal", %{id: id})+ LiveView.push_event(socket, "close-modal", %{id: id})end@impl true@@ -232,7 +231,7 @@ defmodule PlausibleWeb.Live.Components.Modal do><div class="modal-pre-loading w-full self-center"><div class="text-center">- <PlausibleWeb.Components.Generic.spinner class="inline-block h-8 w-8" />+ <.spinner class="inline-block h-8 w-8" /></div></div></div>@@ -243,7 +242,7 @@ defmodule PlausibleWeb.Live.Components.Modal do<Phoenix.Component.focus_wrap:if={@load_content?}phx-mounted={- LiveViewJS.show(+ LiveView.JS.show(time: 300,transition:{"ease-out duration-300", "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",@@ -265,7 +264,7 @@ defmodule PlausibleWeb.Live.Components.Modal do</Phoenix.Component.focus_wrap><div x-show="modalOpen" class="modal-loading hidden w-full self-center"><div class="text-center">- <PlausibleWeb.Components.Generic.spinner class="inline-block h-8 w-8" />+ <.spinner class="inline-block h-8 w-8" /></div></div></div>diff --git a/lib/plausible_web/live/components/verification.ex b/lib/plausible_web/live/components/verification.exindex 1aff441218..4513aae550 100644--- a/lib/plausible_web/live/components/verification.ex+++ b/lib/plausible_web/live/components/verification.ex@@ -29,7 +29,7 @@ defmodule PlausibleWeb.Live.Components.Verification dodef render(assigns) do~H"""<div id="progress-indicator">- <PlausibleWeb.Components.Generic.focus_box>+ <.focus_box><div:if={not @finished?}class="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-gray-700"@@ -152,7 +152,7 @@ defmodule PlausibleWeb.Live.Components.Verification do</div></div></:footer>- </PlausibleWeb.Components.Generic.focus_box>+ </.focus_box></div>"""enddiff --git a/lib/plausible_web/live/csv_export.ex b/lib/plausible_web/live/csv_export.exindex cf3de1921b..aeb883c47b 100644--- a/lib/plausible_web/live/csv_export.ex+++ b/lib/plausible_web/live/csv_export.ex@@ -3,7 +3,6 @@ defmodule PlausibleWeb.Live.CSVExport doLiveView allowing scheduling, watching, downloading, and deleting S3 and local exports."""use PlausibleWeb, :live_view- use Phoenix.HTMLalias Plausible.Exportsdiff --git a/lib/plausible_web/live/csv_import.ex b/lib/plausible_web/live/csv_import.exindex 7e80d3601e..e6094e2826 100644--- a/lib/plausible_web/live/csv_import.ex+++ b/lib/plausible_web/live/csv_import.ex@@ -4,7 +4,6 @@ defmodule PlausibleWeb.Live.CSVImport do"""use PlausibleWeb, :live_view- alias PlausibleWeb.Components.Genericrequire Plausible.Imported.SiteImportalias Plausible.Imported.CSVImporter@@ -136,15 +135,15 @@ defmodule PlausibleWeb.Live.CSVImport dodefp maybe_date_range_warning(assigns) do~H"""<%= if @clamped do %>- <Generic.notice :if={@clamped != @original} title="Dates Adjusted" theme={:yellow} class="mt-4">+ <.notice :if={@clamped != @original} title="Dates Adjusted" theme={:yellow} class="mt-4">The dates <.dates range={@original} />overlap with previous imports, so we'll use the next best period, <.dates range={@clamped} />- </Generic.notice>+ </.notice><% else %>- <Generic.notice title="Dates Conflict" theme={:red} class="mt-4">+ <.notice title="Dates Conflict" theme={:red} class="mt-4">The dates <.dates range={@original} />overlap with dates we've already imported and cannot be used for new imports.- </Generic.notice>+ </.notice><% end %>"""end@@ -173,7 +172,7 @@ defmodule PlausibleWeb.Live.CSVImport do<li id={@table} class="ml-0.5"><div class="flex items-center space-x-2 text-gray-600 dark:text-gray-500"><Heroicons.document_check :if={@status == :success} class="w-4 h-4" />- <Generic.spinner :if={@status == :in_progress} class="w-4 h-4" />+ <.spinner :if={@status == :in_progress} class="w-4 h-4" /><Heroicons.document :if={@status == :empty} class="w-4 h-4 opacity-80" /><Heroicons.document :if={@status == :error} class="w-4 h-4 text-red-600 dark:text-red-700" />diff --git a/lib/plausible_web/live/goal_settings.ex b/lib/plausible_web/live/goal_settings.exindex eac4d5c186..1284436ac4 100644--- a/lib/plausible_web/live/goal_settings.ex+++ b/lib/plausible_web/live/goal_settings.ex@@ -3,7 +3,6 @@ defmodule PlausibleWeb.Live.GoalSettings doLiveView allowing listing, creating and deleting goals."""use PlausibleWeb, :live_view- use Phoenix.HTMLalias Plausible.{Sites, Goals}alias PlausibleWeb.Live.Components.Modaldiff --git a/lib/plausible_web/live/goal_settings/form.ex b/lib/plausible_web/live/goal_settings/form.exindex bbb0f7cba7..eb11a3c490 100644--- a/lib/plausible_web/live/goal_settings/form.ex+++ b/lib/plausible_web/live/goal_settings/form.ex@@ -2,12 +2,9 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do@moduledoc """Live view for the goal creation form"""- use Phoenix.LiveComponent, global_prefixes: ~w(x-)+ use PlausibleWeb, :live_componentuse Plausible- import PlausibleWeb.Live.Components.Form- import PlausibleWeb.Components.Generic-alias PlausibleWeb.Live.Components.ComboBoxalias Plausible.Repodiff --git a/lib/plausible_web/live/goal_settings/list.ex b/lib/plausible_web/live/goal_settings/list.exindex bb6c1f5404..8ac27eca53 100644--- a/lib/plausible_web/live/goal_settings/list.ex+++ b/lib/plausible_web/live/goal_settings/list.ex@@ -2,11 +2,8 @@ defmodule PlausibleWeb.Live.GoalSettings.List do@moduledoc """Phoenix LiveComponent module that renders a list of goals"""- use Phoenix.LiveComponent, global_prefixes: ~w(x-)- use Phoenix.HTML-+ use PlausibleWeb, :live_componentalias PlausibleWeb.Live.Components.Modal- import PlausibleWeb.Components.Genericattr(:goals, :list, required: true)attr(:domain, :string, required: true)diff --git a/lib/plausible_web/live/imports_exports_settings.ex b/lib/plausible_web/live/imports_exports_settings.exindex 55a0e44222..aefcd5982b 100644--- a/lib/plausible_web/live/imports_exports_settings.ex+++ b/lib/plausible_web/live/imports_exports_settings.ex@@ -3,9 +3,7 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings doLiveView allowing listing and deleting imports."""use PlausibleWeb, :live_view- use Phoenix.HTML- import PlausibleWeb.Components.Genericimport PlausibleWeb.TextHelpersalias Plausible.Importeddiff --git a/lib/plausible_web/live/installation.ex b/lib/plausible_web/live/installation.exindex 405fab4834..19b2be8fdc 100644--- a/lib/plausible_web/live/installation.ex+++ b/lib/plausible_web/live/installation.ex@@ -3,10 +3,7 @@ defmodule PlausibleWeb.Live.Installation doUser assistance module around Plausible installation instructions/onboarding"""use PlausibleWeb, :live_view- use Phoenix.HTML-alias Plausible.Verification.{Checks, State}- import PlausibleWeb.Components.Generic@script_extension_params ["outbound-links",diff --git a/lib/plausible_web/live/plugins/api/settings.ex b/lib/plausible_web/live/plugins/api/settings.exindex 313f8f2d7b..48b20c2e33 100644--- a/lib/plausible_web/live/plugins/api/settings.ex+++ b/lib/plausible_web/live/plugins/api/settings.ex@@ -4,11 +4,9 @@ defmodule PlausibleWeb.Live.Plugins.API.Settings do"""use PlausibleWeb, :live_view- use Phoenix.HTMLalias Plausible.Sitesalias Plausible.Plugins.API.Tokens- import PlausibleWeb.Components.Genericdef mount(_params, %{"domain" => domain} = session, socket) dosocket =diff --git a/lib/plausible_web/live/props_settings.ex b/lib/plausible_web/live/props_settings.exindex 26f35b49c5..5e16d16f7f 100644--- a/lib/plausible_web/live/props_settings.ex+++ b/lib/plausible_web/live/props_settings.ex@@ -4,7 +4,6 @@ defmodule PlausibleWeb.Live.PropsSettings do"""use PlausibleWeb, :live_view- use Phoenix.HTMLalias PlausibleWeb.Live.Components.ComboBoxdiff --git a/lib/plausible_web/live/props_settings/form.ex b/lib/plausible_web/live/props_settings/form.exindex db4fcce51e..e2888c2f4f 100644--- a/lib/plausible_web/live/props_settings/form.ex+++ b/lib/plausible_web/live/props_settings/form.ex@@ -91,9 +91,9 @@ defmodule PlausibleWeb.Live.PropsSettings.Form do</.error></div>- <PlausibleWeb.Components.Generic.button type="submit" class="w-full">+ <.button type="submit" class="w-full">Add Property →- </PlausibleWeb.Components.Generic.button>+ </.button><button:if={@prop_key_options_count > 0}diff --git a/lib/plausible_web/live/props_settings/list.ex b/lib/plausible_web/live/props_settings/list.exindex 83924d2954..5d3c4f71c5 100644--- a/lib/plausible_web/live/props_settings/list.ex+++ b/lib/plausible_web/live/props_settings/list.ex@@ -2,9 +2,7 @@ defmodule PlausibleWeb.Live.PropsSettings.List do@moduledoc """Phoenix LiveComponent module that renders a list of custom properties"""- use Phoenix.LiveComponent- use Phoenix.HTML- import PlausibleWeb.Components.Generic+ use PlausibleWeb, :live_componentattr(:props, :list, required: true)attr(:domain, :string, required: true)diff --git a/lib/plausible_web/live/register_form.ex b/lib/plausible_web/live/register_form.exindex 8f0f32b0d0..ed65c09b20 100644--- a/lib/plausible_web/live/register_form.ex+++ b/lib/plausible_web/live/register_form.ex@@ -4,9 +4,6 @@ defmodule PlausibleWeb.Live.RegisterForm do"""use PlausibleWeb, :live_view- use Phoenix.HTML- import PlausibleWeb.Live.Components.Form- import PlausibleWeb.Components.Genericalias Plausible.Authalias Plausible.Repo@@ -52,11 +49,9 @@ defmodule PlausibleWeb.Live.RegisterForm do<h2 class="text-xl font-black dark:text-gray-100">Invitation expired</h2><p class="mt-4">- Your invitation has expired or been revoked. Please request fresh one or you can <%= link(- "sign up",- class: "text-indigo-600 hover:text-indigo-900",- to: Routes.auth_path(@socket, :register_form)- ) %> for a 30-day unlimited free trial without an invitation.+ Your invitation has expired or been revoked. Please request fresh one or you can+ <.styled_link href={Routes.auth_path(@socket, :register_form)}>sign up</.styled_link>+ for a 30-day unlimited free trial without an invitation.</p></div>"""@@ -88,7 +83,7 @@ defmodule PlausibleWeb.Live.RegisterForm docurrent_step="Register"/>- <PlausibleWeb.Components.Generic.focus_box>+ <.focus_box><:title>Enter your details</:title>@@ -179,14 +174,9 @@ defmodule PlausibleWeb.Live.RegisterForm doelse"Start my free trial"end %>- <PlausibleWeb.Components.Generic.button- id="register"- disabled={@disable_submit}- type="submit"- class="mt-4 w-full"- >+ <.button id="register" disabled={@disable_submit} type="submit" class="mt-4 w-full"><%= submit_text %>- </PlausibleWeb.Components.Generic.button>+ </.button><p class="text-center text-gray-600 dark:text-gray-500 mt-4">Already have an account?@@ -195,7 +185,7 @@ defmodule PlausibleWeb.Live.RegisterForm do</.styled_link></p></.form>- </PlausibleWeb.Components.Generic.focus_box>+ </.focus_box>"""enddiff --git a/lib/plausible_web/live/reset_password_form.ex b/lib/plausible_web/live/reset_password_form.exindex 7d60240360..60c835ed40 100644--- a/lib/plausible_web/live/reset_password_form.ex+++ b/lib/plausible_web/live/reset_password_form.ex@@ -4,9 +4,6 @@ defmodule PlausibleWeb.Live.ResetPasswordForm do"""use PlausibleWeb, :live_view- use Phoenix.HTML-- import PlausibleWeb.Live.Components.Formalias Plausible.Authalias Plausible.Repo@@ -58,14 +55,13 @@ defmodule PlausibleWeb.Live.ResetPasswordForm doclass="transition bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal appearance-none focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500"/></div>- <PlausibleWeb.Components.Generic.button id="set" type="submit" class="mt-4 w-full">+ <.button id="set" type="submit" class="mt-4 w-full">Set password →- </PlausibleWeb.Components.Generic.button>+ </.button><p class="text-center text-gray-500 text-xs mt-4">- Don't have an account? <%= link("Register",- to: "/register",- class: "underline text-gray-800 dark:text-gray-200"- ) %> instead.+ Don't have an account?+ <.styled_link href="/register">Register</.styled_link>+ instead.</p></.form>"""diff --git a/lib/plausible_web/live/shields/countries.ex b/lib/plausible_web/live/shields/countries.exindex e08e4d8db2..dc00a76cd9 100644--- a/lib/plausible_web/live/shields/countries.ex+++ b/lib/plausible_web/live/shields/countries.ex@@ -3,7 +3,6 @@ defmodule PlausibleWeb.Live.Shields.Countries doLiveView for IP Addresses Shield"""use PlausibleWeb, :live_view- use Phoenix.HTMLalias Plausible.Shieldsalias Plausible.Sitesdiff --git a/lib/plausible_web/live/shields/country_rules.ex b/lib/plausible_web/live/shields/country_rules.exindex 1c627383e1..54d4744c93 100644--- a/lib/plausible_web/live/shields/country_rules.ex+++ b/lib/plausible_web/live/shields/country_rules.ex@@ -3,13 +3,11 @@ defmodule PlausibleWeb.Live.Shields.CountryRules doLiveView allowing Country Rules management"""- use Phoenix.LiveComponent, global_prefixes: ~w(x-)- use Phoenix.HTML+ use PlausibleWeb, :live_componentalias PlausibleWeb.Live.Components.Modalalias Plausible.Shieldsalias Plausible.Shield- import PlausibleWeb.Components.Genericdef update(assigns, socket) dosocket =diff --git a/lib/plausible_web/live/shields/hostname_rules.ex b/lib/plausible_web/live/shields/hostname_rules.exindex 6485494dca..42a1fd388c 100644--- a/lib/plausible_web/live/shields/hostname_rules.ex+++ b/lib/plausible_web/live/shields/hostname_rules.ex@@ -3,15 +3,13 @@ defmodule PlausibleWeb.Live.Shields.HostnameRules doLiveView allowing hostname Rules management"""- use Phoenix.LiveComponent, global_prefixes: ~w(x-)- use Phoenix.HTML+ use PlausibleWeb, :live_componentalias PlausibleWeb.Live.Components.Modalalias Plausible.Shieldsalias Plausible.Shieldimport PlausibleWeb.ErrorHelpers- import PlausibleWeb.Components.Genericdef update(assigns, socket) dosocket =diff --git a/lib/plausible_web/live/shields/hostnames.ex b/lib/plausible_web/live/shields/hostnames.exindex efc3d32c4e..af6887f661 100644--- a/lib/plausible_web/live/shields/hostnames.ex+++ b/lib/plausible_web/live/shields/hostnames.ex@@ -3,7 +3,6 @@ defmodule PlausibleWeb.Live.Shields.Hostnames doLiveView for Hostnames Shield"""use PlausibleWeb, :live_view- use Phoenix.HTMLalias Plausible.Shieldsalias Plausible.Sitesdiff --git a/lib/plausible_web/live/shields/ip_addresses.ex b/lib/plausible_web/live/shields/ip_addresses.exindex 11358a1428..6f1979f278 100644--- a/lib/plausible_web/live/shields/ip_addresses.ex+++ b/lib/plausible_web/live/shields/ip_addresses.ex@@ -3,7 +3,6 @@ defmodule PlausibleWeb.Live.Shields.IPAddresses doLiveView for IP Addresses Shield"""use PlausibleWeb, :live_view- use Phoenix.HTMLalias Plausible.Shieldsalias Plausible.Sitesdiff --git a/lib/plausible_web/live/shields/ip_rules.ex b/lib/plausible_web/live/shields/ip_rules.exindex 84995e7344..b7c56cec63 100644--- a/lib/plausible_web/live/shields/ip_rules.ex+++ b/lib/plausible_web/live/shields/ip_rules.ex@@ -3,14 +3,11 @@ defmodule PlausibleWeb.Live.Shields.IPRules doLiveView allowing IP Rules management"""- use Phoenix.LiveComponent, global_prefixes: ~w(x-)- use Phoenix.HTML+ use PlausibleWeb, :live_componentalias PlausibleWeb.Live.Components.Modalalias Plausible.Shieldsalias Plausible.Shield- import PlausibleWeb.Live.Components.Form- import PlausibleWeb.Components.Genericdef update(assigns, socket) dosocket =@@ -72,23 +69,22 @@ defmodule PlausibleWeb.Live.Shields.IPRules do<:tbody :let={rule}><.td max_width="max-w-40"><div class="flex items-center truncate">- <span- id={"inet-#{rule.id}"}- class="mr-4 cursor-help"- title={"Added at #{format_added_at(rule.inserted_at, @site.timezone)} by #{rule.added_by}"}- >- <%= rule.inet %>- </span>-<span:if={to_string(rule.inet) == @remote_ip}- class="inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium text-gray-700 dark:text-white ring-1 ring-inset ring-gray-300 dark:ring-gray-700"+ class="inline-flex items-center gap-x-1.5 rounded-md px-2 mr-2 py-1 text-xs font-medium text-gray-700 dark:text-white ring-1 ring-inset ring-gray-300 dark:ring-gray-700"><svg class="h-1.5 w-1.5 fill-green-400" viewBox="0 0 6 6" aria-hidden="true"><circle cx="3" cy="3" r="3" /></svg>YOU</span>+ <span+ id={"inet-#{rule.id}"}+ class="cursor-help"+ title={"Added at #{format_added_at(rule.inserted_at, @site.timezone)} by #{rule.added_by}"}+ >+ <%= rule.inet %>+ </span></div></.td><.td hide_on_mobile>diff --git a/lib/plausible_web/live/shields/page_rules.ex b/lib/plausible_web/live/shields/page_rules.exindex dcfd75ce34..6f851894ac 100644--- a/lib/plausible_web/live/shields/page_rules.ex+++ b/lib/plausible_web/live/shields/page_rules.ex@@ -3,15 +3,13 @@ defmodule PlausibleWeb.Live.Shields.PageRules doLiveView allowing page Rules management"""- use Phoenix.LiveComponent, global_prefixes: ~w(x-)- use Phoenix.HTML+ use PlausibleWeb, :live_componentalias PlausibleWeb.Live.Components.Modalalias Plausible.Shieldsalias Plausible.Shieldimport PlausibleWeb.ErrorHelpers- import PlausibleWeb.Components.Genericdef update(assigns, socket) dosocket =diff --git a/lib/plausible_web/live/shields/pages.ex b/lib/plausible_web/live/shields/pages.exindex 55d8ed1894..23b62a7af6 100644--- a/lib/plausible_web/live/shields/pages.ex+++ b/lib/plausible_web/live/shields/pages.ex@@ -3,7 +3,6 @@ defmodule PlausibleWeb.Live.Shields.Pages doLiveView for IP Addresses Shield"""use PlausibleWeb, :live_view- use Phoenix.HTMLalias Plausible.Shieldsalias Plausible.Sitesdiff --git a/lib/plausible_web/live/sites.ex b/lib/plausible_web/live/sites.exindex 4fb3e96d53..d081c45138 100644--- a/lib/plausible_web/live/sites.ex+++ b/lib/plausible_web/live/sites.ex@@ -4,9 +4,6 @@ defmodule PlausibleWeb.Live.Sites do"""use PlausibleWeb, :live_view- use Phoenix.HTML-- import PlausibleWeb.Components.Genericimport PlausibleWeb.Live.Components.Paginationalias Plausible.Auth@@ -141,10 +138,10 @@ defmodule PlausibleWeb.Live.Sites do</h3><div class="mt-2 text-sm text-yellow-700"><p>- To access the sites you own, you need to subscribe to a monthly or yearly payment plan. <%= link(- "Upgrade now →",- to: Routes.settings_path(PlausibleWeb.Endpoint, :subscription),- class: "text-sm font-medium text-yellow-800"+ To access the sites you own, you need to subscribe to a monthly or yearly payment plan.+ <.styled_link href={Routes.settings_path(PlausibleWeb.Endpoint, :subscription)}>+ Upgrade now →+ </.styled_link>) %></p></div>diff --git a/lib/plausible_web/live/verification.ex b/lib/plausible_web/live/verification.exindex faefb3c107..44cbaad57a 100644--- a/lib/plausible_web/live/verification.ex+++ b/lib/plausible_web/live/verification.ex@@ -6,7 +6,6 @@ defmodule PlausibleWeb.Live.Verification do"""use Plausibleuse PlausibleWeb, :live_view- use Phoenix.HTMLalias Plausible.Verification.{Checks, State}@@ -98,12 +97,12 @@ defmodule PlausibleWeb.Live.Verification doon_ce dodefp awaiting_pageviews(assigns) do~H"""- <PlausibleWeb.Components.Generic.focus_box>+ <.focus_box><div class="flex items-center"><div class="block pulsating-circle"></div><p class="ml-8">Awaiting your first pageview …</p></div>- </PlausibleWeb.Components.Generic.focus_box>+ </.focus_box>"""endenddiff --git a/lib/plausible_web/mjml/templates/stats_report.mjml.eex b/lib/plausible_web/mjml/templates/stats_report.mjml.eexindex 51782cba66..4310ca0048 100644--- a/lib/plausible_web/mjml/templates/stats_report.mjml.eex+++ b/lib/plausible_web/mjml/templates/stats_report.mjml.eex@@ -1,8 +1,17 @@<mjml><mj-head><mj-attributes>- <mj-text color="#3d4852" font-family="'Helvetica Neue', Helvetica, Arial, sans-serif" font-size="14px" />- <mj-button background-color="#4338ca" font-family="'Helvetica Neue', Helvetica, Arial, sans-serif" color="#ffffff" font-size="14px" />+ <mj-text+ color="#3d4852"+ font-family="'Helvetica Neue', Helvetica, Arial, sans-serif"+ font-size="14px"+ />+ <mj-button+ background-color="#4338ca"+ font-family="'Helvetica Neue', Helvetica, Arial, sans-serif"+ color="#ffffff"+ font-size="14px"+ /><mj-class name="text-lg" font-size="24px" font-weight="bold" /><mj-class name="text-sm" font-size="14px" font-weight="normal" /><mj-class name="text-label" font-size="14px" font-weight="bold" color="#666666" />@@ -44,11 +53,11 @@<mj-text css-class="change-visitors" mj-class="text-sm">N/A</mj-text><% @stats.visitors.change >= 0 -> %><mj-text css-class="change-visitors" mj-class="text-sm trend-good">- <%= "#{if @stats.visitors.change != 0, do: "+"}#{@stats.visitors.change}%" %>+ <%= "#{if @stats.visitors.change != 0, do: "+"}#{@stats.visitors.change}%" %></mj-text><% @stats.visitors.change < 0 -> %><mj-text css-class="change-visitors" mj-class="text-sm trend-bad">- <%= @stats.visitors.change %>%+ <%= @stats.visitors.change %>%</mj-text><% end %><mj-spacer height="30px" />@@ -63,11 +72,11 @@<mj-text css-class="change-pageviews" mj-class="text-sm">N/A</mj-text><% @stats.pageviews.change >= 0 -> %><mj-text css-class="change-pageviews" mj-class="text-sm trend-good">- <%= "#{if @stats.pageviews.change != 0, do: "+"}#{@stats.pageviews.change}%" %>+ <%= "#{if @stats.pageviews.change != 0, do: "+"}#{@stats.pageviews.change}%" %></mj-text><% @stats.pageviews.change < 0 -> %><mj-text css-class="change-pageviews" mj-class="text-sm trend-bad">- <%= @stats.pageviews.change %>%+ <%= @stats.pageviews.change %>%</mj-text><% end %><mj-spacer height="30px" />@@ -84,11 +93,11 @@<mj-text css-class="change-bounce-rate" mj-class="text-sm">N/A</mj-text><% @stats.bounce_rate.change <= 0 -> %><mj-text css-class="change-bounce-rate" mj-class="text-sm trend-good">- <%= @stats.bounce_rate.change %>%+ <%= @stats.bounce_rate.change %>%</mj-text><% @stats.bounce_rate.change > 0 -> %><mj-text css-class="change-bounce-rate" mj-class="text-sm trend-bad">- +<%= @stats.bounce_rate.change %>%+ +<%= @stats.bounce_rate.change %>%</mj-text><% end %><mj-spacer height="30px" />@@ -107,18 +116,18 @@<mj-text font-weight="bold">Referrer</mj-text><%= for source <- @stats.sources do %>- <mj-text css-class="referrer-name">- <%= source[:source] %>- </mj-text>+ <mj-text css-class="referrer-name">+ <%= source[:source] %>+ </mj-text><% end %></mj-column><mj-column><mj-text font-weight="bold" align="right">Visitors</mj-text><%= for source <- @stats.sources do %>- <mj-text align="right" css-class="referrer-count">- <%= PlausibleWeb.StatsView.large_number_format(source[:visitors]) %>- </mj-text>+ <mj-text align="right" css-class="referrer-count">+ <%= PlausibleWeb.StatsView.large_number_format(source[:visitors]) %>+ </mj-text><% end %></mj-column></mj-group>@@ -138,9 +147,9 @@</mj-text><%= for page <- @stats.pages do %>- <mj-text css-class="page-name">- <%= page[:page] %>- </mj-text>+ <mj-text css-class="page-name">+ <%= page[:page] %>+ </mj-text><% end %></mj-column><mj-column>@@ -150,7 +159,7 @@<%= for page <- @stats.pages do %><mj-text align="right" css-class="page-count">- <%= PlausibleWeb.StatsView.large_number_format(page[:visitors]) %>+ <%= PlausibleWeb.StatsView.large_number_format(page[:visitors]) %></mj-text><% end %></mj-column>@@ -158,11 +167,13 @@</mj-section><%= if @login_link do %>- <mj-section>- <mj-column>- <mj-button href="<%= PlausibleWeb.Router.Helpers.auth_url(PlausibleWeb.Endpoint, :login_form) %>">Login to view your dashboard</mj-button>- </mj-column>- </mj-section>+ <mj-section>+ <mj-column>+ <mj-button href="<%= PlausibleWeb.Router.Helpers.auth_url(PlausibleWeb.Endpoint, :login_form) %>">+ Login to view your dashboard+ </mj-button>+ </mj-column>+ </mj-section><% end %><mj-section>@@ -173,7 +184,8 @@<mj-section padding="0"><mj-column><mj-text mj-class="text-sm" padding="0 25px 25px 25px">- Don't want to receive these e-mails? <a href="<%= @unsubscribe_link %>">Click here</a> to unsubscribe.+ Don't want to receive these e-mails? <a href="<%= @unsubscribe_link %>">Click here</a>+ to unsubscribe.</mj-text></mj-column></mj-section>diff --git a/lib/plausible_web/templates/auth/activate.html.heex b/lib/plausible_web/templates/auth/activate.html.heexindex 0915003fb9..7ab977865c 100644--- a/lib/plausible_web/templates/auth/activate.html.heex+++ b/lib/plausible_web/templates/auth/activate.html.heex@@ -3,7 +3,7 @@current_step="Activate account"/>-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title><%= if @has_email_code? do %><%= if @has_any_memberships? do %>@@ -29,32 +29,29 @@</:subtitle><div :if={@has_email_code?}>- <%= form_for @conn, @form_submit_url, [], fn f -> %>- <%= text_input(f, :code,- class:- "tracking-widest font-medium shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-36 px-8 border-gray-300 dark:border-gray-500 rounded-md dark:text-gray-200 dark:bg-gray-900 text-center",- oninput:- "this.value=this.value.replace(/[^0-9]/g, ''); if (this.value.length >= 4) document.getElementById('submit').focus()",- onclick: "this.select();",- maxlength: "4",- placeholder: "••••",- style: "letter-spacing: 10px;",- required: "required"- ) %>- <PlausibleWeb.Components.Generic.button id="submit" type="submit" class="w-full mt-8">+ <.form :let={f} for={@conn} action={@form_submit_url}>+ <.input+ field={f[:code]}+ class="tracking-widest font-medium shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-36 px-8 border-gray-300 dark:border-gray-500 rounded-md dark:text-gray-200 dark:bg-gray-900 text-center"+ oninput="this.value=this.value.replace(/[^0-9]/g, ''); if (this.value.length >= 4) document.getElementById('submit').focus()"+ onclick="this.select();"+ maxlength="4"+ placeholder="••••"+ style="letter-spacing: 10px;"+ required={true}+ />+ <.button id="submit" type="submit" class="w-full mt-8">Activate- </PlausibleWeb.Components.Generic.button>- <% end %>+ </.button>+ </.form></div><%= error_tag(assigns, :error) %><div :if={!@has_email_code?}>- <%= button("Request activation code",- to: "/activate/request-code",- method: :post,- class: "w-full button"- ) %>+ <.button_link method="post" class="w-full" href="/activate/request-code">+ Request activation code+ </.button_link></div><:footer :if={@has_email_code?}>@@ -106,4 +103,4 @@</:item></.focus_list></:footer>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/templates/auth/generate_2fa_recovery_codes.html.heex b/lib/plausible_web/templates/auth/generate_2fa_recovery_codes.html.heexindex 01a8e4c5d8..f03af4d8ce 100644--- a/lib/plausible_web/templates/auth/generate_2fa_recovery_codes.html.heex+++ b/lib/plausible_web/templates/auth/generate_2fa_recovery_codes.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title><%= if @from_setup do %>Setup Two-Factor Authentication@@ -45,4 +45,4 @@Finish</button></div>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/templates/auth/initiate_2fa_setup.html.heex b/lib/plausible_web/templates/auth/initiate_2fa_setup.html.heexindex 09c569a6b9..753102c3f9 100644--- a/lib/plausible_web/templates/auth/initiate_2fa_setup.html.heex+++ b/lib/plausible_web/templates/auth/initiate_2fa_setup.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Setup Two-Factor Authentication</:title>@@ -59,4 +59,4 @@Proceed</.unstyled_link></div>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/templates/auth/login_form.html.heex b/lib/plausible_web/templates/auth/login_form.html.heexindex cf6b5f9cd1..62ad966081 100644--- a/lib/plausible_web/templates/auth/login_form.html.heex+++ b/lib/plausible_web/templates/auth/login_form.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title><%= Phoenix.Flash.get(@flash, :login_title) || "Enter your account credentials" %></:title>@@ -9,32 +9,32 @@</p><% end %></:subtitle>- <%= form_for @conn, "/login", [], fn f -> %>+ <.form :let={f} for={@conn} action="/login"><div class="my-4 mt-8">- <%= label(f, :email, class: "block text-gray-700 dark:text-gray-300 mb-2") %>- <%= email_input(f, :email,- autocomplete: "username",- class:- "bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal appearance-none focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500",- placeholder: "[email protected]"- ) %>+ <.input+ type="email"+ autocomplete="username"+ placeholder="[email protected]"+ field={f[:email]}+ label="Email"+ /></div><div class="my-4">- <%= label(f, :password, class: "block text-gray-700 dark:text-gray-300 mb-2") %>- <%= password_input(f, :password,- id: "current-password",- autocomplete: "current-password",- class:- "transition bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal appearance-none focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500"- ) %>+ <.input+ type="password"+ autocomplete="current-password"+ id="current-password"+ field={f[:password]}+ label="Password"+ /></div><%= if @conn.assigns[:error] do %><div class="text-red-500 mt-4"><%= @conn.assigns[:error] %></div><% end %>- <%= submit("Log in", class: "button mt-4 w-full") %>- <% end %>+ <.button class="w-full" type="submit">Log in</.button>+ </.form><:footer><.focus_list>@@ -56,4 +56,4 @@</:item></.focus_list></:footer>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/templates/auth/password_reset_form.html.eex b/lib/plausible_web/templates/auth/password_reset_form.html.eexdeleted file mode 100644index cc41f47198..0000000000--- a/lib/plausible_web/templates/auth/password_reset_form.html.eex+++ /dev/null@@ -1,4 +0,0 @@-<%= live_render(@conn, PlausibleWeb.Live.ResetPasswordForm,- container: {:div, class: "contents"},- session: %{"email" => @email}-) %>diff --git a/lib/plausible_web/templates/auth/password_reset_form.html.heex b/lib/plausible_web/templates/auth/password_reset_form.html.heexnew file mode 100644index 0000000000..018aa78489--- /dev/null+++ b/lib/plausible_web/templates/auth/password_reset_form.html.heex@@ -0,0 +1,4 @@+<%= live_render(@conn, PlausibleWeb.Live.ResetPasswordForm,+ container: {:div, class: "contents"},+ session: %{"email" => @email}+) %>diff --git a/lib/plausible_web/templates/auth/password_reset_request_form.html.heex b/lib/plausible_web/templates/auth/password_reset_request_form.html.heexindex 9a5d600f51..6e9b65e7b0 100644--- a/lib/plausible_web/templates/auth/password_reset_request_form.html.heex+++ b/lib/plausible_web/templates/auth/password_reset_request_form.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Reset your password</:title>@@ -7,13 +7,9 @@Enter your email so we can send a password reset link</:subtitle>- <%= form_for @conn, "/password/request-reset", [], fn f -> %>+ <.form :let={f} for={@conn} action={Routes.auth_path(@conn, :password_reset_request)}><div class="my-4 mt-8">- <%= email_input(f, :email,- class:- "transition bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500",- placeholder: "[email protected]"- ) %>+ <.input type="email" field={f[:email]} placeholder="[email protected]" /></div><%= if @conn.assigns[:error] do %><div class="text-red-500 my-2"><%= @conn.assigns[:error] %></div>@@ -30,6 +26,6 @@</div><% end %>- <%= submit("Send reset link", class: "button mt-4 w-full") %>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ <.button class="w-full" type="submit">Send reset link</.button>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/auth/verify_2fa.html.heex b/lib/plausible_web/templates/auth/verify_2fa.html.heexindex d3d8c7f5a4..ddb2eea274 100644--- a/lib/plausible_web/templates/auth/verify_2fa.html.heex+++ b/lib/plausible_web/templates/auth/verify_2fa.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Enter Your 2FA Code</:title>@@ -24,21 +24,24 @@</.focus_list></:footer>- <%= form_for @conn.params, Routes.auth_path(@conn, :verify_2fa), [- onsubmit: "document.getElementById('verify-button').disabled = true"- ], fn f -> %>+ <.form+ :let={f}+ action={Routes.auth_path(@conn, :verify_2fa)}+ for={@conn.params}+ onsubmit="document.getElementById('verify-button').disabled = true"+ ><div class="mt-2 text-gray-500 dark:text-gray-200 leading-tight"><PlausibleWeb.Components.TwoFactor.verify_2fa_input form={f} field={:code} class="mt-6" />- <div class="mt-4 flex flex-inline items-center sm:justify-start justify-center">- <%= checkbox(f, :remember_2fa,- class:- "block h-5 w-5 rounded dark:bg-gray-700 border-gray-300 text-indigo-600 focus:ring-indigo-600"- ) %>- <label class="block ml-2" for="remember_2fa">- Trust this device for <%= @remember_2fa_days %> days- </label>+ <div>+ <.input+ type="checkbox"+ field={f[:remember_2fa]}+ value="true"+ label={"Trust this device for #{@remember_2fa_days} days"}+ class="block h-5 w-5 rounded dark:bg-gray-700 border-gray-300 text-indigo-600 focus:ring-indigo-600"+ /></div></div>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/auth/verify_2fa_recovery_code.html.heex b/lib/plausible_web/templates/auth/verify_2fa_recovery_code.html.heexindex b4cadf0263..0c87266c5d 100644--- a/lib/plausible_web/templates/auth/verify_2fa_recovery_code.html.heex+++ b/lib/plausible_web/templates/auth/verify_2fa_recovery_code.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Enter Recovery Code</:title>@@ -9,34 +9,34 @@<:footer>Authenticator application working again?- <a href={Routes.auth_path(@conn, :verify_2fa)} class="underline text-indigo-600">+ <.styled_link href={Routes.auth_path(@conn, :verify_2fa)}>Enter code- </a>+ </.styled_link><%= if ee?() do %><br /> Lost your recovery codes?- <a href="https://plausible.io/contact" class="underline text-indigo-600">+ <.styled_link href="https://plausible.io/contact">Contact us- </a>+ </.styled_link><% end %></:footer>- <%= form_for @conn.params,- Routes.auth_path(@conn, :verify_2fa_recovery_code),- [- onsubmit: "document.getElementById('use-code-button').disabled = true"- ], fn f -> %>+ <.form+ :let={f}+ for={@conn.params}+ action={Routes.auth_path(@conn, :verify_2fa_recovery_code)}+ onsubmit="document.getElementById('use-code-button').disabled = true"+ ><div class="mt-6"><div>- <%= text_input(f, :recovery_code,- value: "",- autocomplete: "off",- class:- "font-medium shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full px-2 border-gray-300 dark:border-gray-500 dark:text-gray-200 dark:bg-gray-900 rounded-md",- maxlength: "10",- oninvalid: "document.getElementById('use-code-button').disabled = false",- placeholder: "Enter recovery code",- required: "required"- ) %>+ <.input+ type="text"+ field={f[:recovery_code]}+ autocomplete="off"+ maxlength="10"+ oninvalid="document.getElementById('use-code-button').disabled = false"+ required="required"+ placeholder="Enter recovery code"+ /></div><.buttonid="use-code-button"@@ -48,10 +48,10 @@</span><span class="label-disabled">- <PlausibleWeb.Components.Generic.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" />+ <.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" />Verifying...</span></.button></div>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/auth/verify_2fa_setup.html.heex b/lib/plausible_web/templates/auth/verify_2fa_setup.html.heexindex 7392adee0b..211b562ff1 100644--- a/lib/plausible_web/templates/auth/verify_2fa_setup.html.heex+++ b/lib/plausible_web/templates/auth/verify_2fa_setup.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Setup Two-Factor Authentication</:title>@@ -24,10 +24,13 @@</.focus_list></:footer>- <%= form_for @conn.params, Routes.auth_path(@conn, :verify_2fa_setup), [- id: "verify-2fa-form",- onsubmit: "document.getElementById('verify-button').disabled = true"- ], fn f -> %>+ <.form+ :let={f}+ for={@conn.params}+ action={Routes.auth_path(@conn, :verify_2fa_setup)}+ id="verify-2fa-form"+ onsubmit="document.getElementById('verify-button').disabled = true"+ ><PlausibleWeb.Components.TwoFactor.verify_2fa_input form={f} field={:code} class="mt-6" />- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/billing/change_plan_preview.html.heex b/lib/plausible_web/templates/billing/change_plan_preview.html.heexindex 52b4fca5f7..9febe88eb4 100644--- a/lib/plausible_web/templates/billing/change_plan_preview.html.heex+++ b/lib/plausible_web/templates/billing/change_plan_preview.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Confirm new subscription plan</:title>@@ -85,19 +85,17 @@</a></span><span class="flex space-betwee rounded-md shadow-sm">- <%= button("Confirm plan change",- to: Routes.billing_path(@conn, :change_plan, @preview_info["plan_id"]),- method: :post,- class:- "inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:border-indigo-700 focus:ring active:bg-indigo-700 transition ease-in-out duration-150"- ) %>+ <.button_link+ href={Routes.billing_path(@conn, :change_plan, @preview_info["plan_id"])}+ method="post"+ >+ Confirm plan change+ </.button_link></span></div><div class="text-center mt-8 dark:text-gray-100">- Questions? <%= link("Contact us",- to: "https://plausible.io/contact",- class: "text-indigo-500"- ) %>+ Questions?+ <.styled_link href="https://plausible.io/contact">Contact us</.styled_link></div>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/templates/billing/upgrade_success.html.heex b/lib/plausible_web/templates/billing/upgrade_success.html.heexindex 7882911474..62ca21b86c 100644--- a/lib/plausible_web/templates/billing/upgrade_success.html.heex+++ b/lib/plausible_web/templates/billing/upgrade_success.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Your account is being upgraded...</:title>@@ -48,4 +48,4 @@// is created from Paddle webhooks.ping()</script>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/templates/email/activation_email.html.eex b/lib/plausible_web/templates/email/activation_email.html.heexsimilarity index 100%rename from lib/plausible_web/templates/email/activation_email.html.eexrename to lib/plausible_web/templates/email/activation_email.html.heexdiff --git a/lib/plausible_web/templates/email/cancellation_email.html.eex b/lib/plausible_web/templates/email/cancellation_email.html.heexsimilarity index 100%rename from lib/plausible_web/templates/email/cancellation_email.html.eexrename to lib/plausible_web/templates/email/cancellation_email.html.heexdiff --git a/lib/plausible_web/templates/email/check_stats_email.html.eex b/lib/plausible_web/templates/email/check_stats_email.html.eexdeleted file mode 100644index 88f2492b3a..0000000000--- a/lib/plausible_web/templates/email/check_stats_email.html.eex+++ /dev/null@@ -1,14 +0,0 @@-Plausible is tracking your website stats without compromising the user experience and the privacy of your visitors.-<br /><br />-Here's how to get even more out of your Plausible experience:-<br /><br />-* <%= link("Set up custom events", to: "https://plausible.io/docs/custom-event-goals") %> and <%= link("pageview goals", to: "https://plausible.io/docs/pageview-goals") %> to count actions you want your visitors to take<br />-* Running an ecommerce? Assign monetary values to custom events to track <%= link("revenue attribution", to: "https://plausible.io/docs/ecommerce-revenue-tracking") %><br />-* Follow the journey from a landing page to conversion with <%= link("funnel analysis", to: "https://plausible.io/docs/funnel-analysis") %><br />-* <%= link("Tag your social media, email and paid links", to: "https://plausible.io/docs/manual-link-tagging") %> to see which campaigns are responsible for most conversions<br />-* <%= link("Send custom properties", to: "https://plausible.io/docs/custom-props/introduction") %> to collect data that we don't track automatically<br />-* Explore our <%= link("stats API", to: "https://plausible.io/docs/stats-api") %> to retrieve your stats and our <%= link("sites API", to: "https://plausible.io/docs/sites-api") %> to create and manage sites programmatically<br />-<br /><br />-<%= link("View your Plausible dashboard now", to: "#{plausible_url()}") %> for the most valuable traffic insights at a glance.-<br /><br />-Do reply back to this email if you have any questions or need some guidance.diff --git a/lib/plausible_web/templates/email/check_stats_email.html.heex b/lib/plausible_web/templates/email/check_stats_email.html.heexnew file mode 100644index 0000000000..bff6514d52--- /dev/null+++ b/lib/plausible_web/templates/email/check_stats_email.html.heex@@ -0,0 +1,31 @@+Plausible is tracking your website stats without compromising the user experience and the privacy of your visitors.+<br /><br /> Here's how to get even more out of your Plausible experience: <br /><br /> *+<.unstyled_link href="https://plausible.io/docs/custom-event-goals">+ Set up custom events+</.unstyled_link>+and+<.unstyled_link href="https://plausible.io/docs/pageview-goals">pageview goals</.unstyled_link>+to count actions you want your visitors to take<br />+* Running an ecommerce? Assign monetary values to custom events to track+<.unstyled_link href="https://plausible.io/docs/ecommerce-revenue-tracking">+ revenue attribution+</.unstyled_link>+<br /> * Follow the journey from a landing page to conversion with+<.unstyled_link href="https://plausible.io/docs/funnel-analysis">funnel analysis</.unstyled_link>+<br /> *+<.unstyled_link href="https://plausible.io/docs/manual-link-tagging">+ Tag your social media, email and paid links+</.unstyled_link>+to see which campaigns are responsible for most conversions<br /> *+<.unstyled_link href="https://plausible.io/docs/custom-props/introduction">+ Send custom properties+</.unstyled_link>+to collect data that we don't track automatically<br /> * Explore our+<.unstyled_link href="https://plausible.io/docs/stats-api">stats API</.unstyled_link>+to retrieve your stats and our+<.unstyled_link href="https://plausible.io/docs/sites-api">sites API</.unstyled_link>+to create and manage sites programmatically<br />+<br /><br />+<.unstyled_link href={plausible_url()}>View your Plausible dashboard now</.unstyled_link>+for the most valuable traffic insights at a glance. <br /><br />+Do reply back to this email if you have any questions or need some guidance.diff --git a/lib/plausible_web/templates/email/create_site_email.html.eex b/lib/plausible_web/templates/email/create_site_email.html.eexdeleted file mode 100644index d6c2ca1967..0000000000--- a/lib/plausible_web/templates/email/create_site_email.html.eex+++ /dev/null@@ -1,5 +0,0 @@-You've activated your free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.-<br /><br />-<%= link("Click here", to: "#{plausible_url()}/sites/new") %> to add your website URL, your timezone and install our one-line JavaScript snippet to start collecting visitor statistics.-<br /><br />-Do reply back to this email if you have any questions or need some guidance.diff --git a/lib/plausible_web/templates/email/create_site_email.html.heex b/lib/plausible_web/templates/email/create_site_email.html.heexnew file mode 100644index 0000000000..be8d3122bb--- /dev/null+++ b/lib/plausible_web/templates/email/create_site_email.html.heex@@ -0,0 +1,5 @@+You've activated your free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.+<br /><br />+<.unstyled_link href={"#{plausible_url()}/sites/new"}>Click here</.unstyled_link>+to add your website URL, your timezone and install our one-line JavaScript snippet to start collecting visitor statistics.+<br /><br /> Do reply back to this email if you have any questions or need some guidance.diff --git a/lib/plausible_web/templates/email/csv_import.html.heex b/lib/plausible_web/templates/email/csv_import.html.heexindex feef762cb0..32723d46bc 100644--- a/lib/plausible_web/templates/email/csv_import.html.heex+++ b/lib/plausible_web/templates/email/csv_import.html.heex@@ -3,7 +3,8 @@@site_import.start_date) %> to <%= date_format(@site_import.end_date) %><br /><br />- <%= link("Click here", to: @link) %> to view your dashboard.+ <.unstyled_link href={@link}>Click here</.unstyled_link>+ to view your dashboard.<% else %>Unfortunately, your CSV import for <%= @site_import.site.domain %> did not complete successfully. Sorry about that!<br /><br /> Please try to do the import once again.diff --git a/lib/plausible_web/templates/email/dashboard_locked.html.eex b/lib/plausible_web/templates/email/dashboard_locked.html.eexdeleted file mode 100644index cc457a6ff2..0000000000--- a/lib/plausible_web/templates/email/dashboard_locked.html.eex+++ /dev/null@@ -1,15 +0,0 @@-Last week we sent a reminder that your site traffic has exceeded the limits of your <%= Plausible.product_name() %> subscription tier for two consecutive months. Since we haven't received a response, we've had to temporarily lock access to your stats.-<br /><br />-Your subscription is still active, we're still counting your stats and haven't deleted any of your data but as you have outgrown your subscription tier, we kindly ask you to upgrade to match your new traffic levels. Upon upgrading to a suitable tier, your dashboard access will be immediately restored.-<br /><br />-During the last billing cycle (<%= PlausibleWeb.TextHelpers.format_date_range(@usage.last_cycle.date_range) %>), your account recorded <%= PlausibleWeb.AuthView.delimit_integer(@usage.last_cycle.total) %> billable pageviews. In the billing cycle before that (<%= PlausibleWeb.TextHelpers.format_date_range(@usage.penultimate_cycle.date_range) %>), the usage was <%= PlausibleWeb.AuthView.delimit_integer(@usage.penultimate_cycle.total) %> billable pageviews. Note that billable pageviews include both standard pageviews and custom events. In your <%= link("account settings", to: plausible_url() <> PlausibleWeb.Router.Helpers.settings_path(PlausibleWeb.Endpoint, :subscription)) %>, you'll find an overview of your usage and limits.-<br /><br />-<%= if @suggested_plan == :enterprise do %>-Your usage exceeds our standard plans, so please reply back to this email for a tailored quote.-<% else %>-<%= link("Click here to upgrade your subscription", to: PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)) %>. We recommend you upgrade to the <%= @suggested_plan.volume %>/mo plan. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.-<% end %>-<br /><br />-Do you have questions or need help with anything? Just reply to this email. We're here to help!-<br /><br />-Thanks for understanding and for being a Plausible subscriber!diff --git a/lib/plausible_web/templates/email/dashboard_locked.html.heex b/lib/plausible_web/templates/email/dashboard_locked.html.heexnew file mode 100644index 0000000000..70f371e0eb--- /dev/null+++ b/lib/plausible_web/templates/email/dashboard_locked.html.heex@@ -0,0 +1,26 @@+Last week we sent a reminder that your site traffic has exceeded the limits of your <%= Plausible.product_name() %> subscription tier for two consecutive months. Since we haven't received a response, we've had to temporarily lock access to your stats.+<br /><br />+Your subscription is still active, we're still counting your stats and haven't deleted any of your data but as you have outgrown your subscription tier, we kindly ask you to upgrade to match your new traffic levels. Upon upgrading to a suitable tier, your dashboard access will be immediately restored.+<br /><br />+During the last billing cycle (<%= PlausibleWeb.TextHelpers.format_date_range(+ @usage.last_cycle.date_range+) %>), your account recorded <%= PlausibleWeb.AuthView.delimit_integer(@usage.last_cycle.total) %> billable pageviews. In the billing cycle before that (<%= PlausibleWeb.TextHelpers.format_date_range(+ @usage.penultimate_cycle.date_range+) %>), the usage was <%= PlausibleWeb.AuthView.delimit_integer(@usage.penultimate_cycle.total) %> billable pageviews. Note that billable pageviews include both standard pageviews and custom events. In your+<.unstyled_link href={+ PlausibleWeb.Router.Helpers.settings_url(PlausibleWeb.Endpoint, :subscription)+}>+ account settings+</.unstyled_link>, you'll find an overview of your usage and limits. <br /><br />+<%= if @suggested_plan == :enterprise do %>+ Your usage exceeds our standard plans, so please reply back to this email for a tailored quote.+<% else %>+ <.unstyled_link href={+ PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)+ }>+ Click here to upgrade your subscription+ </.unstyled_link>. We recommend you upgrade to the <%= @suggested_plan.volume %>/mo plan. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.+<% end %>+<br /><br />+Do you have questions or need help with anything? Just reply to this email. We're here to help!+<br /><br /> Thanks for understanding and for being a Plausible subscriber!diff --git a/lib/plausible_web/templates/email/drop_notification.html.eex b/lib/plausible_web/templates/email/drop_notification.html.eexdeleted file mode 100644index b914f915e0..0000000000--- a/lib/plausible_web/templates/email/drop_notification.html.eex+++ /dev/null@@ -1,8 +0,0 @@-We've recorded <%= @current_visitors %> visitors on <%= link(@site.domain, to: "https://" <> @site.domain) %> in the last 12 hours.--<%= if @dashboard_link do %>-<br /><br />-View dashboard: <%= link(@dashboard_link, to: @dashboard_link) %>-<br /><br />-Something looks off? Please <%= link("review your installation", to: @installation_link) %> to verify that Plausible has been integrated correctly.-<% end %>diff --git a/lib/plausible_web/templates/email/drop_notification.html.heex b/lib/plausible_web/templates/email/drop_notification.html.heexnew file mode 100644index 0000000000..f09fb9d2f1--- /dev/null+++ b/lib/plausible_web/templates/email/drop_notification.html.heex@@ -0,0 +1,10 @@+We've recorded <%= @current_visitors %> visitors on+<.unstyled_link href={"https://" <> @site.domain}><%= @site.domain %></.unstyled_link>+in the last 12 hours.+<%= if @dashboard_link do %>+ <br /><br /> View dashboard:+ <.unstyled_link href={@dashboard_link}><%= @dashboard_link %></.unstyled_link>+ <br /><br /> Something looks off? Please+ <.unstyled_link href={@installation_link}>review your installation</.unstyled_link>+ to verify that Plausible has been integrated correctly.+<% end %>diff --git a/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.eex b/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.heexsimilarity index 62%rename from lib/plausible_web/templates/email/enterprise_over_limit_internal.html.eexrename to lib/plausible_web/templates/email/enterprise_over_limit_internal.html.heexindex 483a76f5aa..159722e1e8 100644--- a/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.eex+++ b/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.heex@@ -1,8 +1,15 @@Automated notice about an enterprise account that has gone over their limits. <br /><br />-Customer email: <%= @user.email %><br />-Last billing cycle: <%= PlausibleWeb.TextHelpers.format_date_range(@pageview_usage.last_cycle.date_range) %><br >-Last cycle pageview usage: <%= PlausibleWeb.AuthView.delimit_integer(@pageview_usage.last_cycle.total) %> billable pageviews<br />-Penultimate billing cycle: <%= PlausibleWeb.TextHelpers.format_date_range(@pageview_usage.penultimate_cycle.date_range) %><br >-Penultimate cycle pageview usage: <%= PlausibleWeb.AuthView.delimit_integer(@pageview_usage.penultimate_cycle.total) %> billable pageviews<br />+Last billing cycle: <%= PlausibleWeb.TextHelpers.format_date_range(+ @pageview_usage.last_cycle.date_range+) %><br />+Last cycle pageview usage: <%= PlausibleWeb.AuthView.delimit_integer(+ @pageview_usage.last_cycle.total+) %> billable pageviews<br />+Penultimate billing cycle: <%= PlausibleWeb.TextHelpers.format_date_range(+ @pageview_usage.penultimate_cycle.date_range+) %><br />+Penultimate cycle pageview usage: <%= PlausibleWeb.AuthView.delimit_integer(+ @pageview_usage.penultimate_cycle.total+) %> billable pageviews<br />Site usage: <%= @site_usage %> / <%= @site_allowance %> allowed sites<br />diff --git a/lib/plausible_web/templates/email/error_report_email.html.eex b/lib/plausible_web/templates/email/error_report_email.html.eexdeleted file mode 100644index 2a32b79ddf..0000000000--- a/lib/plausible_web/templates/email/error_report_email.html.eex+++ /dev/null@@ -1,12 +0,0 @@-<h1>Error report</h1>-<p>-Reported by: <%= @reported_by %>-<br/>-Sentry trace: <a href="<%= sentry_link(@trace_id) %>"><%= @trace_id %></a>-<br/>-</p>-<h2>User feedback:</h2>-<pre>-<%= @feedback %>-</pre>-<br/>diff --git a/lib/plausible_web/templates/email/error_report_email.html.heex b/lib/plausible_web/templates/email/error_report_email.html.heexnew file mode 100644index 0000000000..a4dc5b8537--- /dev/null+++ b/lib/plausible_web/templates/email/error_report_email.html.heex@@ -0,0 +1,11 @@+<h1>Error report</h1>+<p>+ Reported by: <%= @reported_by %>+ <br /> Sentry trace: <a href={sentry_link(@trace_id)}><%= @trace_id %></a>+ <br />+</p>+<h2>User feedback:</h2>+<pre>+<%= @feedback %>+</pre>+<br />diff --git a/lib/plausible_web/templates/email/existing_user_invitation.html.eex b/lib/plausible_web/templates/email/existing_user_invitation.html.heexsimilarity index 53%rename from lib/plausible_web/templates/email/existing_user_invitation.html.eexrename to lib/plausible_web/templates/email/existing_user_invitation.html.heexindex 32554a2320..ea1e3b5b7b 100644--- a/lib/plausible_web/templates/email/existing_user_invitation.html.eex+++ b/lib/plausible_web/templates/email/existing_user_invitation.html.heex@@ -1,3 +1,4 @@<%= @invitation.inviter.email %> has invited you to the <%= @invitation.site.domain %> site on <%= Plausible.product_name() %>.-<%= link("Click here", to: Routes.site_url(PlausibleWeb.Endpoint, :index)) %> to view and respond to the invitation. The invitation+<.unstyled_link href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</.unstyled_link>+to view and respond to the invitation. The invitationwill expire 48 hours after this email is sent.diff --git a/lib/plausible_web/templates/email/export_failure.html.eex b/lib/plausible_web/templates/email/export_failure.html.eexdeleted file mode 100644index fc58418bf1..0000000000--- a/lib/plausible_web/templates/email/export_failure.html.eex+++ /dev/null@@ -1,5 +0,0 @@-Your <%= Plausible.product_name() %> export for <%= @site.domain %> has encountered an error and was unsuccessful.-Sorry for the trouble this may have caused.-<br/><br/>-Please attempt to export your data again.-<%= if ee?() do %>Should the problem persist, do reply to this email so we can assist. Thanks!<% end %>diff --git a/lib/plausible_web/templates/email/export_failure.html.heex b/lib/plausible_web/templates/email/export_failure.html.heexnew file mode 100644index 0000000000..2fa1c044a2--- /dev/null+++ b/lib/plausible_web/templates/email/export_failure.html.heex@@ -0,0 +1,5 @@+Your <%= Plausible.product_name() %> export for <%= @site.domain %> has encountered an error and was unsuccessful.+Sorry for the trouble this may have caused. <br /><br /> Please attempt to export your data again.+<%= if ee?() do %>+ Should the problem persist, do reply to this email so we can assist. Thanks!+<% end %>diff --git a/lib/plausible_web/templates/email/export_success.html.eex b/lib/plausible_web/templates/email/export_success.html.eexdeleted file mode 100644index 636bed8e6d..0000000000--- a/lib/plausible_web/templates/email/export_success.html.eex+++ /dev/null@@ -1,3 +0,0 @@-Your <%= Plausible.product_name() %> export for <%= @site.domain %> is now ready for download.-Please click <a href="<%= @download_url %>">here</a> to start the download process.-<%= if @expires_in do %>Note that this link will expire <%= @expires_in %>.<% end %>diff --git a/lib/plausible_web/templates/email/export_success.html.heex b/lib/plausible_web/templates/email/export_success.html.heexnew file mode 100644index 0000000000..03694f1462--- /dev/null+++ b/lib/plausible_web/templates/email/export_success.html.heex@@ -0,0 +1,6 @@+Your <%= Plausible.product_name() %> export for <%= @site.domain %> is now ready for download.+Please click <a href={@download_url}>here</a>+to start the download process.+<%= if @expires_in do %>+ Note that this link will expire <%= @expires_in %>.+<% end %>diff --git a/lib/plausible_web/templates/email/google_analytics_import.html.heex b/lib/plausible_web/templates/email/google_analytics_import.html.heexindex 033d0710a5..e2fba1a143 100644--- a/lib/plausible_web/templates/email/google_analytics_import.html.heex+++ b/lib/plausible_web/templates/email/google_analytics_import.html.heex@@ -3,7 +3,8 @@@site_import.start_date) %> to <%= date_format(@site_import.end_date) %><br /><br />- <%= link("Click here", to: @link) %> to view your dashboard.+ <.styled_link href={@link}>Click here</.styled_link>+ to view your dashboard.<% else %>Unfortunately, your Google Analytics import for <%= @site_import.site.domain %> did not complete successfully. Sorry about that!<br /><br />diff --git a/lib/plausible_web/templates/email/invitation_accepted.html.eex b/lib/plausible_web/templates/email/invitation_accepted.html.eexdeleted file mode 100644index 5717ce2620..0000000000--- a/lib/plausible_web/templates/email/invitation_accepted.html.eex+++ /dev/null@@ -1,2 +0,0 @@-<%= @invitation.email %> has accepted your invitation to <%= @invitation.site.domain %>.-<%= link("Click here", to: Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)) %> to view site settings.diff --git a/lib/plausible_web/templates/email/invitation_accepted.html.heex b/lib/plausible_web/templates/email/invitation_accepted.html.heexnew file mode 100644index 0000000000..3e3b83862b--- /dev/null+++ b/lib/plausible_web/templates/email/invitation_accepted.html.heex@@ -0,0 +1,7 @@+<%= @invitation.email %> has accepted your invitation to <%= @invitation.site.domain %>.+<.unstyled_link href={+ Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)+}>+ Click here+</.unstyled_link>+to view site settings.diff --git a/lib/plausible_web/templates/email/invitation_rejected.html.eex b/lib/plausible_web/templates/email/invitation_rejected.html.eexdeleted file mode 100644index b6c520690f..0000000000--- a/lib/plausible_web/templates/email/invitation_rejected.html.eex+++ /dev/null@@ -1,2 +0,0 @@-<%= @invitation.email %> has rejected your invitation to <%= @invitation.site.domain %>.-<%= link("Click here", to: Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)) %> to view site settings.diff --git a/lib/plausible_web/templates/email/invitation_rejected.html.heex b/lib/plausible_web/templates/email/invitation_rejected.html.heexnew file mode 100644index 0000000000..e7805d733d--- /dev/null+++ b/lib/plausible_web/templates/email/invitation_rejected.html.heex@@ -0,0 +1,7 @@+<%= @invitation.email %> has rejected your invitation to <%= @invitation.site.domain %>.+<.unstyled_link href={+ Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)+}>+ Click here+</.unstyled_link>+to view site settings.diff --git a/lib/plausible_web/templates/email/new_user_invitation.html.eex b/lib/plausible_web/templates/email/new_user_invitation.html.heexsimilarity index 51%rename from lib/plausible_web/templates/email/new_user_invitation.html.eexrename to lib/plausible_web/templates/email/new_user_invitation.html.heexindex 3bb9c59cd3..c860cf3f0d 100644--- a/lib/plausible_web/templates/email/new_user_invitation.html.eex+++ b/lib/plausible_web/templates/email/new_user_invitation.html.heex@@ -1,4 +1,12 @@<%= @invitation.inviter.email %> has invited you to join the <%= @invitation.site.domain %> site on <%= Plausible.product_name() %>.-<%= link("Click here", to: Routes.auth_url(PlausibleWeb.Endpoint, :register_from_invitation_form, @invitation.invitation_id)) %> to create your account. The link is valid for 48 hours after this email is sent.-<br /><br />+<.unstyled_link href={+ Routes.auth_url(+ PlausibleWeb.Endpoint,+ :register_from_invitation_form,+ @invitation.invitation_id+ )+}>+ Click here+</.unstyled_link>+to create your account. The link is valid for 48 hours after this email is sent. <br /><br />Plausible is a lightweight and open-source website analytics tool. We hope you like our simple and ethical approach to tracking website visitors.diff --git a/lib/plausible_web/templates/email/over_limit.html.eex b/lib/plausible_web/templates/email/over_limit.html.eexdeleted file mode 100644index 8f69565424..0000000000--- a/lib/plausible_web/templates/email/over_limit.html.eex+++ /dev/null@@ -1,17 +0,0 @@-Thanks for being a <%= Plausible.product_name() %> subscriber!-<br /><br />-This is a friendly reminder that your traffic has exceeded your subscription tier for two consecutive months. Congrats on all that traffic!-<br /><br />-To maintain uninterrupted access to your stats, we kindly ask you to upgrade your account to match your new traffic levels. Please note, if your account isn't upgraded within the next 7 days, access to your stats will be temporarily locked.-<br /><br />-During the last billing cycle (<%= PlausibleWeb.TextHelpers.format_date_range(@usage.last_cycle.date_range) %>), your account recorded <%= PlausibleWeb.AuthView.delimit_integer(@usage.last_cycle.total) %> billable pageviews. In the billing cycle before that (<%= PlausibleWeb.TextHelpers.format_date_range(@usage.penultimate_cycle.date_range) %>), your account used <%= PlausibleWeb.AuthView.delimit_integer(@usage.penultimate_cycle.total) %> billable pageviews. Note that billable pageviews include both standard pageviews and custom events. In your <%= link("account settings", to: plausible_url() <> PlausibleWeb.Router.Helpers.settings_path(PlausibleWeb.Endpoint, :subscription)) %>, you'll find an overview of your usage and limits.-<br /><br />-<%= if @suggested_plan == :enterprise do %>-Your usage exceeds our standard plans, so please reply back to this email for a tailored quote.-<% else %>-<%= link("Click here to upgrade your subscription", to: PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)) %>. We recommend you upgrade to the <%= @suggested_plan.volume %>/mo plan. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.-<% end %>-<br /><br />-Do you have questions or need help with anything? Just reply to this email. We're here to help!-<br /><br />-Thanks again for using our product and for your support!diff --git a/lib/plausible_web/templates/email/over_limit.html.heex b/lib/plausible_web/templates/email/over_limit.html.heexnew file mode 100644index 0000000000..b33d6b9457--- /dev/null+++ b/lib/plausible_web/templates/email/over_limit.html.heex@@ -0,0 +1,25 @@+Thanks for being a <%= Plausible.product_name() %> subscriber! <br /><br />+This is a friendly reminder that your traffic has exceeded your subscription tier for two consecutive months. Congrats on all that traffic!+<br /><br />+To maintain uninterrupted access to your stats, we kindly ask you to upgrade your account to match your new traffic levels. Please note, if your account isn't upgraded within the next 7 days, access to your stats will be temporarily locked.+<br /><br />+During the last billing cycle (<%= PlausibleWeb.TextHelpers.format_date_range(+ @usage.last_cycle.date_range+) %>), your account recorded <%= PlausibleWeb.AuthView.delimit_integer(@usage.last_cycle.total) %> billable pageviews. In the billing cycle before that (<%= PlausibleWeb.TextHelpers.format_date_range(+ @usage.penultimate_cycle.date_range+) %>), your account used <%= PlausibleWeb.AuthView.delimit_integer(@usage.penultimate_cycle.total) %> billable pageviews. Note that billable pageviews include both standard pageviews and custom events. In your+<.unstyled_link href={plausible_url() <> PlausibleWeb.Router.Helpers.settings_path(PlausibleWeb.Endpoint, :subscription)}>+ account settings+</.unstyled_link>, you'll find an overview of your usage and limits. <br /><br />+<%= if @suggested_plan == :enterprise do %>+ Your usage exceeds our standard plans, so please reply back to this email for a tailored quote.+<% else %>+ <.unstyled_link href={+ PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)+ }>+ Click here to upgrade your subscription+ </.unstyled_link>. We recommend you upgrade to the <%= @suggested_plan.volume %>/mo plan. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.+<% end %>+<br /><br />+Do you have questions or need help with anything? Just reply to this email. We're here to help!+<br /><br /> Thanks again for using our product and for your support!diff --git a/lib/plausible_web/templates/email/ownership_transfer_accepted.html.eex b/lib/plausible_web/templates/email/ownership_transfer_accepted.html.heexsimilarity index 54%rename from lib/plausible_web/templates/email/ownership_transfer_accepted.html.eexrename to lib/plausible_web/templates/email/ownership_transfer_accepted.html.heexindex c8c2740070..3f4159d779 100644--- a/lib/plausible_web/templates/email/ownership_transfer_accepted.html.eex+++ b/lib/plausible_web/templates/email/ownership_transfer_accepted.html.heex@@ -1,3 +1,8 @@<%= @invitation.email %> has accepted the ownership transfer of <%= @invitation.site.domain %>. They will be responsible for billing of it goingforward and your role has been changed to <b>admin</b>.-<%= link("Click here", to: Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)) %> to view site settings.+<.unstyled_link href={+ Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)+}>+ Click here+</.unstyled_link>+to view site settings.diff --git a/lib/plausible_web/templates/email/ownership_transfer_rejected.html.eex b/lib/plausible_web/templates/email/ownership_transfer_rejected.html.eexdeleted file mode 100644index 14deeacb38..0000000000--- a/lib/plausible_web/templates/email/ownership_transfer_rejected.html.eex+++ /dev/null@@ -1,2 +0,0 @@-<%= @invitation.email %> has rejected the ownership transfer of <%= @invitation.site.domain %>.-<%= link("Click here", to: Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)) %> to view site settings.diff --git a/lib/plausible_web/templates/email/ownership_transfer_rejected.html.heex b/lib/plausible_web/templates/email/ownership_transfer_rejected.html.heexnew file mode 100644index 0000000000..7adc0068eb--- /dev/null+++ b/lib/plausible_web/templates/email/ownership_transfer_rejected.html.heex@@ -0,0 +1,7 @@+<%= @invitation.email %> has rejected the ownership transfer of <%= @invitation.site.domain %>.+<.unstyled_link href={+ Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)+}>+ Click here+</.unstyled_link>+to view site settings.diff --git a/lib/plausible_web/templates/email/ownership_transfer_request.html.eex b/lib/plausible_web/templates/email/ownership_transfer_request.html.heexsimilarity index 50%rename from lib/plausible_web/templates/email/ownership_transfer_request.html.eexrename to lib/plausible_web/templates/email/ownership_transfer_request.html.heexindex 4da4185a4a..5543d88c7d 100644--- a/lib/plausible_web/templates/email/ownership_transfer_request.html.eex+++ b/lib/plausible_web/templates/email/ownership_transfer_request.html.heex@@ -1,8 +1,15 @@<%= @invitation.inviter.email %> has requested to transfer the ownership of <%= @invitation.site.domain %> site on <%= Plausible.product_name() %> to you.<%= if @new_owner_account do %>- <%= link("Click here", to: Routes.site_url(PlausibleWeb.Endpoint, :index)) %> to view and respond to the invitation.+ <.unstyled_link href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>+ Click here+ </.unstyled_link>+ to view and respond to the invitation.<% else %>- <%= link("Click here", to: Routes.auth_url(PlausibleWeb.Endpoint, :register_form), invitation: @invitation.invitation_id) %> to create your account.- <br /><br />+ <.unstyled_link href={+ Routes.auth_url(PlausibleWeb.Endpoint, :register_form, invitation: @invitation.invitation_id)+ }>+ Click here+ </.unstyled_link>+ to create your account. <br /><br />Plausible is a lightweight and open-source website analytics tool. We hope you like our simple and ethical approach to tracking website visitors.<% end %>diff --git a/lib/plausible_web/templates/email/password_reset_email.html.eex b/lib/plausible_web/templates/email/password_reset_email.html.heexsimilarity index 52%rename from lib/plausible_web/templates/email/password_reset_email.html.eexrename to lib/plausible_web/templates/email/password_reset_email.html.heexindex 612c7f117a..6f1d0e6513 100644--- a/lib/plausible_web/templates/email/password_reset_email.html.eex+++ b/lib/plausible_web/templates/email/password_reset_email.html.heex@@ -1,2 +1,3 @@-<a href="<%= @reset_link %>">Click here</a> to reset your Plausible password.<br /><br />+<a href={@reset_link}>Click here</a>+to reset your Plausible password.<br /><br />This link will expire in 1 hour. If you don't use it by then, you can request another login link.diff --git a/lib/plausible_web/templates/email/site_member_removed.html.eex b/lib/plausible_web/templates/email/site_member_removed.html.heexsimilarity index 53%rename from lib/plausible_web/templates/email/site_member_removed.html.eexrename to lib/plausible_web/templates/email/site_member_removed.html.heexindex eacdb5dff7..a7de92a8db 100644--- a/lib/plausible_web/templates/email/site_member_removed.html.eex+++ b/lib/plausible_web/templates/email/site_member_removed.html.heex@@ -1,3 +1,4 @@An administrator of <%= @membership.site.domain %> has removed you as a member. You won't be able to see the stats anymore.<br /><br />-<%= link("Click here", to: Routes.site_url(PlausibleWeb.Endpoint, :index)) %> to view your sites.+<.unstyled_link href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</.unstyled_link>+to view your sites.diff --git a/lib/plausible_web/templates/email/site_setup_help_email.html.eex b/lib/plausible_web/templates/email/site_setup_help_email.html.eexdeleted file mode 100644index e78e9d85d2..0000000000--- a/lib/plausible_web/templates/email/site_setup_help_email.html.eex+++ /dev/null@@ -1,11 +0,0 @@-<%= if Plausible.Users.on_trial?(@user) do %>- You signed up for a free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.- <br /><br />-<% end %>-To finish your setup for <%= @site.domain %>, review <%= link("your installation", to: "#{plausible_url()}/#{URI.encode_www_form(@site.domain)}/installation") %> and start collecting visitor statistics.-<br /><br />-This Plausible script is 45 times smaller than Google Analytics script so you’ll have a fast loading site while getting all the important traffic insights on one single page.-<br /><br />-On WordPress? We have a <%= link("WordPress plugin", to: "https://plausible.io/wordpress-analytics-plugin") %> that makes the process simpler. We also have <%= link("integration guides", to: "https://plausible.io/docs/integration-guides") %> for different site builders to help you start counting stats in no time.-<br /><br />-Do reply back to this email if you have any questions or need some guidance.diff --git a/lib/plausible_web/templates/email/site_setup_help_email.html.heex b/lib/plausible_web/templates/email/site_setup_help_email.html.heexnew file mode 100644index 0000000000..feedcaedcf--- /dev/null+++ b/lib/plausible_web/templates/email/site_setup_help_email.html.heex@@ -0,0 +1,20 @@+<%= if Plausible.Users.on_trial?(@user) do %>+ You signed up for a free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.+ <br /><br />+<% end %>+To finish your setup for <%= @site.domain %>, review+<.unstyled_link href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}/installation"}>+ your installation+</.unstyled_link>+and start collecting visitor statistics. <br /><br />+This Plausible script is 45 times smaller than Google Analytics script so you’ll have a fast loading site while getting all the important traffic insights on one single page.+<br /><br /> On WordPress? We have a+<.unstyled_link href="https://plausible.io/wordpress-analytics-plugin">+ WordPress plugin+</.unstyled_link>+that makes the process simpler. We also have+<.unstyled_link href="https://plausible.io/docs/integration-guides">+ integration guides+</.unstyled_link>+for different site builders to help you start counting stats in no time. <br /><br />+Do reply back to this email if you have any questions or need some guidance.diff --git a/lib/plausible_web/templates/email/site_setup_success_email.html.eex b/lib/plausible_web/templates/email/site_setup_success_email.html.eexdeleted file mode 100644index 274b303a07..0000000000--- a/lib/plausible_web/templates/email/site_setup_success_email.html.eex+++ /dev/null@@ -1,13 +0,0 @@-Congrats! We've recorded the first visitor on <%= link(@site.domain, to: "https://#{@site.domain}") %>. Your traffic is now being counted without compromising the user experience and privacy of your visitors.-<br /><br />-Do check out your <%= link("easy to use, fast-loading and privacy-friendly dashboard", to: "#{plausible_url()}/#{URI.encode_www_form(@site.domain)}") %>.-<br /><br />-Something looks off? Take a look at our <%= link("installation troubleshooting guide", to: "https://plausible.io/docs/troubleshoot-integration") %>.-<br /><br />-<%= if not Plausible.ce?() and Plausible.Users.on_trial?(@user) do %>- You're on a 30-day free trial with no obligations so do take your time to explore Plausible. Here's how to get <%= link("the most out of your Plausible experience", to: "https://plausible.io/docs/your-plausible-experience") %>.- <br /><br />-<% end %>-PS: You can import your historical Google Analytics stats into your Plausible dashboard. <%= link("Learn how our GA importer works", to: "https://plausible.io/docs/google-analytics-import") %>.-<br /><br />-<%= unless Plausible.ce?() do %>Do reply back to this email if you have any questions. We're here to help.<% end %>diff --git a/lib/plausible_web/templates/email/site_setup_success_email.html.heex b/lib/plausible_web/templates/email/site_setup_success_email.html.heexnew file mode 100644index 0000000000..ca23104814--- /dev/null+++ b/lib/plausible_web/templates/email/site_setup_success_email.html.heex@@ -0,0 +1,22 @@+Congrats! We've recorded the first visitor on+<.unstyled_link href={"https://#{@site.domain}"}>@site.domain</.unstyled_link>. Your traffic is now being counted without compromising the user experience and privacy of your visitors.+<br /><br /> Do check out your+<.unstyled_link href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}"}>+ easy to use, fast-loading and privacy-friendly dashboard+</.unstyled_link>. <br /><br /> Something looks off? Take a look at our+<.unstyled_link href="https://plausible.io/docs/troubleshoot-integration">+ installation troubleshooting guide+</.unstyled_link>. <br /><br />+<%= if not Plausible.ce?() and Plausible.Users.on_trial?(@user) do %>+ You're on a 30-day free trial with no obligations so do take your time to explore Plausible. Here's how to get+ <.unstyled_link href="https://plausible.io/docs/your-plausible-experience">+ the most out of your Plausible experience+ </.unstyled_link>. <br /><br />+<% end %>+PS: You can import your historical Google Analytics stats into your Plausible dashboard.+<.unstyled_link href="https://plausible.io/docs/google-analytics-import">+ Learn how our GA importer works+</.unstyled_link>. <br /><br />+<%= unless Plausible.ce?() do %>+ Do reply back to this email if you have any questions. We're here to help.+<% end %>diff --git a/lib/plausible_web/templates/email/spike_notification.html.eex b/lib/plausible_web/templates/email/spike_notification.html.eexdeleted file mode 100644index 1b7b031d88..0000000000--- a/lib/plausible_web/templates/email/spike_notification.html.eex+++ /dev/null@@ -1,17 +0,0 @@-There are currently <%= @current_visitors %> visitors on <%= link(@site.domain, to: "https://" <> @site.domain) %>.-<%= if Enum.count(@sources) > 0 do %>- <br />- <br />- The top sources for current visitors:<br />- <%= for %{name: source, count: visitors} <- @sources do %>- <%= source %> - <%= visitors %> visitor<%= if visitors > 1, do: "s" %><br />- <% end %>-<% end %>--<%= if @link do %>-<br /><br />-View dashboard: <%= link(@link, to: @link) %>-<% end %>-<br /><br />--Congrats on the spike in traffic!diff --git a/lib/plausible_web/templates/email/spike_notification.html.heex b/lib/plausible_web/templates/email/spike_notification.html.heexnew file mode 100644index 0000000000..4e6a8a5fbe--- /dev/null+++ b/lib/plausible_web/templates/email/spike_notification.html.heex@@ -0,0 +1,15 @@+There are currently <%= @current_visitors %> visitors on+<.unstyled_link href={"https://" <> @site.domain}><%= @site.domain %></.unstyled_link>.+<%= if Enum.count(@sources) > 0 do %>+ <br />+ <br /> The top sources for current visitors:<br />+ <%= for %{name: source, count: visitors} <- @sources do %>+ <%= source %> - <%= visitors %> visitor<%= if visitors > 1, do: "s" %><br />+ <% end %>+<% end %>++<%= if @link do %>+ <br /><br /> View dashboard:+ <.unstyled_link href={@link}><%= @link %></.unstyled_link>+<% end %>+<br /><br /> Congrats on the spike in traffic!diff --git a/lib/plausible_web/templates/email/trial_one_week_reminder.html.eex b/lib/plausible_web/templates/email/trial_one_week_reminder.html.heexsimilarity index 70%rename from lib/plausible_web/templates/email/trial_one_week_reminder.html.eexrename to lib/plausible_web/templates/email/trial_one_week_reminder.html.heexindex 32bebaab16..1e47bfc93b 100644--- a/lib/plausible_web/templates/email/trial_one_week_reminder.html.eex+++ b/lib/plausible_web/templates/email/trial_one_week_reminder.html.heex@@ -1,7 +1,10 @@-Time flies! Your 30-day free trial of Plausible will end next week.-<br /><br />+Time flies! Your 30-day free trial of Plausible will end next week. <br /><br />Over the last three weeks, We hope you got to experience the potential benefits of having website stats in an easy to use dashboard while respecting the privacy of your visitors, not annoying them with the cookie and privacy notices and still having a fast loading site.<br /><br />-In order to continue receiving valuable website traffic insights at a glance, you’ll need to <%= link("upgrade your account", to: PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)) %>.-<br /><br />+In order to continue receiving valuable website traffic insights at a glance, you’ll need to+<.unstyled_link href={+ PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)+}>+ upgrade your account+</.unstyled_link>. <br /><br />If you have any questions or feedback for us, feel free to reply to this email.diff --git a/lib/plausible_web/templates/email/trial_over_email.html.eex b/lib/plausible_web/templates/email/trial_over_email.html.heexsimilarity index 62%rename from lib/plausible_web/templates/email/trial_over_email.html.eexrename to lib/plausible_web/templates/email/trial_over_email.html.heexindex d5d9a174bb..68bac93b02 100644--- a/lib/plausible_web/templates/email/trial_over_email.html.eex+++ b/lib/plausible_web/templates/email/trial_over_email.html.heex@@ -1,6 +1,10 @@-Your free Plausible trial has now expired. Upgrade your account to continue receiving valuable website traffic insights at a glance while respecting the privacy of your visitors and still having a fast loading site. <br /><br />--<%= link("Upgrade now", to: PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)) %>+Your free Plausible trial has now expired. Upgrade your account to continue receiving valuable website traffic insights at a glance while respecting the privacy of your visitors and still having a fast loading site.<br /><br />+<.unstyled_link href={+ PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)+}>+ Upgrade now+</.unstyled_link>+<br /><br />We will keep recording stats for <%= @extra_offset %> days to give you time to upgrade.diff --git a/lib/plausible_web/templates/email/trial_upgrade_email.html.eex b/lib/plausible_web/templates/email/trial_upgrade_email.html.eexdeleted file mode 100644index e410e7a58e..0000000000--- a/lib/plausible_web/templates/email/trial_upgrade_email.html.eex+++ /dev/null@@ -1,12 +0,0 @@-Thanks for exploring Plausible, a simple and privacy-friendly alternative to Google Analytics. Your free 30-day trial is ending <%= @day %>, but you can keep using Plausible by upgrading to a paid plan.-<br /><br />-In the last month, your account has used <%= PlausibleWeb.AuthView.delimit_integer(@usage) %> billable pageviews<%= if @custom_events > 0, do: " and custom events in total", else: "" %>.-<%= if @suggested_plan == :enterprise do %>-This is more than our standard plans, so please reply back to this email to get a quote for your volume.-<% else %>-Based on that we recommend you select a <%= @suggested_plan.volume %>/mo plan.-<br /><br />-<%= link("Upgrade now", to: PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)) %>-<br /><br />-Have a question, feedback or need some guidance? Just reply to this email to get in touch!-<% end %>diff --git a/lib/plausible_web/templates/email/trial_upgrade_email.html.heex b/lib/plausible_web/templates/email/trial_upgrade_email.html.heexnew file mode 100644index 0000000000..92dd2c947c--- /dev/null+++ b/lib/plausible_web/templates/email/trial_upgrade_email.html.heex@@ -0,0 +1,20 @@+Thanks for exploring Plausible, a simple and privacy-friendly alternative to Google Analytics. Your free 30-day trial is ending <%= @day %>, but you can keep using Plausible by upgrading to a paid plan.+<br /><br />+In the last month, your account has used <%= PlausibleWeb.AuthView.delimit_integer(@usage) %> billable pageviews<%= if @custom_events >+ 0,+ do:+ " and custom events in total",+ else:+ "" %>.+<%= if @suggested_plan == :enterprise do %>+ This is more than our standard plans, so please reply back to this email to get a quote for your volume.+<% else %>+ Based on that we recommend you select a <%= @suggested_plan.volume %>/mo plan. <br /><br />+ <.unstyled_link href={+ PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)+ }>+ Upgrade now+ </.unstyled_link>+ <br /><br />+ Have a question, feedback or need some guidance? Just reply to this email to get in touch!+<% end %>diff --git a/lib/plausible_web/templates/email/welcome_email.html.eex b/lib/plausible_web/templates/email/welcome_email.html.eexdeleted file mode 100644index 785d7c71d3..0000000000--- a/lib/plausible_web/templates/email/welcome_email.html.eex+++ /dev/null@@ -1,15 +0,0 @@-We are building Plausible to provide a simple and ethical approach to tracking website visitors.-We're super excited to have you on board!-<br /><br />-Here's how to get the most out of your Plausible experience:-<br /><br />-* <%= link("Enable email reports", to: "https://plausible.io/docs/email-reports") %> and notifications for <%= link("traffic spikes", to: "https://plausible.io/docs/traffic-spikes") %><br />-* <%= link("Integrate with Search Console", to: "https://plausible.io/docs/google-search-console-integration") %> to get keyword phrases people find your site with<br />-* <%= link("Invite team members and other collaborators", to: "https://plausible.io/docs/users-roles") %><br />-* Set up easy goals including <%= link("404 error pages", to: "https://plausible.io/docs/error-pages-tracking-404") %>, <%= link("file downloads", to: "https://plausible.io/docs/file-downloads-tracking") %> and <%= link("outbound link clicks", to: "https://plausible.io/docs/outbound-link-click-tracking") %><br />-* <%= link("Opt out from counting your own visits", to: "https://plausible.io/docs/excluding") %><br />-* If you're concerned about adblockers, <%= link("set up a proxy to bypass them", to: "https://plausible.io/docs/proxy/introduction") %><br />-<br /><br />-Then you're ready to start exploring your fast loading, ethical and actionable <%= link("Plausible dashboard", to: "https://plausible.io/sites") %>.-<br /><br />-Have a question, feedback or need some guidance? Do reply back to this email.diff --git a/lib/plausible_web/templates/email/welcome_email.html.heex b/lib/plausible_web/templates/email/welcome_email.html.heexnew file mode 100644index 0000000000..5c4a30873e--- /dev/null+++ b/lib/plausible_web/templates/email/welcome_email.html.heex@@ -0,0 +1,39 @@+We are building Plausible to provide a simple and ethical approach to tracking website visitors.+We're super excited to have you on board! <br /><br />+Here's how to get the most out of your Plausible experience: <br /><br /> *+<.unstyled_link href="https://plausible.io/docs/email-reports">+ Enable email reports+</.unstyled_link>+and notifications for+<.unstyled_link href="https://plausible.io/docs/traffic-spikes">traffic spikes</.unstyled_link>+<br /> *+<.unstyled_link href="https://plausible.io/docs/google-search-console-integration">+ Integrate with Search Console+</.unstyled_link>+to get keyword phrases people find your site with<br /> *+<.unstyled_link href="https://plausible.io/docs/users-roles">+ Invite team members and other collaborators+</.unstyled_link>+<br /> * Set up easy goals including+<.unstyled_link href="https://plausible.io/docs/error-pages-tracking-404">+ 404 error pages+</.unstyled_link>),+<.unstyled_link href="https://plausible.io/docs/file-downloads-tracking">+ file downloads+</.unstyled_link>+and+<.unstyled_link href="https://plausible.io/docs/outbound-link-click-tracking">+ outbound link clicks+</.unstyled_link>+<br /> *+<.unstyled_link href="https://plausible.io/docs/excluding">+ Opt out from counting your own visits+</.unstyled_link>+<br /> * If you're concerned about adblockers,+<.unstyled_link href="https://plausible.io/docs/proxy/introduction">+ set up a proxy to bypass them+</.unstyled_link>+<br />+<br /><br /> Then you're ready to start exploring your fast loading, ethical and actionable+<.unstyled_link href="https://plausible.io/sites">Plausible dashboard</.unstyled_link>).+<br /><br /> Have a question, feedback or need some guidance? Do reply back to this email.diff --git a/lib/plausible_web/templates/email/yearly_expiration_notification.html.eex b/lib/plausible_web/templates/email/yearly_expiration_notification.html.heexsimilarity index 63%rename from lib/plausible_web/templates/email/yearly_expiration_notification.html.eexrename to lib/plausible_web/templates/email/yearly_expiration_notification.html.heexindex c2aaeafcac..5c3debfd11 100644--- a/lib/plausible_web/templates/email/yearly_expiration_notification.html.eex+++ b/lib/plausible_web/templates/email/yearly_expiration_notification.html.heex@@ -1,6 +1,11 @@Time flies! This is a reminder that your annual subscription for <%= Plausible.product_name() %> will expire on <%= @next_bill_date %>.-<br /><br />-You need to <%= link("renew your subscription", to: PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)) %> if you want to continue using Plausible to count your website stats in a privacy-friendly way.+<br /><br /> You need to+<.unstyled_link href={+ PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)+}>+ renew your subscription+</.unstyled_link>+if you want to continue using Plausible to count your website stats in a privacy-friendly way.<br /><br />If you don't want to continue your subscription, there's no action required. You will lose access to your dashboard on <%= @next_bill_date %> and we'll stop accepting stats on <%= @accept_traffic_until %>.<br /><br />diff --git a/lib/plausible_web/templates/email/yearly_renewal_notification.html.eex b/lib/plausible_web/templates/email/yearly_renewal_notification.html.heexsimilarity index 57%rename from lib/plausible_web/templates/email/yearly_renewal_notification.html.eexrename to lib/plausible_web/templates/email/yearly_renewal_notification.html.heexindex 01fb4be765..3904165268 100644--- a/lib/plausible_web/templates/email/yearly_renewal_notification.html.eex+++ b/lib/plausible_web/templates/email/yearly_renewal_notification.html.heex@@ -1,9 +1,9 @@-Time flies! This is a reminder that your annual subscription for <%= Plausible.product_name() %> is due to renew on <%= @date %>. We will automatically charge <%= PlausibleWeb.BillingView.present_currency(@currency) %><%= @next_bill_amount %> from your preferred billing method.-<br /><br />+Time flies! This is a reminder that your annual subscription for <%= Plausible.product_name() %> is due to renew on <%= @date %>. We will automatically charge <%= PlausibleWeb.BillingView.present_currency(+ @currency+) %><%= @next_bill_amount %> from your preferred billing method. <br /><br />There's no action required if you're happy to continue using Plausible to count your website stats in a privacy-friendly way.-<br /><br />-If you don't want to continue your subscription, you can cancel it on your <%= link("account settings page", to: "#{plausible_url()}/settings") %>.+<br /><br /> If you don't want to continue your subscription, you can cancel it on your+<.unstyled_link href={"#{plausible_url()}/settings"}>account settings page</.unstyled_link>.<br /><br />BTW, most of our subscribers come from word of mouth, so if you love Plausible, and know someone else who might find it useful, we'd appreciate if you'd let them know. Thank you!-<br /><br />-Have a question, feedback or need some guidance? Do reply back to this email.+<br /><br /> Have a question, feedback or need some guidance? Do reply back to this email.diff --git a/lib/plausible_web/templates/error/404_error.html.eex b/lib/plausible_web/templates/error/404_error.html.eexdeleted file mode 100644index 648ca14777..0000000000--- a/lib/plausible_web/templates/error/404_error.html.eex+++ /dev/null@@ -1,9 +0,0 @@-<div class="container flex flex-col items-center text-center mt-24">- <h1 class="text-5xl font-black dark:text-gray-100"><%= @status %></h1>- <div class="mt-4 text-xl dark:text-gray-100">Oops! There's nothing here</div>- <div class="text-xl dark:text-gray-100">Trying to access your dashboard? You may need to log in again to see it</div>- <div class="mt-6 flex">- <%= link("Login", to: Routes.auth_path(@conn, :login_form), class: "button") %>- <%= link("Go to homepage", to: PlausibleWeb.LayoutView.home_dest(@conn), class: "button button-outline ml-2") %>- </div>-</div>diff --git a/lib/plausible_web/templates/error/404_error.html.heex b/lib/plausible_web/templates/error/404_error.html.heexnew file mode 100644index 0000000000..95f46c15a0--- /dev/null+++ b/lib/plausible_web/templates/error/404_error.html.heex@@ -0,0 +1,13 @@+<div class="container flex flex-col items-center text-center mt-24">+ <h1 class="text-5xl font-black dark:text-gray-100"><%= @status %></h1>+ <div class="mt-4 text-xl dark:text-gray-100">Oops! There's nothing here</div>+ <div class="text-xl dark:text-gray-100">+ Trying to access your dashboard? You may need to log in again to see it+ </div>+ <div class="mt-6 flex">+ <.button_link href={Routes.auth_path(@conn, :login_form)} class="mr-4">Log in</.button_link>+ <.button_link theme="bright" href={PlausibleWeb.LayoutView.home_dest(@conn)}>+ Go to homepage+ </.button_link>+ </div>+</div>diff --git a/lib/plausible_web/templates/error/generic_error.html.eex b/lib/plausible_web/templates/error/generic_error.html.heexsimilarity index 64%rename from lib/plausible_web/templates/error/generic_error.html.eexrename to lib/plausible_web/templates/error/generic_error.html.heexindex 0011ac166c..78da8414e3 100644--- a/lib/plausible_web/templates/error/generic_error.html.eex+++ b/lib/plausible_web/templates/error/generic_error.html.heex@@ -1,5 +1,5 @@<div class="container text-center mt-24"><h1 class="text-5xl font-black dark:text-gray-100"><%= @status %></h1><div class="my-4 text-xl dark:text-gray-100"><%= @message %></div>- <%= link("Go to the homepage", to: PlausibleWeb.LayoutView.home_dest(@conn), class: "button mt-4") %>+ <.button_link href={PlausibleWeb.LayoutView.home_dest(@conn)}>Go to homepage</.button_link></div>diff --git a/lib/plausible_web/templates/error/server_error.html.heex b/lib/plausible_web/templates/error/server_error.html.heexindex 41cc9123f7..dee3ebaa01 100644--- a/lib/plausible_web/templates/error/server_error.html.heex+++ b/lib/plausible_web/templates/error/server_error.html.heex@@ -43,31 +43,41 @@<%= if ee?() do %><%= if assigns[:trace_id] do %><div class="my-6">- <%= form_for :error, Routes.error_report_path(PlausibleWeb.Endpoint, :submit_error_report), fn f -> %>- <%= hidden_input(f, :trace_id, value: @trace_id) %>- <%= label(f, "What happened?",- class: "block text-sm font-medium text-gray-700 dark:text-gray-300"- ) %>- <%= textarea(f, :user_feedback,- rows: 5,- class:- "block w-full max-w-xl border-gray-300 dark:border-gray-700 resize-none shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md dark:bg-gray-900 dark:text-gray-300",- placeholder: "I clicked on 'X' and then hit 'Confirm'..."- ) %>- <%= submit("Send feedback →", class: "button mt-4 w-full") %>- <% end %>+ <.form+ :let={f}+ for={%{}}+ as={:error}+ action={Routes.error_report_path(PlausibleWeb.Endpoint, :submit_error_report)}+ >+ <.input type="hidden" field={f[:trace_id]} value={@trace_id} />+ <PlausibleWeb.Live.Components.Form.label for="user_feedback">+ What happened?+ </PlausibleWeb.Live.Components.Form.label>+ <textarea+ name="user_feedback"+ id="user_feedback"+ rows="5"+ class="block w-full max-w-xl border-gray-300 dark:border-gray-700 resize-none shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md dark:bg-gray-900 dark:text-gray-300"+ placeholder="I clicked on 'X' and then hit 'Confirm'..."+ >+ </textarea>+ <.button class="w-full" type="submit">Send feedback</.button>+ </.form></div><% end %><div class="mb-6 mt-12">- <p class="text-sm text-center">- <%= link("Home page", to: "/", class: "text-indigo-500 mr-8") %>- <%= link("Status page",- to: "https://status.plausible.io",- class: "mr-8 text-indigo-500"- ) %>- <%= link("Contact us", to: "https://plausible.io/contact", class: "text-indigo-500") %>- </p>+ <div class="flex gap-x-5 text-sm justify-center">+ <.styled_link href="/">+ Home page+ </.styled_link>+ <.styled_link href="https://status.plausible.io">+ Status page+ </.styled_link>+ <.styled_link href="https://plausible.io/contact">+ Contact us+ </.styled_link>+ </div></div><% end %></div>diff --git a/lib/plausible_web/templates/error/server_error_report_thanks.html.eex b/lib/plausible_web/templates/error/server_error_report_thanks.html.eexdeleted file mode 100644index f4f3ac3715..0000000000--- a/lib/plausible_web/templates/error/server_error_report_thanks.html.eex+++ /dev/null@@ -1,20 +0,0 @@-<div class="w-full max-w-3xl mt-4 mx-auto flex">- <div class="max-w-lg w-full mx-auto bg-white dark:bg-gray-800 shadow-lg rounded px-8 pt-6 pb-8 mb-4 mt-8" >- <h2 class="text-xl font-black dark:text-gray-100">Thank you!</h2>-- <div class="rounded-md dark:bg-transparent mt-4">- <div class="flex">- <h3 class="text-sm font-medium dark:text-gray-100">- Your report has been submitted.- </h3>- </div>- </div>- <div class="mb-6 mt-12">- <p class="text-sm text-center">- <%= link("Home page", to: "/", class: "text-indigo-500 mr-8") %>- <%= link("Status page", to: "https://status.plausible.io", class: "mr-8 text-indigo-500") %>- <%= link("Contact us", to: "https://plausible.io/contact", class: "text-indigo-500") %>- </p>- </div>- </div>-</div>diff --git a/lib/plausible_web/templates/error/server_error_report_thanks.html.heex b/lib/plausible_web/templates/error/server_error_report_thanks.html.heexnew file mode 100644index 0000000000..e9239a3bb4--- /dev/null+++ b/lib/plausible_web/templates/error/server_error_report_thanks.html.heex@@ -0,0 +1,26 @@+<div class="w-full max-w-3xl mt-4 mx-auto flex">+ <div class="max-w-lg w-full mx-auto bg-white dark:bg-gray-800 shadow-lg rounded px-8 pt-6 pb-8 mb-4 mt-8">+ <h2 class="text-xl font-black dark:text-gray-100">Thank you!</h2>++ <div class="rounded-md dark:bg-transparent mt-4">+ <div class="flex">+ <h3 class="text-sm font-medium dark:text-gray-100">+ Your report has been submitted.+ </h3>+ </div>+ </div>+ <div class="mb-6 mt-12">+ <div class="flex gap-x-5 text-sm justify-center">+ <.styled_link href={PlausibleWeb.LayoutView.home_dest(@conn)}>+ Home page+ </.styled_link>+ <.styled_link href="https://status.plausible.io">+ Status page+ </.styled_link>+ <.styled_link href="https://plausible.io/contact">+ Contact us+ </.styled_link>+ </div>+ </div>+ </div>+</div>diff --git a/lib/plausible_web/templates/google_analytics/confirm.html.heex b/lib/plausible_web/templates/google_analytics/confirm.html.heexindex 0ffa3bf096..6f826f74c6 100644--- a/lib/plausible_web/templates/google_analytics/confirm.html.heex+++ b/lib/plausible_web/templates/google_analytics/confirm.html.heex@@ -1,9 +1,15 @@-<%= form_for @conn, Routes.google_analytics_path(@conn, :import, @site.domain), [onsubmit: "confirmButton.disabled = true; return true;", class: "max-w-md w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>+<.form+ :let={f}+ for={@conn}+ class="max-w-md w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"+ onsubmit="confirmButton.disabled = true; return true;"+ action={Routes.google_analytics_path(@conn, :import, @site.domain)}+><h2 class="text-xl font-black dark:text-gray-100">Import from Google Analytics</h2>- <%= hidden_input(f, :access_token, value: @access_token) %>- <%= hidden_input(f, :refresh_token, value: @refresh_token) %>- <%= hidden_input(f, :expires_at, value: @expires_at) %>+ <.input type="hidden" field={f[:access_token]} />+ <.input type="hidden" field={f[:refresh_token]} />+ <.input type="hidden" field={f[:expires_at]} /><div class="mt-6 text-sm text-gray-500 dark:text-gray-200">Stats from this property and time period will be imported from@@ -11,34 +17,27 @@</div><div class="mt-6">- <%= styled_label(- f,- :property,- "Google Analytics property"- ) %>+ <.label for={f[:property].id}>Google Analytics property</.label><span class="block w-full text-base dark:text-gray-100 sm:text-sm dark:bg-gray-800"><%= @selected_property_name %></span>- <%= hidden_input(f, :property,- readonly: "true",- value: @selected_property- ) %>+ <.input type="hidden" value={@selected_property} field={f[:property]} readonly="true" /></div><div class="flex justify-between mt-3"><div class="w-36">- <%= styled_label(f, :start_date, "From") %>+ <.label for={f[:start_date].id}>From</.label><span class="block w-full text-base dark:text-gray-100 sm:text-sm dark:bg-gray-800"><%= PlausibleWeb.EmailView.date_format(@start_date) %></span>- <%= hidden_input(f, :start_date, value: @start_date, readonly: "true") %>+ <.input type="hidden" value={@start_date} field={f[:start_date]} readonly="true" /></div><div class="align-middle pt-4 dark:text-gray-100">→</div><div class="w-36">- <%= styled_label(f, :end_date, "To") %>+ <.label for={f[:end_date].id}>To</.label><span class="block w-full text-base dark:text-gray-100 sm:text-sm dark:bg-gray-800"><%= PlausibleWeb.EmailView.date_format(@end_date) %></span>- <%= hidden_input(f, :end_date, value: @end_date, readonly: "true") %>+ <.input type="hidden" value={@end_date} field={f[:end_date]} readonly="true" /></div></div>@@ -59,15 +58,19 @@</a></p>- <%= submit(name: "confirmButton", class: "button sm:w-auto w-full [&>span.label-enabled]:block [&>span.label-disabled]:hidden [&[disabled]>span.label-enabled]:hidden [&[disabled]>span.label-disabled]:block") do %>+ <.button+ type="submit"+ name="confirmButton"+ class="button sm:w-auto w-full [&>span.label-enabled]:block [&>span.label-disabled]:hidden [&[disabled]>span.label-enabled]:hidden [&[disabled]>span.label-disabled]:block"+ ><span class="label-enabled pointer-events-none">Confirm import</span><span class="label-disabled">- <PlausibleWeb.Components.Generic.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" />+ <.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" />Starting import...</span>- <% end %>+ </.button></div>-<% end %>+</.form>diff --git a/lib/plausible_web/templates/google_analytics/property_form.html.heex b/lib/plausible_web/templates/google_analytics/property_form.html.heexindex 9dcfc76298..c44b1de049 100644--- a/lib/plausible_web/templates/google_analytics/property_form.html.heex+++ b/lib/plausible_web/templates/google_analytics/property_form.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Import from Google Analytics</:title>@@ -6,18 +6,29 @@<:subtitle>Choose the property in your Google Analytics account that will be imported to the <%= @site.domain %> dashboard.</:subtitle>- <%= form_for @conn, Routes.google_analytics_path(@conn, :property, @site.domain), [onsubmit: "continueButton.disabled = true; return true;"], fn f -> %>- <%= hidden_input(f, :access_token, value: @access_token) %>- <%= hidden_input(f, :refresh_token, value: @refresh_token) %>- <%= hidden_input(f, :expires_at, value: @expires_at) %>+ <.form+ :let={f}+ for={@conn}+ onsubmit="continueButton.disabled = true; return true;"+ action={Routes.google_analytics_path(@conn, :property, @site.domain)}+ >+ <.input type="hidden" field={f[:access_token]} />+ <.input type="hidden" field={f[:refresh_token]} />+ <.input type="hidden" field={f[:expires_at]} /><div class="mt-3">- <%= styled_label(f, :property, "Google Analytics property") %>- <%= styled_select(f, :property, @properties,- prompt: "(Choose property)",- required: "true"- ) %>- <%= styled_error(@conn.assigns[:selected_property_error]) %>+ <.input+ type="select"+ field={f[:property]}+ prompt="(Choose property)"+ options={@properties}+ label="Google Analytics property"+ required="true"+ />++ <p class="text-red-600 dark:text-red-700">+ <%= @conn.assigns[:selected_property_error] %>+ </p></div><div class="mt-6 flex flex-col-reverse sm:flex-row justify-between items-center">@@ -30,16 +41,19 @@</a></p>- <%= submit(name: "continueButton", class: "button sm:w-auto w-full [&>span.label-enabled]:block [&>span.label-disabled]:hidden [&[disabled]>span.label-enabled]:hidden [&[disabled]>span.label-disabled]:block") do %>+ <.button+ type="submit"+ name="continueButton"+ class="button sm:w-auto w-full [&>span.label-enabled]:block [&>span.label-disabled]:hidden [&[disabled]>span.label-enabled]:hidden [&[disabled]>span.label-disabled]:block"+ ><span class="label-enabled pointer-events-none">Continue</span><span class="label-disabled">- <PlausibleWeb.Components.Generic.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" />- Checking...+ <.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" /> Checking...</span>- <% end %>+ </.button></div>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/layout/_flash.html.eex b/lib/plausible_web/templates/layout/_flash.html.eexdeleted file mode 100644index cc4e91dcf1..0000000000--- a/lib/plausible_web/templates/layout/_flash.html.eex+++ /dev/null@@ -1,65 +0,0 @@-<%= if Phoenix.Flash.get(@flash, :success) do %>- <div class="z-50 fixed inset-0 flex items-end justify-center px-4 py-6 pointer-events-none sm:p-6 sm:items-start sm:justify-end">- <div x-data="{ show: true, ttl: <%= Phoenix.Flash.get(@flash, :ttl) || 4000 %> }" x-show="show" x-init="setTimeout(() => show = false, ttl)" x-transition:enter="transform ease-out duration-300 transition" x-transition:enter-start="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2" x-transition:enter-end="translate-y-0 opacity-100 sm:translate-x-0" x-transition:leave="transition ease-in duration-100" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" class="max-w-sm w-full bg-white dark:bg-gray-800 shadow-lg rounded-lg pointer-events-auto">- <div class="rounded-lg ring-1 ring-black ring-opacity-5 overflow-hidden">- <div class="p-4">- <div class="flex items-start">- <div class="flex-shrink-0">- <svg class="h-6 w-6 text-green-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />- </svg>- </div>- <div class="ml-3 w-0 flex-1 pt-0.5">- <p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">- <%= Phoenix.Flash.get(@flash, :success_title) || "Success!" %>- </p>- <p class="mt-1 text-sm leading-5 text-gray-500 dark:text-gray-200">- <%= Phoenix.Flash.get(@flash, :success) %>- </p>- </div>- <div class="ml-4 flex-shrink-0 flex">- <button class="inline-flex text-gray-400 focus:outline-none focus:text-gray-500 dark:focus:text-gray-200 transition ease-in-out duration-150" @click="show = false">- <!-- Heroicon name: x -->- <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">- <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />- </svg>- </button>- </div>- </div>- </div>- </div>- </div>- </div>-<% end %>--<%= if Phoenix.Flash.get(@flash, :error) do %>- <div class="z-50 fixed inset-0 flex items-end justify-center px-4 py-6 pointer-events-none sm:p-6 sm:items-start sm:justify-end">- <div x-data="{ show: true, ttl: <%= Phoenix.Flash.get(@flash, :ttl) || 4000 %> }" x-show="show" x-init="setTimeout(() => show = false, ttl)" x-transition:enter="transform ease-out duration-300 transition" x-transition:enter-start="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2" x-transition:enter-end="translate-y-0 opacity-100 sm:translate-x-0" x-transition:leave="transition ease-in duration-100" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" class="max-w-sm w-full bg-white dark:bg-gray-800 shadow-lg rounded-lg pointer-events-auto">- <div class="rounded-lg ring-1 ring-black ring-opacity-5 overflow-hidden">- <div class="p-4">- <div class="flex items-start">- <div class="flex-shrink-0">- <svg class="w-6 h-6 text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>- </div>- <div class="ml-3 w-0 flex-1 pt-0.5">- <p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">- <%= Phoenix.Flash.get(@flash, :error_title) || "Error" %>- </p>- <p class="mt-1 text-sm leading-5 text-gray-500 dark:text-gray-200">- <%= Phoenix.Flash.get(@flash, :error) %>- </p>- </div>- <div class="ml-4 flex-shrink-0 flex">- <button class="inline-flex text-gray-400 focus:outline-none focus:text-gray-500 dark:focus:text-gray-200 transition ease-in-out duration-150" @click="show = false">- <!-- Heroicon name: x -->- <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">- <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />- </svg>- </button>- </div>- </div>- </div>- </div>- </div>- </div>-<% end %>diff --git a/lib/plausible_web/templates/layout/_flash.html.heex b/lib/plausible_web/templates/layout/_flash.html.heexnew file mode 100644index 0000000000..1fb19f68c2--- /dev/null+++ b/lib/plausible_web/templates/layout/_flash.html.heex@@ -0,0 +1,136 @@+<%= if Phoenix.Flash.get(@flash, :success) do %>+ <div class="z-50 fixed inset-0 flex items-end justify-center px-4 py-6 pointer-events-none sm:p-6 sm:items-start sm:justify-end">+ <div+ x-data={"{ show: true, ttl: #{Phoenix.Flash.get(@flash, :ttl) || 4000} }"}+ x-show="show"+ x-init="setTimeout(() => show = false, ttl)"+ x-transition:enter="transform ease-out duration-300 transition"+ x-transition:enter-start="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"+ x-transition:enter-end="translate-y-0 opacity-100 sm:translate-x-0"+ x-transition:leave="transition ease-in duration-100"+ x-transition:leave-start="opacity-100"+ x-transition:leave-end="opacity-0"+ class="max-w-sm w-full bg-white dark:bg-gray-800 shadow-lg rounded-lg pointer-events-auto"+ >+ <div class="rounded-lg ring-1 ring-black ring-opacity-5 overflow-hidden">+ <div class="p-4">+ <div class="flex items-start">+ <div class="flex-shrink-0">+ <svg+ class="h-6 w-6 text-green-400"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"+ />+ </svg>+ </div>+ <div class="ml-3 w-0 flex-1 pt-0.5">+ <p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">+ <%= Phoenix.Flash.get(@flash, :success_title) || "Success!" %>+ </p>+ <p class="mt-1 text-sm leading-5 text-gray-500 dark:text-gray-200">+ <%= Phoenix.Flash.get(@flash, :success) %>+ </p>+ </div>+ <div class="ml-4 flex-shrink-0 flex">+ <button+ class="inline-flex text-gray-400 focus:outline-none focus:text-gray-500 dark:focus:text-gray-200 transition ease-in-out duration-150"+ @click="show = false"+ >+ <!-- Heroicon name: x -->+ <svg+ class="h-5 w-5"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 20 20"+ fill="currentColor"+ >+ <path+ fill-rule="evenodd"+ d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"+ clip-rule="evenodd"+ />+ </svg>+ </button>+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>+<% end %>++<%= if Phoenix.Flash.get(@flash, :error) do %>+ <div class="z-50 fixed inset-0 flex items-end justify-center px-4 py-6 pointer-events-none sm:p-6 sm:items-start sm:justify-end">+ <div+ x-data={"{ show: true, ttl: #{Phoenix.Flash.get(@flash, :ttl) || 4000} }"}+ x-show="show"+ x-init="setTimeout(() => show = false, ttl)"+ x-transition:enter="transform ease-out duration-300 transition"+ x-transition:enter-start="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"+ x-transition:enter-end="translate-y-0 opacity-100 sm:translate-x-0"+ x-transition:leave="transition ease-in duration-100"+ x-transition:leave-start="opacity-100"+ x-transition:leave-end="opacity-0"+ class="max-w-sm w-full bg-white dark:bg-gray-800 shadow-lg rounded-lg pointer-events-auto"+ >+ <div class="rounded-lg ring-1 ring-black ring-opacity-5 overflow-hidden">+ <div class="p-4">+ <div class="flex items-start">+ <div class="flex-shrink-0">+ <svg+ class="w-6 h-6 text-red-400"+ fill="none"+ stroke="currentColor"+ viewBox="0 0 24 24"+ xmlns="http://www.w3.org/2000/svg"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"+ >+ </path>+ </svg>+ </div>+ <div class="ml-3 w-0 flex-1 pt-0.5">+ <p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">+ <%= Phoenix.Flash.get(@flash, :error_title) || "Error" %>+ </p>+ <p class="mt-1 text-sm leading-5 text-gray-500 dark:text-gray-200">+ <%= Phoenix.Flash.get(@flash, :error) %>+ </p>+ </div>+ <div class="ml-4 flex-shrink-0 flex">+ <button+ class="inline-flex text-gray-400 focus:outline-none focus:text-gray-500 dark:focus:text-gray-200 transition ease-in-out duration-150"+ @click="show = false"+ >+ <!-- Heroicon name: x -->+ <svg+ class="h-5 w-5"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 20 20"+ fill="currentColor"+ >+ <path+ fill-rule="evenodd"+ d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"+ clip-rule="evenodd"+ />+ </svg>+ </button>+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>+<% end %>diff --git a/lib/plausible_web/templates/layout/_footer.html.heex b/lib/plausible_web/templates/layout/_footer.html.heexindex d90e774c83..4265888a0a 100644--- a/lib/plausible_web/templates/layout/_footer.html.heex+++ b/lib/plausible_web/templates/layout/_footer.html.heex@@ -3,15 +3,17 @@<div class="xl:grid xl:grid-cols-3 xl:gap-8"><div class="my-8 xl:my-0"><h4 class="font-semibold tracking-wider text-gray-300 leading-5">- <%= img_tag(- PlausibleWeb.Router.Helpers.static_path(- @conn,- logo_path("logo_dark.svg")- ),- class: "inline-block w-40 mr-1",- alt: "Plausible logo",- loading: "lazy"- ) %>+ <img+ src={+ PlausibleWeb.Router.Helpers.static_path(+ @conn,+ logo_path("logo_dark.svg")+ )+ }+ class="inline-block w-40 mr-1"+ alt="Plausible logo"+ loading="lazy"+ /></h4><p class="mt-4 text-base text-gray-400 leading-6"><%= if ee?() do %>diff --git a/lib/plausible_web/templates/layout/_header.html.heex b/lib/plausible_web/templates/layout/_header.html.heexindex 5662903c17..bf376249b0 100644--- a/lib/plausible_web/templates/layout/_header.html.heex+++ b/lib/plausible_web/templates/layout/_header.html.heex@@ -3,24 +3,28 @@<nav class="relative flex items-center justify-between sm:h-10 md:justify-center"><div class="flex items-center flex-1 md:absolute md:inset-y-0 md:left-0"><a href={home_dest(@conn)}>- <%= img_tag(- PlausibleWeb.Router.Helpers.static_path(- @conn,- logo_path("logo_dark.svg")- ),- class: "w-44 -mt-2 hidden dark:inline",- alt: "Plausible logo",- loading: "lazy"- ) %>- <%= img_tag(- PlausibleWeb.Router.Helpers.static_path(- @conn,- logo_path("logo_light.svg")- ),- class: "w-44 -mt-2 inline dark:hidden",- alt: "Plausible logo",- loading: "lazy"- ) %>+ <img+ src={+ PlausibleWeb.Router.Helpers.static_path(+ @conn,+ logo_path("logo_dark.svg")+ )+ }+ class="w-44 -mt-2 hidden dark:inline"+ alt="Plausible logo"+ loading="lazy"+ />+ <img+ src={+ PlausibleWeb.Router.Helpers.static_path(+ @conn,+ logo_path("logo_light.svg")+ )+ }+ class="w-44 -mt-2 inline dark:hidden"+ alt="Plausible logo"+ loading="lazy"+ /></a></div><div class="absolute inset-y-0 right-0 flex items-center justify-end">@@ -43,11 +47,12 @@:if={ee?() and Plausible.Users.on_trial?(@conn.assigns[:current_user])}class="hidden mr-6 sm:block">- <%= link(trial_notificaton(@conn.assigns[:current_user]),- to: Routes.settings_path(@conn, :subscription),- class:- "text-sm text-yellow-900 dark:text-yellow-900 rounded px-3 py-2 rounded-md bg-yellow-100 dark:bg-yellow-100"- ) %>+ <.styled_link+ class="text-sm text-yellow-900 dark:text-yellow-900 rounded px-3 py-2 rounded-md bg-yellow-100 dark:bg-yellow-100"+ href={Routes.settings_path(@conn, :subscription)}+ >+ <%= trial_notificaton(@conn.assigns[:current_user]) %>+ </.styled_link></li><li class="w-full sm:w-auto"><.dropdown>@@ -55,9 +60,10 @@<span class="font-medium truncate dark:text-gray-100 hidden md:block"><%= @conn.assigns[:current_user].name %></span>- <%= img_tag(Plausible.Auth.User.profile_img_url(@conn.assigns[:current_user]),- class: "w-7 rounded-full"- ) %>+ <img+ src={Plausible.Auth.User.profile_img_url(@conn.assigns[:current_user])}+ class="w-7 rounded-full"+ /></:button><:panel class="absolute right-0 z-10 mt-2 w-60 origin-top-right divide-y divide-gray-100 dark:divide-gray-400 rounded-md bg-white dark:bg-gray-800 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"><div class="px-3.5 py-3" role="none">diff --git a/lib/plausible_web/templates/layout/_settings_tab.html.heex b/lib/plausible_web/templates/layout/_settings_tab.html.heexindex 918240d9e8..a2d379dbc7 100644--- a/lib/plausible_web/templates/layout/_settings_tab.html.heex+++ b/lib/plausible_web/templates/layout/_settings_tab.html.heex@@ -9,7 +9,7 @@!@this_tab && "text-gray-600 dark:text-gray-400"]}>- <PlausibleWeb.Components.Generic.dynamic_icon+ <.dynamic_icon:if={not @submenu? && @icon}name={@icon}class={["h-4 w-4 mr-2", is_current_tab(@conn, @this_tab) && "stroke-2"]}diff --git a/lib/plausible_web/templates/layout/_site_settings_tab.html.heex b/lib/plausible_web/templates/layout/_site_settings_tab.html.heexindex ef493adbcc..e87976b85d 100644--- a/lib/plausible_web/templates/layout/_site_settings_tab.html.heex+++ b/lib/plausible_web/templates/layout/_site_settings_tab.html.heex@@ -9,7 +9,7 @@!@this_tab && "text-gray-600 dark:text-gray-400"]}>- <PlausibleWeb.Components.Generic.dynamic_icon+ <.dynamic_icon:if={not @submenu? && @icon}name={@icon}class={["h-4 w-4 mr-2", is_current_tab(@conn, @this_tab) && "stroke-2"]}diff --git a/lib/plausible_web/templates/layout/base_email.html.eex b/lib/plausible_web/templates/layout/base_email.html.eexdeleted file mode 100644index 4fb94f6a65..0000000000--- a/lib/plausible_web/templates/layout/base_email.html.eex+++ /dev/null@@ -1,15 +0,0 @@-<%= PlausibleWeb.EmailView.greet_recipient(assigns) %>-<br /><br />--<%= @inner_content %>-<br /><br />--<%= if ee?() do %>Regards,<br />-The Plausible Team 💌-<br /><br /><% end %>-----<br /><br />-<%= link(plausible_url(), to: plausible_url()) %><br />--<%= if ee?() do %>{{{ pm:unsubscribe }}}<% end %>diff --git a/lib/plausible_web/templates/layout/base_email.html.heex b/lib/plausible_web/templates/layout/base_email.html.heexnew file mode 100644index 0000000000..f4b9ad888a--- /dev/null+++ b/lib/plausible_web/templates/layout/base_email.html.heex@@ -0,0 +1,16 @@+<%= PlausibleWeb.EmailView.greet_recipient(assigns) %>+<br /><br />++<%= @inner_content %>+<br /><br />++<%= if ee?() do %>+ Regards,<br /> The Plausible Team 💌 <br /><br />+<% end %>+-- <br /><br />+<.unstyled_link href={plausible_url()}><%= plausible_url() %></.unstyled_link>+<br />++<%= if ee?() do %>+ {{{ pm:unsubscribe }}}+<% end %>diff --git a/lib/plausible_web/templates/layout/base_error.html.heex b/lib/plausible_web/templates/layout/base_error.html.heexindex bf3e20d93e..5df4459137 100644--- a/lib/plausible_web/templates/layout/base_error.html.heex+++ b/lib/plausible_web/templates/layout/base_error.html.heex@@ -11,24 +11,28 @@<body class="flex flex-col h-full bg-gray-100 dark:bg-gray-900"><div class="w-full my-8 text-center"><a href={home_dest(@conn)}>- <%= img_tag(- PlausibleWeb.Router.Helpers.static_path(- @conn,- logo_path("logo_dark.svg")- ),- class: "w-44 hidden dark:inline",- alt: "Plausible logo",- loading: "lazy"- ) %>- <%= img_tag(- PlausibleWeb.Router.Helpers.static_path(- @conn,- logo_path("logo_light.svg")- ),- class: "w-44 inline dark:hidden",- alt: "Plausible logo",- loading: "lazy"- ) %>+ <img+ src={+ PlausibleWeb.Router.Helpers.static_path(+ @conn,+ logo_path("logo_dark.svg")+ )+ }+ class="w-44 hidden dark:inline"+ alt="Plausible logo"+ loading="lazy"+ />+ <img+ src={+ PlausibleWeb.Router.Helpers.static_path(+ @conn,+ logo_path("logo_light.svg")+ )+ }+ class="w-44 inline dark:hidden"+ alt="Plausible logo"+ loading="lazy"+ /></a></div>diff --git a/lib/plausible_web/templates/layout/embedded.html.eex b/lib/plausible_web/templates/layout/embedded.html.eexdeleted file mode 100644index e69de29bb2..0000000000diff --git a/lib/plausible_web/templates/layout/embedded.html.heex b/lib/plausible_web/templates/layout/embedded.html.heexnew file mode 100644index 0000000000..8b13789179--- /dev/null+++ b/lib/plausible_web/templates/layout/embedded.html.heex@@ -0,0 +1 @@+diff --git a/lib/plausible_web/templates/layout/priority_email.html.eex b/lib/plausible_web/templates/layout/priority_email.html.eexdeleted file mode 100644index 2567b8b1b5..0000000000--- a/lib/plausible_web/templates/layout/priority_email.html.eex+++ /dev/null@@ -1,13 +0,0 @@-<%= PlausibleWeb.EmailView.greet_recipient(assigns) %>-<br /><br />--<%= @inner_content %>-<br /><br />--<%= if ee?() do %>Regards,<br />-The Plausible Team 💌-<br /><br /><% end %>-----<br /><br />-<%= link(plausible_url(), to: plausible_url()) %><br />diff --git a/lib/plausible_web/templates/layout/priority_email.html.heex b/lib/plausible_web/templates/layout/priority_email.html.heexnew file mode 100644index 0000000000..fcbca09d1c--- /dev/null+++ b/lib/plausible_web/templates/layout/priority_email.html.heex@@ -0,0 +1,12 @@+<%= PlausibleWeb.EmailView.greet_recipient(assigns) %>+<br /><br />++<%= @inner_content %>+<br /><br />++<%= if ee?() do %>+ Regards,<br /> The Plausible Team 💌 <br /><br />+<% end %>+-- <br /><br />+<.unstyled_link href={plausible_url()}><%= plausible_url() %></.unstyled_link>+<br />diff --git a/lib/plausible_web/templates/layout/settings.html.heex b/lib/plausible_web/templates/layout/settings.html.heexindex 4ec71e06b7..e4411f1c05 100644--- a/lib/plausible_web/templates/layout/settings.html.heex+++ b/lib/plausible_web/templates/layout/settings.html.heex@@ -9,10 +9,9 @@] %><div class="container pt-6">- <%= link("← Back to Sites",- to: "/sites",- class: "text-indigo-600 font-bold text-sm"- ) %>+ <.styled_link class="text-indigo-600 font-bold text-sm" href="/sites">+ ← Back to Sites+ </.styled_link><div class="pb-5 border-b border-gray-200 dark:border-gray-500"><h2 class="text-2xl font-bold leading-7 text-gray-900 dark:text-gray-100 sm:text-3xl sm:leading-9 sm:truncate">Settingsdiff --git a/lib/plausible_web/templates/layout/site_settings.html.heex b/lib/plausible_web/templates/layout/site_settings.html.heexindex 1a4e59a62a..53248e2a99 100644--- a/lib/plausible_web/templates/layout/site_settings.html.heex+++ b/lib/plausible_web/templates/layout/site_settings.html.heex@@ -1,9 +1,11 @@<%= render_layout "app.html", assigns do %><div class="container pt-6">- <%= link("← Back to Stats",- to: "/#{URI.encode_www_form(@site.domain)}",- class: "text-indigo-600 font-bold text-sm"- ) %>+ <.styled_link+ class="text-indigo-600 font-bold text-sm"+ href={"/#{URI.encode_www_form(@site.domain)}"}+ >+ ← Back to Stats+ </.styled_link><div class="pb-5 border-b border-gray-200 dark:border-gray-500"><h2 class="text-2xl font-bold leading-7 text-gray-900 dark:text-gray-100 sm:text-3xl sm:leading-9 sm:truncate">Settings for <%= @site.domain %>@@ -11,18 +13,21 @@</div><div class="lg:grid lg:grid-cols-12 lg:gap-x-5 lg:mt-4"><div class="py-4 g:py-0 lg:col-span-3">- <%= form_for @conn, "/sites/#{URI.encode_www_form(@site.domain)}", [class: "lg:hidden"], fn f -> %>+ <.form+ for={@conn}+ action={"/sites/#{URI.encode_www_form(@site.domain)}"}+ class="lg:hidden"+ ><% options = flat_settings_options(@conn) %>- <%= select(f, :tab, options,- class:- "dark:bg-gray-800 mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 dark:border-gray-500 outline-none focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 rounded-md dark:text-gray-100",- onchange:- "location.href = '/" <>- URI.encode_www_form(@site.domain) <> "/settings/' + event.target.value",- selected:- Enum.find_value(options, &(is_current_tab(@conn, elem(&1, 1)) && elem(&1, 1)))- ) %>- <% end %>+ <.input+ type="select"+ name="tab"+ options={options}+ class="dark:bg-gray-800 mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 dark:border-gray-500 outline-none focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 rounded-md dark:text-gray-100"+ onchange={"location.href = '/" <> URI.encode_www_form(@site.domain) <> "/settings/' + event.target.value"}+ value={Enum.find_value(options, &(is_current_tab(@conn, elem(&1, 1)) && elem(&1, 1)))}+ />+ </.form><div class="hidden lg:block"><%= for %{key: key, value: value, icon: icon} <- settings_tabs(@conn) do %><%= if is_binary(value) do %>diff --git a/lib/plausible_web/templates/page/index.html.heex b/lib/plausible_web/templates/page/index.html.heexindex fcb055d84c..09d7b52012 100644--- a/lib/plausible_web/templates/page/index.html.heex+++ b/lib/plausible_web/templates/page/index.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Welcome to Plausible!</:title>@@ -37,4 +37,4 @@</:item></.focus_list></:footer>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/templates/settings/new_api_key.html.heex b/lib/plausible_web/templates/settings/new_api_key.html.heexindex a51a35085c..eb1f9968d2 100644--- a/lib/plausible_web/templates/settings/new_api_key.html.heex+++ b/lib/plausible_web/templates/settings/new_api_key.html.heex@@ -1,52 +1,24 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Create new API key</:title>- <%= form_for @changeset, Routes.settings_path(@conn, :api_keys), fn f -> %>- <div class="my-4">- <%= label(f, :name, class: "block font-medium text-gray-700 dark:text-gray-300") %>- <div class="mt-1">- <%= text_input(f, :name,- class:- "dark:bg-gray-900 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full border-gray-300 dark:border-gray-500 dark:text-gray-300 dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500 rounded-md",- placeholder: "Development"- ) %>- </div>- <%= error_tag(f, :name) %>- </div>- <div class="my-4">- <%= label(f, :key, class: "block font-medium text-gray-700 dark:text-gray-300") %>- <div class="relative mt-1">- <%= text_input(f, :key,- id: "key-input",- class:- "dark:text-gray-300 shadow-sm bg-gray-50 dark:bg-gray-850 focus:ring-indigo-500 focus:border-indigo-500 block w-full border-gray-300 dark:border-gray-500 rounded-md pr-16",- readonly: "readonly"- ) %>- <a- onclick="var textarea = document.getElementById('key-input'); textarea.focus(); textarea.select(); document.execCommand('copy');"- href="javascript:void(0)"- class="absolute flex items-center text-xs font-medium text-indigo-600 no-underline hover:underline"- style="top: 12px; right: 12px;"- >- <svg- class="pr-1 text-indigo-600 dark:text-indigo-500"- xmlns="http://www.w3.org/2000/svg"- width="16"- height="16"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- ><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>COPY- </a>- <%= error_tag(f, :key) %>- <p class="mt-2 text-gray-500 dark:text-gray-200">- Make sure to store the key in a secure place. Once created, we will not be able to show it again.- </p>- </div>+ <.form :let={f} for={@changeset} action={Routes.settings_path(@conn, :api_keys)}>+ <.input type="text" field={f[:name]} label="Name" placeholder="Development" />++ <div class="mt-4">+ <.input_with_clipboard id="key-input" name="api_key[key]" label="Key" value={f[:key].value} />++ <.error :for={+ msg <- Enum.map(f[:key].errors, &PlausibleWeb.Live.Components.Form.translate_error/1)+ }>+ <%= msg %>+ </.error>++ <p class="mt-2 text-gray-500 dark:text-gray-200">+ Make sure to store the key in a secure place. Once created, we will not be able to show it again.+ </p></div>- <%= submit("Continue", class: "button mt-4 w-full") %>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ <.button type="submit" class="w-full">+ Continue+ </.button>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/settings/security.html.heex b/lib/plausible_web/templates/settings/security.html.heexindex 249b8263ba..9b3ca7a367 100644--- a/lib/plausible_web/templates/settings/security.html.heex+++ b/lib/plausible_web/templates/settings/security.html.heex@@ -70,9 +70,9 @@/><div :if={@totp_enabled?} class="mt-2">- <PlausibleWeb.Live.Components.Form.label for={f[:two_factor_code].id} class="mb-2">+ <.label for={f[:two_factor_code].id} class="mb-2">Verify with 2FA Code- </PlausibleWeb.Live.Components.Form.label>+ </.label><PlausibleWeb.Components.TwoFactor.verify_2fa_inputform={f}show_button?={false}@@ -129,7 +129,6 @@</div><PlausibleWeb.Components.TwoFactor.modal- :let={f}id="disable-2fa-modal"state_param="disable2FAOpen"form_data={@conn.params}@@ -154,18 +153,18 @@</div><div class="mt-3">- <%= password_input(f, :password,- id: "disable_2fa_password",- placeholder: "Enter password",- "x-ref": "disable2FAPassword",- class:- "shadow-sm dark:bg-gray-900 dark:text-gray-300 focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:border-gray-500 rounded-md dark:bg-gray-800"- ) %>+ <.input+ type="password"+ id="disable_2fa_password"+ name="disable_2fa_password"+ value=""+ placeholder="Enter password"+ x-ref="disable2FAPassword"+ /></div></PlausibleWeb.Components.TwoFactor.modal><PlausibleWeb.Components.TwoFactor.modal- :let={f}id="regenerate-2fa-modal"state_param="regenerate2FAOpen"form_data={@conn.params}@@ -203,13 +202,14 @@</div><div class="mt-3 w-full">- <%= password_input(f, :password,- id: "regenerate_2fa_password",- placeholder: "Enter password",- "x-ref": "regenerate2FAPassword",- class:- "w-full shadow-sm dark:bg-gray-900 dark:text-gray-300 focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:border-gray-500 rounded-md dark:bg-gray-800"- ) %>+ <.input+ type="password"+ id="regenerate_2fa_password"+ name="regenerate_2fa_password"+ value=""+ placeholder="Enter password"+ x-ref="regenerate2FAPassword"+ /></div></PlausibleWeb.Components.TwoFactor.modal></div>diff --git a/lib/plausible_web/templates/site/change_domain.html.heex b/lib/plausible_web/templates/site/change_domain.html.heexindex e234a7bb11..0d05408126 100644--- a/lib/plausible_web/templates/site/change_domain.html.heex+++ b/lib/plausible_web/templates/site/change_domain.html.heex@@ -2,7 +2,7 @@flow={PlausibleWeb.Flows.domain_change()}current_step="Set up new domain"/>-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Change your website domain</:title><:subtitle>@@ -26,24 +26,25 @@</.focus_list></:footer>- <%= form_for @changeset, Routes.site_path(@conn, :change_domain_submit, @site.domain, flow: PlausibleWeb.Flows.domain_change()), [], fn f -> %>- <div class="my-6">- <%= label(f, :domain, class: "text-sm block font-medium dark:text-gray-300") %>- <p class="text-gray-500 dark:text-gray-400 mt-1 text-sm">- Just the naked domain or subdomain without 'www', 'https' etc.- </p>- <div class="mt-2 flex rounded-md shadow-sm">- <%= text_input(f, :domain,- class:- "text-sm focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-800 flex-1 block w-full px-3 py-2 rounded-none rounded-r-md border-gray-300 dark:border-gray-500 dark:bg-gray-900 dark:text-gray-300",- placeholder: "example.com"- ) %>- </div>- <%= error_tag(f, :domain) %>- </div>+ <.form+ :let={f}+ for={@changeset}+ action={+ Routes.site_path(@conn, :change_domain_submit, @site.domain,+ flow: PlausibleWeb.Flows.domain_change()+ )+ }+ >+ <.input+ help_text="Just the naked domain or subdomain without 'www', 'https' etc."+ type="text"+ placeholder="example.com"+ field={f[:domain]}+ label="Domain"+ />- <PlausibleWeb.Components.Generic.button type="submit" class="mt-4 w-full">+ <.button type="submit" class="mt-4 w-full">Change Domain and add new Snippet- </PlausibleWeb.Components.Generic.button>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ </.button>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/site/csv_import.html.heex b/lib/plausible_web/templates/site/csv_import.html.heexindex 0f1b5a51c2..7570d8a282 100644--- a/lib/plausible_web/templates/site/csv_import.html.heex+++ b/lib/plausible_web/templates/site/csv_import.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Import from CSV files</:title><:subtitle>Please ensure each file follows@@ -13,4 +13,4 @@"storage" => on_ee(do: "s3", else: "local")}) %>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/templates/site/edit_shared_link.html.eex b/lib/plausible_web/templates/site/edit_shared_link.html.eexdeleted file mode 100644index e36d12fb91..0000000000--- a/lib/plausible_web/templates/site/edit_shared_link.html.eex+++ /dev/null@@ -1,12 +0,0 @@-<%= form_for @changeset, "/sites/#{URI.encode_www_form(@site.domain)}/shared-links/#{@changeset.data.slug}", [class: "max-w-md w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>- <h2 class="text-xl font-black dark:text-gray-100">Edit shared link</h2>- <div class="my-4">- <%= label f, :name, "Name", class: "block text-sm font-medium text-gray-700 dark:text-gray-100" %>- <div class="mt-1">- <%= text_input f, :name, class: "shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md", required: "required" %>- <%= error_tag f, :name %>- </div>- </div>-- <%= submit "Update", class: "button mt-4 w-full" %>-<% end %>diff --git a/lib/plausible_web/templates/site/edit_shared_link.html.heex b/lib/plausible_web/templates/site/edit_shared_link.html.heexnew file mode 100644index 0000000000..b448597c5a--- /dev/null+++ b/lib/plausible_web/templates/site/edit_shared_link.html.heex@@ -0,0 +1,14 @@+<.focus_box>+ <:title>Edit Shared Link</:title>++ <.form+ :let={f}+ for={@changeset}+ action={"/sites/#{URI.encode_www_form(@site.domain)}/shared-links/#{@changeset.data.slug}"}+ class=""+ >+ <.input type="text" field={f[:name]} label="Name" />++ <.button class="w-full" type="submit">Update</.button>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/site/membership/invite_member_form.html.heex b/lib/plausible_web/templates/site/membership/invite_member_form.html.heexindex d4c46c5894..0891dde650 100644--- a/lib/plausible_web/templates/site/membership/invite_member_form.html.heex+++ b/lib/plausible_web/templates/site/membership/invite_member_form.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Invite member to <%= @site.domain %></:title>@@ -8,7 +8,7 @@The invitation will expire in 48 hours</:subtitle>- <%= form_for @conn, Routes.membership_path(@conn, :invite_member, @site.domain), fn f -> %>+ <.form :let={f} for={@conn} action={Routes.membership_path(@conn, :invite_member, @site.domain)}><PlausibleWeb.Components.Billing.Notice.limit_exceeded:if={Map.get(assigns, :is_at_limit, false)}current_user={@current_user}@@ -18,29 +18,13 @@/><div class="my-6">- <%= label(f, :email, "Email address",- class: "block font-medium text-gray-700 dark:text-gray-300"- ) %>- <div class="mt-1 relative rounded-md shadow-sm">- <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">- <svg- class="h-5 w-5 text-gray-500 dark:text-gray-400"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 20 20"- fill="currentColor"- aria-hidden="true"- >- <path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z" /><path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" />- </svg>- </div>- <%= email_input(f, :email,- class:- "focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-900 dark:text-gray-300 block w-full rounded-md pl-10 border-gray-300 dark:border-gray-500",- placeholder: "[email protected]",- required: "true"- ) %>- </div>- <%= error_tag(f, :email) %>+ <.input+ type="email"+ field={f[:email]}+ label="Email address"+ placeholder="[email protected]"+ required="true"+ /><%= if @conn.assigns[:error] do %><div class="text-red-500 mb-4"><%= @conn.assigns[:error] %></div>@@ -48,18 +32,24 @@</div><fieldset x-data="{selectedOption: null}">- <%= label(f, :role, class: "block font-medium text-gray-700 dark:text-gray-300") %>+ <.label for={f[:role].id}>+ Role+ </.label><div class="mt-1 bg-white rounded-md -space-y-px dark:bg-gray-800"><labelclass="border-gray-200 dark:border-gray-500 rounded-tl-md rounded-tr-md relative border p-4 flex cursor-pointer"x-class="{'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': selectedOption === 'admin', 'border-gray-200': selectedOption !== 'admin'}">- <%= radio_button(f, :role, "admin",- class:- "dark:bg-gray-900 h-4 w-4 mt-0.5 cursor-pointer text-indigo-600 border-gray-300 dark:border-gray-500 focus:ring-indigo-500",- "x-model": "selectedOption",- required: "true"- ) %>+ <.input+ type="radio"+ field={f[:role]}+ id="role_admin"+ value="admin"+ x-model="selectedOption"+ required="true"+ width="w-4"+ class="block dark:bg-gray-900 h-4 w-4 mt-0.5 cursor-pointer text-indigo-600 border-gray-300 dark:border-gray-500 focus:ring-indigo-500"+ /><div class="ml-3 flex flex-col"><spanclass="text-gray-900 dark:text-gray-100 block text-sm font-medium"@@ -80,12 +70,16 @@class="border-gray-200 dark:border-gray-500 rounded-bl-md rounded-br-md relative border p-4 flex cursor-pointer"x-class="{'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': selectedOption === 'viewer', 'border-gray-200': selectedOption !== 'viewer'}">- <%= radio_button(f, :role, "viewer",- class:- "dark:bg-gray-900 h-4 w-4 mt-0.5 cursor-pointer text-indigo-600 border-gray-300 dark:border-gray-500 focus:ring-indigo-500",- "x-model": "selectedOption",- required: "true"- ) %>+ <.input+ type="radio"+ field={f[:role]}+ id="role_viewer"+ value="viewer"+ x-model="selectedOption"+ required="true"+ width="w-4"+ class="block dark:bg-gray-900 h-4 w-4 mt-0.5 cursor-pointer text-indigo-600 border-gray-300 dark:border-gray-500 focus:ring-indigo-500"+ /><div class="ml-3 flex flex-col"><spanclass="text-gray-900 dark:text-gray-100 text-sm block font-medium"@@ -105,9 +99,9 @@</fieldset><div class="mt-6">- <%= submit(class: "button w-full") do %>- <span>Invite</span>- <% end %>+ <.button type="submit" class="w-full">+ Invite+ </.button></div>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/site/membership/transfer_ownership_form.html.heex b/lib/plausible_web/templates/site/membership/transfer_ownership_form.html.heexindex a610acd337..18afc3aafd 100644--- a/lib/plausible_web/templates/site/membership/transfer_ownership_form.html.heex+++ b/lib/plausible_web/templates/site/membership/transfer_ownership_form.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Transfer ownership of <%= @site.domain %></:title>@@ -12,37 +12,25 @@and any othermember roles will stay the same.</:subtitle>- <%= form_for @conn, Routes.membership_path(@conn, :transfer_ownership, @site.domain), fn f -> %>+ <.form+ :let={f}+ for={@conn}+ action={Routes.membership_path(@conn, :transfer_ownership, @site.domain)}+ ><%= if @conn.assigns[:error] do %><div class="text-red-500 text-xs italic mt-4"><%= @conn.assigns[:error] %></div><% end %><div class="my-6">- <%= label(f, :email, "Email address",- class: "block font-medium text-gray-700 dark:text-gray-300"- ) %>- <div class="mt-1 relative rounded-md shadow-sm">- <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">- <svg- class="h-5 w-5 text-gray-400"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 20 20"- fill="currentColor"- aria-hidden="true"- >- <path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z" /><path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" />- </svg>- </div>- <%= email_input(f, :email,- class:- "focus:ring-indigo-500 focus:border-indigo-500 block w-full rounded-md pl-10 border-gray-300",- placeholder: "[email protected]",- required: "true"- ) %>- </div>- <%= error_tag(f, :email) %>+ <.input+ type="email"+ field={f[:email]}+ label="Email address"+ placeholder="[email protected]"+ required="true"+ /></div><.button type="submit" class="w-full" mt?={false}>Request transfer</.button>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/site/new.html.heex b/lib/plausible_web/templates/site/new.html.heexindex 8ee77069ba..e8e79ae3f0 100644--- a/lib/plausible_web/templates/site/new.html.heex+++ b/lib/plausible_web/templates/site/new.html.heex@@ -1,11 +1,11 @@<PlausibleWeb.Components.FlowProgress.render flow={@flow} current_step="Add site info" />-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Add website info</:title>- <%= form_for @changeset, @form_submit_url, [class: ""], fn f -> %>+ <.form :let={f} for={@changeset} action={@form_submit_url}><PlausibleWeb.Components.Billing.Notice.limit_exceeded:if={@site_limit_exceeded?}current_user={@current_user}@@ -44,37 +44,26 @@<% end %><div class="my-6">- <%= label(f, :domain, class: "block font-medium dark:text-gray-300") %>- <p class="text-gray-500 dark:text-gray-400 mt-1 text-sm">- Just the naked domain or subdomain without 'www', 'https' etc.- </p>- <div class="mt-2 flex rounded-md shadow-sm">- <%= text_input(f, :domain,- class:- "focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-800 flex-1 block w-full px-3 py-2 rounded-none rounded-r-md border-gray-300 dark:border-gray-500 dark:bg-gray-900 dark:text-gray-300",- placeholder: "example.com",- disabled: @site_limit_exceeded?- ) %>- </div>- <%= error_tag(f, :domain) %>+ <.input+ help_text="Just the naked domain or subdomain without 'www', 'https' etc."+ type="text"+ placeholder="example.com"+ field={f[:domain]}+ label="Domain"+ disabled={@site_limit_exceeded?}+ /></div><div class="my-6">- <%= label(f, :timezone, "Reporting Timezone",- class: "block font-medium text-gray-700 dark:text-gray-300"- ) %>- <p class="text-gray-500 dark:text-gray-400 text-sm mt-1">- To make sure we agree on what 'today' means- </p>-- <div class="inline-block relative w-full">- <%= select(f, :timezone, Plausible.Timezones.options(),- id: "tz-select",- selected: "Etc/Greenwich",- class:- "mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 dark:border-gray-500 dark:bg-gray-900 dark:text-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",- disabled: @site_limit_exceeded?- ) %>- </div>+ <.input+ type="select"+ help_text="To make sure we agree on what 'today' means"+ field={f[:timezone]}+ id="tz-select"+ value="Etc/Greenwich"+ disabled={@site_limit_exceeded?}+ label="Reporting Timezone"+ options={Plausible.Timezones.options()}+ /></div><script>var option;@@ -92,9 +81,12 @@if (option) { option.selected = "selected"}</script>- <%= submit("Add snippet",- class: "button mt-4 w-full disabled:cursor-not-allowed",- disabled: @site_limit_exceeded?- ) %>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ <.button+ disabled={@site_limit_exceeded?}+ type="submit"+ class="w-full disabled:cursor-not-allowed"+ >+ Install Plausible+ </.button>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/site/new_shared_link.html.heex b/lib/plausible_web/templates/site/new_shared_link.html.heexindex 5c9f6e8139..c601c31d33 100644--- a/lib/plausible_web/templates/site/new_shared_link.html.heex+++ b/lib/plausible_web/templates/site/new_shared_link.html.heex@@ -3,16 +3,14 @@<:subtitle>Password protection is optional. Please make sure you save it in a secure place. Once the link is created, we cannot reveal the password.</:subtitle>- <%= form_for @changeset, "/sites/#{URI.encode_www_form(@site.domain)}/shared-links", [], fn f -> %>+ <.form+ :let={f}+ for={@changeset}+ action={"/sites/#{URI.encode_www_form(@site.domain)}/shared-links"}+ ><div class="flex flex-col gap-y-4">- <PlausibleWeb.Live.Components.Form.input- field={f[:name]}- label="Name"- required="required"- autocomplete="off"- mt?={false}- />- <PlausibleWeb.Live.Components.Form.input+ <.input field={f[:name]} label="Name" required="required" autocomplete="off" mt?={false} />+ <.inputfield={f[:password]}label="Password (optional)"type="password"@@ -22,5 +20,5 @@<.button class="w-full mt-4" type="submit" mt?={false}>Create shared link</.button></div>- <% end %>+ </.form></.focus_box>diff --git a/lib/plausible_web/templates/site/settings_general.html.heex b/lib/plausible_web/templates/site/settings_general.html.heexindex d6d4095633..23bb24c4e4 100644--- a/lib/plausible_web/templates/site/settings_general.html.heex+++ b/lib/plausible_web/templates/site/settings_general.html.heex@@ -6,13 +6,7 @@<:subtitle>Moving your site to a different domain? We got you!</:subtitle>- <PlausibleWeb.Live.Components.Form.input- name="domain"- label="Domain"- value={@site.domain}- disabled- width="w-1/2"- />+ <.input name="domain" label="Domain" value={@site.domain} disabled width="w-1/2" /><.button_link href={Routes.site_path(@conn, :change_domain, @site.domain)}>Change Domain@@ -22,8 +16,8 @@<.tile docs="general"><:title>Site Timezone</:title><:subtitle>Update your reporting timezone</:subtitle>- <%= form_for @changeset, "/#{URI.encode_www_form(@site.domain)}/settings", fn f -> %>- <PlausibleWeb.Live.Components.Form.input+ <.form :let={f} for={@changeset} action={"/#{URI.encode_www_form(@site.domain)}/settings"}>+ <.inputfield={f[:timezone]}label="Reporting Timezone"type="select"@@ -33,7 +27,7 @@<.button type="submit">Save timezone</.button>- <% end %>+ </.form></.tile><.tile docs="plausible-script"><:title>Site Installation</:title>diff --git a/lib/plausible_web/templates/site/settings_people.html.heex b/lib/plausible_web/templates/site/settings_people.html.heexindex 74f2b56964..331d3c7325 100644--- a/lib/plausible_web/templates/site/settings_people.html.heex+++ b/lib/plausible_web/templates/site/settings_people.html.heex@@ -18,9 +18,10 @@<li class="py-4"><div class="flex items-center space-x-4"><div class="flex-shrink-0">- <%= img_tag(Plausible.Auth.User.profile_img_url(membership.user),- class: "h-8 w-8 rounded-full"- ) %>+ <img+ src={Plausible.Auth.User.profile_img_url(membership.user)}+ class="h-8 w-8 rounded-full"+ /></div><div class="flex-1 min-w-0"><p class="text-sm truncate">@@ -104,19 +105,34 @@class="select-none hover:bg-gray-100 dark:hover:bg-gray-900 text-red-600"role="option">- <%= link("Transfer ownership →",- to:+ <.unstyled_link+ class="inline-block w-full text-sm p-4 text-red-600 font-medium"+ href={Routes.membership_path(@conn,:transfer_ownership_form,@site.domain- ),- class: "inline-block w-full text-sm p-4 text-red-600 font-medium"- ) %>+ )+ }+ >+ Transfer ownership+ </.unstyled_link></li><% end %><% else %>- <%= link(to: Routes.membership_path(@conn, :update_role, @site.domain, membership.id, "admin"), method: :put, class: "p-4 flex justify-between group hover:bg-indigo-500") do %>+ <.unstyled_link+ href={+ Routes.membership_path(+ @conn,+ :update_role,+ @site.domain,+ membership.id,+ "admin"+ )+ }+ method="put"+ class="p-4 flex justify-between group hover:bg-indigo-500"+ ><div><p class="text-sm font-medium text-gray-900 dark:text-gray-100 group-hover:text-white">Admin@@ -143,8 +159,20 @@</svg></span><% end %>- <% end %>- <%= link(to: Routes.membership_path(@conn, :update_role, @site.domain, membership.id, "viewer"), method: :put, class: "p-4 flex justify-between group hover:bg-indigo-500") do %>+ </.unstyled_link>+ <.unstyled_link+ href={+ Routes.membership_path(+ @conn,+ :update_role,+ @site.domain,+ membership.id,+ "viewer"+ )+ }+ method="put"+ class="p-4 flex justify-between group hover:bg-indigo-500"+ ><div><p class="text-sm font-medium text-gray-900 dark:text-gray-100 group-hover:text-white">Viewer@@ -171,11 +199,17 @@</svg></span><% end %>- <% end %>+ </.unstyled_link>- <%= link(to: Routes.membership_path(@conn, :remove_member, @site.domain, membership.id), method: :delete, class: "p-4 flex hover:bg-gray-100 dark:hover:bg-gray-900 text-red-600") do %>+ <.unstyled_link+ href={+ Routes.membership_path(@conn, :remove_member, @site.domain, membership.id)+ }+ method="delete"+ class="p-4 flex hover:bg-gray-100 dark:hover:bg-gray-900 text-red-600"+ ><p class="text-red-600 font-medium text-sm">Remove member</p>- <% end %>+ </.unstyled_link><% end %></ul></div>diff --git a/lib/plausible_web/templates/site/settings_search_console.html.heex b/lib/plausible_web/templates/site/settings_search_console.html.heexindex 72ff7366c5..be7c898ff9 100644--- a/lib/plausible_web/templates/site/settings_search_console.html.heex+++ b/lib/plausible_web/templates/site/settings_search_console.html.heex@@ -9,7 +9,7 @@</:subtitle><%= if Keyword.get(Application.get_env(:plausible, :google), :client_id) do %><%= if @site.google_auth do %>- <PlausibleWeb.Live.Components.Form.input+ <.inputname="account"label="Linked Google account"value={@site.google_auth.email}@@ -44,17 +44,24 @@</p><% end %>- <%= form_for Plausible.Site.GoogleAuth.changeset(@site.google_auth), "/#{URI.encode_www_form(@site.domain)}/settings/google", [class: "max-w-xs"], fn f -> %>+ <.form+ :let={f}+ for={Plausible.Site.GoogleAuth.changeset(@site.google_auth)}+ class="max-w-xs"+ action={"/#{URI.encode_www_form(@site.domain)}/settings/google"}+ ><div class="inline-block relative w-full">- <%= select(f, :property, domains,- prompt: "(Choose property)",- class:- "dark:bg-gray-800 mt-1 block w-full pl-3 pr-10 py-2 border-gray-300 dark:border-gray-500 outline-none focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:rounded-md "- ) %>+ <.input+ options={domains}+ type="select"+ field={f[:property]}+ prompt="(Choose property)"+ class="dark:bg-gray-800 mt-1 block w-full pl-3 pr-10 py-2 border-gray-300 dark:border-gray-500 outline-none focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:rounded-md"+ /></div><.button type="submit">Save</.button>- <% end %>+ </.form><% {:error, error} -> %><.notice title="Integration Error" theme={:red} class="mt-8"><%= case error do %>@@ -111,10 +118,10 @@</svg><p>An extra step is needed to set up your <%= Plausible.product_name() %> for the Google Search Console integration.- Find instructions <%= link("here",- to: "https://github.com/plausible/community-edition/wiki/google-integration",- class: "text-indigo-500"- ) %>+ Find instructions+ <.styled_link href="https://github.com/plausible/community-edition/wiki/google-integration">+ here+ </.styled_link></p></div><% end %>diff --git a/lib/plausible_web/templates/site/settings_visibility.html.heex b/lib/plausible_web/templates/site/settings_visibility.html.heexindex 7eec3397d7..c6772e3253 100644--- a/lib/plausible_web/templates/site/settings_visibility.html.heex+++ b/lib/plausible_web/templates/site/settings_visibility.html.heex@@ -16,10 +16,13 @@for={nil}><.toggle_submit set_to={@site.public}>- Make stats publicly available on <%= link(PlausibleWeb.StatsView.pretty_stats_url(@site),- to: Routes.stats_path(@conn, :stats, @site.domain, []),- class: "text-indigo-500"- ) %>+ Make stats publicly available on+ <.unstyled_link+ class="text-indigo-500"+ href={Routes.stats_path(@conn, :stats, @site.domain, [])}+ >+ <%= PlausibleWeb.StatsView.pretty_stats_url(@site) %>+ </.unstyled_link></.toggle_submit></.form></.tile>@@ -55,7 +58,7 @@<Heroicons.lock_open :if={!link.password_hash} class="w-6 h-6 feather ml-2" /></.td><.td>- <PlausibleWeb.Live.Components.Form.input_with_clipboard+ <.input_with_clipboardname={link.slug}id={link.slug}value={shared_link_dest(@site, link)}@@ -85,7 +88,7 @@You can use shared links to embed your stats in any other webpage using an <code>iframe</code>. Copy & paste a shared link into the form below to generate the embed code.</:subtitle>- <PlausibleWeb.Live.Components.Form.input+ <.inputname="embed-link"id="embed-link"label="Enter Shared Link (only public shared links without password can be embedded)"@@ -93,7 +96,7 @@width="w-1/2"/>- <PlausibleWeb.Live.Components.Form.input+ <.inputtype="select"name="theme"id="theme"@@ -103,7 +106,7 @@width="w-1/2"/>- <PlausibleWeb.Live.Components.Form.input+ <.inputname="background"id="background"label="Custom Background Colour (optional). Try using `transparent` background to blend the dashboard with your site."@@ -112,19 +115,12 @@width="w-1/2"/>- <PlausibleWeb.Live.Components.Form.input- name="base-url"- type="hidden"- id="base-url"- value={plausible_url()}- />- <PlausibleWeb.Components.Generic.button id="generate-embed" class="mt-4">+ <.input name="base-url" type="hidden" id="base-url" value={plausible_url()} />+ <.button id="generate-embed" class="mt-4">Generate Embed Code- </PlausibleWeb.Components.Generic.button>+ </.button>- <%= label(nil, "embed-code", "Embed Code",- class: "mt-8 mb-2 block font-medium dark:text-gray-100"- ) %>+ <.label for="embed-code">Embed Code</.label><div class="relative mt-1"><textareadiff --git a/lib/plausible_web/templates/stats/shared_link_password.html.heex b/lib/plausible_web/templates/stats/shared_link_password.html.heexindex b300a03af5..c0935bdfc3 100644--- a/lib/plausible_web/templates/stats/shared_link_password.html.heex+++ b/lib/plausible_web/templates/stats/shared_link_password.html.heex@@ -1,21 +1,19 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Enter password</:title><:subtitle>This link is password-protected. Please enter the password to continue to the dashboard.</:subtitle>- <%= form_for @conn, "/share/#{@link.slug}/authenticate", fn f -> %>+ <.form :let={f} for={@conn} action={"/share/#{@link.slug}/authenticate"}><div class="my-6">- <%= label(f, :password, "Password", class: "block dark:text-gray-100") %>- <%= password_input(f, :password,- class:- "transition mt-3 bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500"- ) %>+ <.input type="password" field={f[:password]} /><%= if @conn.assigns[:error] do %><div class="text-red-500 text-xs italic mt-4"><%= @conn.assigns[:error] %></div><% end %></div>- <%= submit("Continue", class: "button mt-4 w-full") %>- <% end %>-</PlausibleWeb.Components.Generic.focus_box>+ <.button type="submit" class="w-full">+ Continue+ </.button>+ </.form>+</.focus_box>diff --git a/lib/plausible_web/templates/unsubscribe/success.html.heex b/lib/plausible_web/templates/unsubscribe/success.html.heexindex f5baf8da19..c87f766169 100644--- a/lib/plausible_web/templates/unsubscribe/success.html.heex+++ b/lib/plausible_web/templates/unsubscribe/success.html.heex@@ -1,4 +1,4 @@-<PlausibleWeb.Components.Generic.focus_box>+<.focus_box><:title>Unsubscribe successful</:title>@@ -6,4 +6,4 @@<:subtitle>You will no longer receive a <%= @interval %> analytics report for <%= @site.domain %></:subtitle>-</PlausibleWeb.Components.Generic.focus_box>+</.focus_box>diff --git a/lib/plausible_web/views/form_helpers.ex b/lib/plausible_web/views/form_helpers.exdeleted file mode 100644index 6386a7d2fc..0000000000--- a/lib/plausible_web/views/form_helpers.ex+++ /dev/null@@ -1,54 +0,0 @@-defmodule PlausibleWeb.FormHelpers do- @label_opts [class: "block text-sm font-medium text-gray-700 dark:text-gray-100"]- def styled_label(form, field, text, opts \\ []) do- opts = Keyword.merge(@label_opts, opts)- Phoenix.HTML.Form.label(form, field, text, opts)- end-- @text_input_opts [- class:- "mt-1 block w-full px-3 py-2 text-base dark:text-gray-100 dark:border-gray-500 border-gray-300 focus:outline-none sm:text-sm rounded-md"- ]- @active_text_input_class "dark:bg-gray-900 focus:ring-indigo-500 focus:border-indigo-500"- @disabled_text_input_class "bg-gray-100 dark:bg-gray-800 select-none cursor-default"- def styled_text_input(form, field, opts \\ []) do- opts = merge_opts(@text_input_opts, opts)-- extra_class =- if opts[:readonly] == "true", do: @disabled_text_input_class, else: @active_text_input_class-- opts = merge_opts(opts, class: extra_class)-- Phoenix.HTML.Form.text_input(form, field, opts)- end-- @select_opts [- class:- "mt-1 block w-full pl-3 pr-10 py-2 text-base dark:text-gray-100 dark:border-gray-500 border-gray-300 focus:outline-none sm:text-sm rounded-md"- ]- @active_select_class "dark:bg-gray-900 focus:ring-indigo-500 focus:border-indigo-500"- @disabled_select_class "bg-gray-100 dark:bg-gray-800 select-none"- def styled_select(form, field, options, opts \\ []) do- opts = merge_opts(@select_opts, opts)-- extra_class =- if opts[:disabled] == "true", do: @disabled_select_class, else: @active_select_class-- opts = merge_opts(opts, class: extra_class)- Phoenix.HTML.Form.select(form, field, options, opts)- end-- @error_opts [class: "mt-1 block text-sm font-medium text-red-700 dark:text-red-500"]- def styled_error(nil), do: nil-- def styled_error(error) when is_binary(error) do- Phoenix.HTML.Tag.content_tag(:p, error, @error_opts)- end-- defp merge_opts(opts1, opts2) do- Keyword.merge(opts1, opts2, fn- :class, v1, v2 -> v1 <> " " <> v2- _k, _v1, v2 -> v2- end)- end-enddiff --git a/test/plausible/imported/csv_importer_test.exs b/test/plausible/imported/csv_importer_test.exsindex 3bb6f8ca08..bb3c759d4b 100644--- a/test/plausible/imported/csv_importer_test.exs+++ b/test/plausible/imported/csv_importer_test.exs@@ -539,7 +539,7 @@ defmodule Plausible.Imported.CSVImporterTest doassert email.to == [{user.name, user.email}]assert email.html_body =~- ~s[Please click <a href="http://localhost:8000/#{URI.encode_www_form(exported_site.domain)}/download/export">here</a> to start the download process.]+ ~s[Please click <a href="http://localhost:8000/#{URI.encode_www_form(exported_site.domain)}/download/export">here</a>]# download archiveon_ee dodiff --git a/test/plausible_web/controllers/site_controller_test.exs b/test/plausible_web/controllers/site_controller_test.exsindex 277d2a295c..e01e73a952 100644--- a/test/plausible_web/controllers/site_controller_test.exs+++ b/test/plausible_web/controllers/site_controller_test.exs@@ -859,11 +859,11 @@ defmodule PlausibleWeb.SiteControllerTest doconn = get(conn, "/#{site.domain}/settings/integrations")resp = html_response(conn, 200)- assert button = find(resp, "button#search-console-connect")+ assert button = find(resp, "a#search-console-connect")assert text(button) == "Continue with Google"- assert text_of_attr(button, "data-to") =~ "https://accounts.google.com/o/oauth2/v2/auth?"- assert text_of_attr(button, "data-to") =~ "webmasters.readonly"- refute text_of_attr(button, "data-to") =~ "analytics.readonly"+ assert text_of_attr(button, "href") =~ "https://accounts.google.com/o/oauth2/v2/auth?"+ assert text_of_attr(button, "href") =~ "webmasters.readonly"+ refute text_of_attr(button, "href") =~ "analytics.readonly"endtest "displays appropriate error in case of google account `google_auth_error`", %{@@ -1441,7 +1441,7 @@ defmodule PlausibleWeb.SiteControllerTest dolink = insert(:shared_link, site: site)conn = get(conn, "/sites/#{site.domain}/shared-links/#{link.slug}/edit")- assert html_response(conn, 200) =~ "Edit shared link"+ assert html_response(conn, 200) =~ "Edit Shared Link"endenddiff --git a/test/plausible_web/email_test.exs b/test/plausible_web/email_test.exsindex e161d2a99a..03e5085d82 100644--- a/test/plausible_web/email_test.exs+++ b/test/plausible_web/email_test.exs@@ -2,6 +2,7 @@ defmodule PlausibleWeb.EmailTest doalias PlausibleWeb.Emailuse ExUnit.Case, async: trueimport Plausible.Factory+ import Plausible.Test.Support.HTMLdescribe "base_email layout" dotest "greets user by first name if user in template assigns" do@@ -141,12 +142,14 @@ defmodule PlausibleWeb.EmailTest doassert html_body =~"cycle before that (#{PlausibleWeb.TextHelpers.format_date_range(penultimate_cycle)}), your account used 12,300 billable pageviews"- assert html_body =~ "/billing/choose-plan\">Click here to upgrade your subscription</a>"+ assert text_of_element(html_body, ~s|a[href$="/billing/choose-plan"]|) ==+ "Click here to upgrade your subscription"++ assert text_of_element(html_body, ~s|a[href$="/settings/billing/subscription"]|) ==+ "account settings"assert html_body =~PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)-- assert html_body =~ "/settings/billing/subscription\">account settings</a>"endtest "asks enterprise level usage to contact us" do@@ -191,12 +194,14 @@ defmodule PlausibleWeb.EmailTest doassert html_body =~"cycle before that (#{PlausibleWeb.TextHelpers.format_date_range(penultimate_cycle)}), the usage was 12,300 billable pageviews"- assert html_body =~ "/billing/choose-plan\">Click here to upgrade your subscription</a>"+ assert text_of_element(html_body, ~s|a[href$="/billing/choose-plan"]|) ==+ "Click here to upgrade your subscription"++ assert text_of_element(html_body, ~s|a[href$="/settings/billing/subscription"]|) ==+ "account settings"assert html_body =~PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)-- assert html_body =~ "/settings/billing/subscription\">account settings</a>"endtest "asks enterprise level usage to contact us" dodiff --git a/test/workers/traffic_change_notifier_test.exs b/test/workers/traffic_change_notifier_test.exsindex fc78cad946..e460297eb5 100644--- a/test/workers/traffic_change_notifier_test.exs+++ b/test/workers/traffic_change_notifier_test.exs@@ -239,7 +239,7 @@ defmodule Plausible.Workers.TrafficChangeNotifierTest doTrafficChangeNotifier.perform(nil, clickhouse_stub)- assert_email_delivered_with(html_body: ~r/View dashboard: <a href=\"http.+\/example.com/)+ assert_email_delivered_with(html_body: ~r/View dashboard:\s+<a href=\"http.+\/example.com/)endendend