Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Upgrade deps, add storybook (#4947)

Uku Taht6c30f62d5d5f
diff --git a/.formatter.exs b/.formatter.exs
index 0afac0f5fe..6f8425f230 100644
--- a/.formatter.exs
+++ b/.formatter.exs
@@ -2,5 +2,10 @@
plugins: [Phoenix.LiveView.HTMLFormatter],
import_deps: [:ecto, :ecto_sql, :phoenix],
subdirectories: ["priv/*/migrations"],
- inputs: ["*.{heex,ex,exs}", "{config,lib,test,extra}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
+ inputs: [
+ "*.{heex,ex,exs}",
+ "{config,lib,test,extra}/**/*.{heex,ex,exs}",
+ "priv/*/seeds.exs",
+ "storybook/**/*.exs"
+ ]
]
diff --git a/Dockerfile b/Dockerfile
index 34d594ca93..3e62878f8c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -41,6 +41,7 @@ COPY tracker ./tracker
COPY priv ./priv
COPY lib ./lib
COPY extra ./extra
+COPY storybook ./storybook
RUN npm run deploy --prefix ./tracker && \
mix assets.deploy && \
diff --git a/assets/.eslintrc.json b/assets/.eslintrc.json
index 7261a4b6a8..bea69f9255 100644
--- a/assets/.eslintrc.json
+++ b/assets/.eslintrc.json
@@ -50,6 +50,9 @@
"import/resolver": {
"typescript": {
"alwaysTryTypes": true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
+ },
+ "node": {
+ "moduleDirectory": ["node_modules", "../deps"]
}
},
"react": {
diff --git a/assets/css/storybook.css b/assets/css/storybook.css
new file mode 100644
index 0000000000..e245aca2aa
--- /dev/null
+++ b/assets/css/storybook.css
@@ -0,0 +1,14 @@
+@import "tailwindcss/base";
+@import "tailwindcss/components";
+@import "tailwindcss/utilities";
+
+/*
+ * Put your component styling within the Tailwind utilities layer.
+ * See the https://hexdocs.pm/phoenix_storybook/sandboxing.html guide for more info.
+ */
+
+@layer utilities {
+ * {
+ font-family: system-ui;
+ }
+}
diff --git a/assets/js/liveview/live_socket.js b/assets/js/liveview/live_socket.js
index b2d84dae51..87db6f7315 100644
--- a/assets/js/liveview/live_socket.js
+++ b/assets/js/liveview/live_socket.js
@@ -1,7 +1,11 @@
+// eslint-disable-next-line import/no-unresolved
import "phoenix_html"
-import Alpine from 'alpinejs'
+// eslint-disable-next-line import/no-unresolved
import { Socket } from "phoenix"
+// eslint-disable-next-line import/no-unresolved
import { LiveSocket } from "phoenix_live_view"
+// eslint-disable-next-line import/no-unresolved
+import Alpine from 'alpinejs'
let csrfToken = document.querySelector("meta[name='csrf-token']")
let websocketUrl = document.querySelector("meta[name='websocket-url']")
diff --git a/assets/js/storybook.js b/assets/js/storybook.js
new file mode 100644
index 0000000000..8838db5770
--- /dev/null
+++ b/assets/js/storybook.js
@@ -0,0 +1,39 @@
+import Alpine from 'alpinejs'
+import dropdown from "./liveview/dropdown"
+
+// If your components require any hooks or custom uploaders, or if your pages
+// require connect parameters, uncomment the following lines and declare them as
+// such:
+//
+// import * as Hooks from "./hooks";
+// import * as Params from "./params";
+// import * as Uploaders from "./uploaders";
+
+// (function () {
+// window.storybook = { Hooks, Params, Uploaders };
+// })();
+
+
+window.Alpine = Alpine
+document.addEventListener('DOMContentLoaded', () => {
+ window.Alpine.start();
+});
+
+document.addEventListener('alpine:init', () => {
+ window.Alpine.data('dropdown', dropdown)
+});
+
+
+ (function () {
+ window.storybook = {
+ LiveSocketOptions: {
+ dom: {
+ onBeforeElUpdated(from, to) {
+ if (from._x_dataStack) {
+ window.Alpine.clone(from, to)
+ }
+ }
+ }
+ }
+ };
+ })();
diff --git a/assets/package-lock.json b/assets/package-lock.json
index 6aa0601961..1fe7a6dc22 100644
--- a/assets/package-lock.json
+++ b/assets/package-lock.json
@@ -26,9 +26,6 @@
"d3": "^7.9.0",
"dayjs": "^1.11.7",
"iframe-resizer": "^4.3.2",
- "phoenix": "^1.7.2",
- "phoenix_html": "^3.3.1",
- "phoenix_live_view": "^0.18.18",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-flatpickr": "3.10.5",
@@ -9308,17 +9305,6 @@
"node": ">=8"
}
},
- "node_modules/phoenix": {
- "version": "1.7.2",
- "license": "MIT"
- },
- "node_modules/phoenix_html": {
- "version": "3.3.1"
- },
- "node_modules/phoenix_live_view": {
- "version": "0.18.18",
- "license": "MIT"
- },
"node_modules/picocolors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
diff --git a/assets/package.json b/assets/package.json
index 09ca12902b..426f11441f 100644
--- a/assets/package.json
+++ b/assets/package.json
@@ -30,9 +30,6 @@
"d3": "^7.9.0",
"dayjs": "^1.11.7",
"iframe-resizer": "^4.3.2",
- "phoenix": "^1.7.2",
- "phoenix_html": "^3.3.1",
- "phoenix_live_view": "^0.18.18",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-flatpickr": "3.10.5",
diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js
index e1a029ef9b..1034d05212 100644
--- a/assets/tailwind.config.js
+++ b/assets/tailwind.config.js
@@ -14,6 +14,7 @@ module.exports = {
"max-w-screen-xl"
],
darkMode: 'class',
+ important: '.plausible',
theme: {
container: {
center: true,
@@ -51,7 +52,6 @@ module.exports = {
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/aspect-ratio'),
- plugin(({ addVariant }) => addVariant("phx-no-feedback", [".phx-no-feedback&", ".phx-no-feedback &"])),
plugin(({ addVariant }) => addVariant("phx-click-loading", [".phx-click-loading&", ".phx-click-loading &"])),
plugin(({ addVariant }) => addVariant("phx-submit-loading", [".phx-submit-loading&", ".phx-submit-loading &"])),
plugin(({ addVariant }) => addVariant("phx-change-loading", [".phx-change-loading&", ".phx-change-loading &"])),
diff --git a/config/config.exs b/config/config.exs
index ce130a022b..a4a17ba942 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -20,7 +20,7 @@ config :esbuild,
version: "0.17.11",
default: [
args:
- ~w(js/app.js js/dashboard.tsx js/embed.host.js js/embed.content.js --bundle --target=es2017 --loader:.js=jsx --outdir=../priv/static/js --define:BUILD_EXTRA=true),
+ ~w(js/app.js js/storybook.js js/dashboard.tsx js/embed.host.js js/embed.content.js --bundle --target=es2017 --loader:.js=jsx --outdir=../priv/static/js --define:BUILD_EXTRA=true),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]
@@ -34,6 +34,14 @@ config :tailwind,
--output=../priv/static/css/app.css
),
cd: Path.expand("../assets", __DIR__)
+ ],
+ storybook: [
+ args: ~w(
+ --config=tailwind.config.js
+ --input=css/storybook.css
+ --output=../priv/static/css/storybook.css
+ ),
+ cd: Path.expand("../assets", __DIR__)
]
config :ua_inspector,
diff --git a/config/dev.exs b/config/dev.exs
index ecfa88de89..ca0dbec390 100644
--- a/config/dev.exs
+++ b/config/dev.exs
@@ -8,6 +8,7 @@ config :plausible, PlausibleWeb.Endpoint,
watchers: [
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]},
+ storybook_tailwind: {Tailwind, :install_and_run, [:storybook, ~w(--watch)]},
npm: ["--prefix", "assets", "run", "typecheck", "--", "--watch", "--preserveWatchOutput"],
npm: [
"run",
@@ -21,7 +22,8 @@ config :plausible, PlausibleWeb.Endpoint,
],
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
- ~r"lib/plausible_web/(controllers|live|components|templates|views|plugs)/.*(ex|heex)$"
+ ~r"lib/plausible_web/(controllers|live|components|templates|views|plugs)/.*(ex|heex)$",
+ ~r"storybook/.*(exs)$"
]
]
diff --git a/config/runtime.exs b/config/runtime.exs
index 93884f0573..17d0f8f0af 100644
--- a/config/runtime.exs
+++ b/config/runtime.exs
@@ -969,3 +969,5 @@ unless s3_disabled? do
exports_bucket: s3_env_value.("S3_EXPORTS_BUCKET"),
imports_bucket: s3_env_value.("S3_IMPORTS_BUCKET")
end
+
+config :phoenix_storybook, enabled: env !== "prod"
diff --git a/extra/lib/plausible_web/live/funnel_settings.ex b/extra/lib/plausible_web/live/funnel_settings.ex
index dffe088663..f45b905fd7 100644
--- a/extra/lib/plausible_web/live/funnel_settings.ex
+++ b/extra/lib/plausible_web/live/funnel_settings.ex
@@ -48,7 +48,7 @@ defmodule PlausibleWeb.Live.FunnelSettings do
<.flash_messages flash={@flash} />
<%= if @setup_funnel? do %>
- <%= live_render(
+ {live_render(
@socket,
PlausibleWeb.Live.FunnelSettings.Form,
id: "funnels-form",
@@ -56,7 +56,7 @@ defmodule PlausibleWeb.Live.FunnelSettings do
"domain" => @domain,
"funnel_id" => @funnel_id
}
- ) %>
+ )}
<% end %>
<div :if={@goal_count >= Funnel.min_steps()}>
<.live_component
diff --git a/extra/lib/plausible_web/live/funnel_settings/form.ex b/extra/lib/plausible_web/live/funnel_settings/form.ex
index 1fcd46f1fe..e7d5b0867a 100644
--- a/extra/lib/plausible_web/live/funnel_settings/form.ex
+++ b/extra/lib/plausible_web/live/funnel_settings/form.ex
@@ -64,7 +64,7 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do
class="bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"
>
<.title class="mb-6">
- <%= if @funnel, do: "Edit", else: "Add" %> Funnel
+ {if @funnel, do: "Edit", else: "Add"} Funnel
</.title>
<.input
@@ -136,7 +136,7 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do
length(@step_ids) > map_size(@selections_made)
}
>
- <span><%= if @funnel, do: "Update", else: "Add" %> Funnel</span>
+ <span>{if @funnel, do: "Update", else: "Add"} Funnel</span>
</.button>
</div>
</.form>
diff --git a/extra/lib/plausible_web/live/funnel_settings/list.ex b/extra/lib/plausible_web/live/funnel_settings/list.ex
index ee76732bc8..18958dc16f 100644
--- a/extra/lib/plausible_web/live/funnel_settings/list.ex
+++ b/extra/lib/plausible_web/live/funnel_settings/list.ex
@@ -22,11 +22,11 @@ defmodule PlausibleWeb.Live.FunnelSettings.List do
<.table rows={@funnels}>
<:tbody :let={funnel}>
<.td truncate>
- <span class="font-medium"><%= funnel.name %></span>
+ <span class="font-medium">{funnel.name}</span>
</.td>
<.td hide_on_mobile>
<span class="text-gray-500 dark:text-gray-400">
- <%= funnel.steps_count %>-step funnel
+ {funnel.steps_count}-step funnel
</span>
</.td>
<.td actions>
diff --git a/extra/lib/plausible_web/views/help_scout_view.ex b/extra/lib/plausible_web/views/help_scout_view.ex
index 8a3b8c1bc2..5c5674b53b 100644
--- a/extra/lib/plausible_web/views/help_scout_view.ex
+++ b/extra/lib/plausible_web/views/help_scout_view.ex
@@ -17,7 +17,7 @@ defmodule PlausibleWeb.HelpScoutView do
<%= if @conn.assigns[:error] do %>
<p>
- Failed to get details: <%= @error %>
+ Failed to get details: {@error}
</p>
<% else %>
<div class="status">
@@ -25,7 +25,7 @@ defmodule PlausibleWeb.HelpScoutView do
Status
</p>
<p class="value">
- <a href={@status_link} target="_blank"><%= @status_label %></a>
+ <a href={@status_link} target="_blank">{@status_label}</a>
</p>
</div>
@@ -34,13 +34,13 @@ defmodule PlausibleWeb.HelpScoutView do
Plan
</p>
<p class="value">
- <a href={@plan_link} target="_blank"><%= @plan_label %></a>
+ <a href={@plan_link} target="_blank">{@plan_label}</a>
</p>
</div>
<div class="sites">
<p class="label">
- Owner of <b><a href={@sites_link} target="_blank"><%= @sites_count %> sites</a></b>
+ Owner of <b><a href={@sites_link} target="_blank">{@sites_count} sites</a></b>
</p>
<p class="value"></p>
</div>
@@ -51,7 +51,7 @@ defmodule PlausibleWeb.HelpScoutView do
</p>
<div class="value">
- <%= Phoenix.HTML.Format.text_to_html(@notes, escape: true) %>
+ {PhoenixHTMLHelpers.Format.text_to_html(@notes, escape: true)}
</div>
</div>
<% end %>
@@ -64,7 +64,7 @@ defmodule PlausibleWeb.HelpScoutView do
<.layout>
<%= if @conn.assigns[:error] do %>
<p>
- Failed to run search: <%= @error %>
+ Failed to run search: {@error}
</p>
<% else %>
<div class="search">
@@ -82,7 +82,7 @@ defmodule PlausibleWeb.HelpScoutView do
onclick={"loadContent('/helpscout/show?#{URI.encode_query(email: user.email, conversation_id: @conversation_id, customer_id: @customer_id)}')"}
href="#"
>
- <%= user.email %> (<%= user.sites_count %> sites)
+ {user.email} ({user.sites_count} sites)
</a>
</li>
</ul>
@@ -160,7 +160,7 @@ defmodule PlausibleWeb.HelpScoutView do
<body>
<div id="content">
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
<script type="text/javascript">
diff --git a/lib/plausible/billing/ecto/feature.ex b/lib/plausible/billing/ecto/feature.ex
index a1356f2e7c..f9464cc617 100644
--- a/lib/plausible/billing/ecto/feature.ex
+++ b/lib/plausible/billing/ecto/feature.ex
@@ -33,7 +33,7 @@ end
defmodule Plausible.Billing.Ecto.FeatureList do
@moduledoc """
- Ecto type representing a list of features. This is a proxy for
+ Ecto type representing a list of features. This is a proxy for
`{:array, Plausible.Billing.Ecto.Feature}` and is required for Kaffy to
render the HTML input correctly.
"""
@@ -52,15 +52,8 @@ defmodule Plausible.Billing.Ecto.FeatureList do
for mod <- Plausible.Billing.Feature.list(), not mod.free?() do
[
{:safe, ~s(<label style="padding-right: 15px;">)},
- Phoenix.HTML.Tag.tag(
- :input,
- name: Phoenix.HTML.Form.input_name(form, field) <> "[]",
- id: Phoenix.HTML.Form.input_id(form, field, mod.name()),
- type: "checkbox",
- value: mod.name(),
- style: "margin-right: 3px;",
- checked: mod in features
- ),
+ {:safe,
+ ~s(<input type="checkbox" name="#{form.name}[#{field}][]" "#{form.name}_#{field}_#{mod.name()}" value="#{mod.name()}" style="margin-right: 3px;" #{if mod in features, do: "checked", else: ""}>)},
mod.display_name(),
{:safe, ~s(</label>)}
]
@@ -68,7 +61,7 @@ defmodule Plausible.Billing.Ecto.FeatureList do
[
{:safe, ~s(<div class="form-group">)},
- Phoenix.HTML.Form.label(form, field),
+ {:safe, ~s(<label for="#{form.name}_#{field}">#{Phoenix.Naming.humanize(field)}</label>)},
{:safe, ~s(<div class="form-control">)},
checkboxes,
{:safe, ~s(</div>)},
diff --git a/lib/plausible/billing/ecto/limit.ex b/lib/plausible/billing/ecto/limit.ex
index 8dfdbd5a44..21c5bedce4 100644
--- a/lib/plausible/billing/ecto/limit.ex
+++ b/lib/plausible/billing/ecto/limit.ex
@@ -25,14 +25,9 @@ defmodule Plausible.Billing.Ecto.Limit do
[
{:safe, ~s(<div class="form-group">)},
- Phoenix.HTML.Form.label(form, field),
- Phoenix.HTML.Form.number_input(form, field,
- class: "form-control",
- name: "#{form.name}[#{field}]",
- id: "#{form.name}_#{field}",
- value: value,
- min: -1
- ),
+ {:safe, ~s(<label for="#{form.name}_#{field}">#{Phoenix.Naming.humanize(field)}</label>)},
+ {:safe,
+ ~s(<input id="#{form.name}_#{field}" name="#{form.name}[#{field}]" class="form-control" value="#{value}" min="-1" type="number" />)},
{:safe, ~s(<p class="help_text">Use -1 for unlimited.</p>)},
{:safe, ~s(</div>)}
]
diff --git a/lib/plausible_web.ex b/lib/plausible_web.ex
index d7650aac30..a4da51cc9e 100644
--- a/lib/plausible_web.ex
+++ b/lib/plausible_web.ex
@@ -60,7 +60,6 @@ defmodule PlausibleWeb do
use Phoenix.Component
- import PlausibleWeb.ErrorHelpers
import PlausibleWeb.Components.Generic
import PlausibleWeb.Live.Components.Form
alias PlausibleWeb.Router.Helpers, as: Routes
diff --git a/lib/plausible_web/components/billing/billing.ex b/lib/plausible_web/components/billing/billing.ex
index 5e3d6c7eb4..80abd6408b 100644
--- a/lib/plausible_web/components/billing/billing.ex
+++ b/lib/plausible_web/components/billing/billing.ex
@@ -114,12 +114,12 @@ defmodule PlausibleWeb.Components.Billing do
class="text-sm dark:text-gray-100"
x-bind:class={"tab === '#{@tab}' ? 'text-indigo-600 dark:text-indigo-500 font-semibold' : 'font-medium'"}
>
- <%= @name %>
+ {@name}
</span>
<span class="flex text-xs text-gray-500 dark:text-gray-400">
- <%= if @disabled,
+ {if @disabled,
do: "Not available",
- else: PlausibleWeb.TextHelpers.format_date_range(@date_range) %>
+ else: PlausibleWeb.TextHelpers.format_date_range(@date_range)}
</span>
</div>
</button>
@@ -152,7 +152,7 @@ defmodule PlausibleWeb.Components.Billing do
~H"""
<table class="min-w-full text-gray-900 dark:text-gray-100" {@rest}>
<tbody class="divide-y divide-gray-200 dark:divide-gray-600">
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</tbody>
</table>
"""
@@ -168,11 +168,11 @@ defmodule PlausibleWeb.Components.Billing do
~H"""
<tr {@rest}>
<td class={["text-sm py-4 pr-1 sm:whitespace-nowrap text-left", @pad && "pl-6"]}>
- <%= @title %>
+ {@title}
</td>
<td class="text-sm py-4 sm:whitespace-nowrap text-right">
- <%= Cldr.Number.to_string!(@usage) %>
- <%= if is_number(@limit), do: "/ #{Cldr.Number.to_string!(@limit)}" %>
+ {Cldr.Number.to_string!(@usage)}
+ {if is_number(@limit), do: "/ #{Cldr.Number.to_string!(@limit)}"}
</td>
</tr>
"""
@@ -186,7 +186,7 @@ defmodule PlausibleWeb.Components.Billing do
>
<h4 class="font-black dark:text-gray-100">Monthly quota</h4>
<div class="py-2 text-xl font-medium dark:text-gray-100">
- <%= PlausibleWeb.AuthView.subscription_quota(@subscription, format: :long) %>
+ {PlausibleWeb.AuthView.subscription_quota(@subscription, format: :long)}
</div>
<.styled_link
:if={
@@ -196,7 +196,7 @@ defmodule PlausibleWeb.Components.Billing do
id="#upgrade-or-change-plan-link"
href={Routes.billing_path(PlausibleWeb.Endpoint, :choose_plan)}
>
- <%= change_plan_or_upgrade_text(@subscription) %>
+ {change_plan_or_upgrade_text(@subscription)}
</.styled_link>
</div>
"""
@@ -206,13 +206,13 @@ defmodule PlausibleWeb.Components.Billing do
~H"""
<ul class="w-full py-4">
<li>
- Up to <b><%= present_limit(@plan, :monthly_pageview_limit) %></b> monthly pageviews
+ Up to <b>{present_limit(@plan, :monthly_pageview_limit)}</b> monthly pageviews
</li>
<li>
- Up to <b><%= present_limit(@plan, :site_limit) %></b> sites
+ Up to <b>{present_limit(@plan, :site_limit)}</b> sites
</li>
<li>
- Up to <b><%= present_limit(@plan, :hourly_api_request_limit) %></b> hourly api requests
+ Up to <b>{present_limit(@plan, :hourly_api_request_limit)}</b> hourly api requests
</li>
</ul>
"""
@@ -258,7 +258,7 @@ defmodule PlausibleWeb.Components.Billing do
@checkout_disabled && "pointer-events-none bg-gray-400 dark:bg-gray-600"
]}
>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</button>
"""
end
diff --git a/lib/plausible_web/components/billing/notice.ex b/lib/plausible_web/components/billing/notice.ex
index 34909cfe54..dcfcdb9c8e 100644
--- a/lib/plausible_web/components/billing/notice.ex
+++ b/lib/plausible_web/components/billing/notice.ex
@@ -76,7 +76,7 @@ defmodule PlausibleWeb.Components.Billing.Notice do
title="Notice"
{@rest}
>
- <%= account_label(@current_user, @billable_user) %> does not have access to <%= @feature_mod.display_name() %>. To get access to this feature,
+ {account_label(@current_user, @billable_user)} does not have access to {@feature_mod.display_name()}. To get access to this feature,
<.upgrade_call_to_action
current_team={@current_team}
current_user={@current_user}
@@ -96,7 +96,7 @@ defmodule PlausibleWeb.Components.Billing.Notice do
def limit_exceeded(assigns) do
~H"""
<.notice {@rest} title="Notice">
- <%= account_label(@current_user, @billable_user) %> is limited to <%= @limit %> <%= @resource %>. To increase this limit,
+ {account_label(@current_user, @billable_user)} is limited to {@limit} {@resource}. To increase this limit,
<.upgrade_call_to_action
current_team={@current_team}
current_user={@current_user}
@@ -239,7 +239,7 @@ defmodule PlausibleWeb.Components.Billing.Notice do
~H"""
<aside class={@class}>
<.notice title="Pending ownership transfers" class="shadow-md dark:shadow-none mt-4">
- <%= @message %> To exclude pending sites from your usage, please go to
+ {@message} To exclude pending sites from your usage, please go to
<.link href="https://plausible.io/sites" class="whitespace-nowrap font-semibold">
plausible.io/sites
</.link>
diff --git a/lib/plausible_web/components/billing/pageview_slider.ex b/lib/plausible_web/components/billing/pageview_slider.ex
index 10ee1ba887..e71d8b8cf0 100644
--- a/lib/plausible_web/components/billing/pageview_slider.ex
+++ b/lib/plausible_web/components/billing/pageview_slider.ex
@@ -19,7 +19,7 @@ defmodule PlausibleWeb.Components.Billing.PageviewSlider do
<output class="lg:w-1/4 lg:order-1 font-medium text-lg text-gray-600 dark:text-gray-200">
<span :if={@volume != :enterprise}>Up to</span>
<strong id="slider-value" class="text-gray-900 dark:text-gray-100">
- <%= format_volume(@volume, @available_volumes) %>
+ {format_volume(@volume, @available_volumes)}
</strong>
monthly pageviews
</output>
@@ -39,7 +39,7 @@ defmodule PlausibleWeb.Components.Billing.PageviewSlider do
<form class="max-w-md lg:max-w-none w-full lg:w-1/2 lg:order-2">
<div class="flex items-baseline space-x-2">
<span class="text-xs font-medium text-gray-600 dark:text-gray-200">
- <%= List.first(@slider_labels) %>
+ {List.first(@slider_labels)}
</span>
<div class="flex-1 relative">
<input
@@ -64,7 +64,7 @@ defmodule PlausibleWeb.Components.Billing.PageviewSlider do
/>
</div>
<span class="text-xs font-medium text-gray-600 dark:text-gray-200">
- <%= List.last(@slider_labels) %>
+ {List.last(@slider_labels)}
</span>
</div>
</form>
diff --git a/lib/plausible_web/components/billing/plan_benefits.ex b/lib/plausible_web/components/billing/plan_benefits.ex
index 76610d8918..6c6f9edf44 100644
--- a/lib/plausible_web/components/billing/plan_benefits.ex
+++ b/lib/plausible_web/components/billing/plan_benefits.ex
@@ -28,7 +28,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBenefits do
<ul role="list" class={["mt-8 space-y-3 text-sm leading-6 xl:mt-10", @class]}>
<li :for={benefit <- @benefits} class="flex gap-x-3">
<Heroicons.check class="h-6 w-5 text-indigo-600 dark:text-green-600" />
- <%= if is_binary(benefit), do: benefit, else: benefit.(assigns) %>
+ {if is_binary(benefit), do: benefit, else: benefit.(assigns)}
</li>
</ul>
"""
diff --git a/lib/plausible_web/components/billing/plan_box.ex b/lib/plausible_web/components/billing/plan_box.ex
index 7d5b6aea4b..919428d43b 100644
--- a/lib/plausible_web/components/billing/plan_box.ex
+++ b/lib/plausible_web/components/billing/plan_box.ex
@@ -32,7 +32,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
!@highlight && "text-gray-900 dark:text-gray-100",
@highlight && "text-indigo-600 dark:text-indigo-300"
]}>
- <%= String.capitalize(to_string(@kind)) %>
+ {String.capitalize(to_string(@kind))}
</h3>
<.pill :if={@highlight} text={@highlight} />
</div>
@@ -98,7 +98,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
id="highlight-pill"
class="rounded-full bg-indigo-600/10 px-2.5 py-1 text-xs font-semibold leading-5 text-indigo-600 dark:text-indigo-300 dark:ring-1 dark:ring-indigo-300/50"
>
- <%= @text %>
+ {@text}
</p>
</div>
"""
@@ -142,7 +142,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
id={"#{@kind}-price-tag-amount"}
class="text-4xl font-bold tracking-tight text-gray-900 dark:text-gray-100"
>
- <%= @plan_to_render.monthly_cost |> Plausible.Billing.format_price() %>
+ {@plan_to_render.monthly_cost |> Plausible.Billing.format_price()}
</span>
<span
id={"#{@kind}-price-tag-interval"}
@@ -156,13 +156,13 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
defp price_tag(%{selected_interval: :yearly} = assigns) do
~H"""
<span class="text-2xl font-bold w-max tracking-tight line-through text-gray-500 dark:text-gray-600 mr-1">
- <%= @plan_to_render.monthly_cost |> Money.mult!(12) |> Plausible.Billing.format_price() %>
+ {@plan_to_render.monthly_cost |> Money.mult!(12) |> Plausible.Billing.format_price()}
</span>
<span
id={"#{@kind}-price-tag-amount"}
class="text-4xl font-bold tracking-tight text-gray-900 dark:text-gray-100"
>
- <%= @plan_to_render.yearly_cost |> Plausible.Billing.format_price() %>
+ {@plan_to_render.yearly_cost |> Plausible.Billing.format_price()}
</span>
<span id={"#{@kind}-price-tag-interval"} class="text-sm font-semibold leading-6 text-gray-600">
/year
@@ -234,13 +234,13 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
<% end %>
<.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 %>
+ {@disabled_message}
<Heroicons.information_circle class="hidden sm:block w-5 h-5 sm:ml-2" />
</div>
<:tooltip_content>
Your usage exceeds the following limit(s):<br /><br />
<p :for={limit <- @exceeded_plan_limits}>
- <%= Phoenix.Naming.humanize(limit) %><br />
+ {Phoenix.Naming.humanize(limit)}<br />
</p>
</:tooltip_content>
</.tooltip>
@@ -248,7 +248,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
:if={@disabled_message && @exceeded_plan_limits == []}
class="pt-2 text-sm w-full text-red-700 dark:text-red-500 text-center"
>
- <%= @disabled_message %>
+ {@disabled_message}
</div>
"""
end
@@ -337,7 +337,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
@checkout_disabled && "pointer-events-none bg-gray-400 dark:bg-gray-600"
]}
>
- <%= @change_plan_link_text %>
+ {@change_plan_link_text}
</button>
"""
end
diff --git a/lib/plausible_web/components/flow_progress.ex b/lib/plausible_web/components/flow_progress.ex
index 300677c99c..b3528511b9 100644
--- a/lib/plausible_web/components/flow_progress.ex
+++ b/lib/plausible_web/components/flow_progress.ex
@@ -34,25 +34,25 @@ defmodule PlausibleWeb.Components.FlowProgress do
:if={idx == @current_step_idx}
class="w-5 h-5 bg-indigo-600 text-white rounded-full flex items-center justify-center font-semibold"
>
- <%= idx + 1 %>
+ {idx + 1}
</div>
<div
:if={idx > @current_step_idx}
class="w-5 h-5 bg-gray-300 text-white dark:bg-gray-800 rounded-full flex items-center justify-center"
>
- <%= idx + 1 %>
+ {idx + 1}
</div>
<span :if={idx < @current_step_idx} class="ml-2 text-gray-500">
- <%= step %>
+ {step}
</span>
<span
:if={idx == @current_step_idx}
class="ml-2 font-semibold text-black dark:text-gray-300"
>
- <%= step %>
+ {step}
</span>
<span :if={idx > @current_step_idx} class="ml-2 text-gray-500">
- <%= step %>
+ {step}
</span>
</div>
<div :if={idx + 1 != length(@steps)} class="flex-1 h-px bg-gray-300 mx-4 dark:bg-gray-800 ">
diff --git a/lib/plausible_web/components/generic.ex b/lib/plausible_web/components/generic.ex
index 81fd13eee2..587d86c8b5 100644
--- a/lib/plausible_web/components/generic.ex
+++ b/lib/plausible_web/components/generic.ex
@@ -63,7 +63,7 @@ defmodule PlausibleWeb.Components.Generic do
]}
{@rest}
>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</button>
"""
end
@@ -84,7 +84,7 @@ defmodule PlausibleWeb.Components.Generic do
[]
else
[
- "data-csrf": Phoenix.HTML.Tag.csrf_token_value(assigns.href),
+ "data-csrf": Phoenix.Controller.get_csrf_token(),
"data-method": assigns.method,
"data-to": assigns.href
]
@@ -126,7 +126,7 @@ defmodule PlausibleWeb.Components.Generic do
{@extra}
{@rest}
>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</.link>
"""
end
@@ -178,11 +178,11 @@ defmodule PlausibleWeb.Components.Generic do
</div>
<div class={["w-full", @title && "ml-3"]}>
<h3 :if={@title} class={"font-medium #{@theme.title_text} mb-2"}>
- <%= @title %>
+ {@title}
</h3>
<div class={"#{@theme.body_text}"}>
<p>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</p>
</div>
</div>
@@ -216,7 +216,7 @@ defmodule PlausibleWeb.Components.Generic do
class={"text-indigo-600 hover:text-indigo-700 dark:text-indigo-500 dark:hover:text-indigo-600 " <> @class}
{@rest}
>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</.unstyled_link>
"""
end
@@ -241,10 +241,11 @@ defmodule PlausibleWeb.Components.Generic do
class="relative inline-block text-left"
>
<button x-ref="button" x-on:click="toggle()" type="button" class={List.first(@button).class}>
- <%= render_slot(List.first(@button)) %>
+ {render_slot(List.first(@button))}
</button>
<div
x-show="open"
+ x-cloak
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
@@ -258,7 +259,7 @@ defmodule PlausibleWeb.Components.Generic do
@menu_class
]}
>
- <%= render_slot(List.first(@menu)) %>
+ {render_slot(List.first(@menu))}
</div>
</div>
"""
@@ -293,7 +294,7 @@ defmodule PlausibleWeb.Components.Generic do
data-ui-state={@state}
{@rest}
>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</.unstyled_link>
"""
else
@@ -301,7 +302,7 @@ defmodule PlausibleWeb.Components.Generic do
~H"""
<div data-ui-state={@state} class={@class}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
"""
end
@@ -327,7 +328,7 @@ defmodule PlausibleWeb.Components.Generic do
[]
else
[
- "data-csrf": Phoenix.HTML.Tag.csrf_token_value(assigns.href),
+ "data-csrf": Phoenix.Controller.get_csrf_token(),
"data-method": assigns.method,
"data-to": assigns.href
]
@@ -350,13 +351,13 @@ defmodule PlausibleWeb.Components.Generic do
{@extra}
{@rest}
>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
<Heroicons.arrow_top_right_on_square class={["opacity-60", @icon_class]} />
</.link>
"""
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>
"""
end
end
@@ -388,7 +389,7 @@ defmodule PlausibleWeb.Components.Generic do
def settings_tiles(assigns) do
~H"""
<div class="text-gray-900 leading-5 dark:text-gray-100">
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
"""
end
@@ -406,12 +407,12 @@ defmodule PlausibleWeb.Components.Generic do
<div class="shadow bg-white dark:bg-gray-800 rounded-md mb-6">
<header class="relative py-4 px-6">
<.title>
- <%= render_slot(@title) %>
+ {render_slot(@title)}
<.docs_info :if={@docs} slug={@docs} />
</.title>
<div class="text-sm mt-px text-gray-500 dark:text-gray-400 leading-5">
- <%= render_slot(@subtitle) %>
+ {render_slot(@subtitle)}
</div>
<%= if @feature_mod do %>
<PlausibleWeb.Components.Site.Feature.toggle
@@ -424,7 +425,7 @@ defmodule PlausibleWeb.Components.Generic do
</header>
<div class="pb-4 px-6">
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
</div>
"""
@@ -455,7 +456,7 @@ defmodule PlausibleWeb.Components.Generic do
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
>
- <%= render_slot(List.first(@tooltip_content)) %>
+ {render_slot(List.first(@tooltip_content))}
</div>
<div
x-on:click="sticky = true; hovered = true"
@@ -463,7 +464,7 @@ defmodule PlausibleWeb.Components.Generic do
x-on:mouseover="hovered = true"
x-on:mouseout="hovered = false"
>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
</div>
"""
@@ -500,7 +501,7 @@ defmodule PlausibleWeb.Components.Generic do
~H"""
<ol class="list-disc space-y-1 ml-4 text-sm">
<li :for={item <- @item} class="marker:text-indigo-700 dark:marker:text-indigo-700">
- <%= render_slot(item) %>
+ {render_slot(item)}
</li>
</ol>
"""
@@ -520,20 +521,20 @@ defmodule PlausibleWeb.Components.Generic do
>
<div class="p-8">
<.title :if={@title != []}>
- <%= render_slot(@title) %>
+ {render_slot(@title)}
</.title>
<div></div>
<div :if={@subtitle != []} class="text-sm mt-4 leading-6">
- <%= render_slot(@subtitle) %>
+ {render_slot(@subtitle)}
</div>
<div :if={@title != []} class="mt-8">
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
<div :if={@title == []}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
</div>
<div
@@ -541,7 +542,7 @@ defmodule PlausibleWeb.Components.Generic do
class="flex flex-col dark:text-gray-200 border-t border-gray-300 dark:border-gray-700"
>
<div class="p-8">
- <%= render_slot(@footer) %>
+ {render_slot(@footer)}
</div>
</div>
</div>
@@ -561,14 +562,14 @@ defmodule PlausibleWeb.Components.Generic do
<table :if={not Enum.empty?(@rows)} class={@width} {@rest}>
<thead :if={@thead != []}>
<tr class="border-b border-gray-200 dark:border-gray-700">
- <%= render_slot(@thead) %>
+ {render_slot(@thead)}
</tr>
</thead>
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
<tr :for={item <- @rows} {if @row_attrs, do: @row_attrs.(item), else: %{}}>
- <%= render_slot(@tbody, item) %>
+ {render_slot(@tbody, item)}
</tr>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</tbody>
</table>
"""
@@ -605,10 +606,10 @@ defmodule PlausibleWeb.Components.Generic do
{@rest}
>
<div :if={@actions} class="flex gap-2">
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
<div :if={!@actions}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
</td>
"""
@@ -630,7 +631,7 @@ defmodule PlausibleWeb.Components.Generic do
~H"""
<th scope="col" class={[@hide_on_mobile && "hidden md:table-cell", @class]}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</th>
"""
end
@@ -667,7 +668,7 @@ defmodule PlausibleWeb.Components.Generic do
else: "text-gray-900 dark:text-gray-100"
)
]}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</span>
</div>
"""
@@ -743,7 +744,7 @@ defmodule PlausibleWeb.Components.Generic do
</form>
</div>
</div>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
"""
end
@@ -754,7 +755,7 @@ defmodule PlausibleWeb.Components.Generic do
def h2(assigns) do
~H"""
<h2 class={[@class || "font-semibold leading-6 text-gray-900 dark:text-gray-100"]}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</h2>
"""
end
@@ -765,7 +766,7 @@ defmodule PlausibleWeb.Components.Generic do
def title(assigns) do
~H"""
<.h2 class={["text-lg font-medium text-gray-900 dark:text-gray-100 leading-7", @class]}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</.h2>
"""
end
diff --git a/lib/plausible_web/components/site/feature.ex b/lib/plausible_web/components/site/feature.ex
index 92b69971ea..9d147941ca 100644
--- a/lib/plausible_web/components/site/feature.ex
+++ b/lib/plausible_web/components/site/feature.ex
@@ -26,12 +26,12 @@ defmodule PlausibleWeb.Components.Site.Feature do
class={@class}
>
<.toggle_submit set_to={@current_setting} disabled?={@disabled?}>
- Show <%= @feature_mod.display_name() %> in the Dashboard
+ Show {@feature_mod.display_name()} in the Dashboard
</.toggle_submit>
</.form>
<div :if={@current_setting}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</div>
</div>
"""
diff --git a/lib/plausible_web/components/two_factor.ex b/lib/plausible_web/components/two_factor.ex
index b0e3915843..bfb2c7dd2c 100644
--- a/lib/plausible_web/components/two_factor.ex
+++ b/lib/plausible_web/components/two_factor.ex
@@ -16,7 +16,7 @@ defmodule PlausibleWeb.Components.TwoFactor do
assigns = assign(assigns, :code, qr_code)
~H"""
- <%= Phoenix.HTML.raw(@code) %>
+ {Phoenix.HTML.raw(@code)}
"""
end
@@ -38,25 +38,29 @@ defmodule PlausibleWeb.Components.TwoFactor do
end
assigns = assign(assigns, :input_class, input_class)
+ assigns = assign(assigns, :field, assigns[:form][assigns[:field]])
~H"""
<div class={[@class, "flex items-center"]}>
- <%= Phoenix.HTML.Form.text_input(@form, @field,
- autocomplete: "off",
- class: @input_class,
- oninput:
+ <input
+ type="text"
+ name={@field.name}
+ value={@field.value}
+ autocomplete="off"
+ class={@input_class}
+ oninput={
if @show_button? do
"this.value=this.value.replace(/[^0-9]/g, ''); if (this.value.length >= 6) document.getElementById('#{@id}').focus()"
else
"this.value=this.value.replace(/[^0-9]/g, '');"
- end,
- onclick: "this.select();",
- oninvalid: @show_button? && "document.getElementById('#{@id}').disabled = false",
- maxlength: "6",
- placeholder: "••••••",
- value: "",
- required: "required"
- ) %>
+ end
+ }
+ onclick="this.select();"
+ oninvalid={@show_button? && "document.getElementById('#{@id}').disabled = false"}
+ maxlength="6"
+ placeholder="••••••"
+ required="required"
+ />
<.button
:if={@show_button?}
type="submit"
@@ -142,19 +146,19 @@ defmodule PlausibleWeb.Components.TwoFactor do
</div>
<div class="sm:flex sm:items-start">
<div class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-green-100 sm:mx-0 sm:h-10 sm:w-10">
- <%= render_slot(@icon) %>
+ {render_slot(@icon)}
</div>
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left text-gray-900 dark:text-gray-100">
<h3 class="text-lg leading-6 font-medium" id="modal-title">
- <%= @title %>
+ {@title}
</h3>
- <%= render_slot(@inner_block, f) %>
+ {render_slot(@inner_block, f)}
</div>
</div>
</div>
<div class="bg-gray-50 dark:bg-gray-850 px-4 py-3 sm:px-9 sm:flex sm:flex-row-reverse">
- <%= render_slot(@buttons) %>
+ {render_slot(@buttons)}
<.button
type="button"
x-on:click={"#{@state_param} = false"}
diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.ex
index f9b53de98f..c18ee85b5e 100644
--- a/lib/plausible_web/controllers/auth_controller.ex
+++ b/lib/plausible_web/controllers/auth_controller.ex
@@ -57,6 +57,7 @@ defmodule PlausibleWeb.AuthController do
flow = params["flow"] || PlausibleWeb.Flows.register()
render(conn, "activate.html",
+ error: nil,
has_email_code?: Plausible.Users.has_email_code?(user),
has_any_memberships?: Plausible.Teams.Users.has_sites?(user),
form_submit_url: "/activate?flow=#{flow}"
diff --git a/lib/plausible_web/live/choose_plan.ex b/lib/plausible_web/live/choose_plan.ex
index 8b2c189236..dde36eb2e9 100644
--- a/lib/plausible_web/live/choose_plan.ex
+++ b/lib/plausible_web/live/choose_plan.ex
@@ -3,7 +3,6 @@ defmodule PlausibleWeb.Live.ChoosePlan do
LiveView for upgrading to a plan, or changing an existing plan.
"""
use PlausibleWeb, :live_view
- use Phoenix.HTML
require Plausible.Billing.Subscription.Status
@@ -107,9 +106,9 @@ defmodule PlausibleWeb.Live.ChoosePlan do
<Notice.upgrade_ineligible :if={not Quota.eligible_for_upgrade?(@usage)} />
<div class="mx-auto max-w-4xl text-center">
<p class="text-4xl font-bold tracking-tight lg:text-5xl">
- <%= if @owned_plan,
+ {if @owned_plan,
do: "Change subscription plan",
- else: "Upgrade your account" %>
+ else: "Upgrade your account"}
</p>
</div>
<div class="mt-12 flex flex-col gap-8 lg:flex-row items-center lg:items-baseline">
diff --git a/lib/plausible_web/live/components/combo_box.ex b/lib/plausible_web/live/components/combo_box.ex
index de3c409be0..6b6695375d 100644
--- a/lib/plausible_web/live/components/combo_box.ex
+++ b/lib/plausible_web/live/components/combo_box.ex
@@ -253,9 +253,9 @@ defmodule PlausibleWeb.Live.Components.ComboBox do
class="block truncate py-2 px-3"
>
<%= if @creatable do %>
- Create "<%= @display_value %>"
+ Create "{@display_value}"
<% else %>
- <%= @display_value %>
+ {@display_value}
<% end %>
</a>
</li>
diff --git a/lib/plausible_web/live/components/form.ex b/lib/plausible_web/live/components/form.ex
index 7373bbde0c..e5fcf02bf3 100644
--- a/lib/plausible_web/live/components/form.ex
+++ b/lib/plausible_web/live/components/form.ex
@@ -18,7 +18,7 @@ defmodule PlausibleWeb.Live.Components.Form do
<.input name="my-input" errors={["oh no!"]} />
"""
- @default_input_class "text-sm dark:bg-gray-900 block pl-3.5 py-2.5 border-gray-300 dark:border-gray-500 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 rounded-md"
+ @default_input_class "text-sm text-gray-900 dark:text-white dark:bg-gray-900 block pl-3.5 py-2.5 border-gray-300 dark:border-gray-500 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 rounded-md"
attr(:id, :any, default: nil)
attr(:name, :any)
@@ -55,6 +55,8 @@ defmodule PlausibleWeb.Live.Components.Form do
slot(:inner_block)
def input(%{field: %Phoenix.HTML.FormField{} = field} = assigns) do
+ errors = if Phoenix.Component.used_input?(field), do: field.errors, else: []
+
assigns
|> assign(
field: nil,
@@ -63,7 +65,7 @@ defmodule PlausibleWeb.Live.Components.Form do
mt?: assigns.mt?,
width: assigns.width
)
- |> assign(:errors, Enum.map(field.errors, &translate_error(&1)))
+ |> assign(:errors, Enum.map(errors, &translate_error(&1)))
|> assign_new(:name, fn -> if assigns.multiple, do: field.name <> "[]", else: field.name end)
|> assign_new(:value, fn -> field.value end)
|> input()
@@ -71,27 +73,27 @@ defmodule PlausibleWeb.Live.Components.Form do
def input(%{type: "select"} = assigns) do
~H"""
- <div phx-feedback-for={@name} class={@mt? && "mt-2"}>
- <.label for={@id} class="mb-2"><%= @label %></.label>
+ <div 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 %>
+ {@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) %>
+ <option :if={@prompt} value="">{@prompt}</option>
+ {Phoenix.HTML.Form.options_for_select(@options, @value)}
</select>
- <.error :for={msg <- @errors}><%= msg %></.error>
+ <.error :for={msg <- @errors}>{msg}</.error>
</div>
"""
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"]}
- >
+ <div class={[
+ "flex flex-inline items-center sm:justify-start justify-center gap-x-2",
+ @mt? && "mt-2"
+ ]}>
<input
type="checkbox"
value={@value || "true"}
@@ -99,7 +101,7 @@ defmodule PlausibleWeb.Live.Components.Form do
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>
+ <.label for={@id}>{@label}</.label>
</div>
"""
end
@@ -116,12 +118,12 @@ defmodule PlausibleWeb.Live.Components.Form do
assigns = assign(assigns, :errors, errors)
~H"""
- <div phx-feedback-for={@name} class={@mt? && "mt-2"}>
+ <div class={@mt? && "mt-2"}>
<.label :if={@label != nil and @label != ""} for={@id} class="mb-2">
- <%= @label %>
+ {@label}
</.label>
<p :if={@help_text} class="text-gray-500 dark:text-gray-400 mb-2 text-sm">
- <%= @help_text %>
+ {@help_text}
</p>
<input
type={@type}
@@ -131,9 +133,9 @@ defmodule PlausibleWeb.Live.Components.Form do
class={[@class, @width, assigns[:rest][:disabled] && "text-gray-500 dark:text-gray-400"]}
{@rest}
/>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
<.error :for={msg <- @errors}>
- <%= msg %>
+ {msg}
</.error>
</div>
"""
@@ -153,7 +155,7 @@ defmodule PlausibleWeb.Live.Components.Form do
<div>
<div :if={@label}>
<.label for={@id} class="mb-2">
- <%= @label %>
+ {@label}
</.label>
</div>
<div class="relative">
@@ -218,10 +220,14 @@ defmodule PlausibleWeb.Live.Components.Form do
|> assign(:too_weak?, too_weak?)
|> assign(:field, %{field | errors: errors})
|> assign(:strength, strength)
+ |> assign(
+ :show_meter?,
+ Phoenix.Component.used_input?(field) && (too_weak? || strength.score > 0)
+ )
~H"""
<.input field={@field} type="password" autocomplete="new-password" label={@label} id={@id} {@rest}>
- <.strength_meter :if={@too_weak? or @strength.score > 0} {@strength} />
+ <.strength_meter :if={@show_meter?} {@strength} />
</.input>
"""
end
@@ -256,7 +262,7 @@ defmodule PlausibleWeb.Live.Components.Form do
assigns = assign(assigns, :class, final_class)
~H"""
- <p class={@class}>Min <%= @minimum %> characters</p>
+ <p class={@class}>Min {@minimum} characters</p>
"""
end
@@ -311,11 +317,11 @@ defmodule PlausibleWeb.Live.Components.Form do
>
</div>
</div>
- <p :if={@score <= 2} class="text-sm text-red-500 phx-no-feedback:hidden">
+ <p :if={@score <= 2} class="text-sm text-red-500">
Password is too weak
</p>
<p :if={@feedback} class="text-xs text-gray-500">
- <%= @feedback %>
+ {@feedback}
</p>
"""
end
@@ -330,7 +336,7 @@ defmodule PlausibleWeb.Live.Components.Form do
def label(assigns) do
~H"""
<label for={@for} class={["text-sm block font-medium dark:text-gray-100", @class]}>
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</label>
"""
end
@@ -342,8 +348,8 @@ defmodule PlausibleWeb.Live.Components.Form do
def error(assigns) do
~H"""
- <p class="flex gap-3 text-sm leading-6 text-red-500 phx-no-feedback:hidden">
- <%= render_slot(@inner_block) %>
+ <p class="flex gap-3 text-sm leading-6 text-red-500">
+ {render_slot(@inner_block)}
</p>
"""
end
diff --git a/lib/plausible_web/live/components/modal.ex b/lib/plausible_web/live/components/modal.ex
index 89af4b3432..27d7404365 100644
--- a/lib/plausible_web/live/components/modal.ex
+++ b/lib/plausible_web/live/components/modal.ex
@@ -260,7 +260,7 @@ defmodule PlausibleWeb.Live.Components.Modal do
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
x-on:click.outside="closeModal()"
>
- <%= render_slot(@inner_block, modal_unique_id(@modal_sequence_id)) %>
+ {render_slot(@inner_block, modal_unique_id(@modal_sequence_id))}
</Phoenix.Component.focus_wrap>
<div x-show="modalOpen" class="modal-loading hidden w-full self-center">
<div class="text-center">
diff --git a/lib/plausible_web/live/components/pagination.ex b/lib/plausible_web/live/components/pagination.ex
index 1ac65efe42..966b7b5411 100644
--- a/lib/plausible_web/live/components/pagination.ex
+++ b/lib/plausible_web/live/components/pagination.ex
@@ -12,7 +12,7 @@ defmodule PlausibleWeb.Live.Components.Pagination do
>
<div class="hidden sm:block">
<p class="text-sm text-gray-700 dark:text-gray-300">
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</p>
</div>
<div class="flex-1 flex justify-between sm:justify-end">
diff --git a/lib/plausible_web/live/components/verification.ex b/lib/plausible_web/live/components/verification.ex
index 4513aae550..ac796c6b8e 100644
--- a/lib/plausible_web/live/components/verification.ex
+++ b/lib/plausible_web/live/components/verification.ex
@@ -59,7 +59,7 @@ defmodule PlausibleWeb.Live.Components.Verification do
<span :if={not @finished?}>Verifying your installation</span>
<span :if={@finished? and not @success? and @interpretation}>
- <%= List.first(@interpretation.errors) %>
+ {List.first(@interpretation.errors)}
</span>
</.title>
<p :if={@finished? and @success?} id="progress" class="text-sm mt-4">
@@ -67,19 +67,19 @@ defmodule PlausibleWeb.Live.Components.Verification do
</p>
<p
:if={@finished? and @success? and @awaiting_first_pageview?}
- id="progress"
+ id="awaiting"
class="text-sm mt-4 animate-pulse"
>
Awaiting your first pageview
</p>
- <p :if={not @finished?} class="text-sm mt-4 animate-pulse" id="progress"><%= @message %></p>
+ <p :if={not @finished?} class="text-sm mt-4 animate-pulse" id="progress">{@message}</p>
<p
:if={@finished? and not @success? and @interpretation}
class="mt-4 text-sm text-ellipsis overflow-hidden"
id="recommendation"
>
- <span><%= List.first(@interpretation.recommendations).text %>.&nbsp;</span>
+ <span>{List.first(@interpretation.recommendations).text}.&nbsp;</span>
<.styled_link href={List.first(@interpretation.recommendations).url} new_tab={true}>
Learn more
</.styled_link>
@@ -145,7 +145,7 @@ defmodule PlausibleWeb.Live.Components.Verification do
<.focus_list>
<:item :for={{diag, value} <- Map.from_struct(@verification_state.diagnostics)}>
<span class="text-sm">
- <%= Phoenix.Naming.humanize(diag) %>: <span class="font-mono"><%= value %></span>
+ {Phoenix.Naming.humanize(diag)}: <span class="font-mono">{value}</span>
</span>
</:item>
</.focus_list>
diff --git a/lib/plausible_web/live/csv_export.ex b/lib/plausible_web/live/csv_export.ex
index bdf2b1c6e4..4be300fb90 100644
--- a/lib/plausible_web/live/csv_export.ex
+++ b/lib/plausible_web/live/csv_export.ex
@@ -173,7 +173,7 @@ defmodule PlausibleWeb.Live.CSVExport do
<:tbody :let={export}>
<.td>
<.styled_link href={@href}>
- <%= export.name %>
+ {export.name}
</.styled_link>
</.td>
<.td actions>
@@ -188,14 +188,14 @@ defmodule PlausibleWeb.Live.CSVExport do
<p :if={@export.expires_at} class="text-sm">
Note: this file will expire
<.hint message={@export.expires_at}>
- <%= Timex.Format.DateTime.Formatters.Relative.format!(@export.expires_at, "{relative}") %>.
+ {Timex.Format.DateTime.Formatters.Relative.format!(@export.expires_at, "{relative}")}.
</.hint>
</p>
<p :if={@storage == "local"} class="text-sm">
Located at
- <.hint message={@export.path}><%= format_path(@export.path) %></.hint>
- (<%= format_bytes(@export.size) %>)
+ <.hint message={@export.path}>{format_path(@export.path)}</.hint>
+ ({format_bytes(@export.size)})
</p>
"""
end
@@ -203,7 +203,7 @@ defmodule PlausibleWeb.Live.CSVExport do
defp hint(assigns) do
~H"""
<span title={@message} class="underline cursor-help underline-offset-2 decoration-dashed">
- <%= render_slot(@inner_block) %>
+ {render_slot(@inner_block)}
</span>
"""
end
diff --git a/lib/plausible_web/live/csv_import.ex b/lib/plausible_web/live/csv_import.ex
index d70625c499..8aac08b75d 100644
--- a/lib/plausible_web/live/csv_import.ex
+++ b/lib/plausible_web/live/csv_import.ex
@@ -87,7 +87,7 @@ defmodule PlausibleWeb.Live.CSVImport do
original={@original_date_range}
/>
<p :for={error <- upload_errors(@uploads.import)} class="text-red-400">
- <%= error_to_string(error) %>
+ {error_to_string(error)}
</p>
</form>
</div>
@@ -151,8 +151,8 @@ defmodule PlausibleWeb.Live.CSVImport do
defp dates(assigns) do
~H"""
<span class="whitespace-nowrap">
- <span class="font-medium"><%= @range.first %></span>
- to <span class="font-medium"><%= @range.last %></span>
+ <span class="font-medium">{@range.first}</span>
+ to <span class="font-medium">{@range.last}</span>
</span>
"""
end
@@ -182,15 +182,15 @@ defmodule PlausibleWeb.Live.CSVImport do
if(@status == :error, do: "text-red-600 dark:text-red-700")
]}>
<%= if @upload do %>
- <%= @upload.client_name %>
+ {@upload.client_name}
<% else %>
- <%= @table %>_YYYYMMDD_YYYYMMDD.csv
+ {@table}_YYYYMMDD_YYYYMMDD.csv
<% end %>
</span>
</div>
<p :for={error <- @errors} class="ml-6 text-sm text-red-600 dark:text-red-700">
- <%= error_to_string(error) %>
+ {error_to_string(error)}
</p>
</li>
"""
diff --git a/lib/plausible_web/live/flash.ex b/lib/plausible_web/live/flash.ex
index 2a9c5c8fae..d9c53a4271 100644
--- a/lib/plausible_web/live/flash.ex
+++ b/lib/plausible_web/live/flash.ex
@@ -55,10 +55,10 @@ defmodule PlausibleWeb.Live.Flash do
<.icon_success />
</:icon>
<:title>
- <%= Flash.get(@flash, :success_title) || "Success!" %>
+ {Flash.get(@flash, :success_title) || "Success!"}
</:title>
<:message>
- <%= Flash.get(@flash, :success) %>
+ {Flash.get(@flash, :success)}
</:message>
</.flash>
<.flash :if={Flash.get(@flash, :error)} key="error">
@@ -66,10 +66,10 @@ defmodule PlausibleWeb.Live.Flash do
<.icon_error />
</:icon>
<:title>
- <%= Flash.get(@flash, :error_title) || "Error!" %>
+ {Flash.get(@flash, :error_title) || "Error!"}
</:title>
<:message>
- <%= Flash.get(@flash, :error) %>
+ {Flash.get(@flash, :error)}
</:message>
</.flash>
<.flash
@@ -96,7 +96,7 @@ defmodule PlausibleWeb.Live.Flash do
end
slot(:icon, required: true)
- slot(:title, require: true)
+ slot(:title, required: true)
slot(:message, required: true)
attr(:key, :string, default: nil)
attr(:on_close, :any, default: "lv:clear-flash")
@@ -115,13 +115,13 @@ defmodule PlausibleWeb.Live.Flash do
<div class="rounded-lg ring-1 ring-black ring-opacity-5 overflow-hidden">
<div class="p-4">
<div class="flex items-start">
- <%= render_slot(@icon) %>
+ {render_slot(@icon)}
<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">
- <%= render_slot(@title) %>
+ {render_slot(@title)}
</p>
<p class="mt-1 text-sm leading-5 text-gray-500 dark:text-gray-200">
- <%= render_slot(@message) %>
+ {render_slot(@message)}
</p>
</div>
<div class="ml-4 flex-shrink-0 flex">
diff --git a/lib/plausible_web/live/goal_settings/form.ex b/lib/plausible_web/live/goal_settings/form.ex
index c2a9b49da4..669ceee695 100644
--- a/lib/plausible_web/live/goal_settings/form.ex
+++ b/lib/plausible_web/live/goal_settings/form.ex
@@ -56,8 +56,8 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
def render(assigns) do
~H"""
<div id={@id}>
- <%= if @goal, do: edit_form(assigns) %>
- <%= if is_nil(@goal), do: create_form(assigns) %>
+ {if @goal, do: edit_form(assigns)}
+ {if is_nil(@goal), do: create_form(assigns)}
</div>
"""
end
@@ -65,7 +65,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
def edit_form(assigns) do
~H"""
<.form :let={f} for={@form} phx-submit="save-goal" phx-target={@myself}>
- <.title>Edit Goal for <%= @domain %></.title>
+ <.title>Edit Goal for {@domain}</.title>
<.custom_event_fields
:if={@selected_tab == "custom_events"}
@@ -105,7 +105,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
>
<.spinner class="spinner block absolute right-9 top-8" x-show="tabSelectionInProgress" />
- <.title>Add Goal for <%= @domain %></.title>
+ <.title>Add Goal for {@domain}</.title>
<.tabs selected_tab={@selected_tab} myself={@myself} />
@@ -145,7 +145,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
phx-target={@myself}
>
<span :if={@event_name_options_count > 1}>
- Already sending custom events? We've found <%= @event_name_options_count %> custom events from the last 6 months that are not yet configured as goals. Click here to add them.
+ Already sending custom events? We've found {@event_name_options_count} custom events from the last 6 months that are not yet configured as goals. Click here to add them.
</span>
<span :if={@event_name_options_count == 1}>
Already sending custom events? We've found 1 custom event from the last 6 months that is not yet configured as a goal. Click here to add it.
@@ -182,7 +182,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
/>
<.error :for={msg <- Enum.map(@f[:page_path].errors, &translate_error/1)}>
- <%= msg %>
+ {msg}
</.error>
<.input
@@ -241,7 +241,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
/>
<.error :for={msg <- Enum.map(@f[:event_name].errors, &translate_error/1)}>
- <%= msg %>
+ {msg}
</.error>
</div>
diff --git a/lib/plausible_web/live/goal_settings/list.ex b/lib/plausible_web/live/goal_settings/list.ex
index 8ac27eca53..82e0df7ad9 100644
--- a/lib/plausible_web/live/goal_settings/list.ex
+++ b/lib/plausible_web/live/goal_settings/list.ex
@@ -36,7 +36,7 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
<div class="truncate block">
<%= if not @revenue_goals_enabled? && goal.currency do %>
<div class="truncate">
- <%= goal %>
+ {goal}
<br />
<span class="text-red-600">
Unlock Revenue Goals by upgrading to a business plan
@@ -44,7 +44,7 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
</div>
<% else %>
<.goal_description goal={goal} />
- <span><%= goal %></span>
+ <span>{goal}</span>
<% end %>
</div>
</div>
@@ -115,11 +115,11 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
def goal_description(assigns) do
~H"""
<span :if={@goal.page_path} class="block truncate text-gray-400 dark:text-gray-600">
- <%= pageview_description(@goal) %>
+ {pageview_description(@goal)}
</span>
<span :if={@goal.event_name} class="block truncate text-gray-400 dark:text-gray-600">
- <%= custom_event_description(@goal) %>
+ {custom_event_description(@goal)}
</span>
"""
end
diff --git a/lib/plausible_web/live/imports_exports_settings.ex b/lib/plausible_web/live/imports_exports_settings.ex
index bcfc4a63f6..328f483416 100644
--- a/lib/plausible_web/live/imports_exports_settings.ex
+++ b/lib/plausible_web/live/imports_exports_settings.ex
@@ -68,7 +68,7 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do
~H"""
<.notice :if={@import_warning} theme={:gray}>
- <%= @import_warning %>
+ {@import_warning}
</.notice>
<div class="mt-4 flex justify-end gap-x-4">
@@ -132,24 +132,22 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do
class="max-w-sm"
title={"#{Plausible.Imported.SiteImport.label(entry.site_import)} created at #{format_date(entry.site_import.inserted_at)}"}
>
- <%= Plausible.Imported.SiteImport.label(entry.site_import) %>
+ {Plausible.Imported.SiteImport.label(entry.site_import)}
</div>
</div>
</.td>
<.td hide_on_mobile>
- <%= format_date(entry.site_import.start_date) %> - <%= format_date(
- entry.site_import.end_date
- ) %>
+ {format_date(entry.site_import.start_date)} - {format_date(entry.site_import.end_date)}
</.td>
<.td>
<div class="text-right">
- <%= if entry.live_status == SiteImport.completed(),
+ {if entry.live_status == SiteImport.completed(),
do:
PlausibleWeb.StatsView.large_number_format(
pageview_count(entry.site_import, @pageview_counts)
- ) %>
+ )}
</div>
</.td>
<.td actions>
diff --git a/lib/plausible_web/live/installation.ex b/lib/plausible_web/live/installation.ex
index 64096ffe4a..4d6bd56be2 100644
--- a/lib/plausible_web/live/installation.ex
+++ b/lib/plausible_web/live/installation.ex
@@ -293,12 +293,12 @@ defmodule PlausibleWeb.Live.Installation do
class="block h-5 w-5 rounded dark:bg-gray-700 border-gray-300 text-indigo-600 focus:ring-indigo-600 mr-2"
/>
<label for={"check-#{@variant}"}>
- <%= @label %>
+ {@label}
</label>
<div class="ml-2 collapse md:visible">
<.tooltip sticky?={false}>
<:tooltip_content>
- <%= @tooltip %>
+ {@tooltip}
<br /><br />Click to learn more.
</:tooltip_content>
<a href={@learn_more} target="_blank" rel="noopener noreferrer">
diff --git a/lib/plausible_web/live/plugins/api/settings.ex b/lib/plausible_web/live/plugins/api/settings.ex
index a7963e8af9..b521f7ef9d 100644
--- a/lib/plausible_web/live/plugins/api/settings.ex
+++ b/lib/plausible_web/live/plugins/api/settings.ex
@@ -35,7 +35,7 @@ defmodule PlausibleWeb.Live.Plugins.API.Settings do
<.flash_messages flash={@flash} />
<%= if @add_token? do %>
- <%= live_render(
+ {live_render(
@socket,
PlausibleWeb.Live.Plugins.API.TokenForm,
id: "token-form",
@@ -44,7 +44,7 @@ defmodule PlausibleWeb.Live.Plugins.API.Settings do
"token_description" => @token_description,
"rendered_by" => self()
}
- ) %>
+ )}
<% end %>
<div>
@@ -64,14 +64,14 @@ defmodule PlausibleWeb.Live.Plugins.API.Settings do
<:tbody :let={token}>
<.td>
<span class="token-description">
- <%= token.description %>
+ {token.description}
</span>
</.td>
<.td hide_on_mobile>
- **********<%= token.hint %>
+ **********{token.hint}
</.td>
<.td hide_on_mobile>
- <%= Plausible.Plugins.API.Token.last_used_humanize(token) %>
+ {Plausible.Plugins.API.Token.last_used_humanize(token)}
</.td>
<.td actions>
<.delete_button
diff --git a/lib/plausible_web/live/plugins/api/token_form.ex b/lib/plausible_web/live/plugins/api/token_form.ex
index eb426b3cea..fd44530d30 100644
--- a/lib/plausible_web/live/plugins/api/token_form.ex
+++ b/lib/plausible_web/live/plugins/api/token_form.ex
@@ -58,7 +58,7 @@ defmodule PlausibleWeb.Live.Plugins.API.TokenForm do
phx-click-away="cancel-add-token"
>
<.title>
- Add Plugin Token for <%= @domain %>
+ Add Plugin Token for {@domain}
</.title>
<div class="mt-4">
diff --git a/lib/plausible_web/live/props_settings.ex b/lib/plausible_web/live/props_settings.ex
index b968754761..ae9b32d2bd 100644
--- a/lib/plausible_web/live/props_settings.ex
+++ b/lib/plausible_web/live/props_settings.ex
@@ -39,7 +39,7 @@ defmodule PlausibleWeb.Live.PropsSettings do
<section id="props-settings-main">
<.flash_messages flash={@flash} />
<%= if @add_prop? do %>
- <%= live_render(
+ {live_render(
@socket,
PlausibleWeb.Live.PropsSettings.Form,
id: "props-form",
@@ -48,7 +48,7 @@ defmodule PlausibleWeb.Live.PropsSettings do
"site_id" => @site_id,
"rendered_by" => self()
}
- ) %>
+ )}
<% end %>
<.live_component
diff --git a/lib/plausible_web/live/props_settings/form.ex b/lib/plausible_web/live/props_settings/form.ex
index 6a7d7b8243..2528b80622 100644
--- a/lib/plausible_web/live/props_settings/form.ex
+++ b/lib/plausible_web/live/props_settings/form.ex
@@ -53,7 +53,7 @@ defmodule PlausibleWeb.Live.PropsSettings.Form do
phx-submit="allow-prop"
phx-click-away="cancel-allow-prop"
>
- <.title>Add Property for <%= @domain %></.title>
+ <.title>Add Property for {@domain}</.title>
<div class="mt-6">
<.label for="prop_input">
@@ -89,9 +89,9 @@ defmodule PlausibleWeb.Live.PropsSettings.Form do
/>
<.error :for={{msg, opts} <- f[:allowed_event_props].errors}>
- <%= Enum.reduce(opts, msg, fn {key, value}, acc ->
+ {Enum.reduce(opts, msg, fn {key, value}, acc ->
String.replace(acc, "%{#{key}}", fn _ -> to_string(value) end)
- end) %>
+ end)}
</.error>
</div>
@@ -105,7 +105,7 @@ defmodule PlausibleWeb.Live.PropsSettings.Form do
class="mt-4 text-sm hover:underline text-indigo-600 dark:text-indigo-400 text-left"
phx-click="allow-existing-props"
>
- Already sending custom properties? Click to add <%= @prop_key_options_count %> existing properties we found.
+ Already sending custom properties? Click to add {@prop_key_options_count} existing properties we found.
</button>
</.form>
</div>
diff --git a/lib/plausible_web/live/props_settings/list.ex b/lib/plausible_web/live/props_settings/list.ex
index 5d3c4f71c5..58db509662 100644
--- a/lib/plausible_web/live/props_settings/list.ex
+++ b/lib/plausible_web/live/props_settings/list.ex
@@ -19,7 +19,7 @@ defmodule PlausibleWeb.Live.PropsSettings.List do
<%= if is_list(@props) && length(@props) > 0 do %>
<.table id="allowed-props" rows={Enum.with_index(@props)}>
<:tbody :let={{prop, index}}>
- <.td id={"prop-#{index}"}><span class="font-medium"><%= prop %></span></.td>
+ <.td id={"prop-#{index}"}><span class="font-medium">{prop}</span></.td>
<.td actions>
<.delete_button
id={"disallow-prop-#{prop}"}
diff --git a/lib/plausible_web/live/register_form.ex b/lib/plausible_web/live/register_form.ex
index 60a9ba0bdc..13c2c95657 100644
--- a/lib/plausible_web/live/register_form.ex
+++ b/lib/plausible_web/live/register_form.ex
@@ -42,7 +42,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
def render(%{invitation_expired: true} = assigns) do
~H"""
<div class="mx-auto mt-6 text-center dark:text-gray-300">
- <h1 class="text-3xl font-black"><%= Plausible.product_name() %></h1>
+ <h1 class="text-3xl font-black">{Plausible.product_name()}</h1>
<div class="text-xl font-medium">Lightweight and privacy-friendly web analytics</div>
</div>
@@ -63,7 +63,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
<div class="mx-auto text-center dark:text-gray-300">
<h1 class="text-3xl font-black">
<%= if ce?() or @live_action == :register_from_invitation_form do %>
- Register your <%= Plausible.product_name() %> account
+ Register your {Plausible.product_name()} account
<% else %>
Register your 30-day free trial
<% end %>
@@ -155,7 +155,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
</div>
<%= if @captcha_error do %>
<div class="text-red-500 text-xs italic mt-3" x-data x-init="hcaptcha.reset()">
- <%= @captcha_error %>
+ {@captcha_error}
</div>
<% end %>
<script
@@ -176,7 +176,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
"Start my free trial"
end %>
<.button id="register" disabled={@disable_submit} type="submit" class="mt-4 w-full">
- <%= submit_text %>
+ {submit_text}
</.button>
<p class="text-center text-gray-600 dark:text-gray-500 mt-4">
diff --git a/lib/plausible_web/live/shields/country_rules.ex b/lib/plausible_web/live/shields/country_rules.ex
index 54d4744c93..a74f37dc89 100644
--- a/lib/plausible_web/live/shields/country_rules.ex
+++ b/lib/plausible_web/live/shields/country_rules.ex
@@ -53,7 +53,7 @@ defmodule PlausibleWeb.Live.Shields.CountryRules do
theme={:gray}
>
<p>
- You've reached the maximum number of countries you can block (<%= Shields.maximum_country_rules() %>). Please remove one before adding another.
+ You've reached the maximum number of countries you can block ({Shields.maximum_country_rules()}). Please remove one before adding another.
</p>
</.notice>
@@ -76,7 +76,7 @@ defmodule PlausibleWeb.Live.Shields.CountryRules do
class="mr-4 cursor-help"
title={"Added at #{format_added_at(rule.inserted_at, @site.timezone)} by #{rule.added_by}"}
>
- <%= country.flag %> <%= country.name %>
+ {country.flag} {country.name}
</span>
</div>
</.td>
diff --git a/lib/plausible_web/live/shields/hostname_rules.ex b/lib/plausible_web/live/shields/hostname_rules.ex
index 42a1fd388c..e3c158de7f 100644
--- a/lib/plausible_web/live/shields/hostname_rules.ex
+++ b/lib/plausible_web/live/shields/hostname_rules.ex
@@ -9,8 +9,6 @@ defmodule PlausibleWeb.Live.Shields.HostnameRules do
alias Plausible.Shields
alias Plausible.Shield
- import PlausibleWeb.ErrorHelpers
-
def update(assigns, socket) do
socket =
socket
@@ -58,7 +56,7 @@ defmodule PlausibleWeb.Live.Shields.HostnameRules do
theme={:gray}
>
<p>
- You've reached the maximum number of hostnames you can block (<%= Shields.maximum_hostname_rules() %>). Please remove one before adding another.
+ You've reached the maximum number of hostnames you can block ({Shields.maximum_hostname_rules()}). Please remove one before adding another.
</p>
</.notice>
@@ -83,7 +81,7 @@ defmodule PlausibleWeb.Live.Shields.HostnameRules do
class="mr-4 cursor-help text-ellipsis truncate max-w-xs"
title={"Added at #{format_added_at(rule.inserted_at, @site.timezone)} by #{rule.added_by}"}
>
- <%= rule.hostname %>
+ {rule.hostname}
</span>
</div>
</.td>
@@ -136,12 +134,11 @@ defmodule PlausibleWeb.Live.Shields.HostnameRules do
id={"#{f[:hostname].id}-#{modal_unique_id}"}
creatable
/>
-
- <%= error_tag(f, :hostname) %>
+ <.error :for={msg <- f[:hostname].errors}>{translate_error(msg)}</.error>
<p class="mt-4 text-sm text-gray-500 dark:text-gray-400">
You can use a wildcard (<code>*</code>) to match multiple hostnames. For example,
- <code>*<%= @site.domain %></code>
+ <code>*{@site.domain}</code>
will only record traffic on your main domain and all of its subdomains.<br /><br />
<%= if @hostname_rules_count >= 1 do %>
diff --git a/lib/plausible_web/live/shields/ip_rules.ex b/lib/plausible_web/live/shields/ip_rules.ex
index b7c56cec63..3094f83a6e 100644
--- a/lib/plausible_web/live/shields/ip_rules.ex
+++ b/lib/plausible_web/live/shields/ip_rules.ex
@@ -51,7 +51,7 @@ defmodule PlausibleWeb.Live.Shields.IPRules do
theme={:gray}
>
<p>
- You've reached the maximum number of IP addresses you can block (<%= Shields.maximum_ip_rules() %>). Please remove one before adding another.
+ You've reached the maximum number of IP addresses you can block ({Shields.maximum_ip_rules()}). Please remove one before adding another.
</p>
</.notice>
@@ -83,7 +83,7 @@ defmodule PlausibleWeb.Live.Shields.IPRules do
class="cursor-help"
title={"Added at #{format_added_at(rule.inserted_at, @site.timezone)} by #{rule.added_by}"}
>
- <%= rule.inet %>
+ {rule.inet}
</span>
</div>
</.td>
@@ -97,7 +97,7 @@ defmodule PlausibleWeb.Live.Shields.IPRules do
</.td>
<.td hide_on_mobile truncate>
<span :if={rule.description} title={rule.description}>
- <%= rule.description %>
+ {rule.description}
</span>
<span :if={!rule.description} class="text-gray-400 dark:text-gray-600">
--
diff --git a/lib/plausible_web/live/shields/page_rules.ex b/lib/plausible_web/live/shields/page_rules.ex
index 6f851894ac..96e304820d 100644
--- a/lib/plausible_web/live/shields/page_rules.ex
+++ b/lib/plausible_web/live/shields/page_rules.ex
@@ -9,8 +9,6 @@ defmodule PlausibleWeb.Live.Shields.PageRules do
alias Plausible.Shields
alias Plausible.Shield
- import PlausibleWeb.ErrorHelpers
-
def update(assigns, socket) do
socket =
socket
@@ -58,7 +56,7 @@ defmodule PlausibleWeb.Live.Shields.PageRules do
theme={:gray}
>
<p>
- You've reached the maximum number of pages you can block (<%= Shields.maximum_page_rules() %>). Please remove one before adding another.
+ You've reached the maximum number of pages you can block ({Shields.maximum_page_rules()}). Please remove one before adding another.
</p>
</.notice>
@@ -79,7 +77,7 @@ defmodule PlausibleWeb.Live.Shields.PageRules do
class="mr-4 cursor-help text-ellipsis truncate max-w-xs"
title={"Added at #{format_added_at(rule.inserted_at, @site.timezone)} by #{rule.added_by}"}
>
- <%= rule.page_path %>
+ {rule.page_path}
</span>
</.td>
<.td hide_on_mobile>
@@ -132,7 +130,7 @@ defmodule PlausibleWeb.Live.Shields.PageRules do
creatable
/>
- <%= error_tag(f, :page_path) %>
+ <.error :for={msg <- f[:page_path].errors}>{translate_error(msg)}</.error>
<p class="mt-4 text-sm text-gray-500 dark:text-gray-400">
You can use a wildcard (<code>*</code>) to match multiple pages. For example,
diff --git a/lib/plausible_web/live/sites.ex b/lib/plausible_web/live/sites.ex
index 97159073f6..25c8d0d1b6 100644
--- a/lib/plausible_web/live/sites.ex
+++ b/lib/plausible_web/live/sites.ex
@@ -100,7 +100,7 @@ defmodule PlausibleWeb.Live.Sites do
page_number={@sites.page_number}
total_pages={@sites.total_pages}
>
- Total of <span class="font-medium"><%= @sites.total_entries %></span> sites
+ Total of <span class="font-medium">{@sites.total_entries}</span> sites
</.pagination>
<.invitation_modal :if={Enum.any?(@sites.entries, &(&1.entry_type == "invitation"))} />
</div>
@@ -166,7 +166,7 @@ defmodule PlausibleWeb.Live.Sites do
/>
<div class="flex-1 truncate -mt-px">
<h3 class="text-gray-900 font-medium text-lg truncate dark:text-gray-100">
- <%= @site.domain %>
+ {@site.domain}
</h3>
</div>
@@ -212,7 +212,7 @@ defmodule PlausibleWeb.Live.Sites do
class="text-gray-900 font-medium text-lg truncate dark:text-gray-100"
style="width: calc(100% - 4rem)"
>
- <%= @site.domain %>
+ {@site.domain}
</h3>
</div>
</div>
@@ -308,7 +308,7 @@ defmodule PlausibleWeb.Live.Sites do
<div class="flex justify-between items-center">
<p>
<span class="text-gray-800 dark:text-gray-200">
- <b><%= PlausibleWeb.StatsView.large_number_format(@hourly_stats.visitors) %></b>
+ <b>{PlausibleWeb.StatsView.large_number_format(@hourly_stats.visitors)}</b>
visitor<span :if={@hourly_stats.visitors != 1}>s</span> in last 24h
</span>
</p>
@@ -357,7 +357,7 @@ defmodule PlausibleWeb.Live.Sites do
</path>
</svg>
- <%= abs(@change) %>%
+ {abs(@change)}%
</p>
"""
end
diff --git a/lib/plausible_web/router.ex b/lib/plausible_web/router.ex
index cdd96a6f45..c1006ce232 100644
--- a/lib/plausible_web/router.ex
+++ b/lib/plausible_web/router.ex
@@ -2,6 +2,7 @@ defmodule PlausibleWeb.Router do
use PlausibleWeb, :router
use Plausible
import Phoenix.LiveView.Router
+ import PhoenixStorybook.Router
pipeline :browser do
plug :accepts, ["html"]
@@ -77,6 +78,15 @@ defmodule PlausibleWeb.Router do
forward "/sent-emails", Bamboo.SentEmailViewerPlug
end
+ scope "/" do
+ storybook_assets()
+ end
+
+ scope "/", PlausibleWeb do
+ pipe_through :browser
+ live_storybook("/storybook", backend_module: PlausibleWeb.Storybook)
+ end
+
on_ee do
use Kaffy.Routes,
scope: "/crm",
diff --git a/lib/plausible_web/storybook.ex b/lib/plausible_web/storybook.ex
new file mode 100644
index 0000000000..9846e9ea63
--- /dev/null
+++ b/lib/plausible_web/storybook.ex
@@ -0,0 +1,13 @@
+defmodule PlausibleWeb.Storybook do
+ @moduledoc false
+
+ use PhoenixStorybook,
+ otp_app: :plausible_web,
+ title: "Plausible Storybook",
+ content_path: Path.expand("../../storybook", __DIR__),
+ # assets path are remote path, not local file-system paths
+ css_path: "/css/storybook.css",
+ js_path: "/js/storybook.js",
+ sandbox_class: "plausible",
+ color_mode: true
+end
diff --git a/lib/plausible_web/templates/auth/activate.html.heex b/lib/plausible_web/templates/auth/activate.html.heex
index 7ab977865c..2cf24bca0b 100644
--- a/lib/plausible_web/templates/auth/activate.html.heex
+++ b/lib/plausible_web/templates/auth/activate.html.heex
@@ -18,13 +18,13 @@
<:subtitle :if={@has_email_code?}>
<p class="truncate">
- Please enter the 4-digit code we sent to <b><%= @conn.assigns[:current_user].email %></b>
+ Please enter the 4-digit code we sent to <b>{@conn.assigns[:current_user].email}</b>
</p>
</:subtitle>
<:subtitle :if={!@has_email_code?}>
<p class="truncate">
- A 4-digit activation code will be sent to <b><%= @conn.assigns[:current_user].email %></b>
+ A 4-digit activation code will be sent to <b>{@conn.assigns[:current_user].email}</b>
</p>
</:subtitle>
@@ -46,7 +46,7 @@
</.form>
</div>
- <%= error_tag(assigns, :error) %>
+ <.error>{@error}</.error>
<div :if={!@has_email_code?}>
<.button_link method="post" class="w-full" href="/activate/request-code">
@@ -65,7 +65,7 @@
<.styled_link href="/activate/request-code" method="post">
Send a new code
</.styled_link>
- to <%= @conn.assigns[:current_user].email %>
+ to {@conn.assigns[:current_user].email}
</:item>
<:item :if={ee?()}>
<.styled_link href="https://plausible.io/contact" new_tab={true}>
@@ -88,7 +88,7 @@
<.styled_link method="post" href={Routes.settings_path(@conn, :cancel_update_email)}>
Change email back to
</.styled_link>
- <%= @conn.assigns[:current_user].previous_email %>
+ {@conn.assigns[:current_user].previous_email}
</:item>
<:item :if={not @has_any_memberships?}>
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.heex
index f03af4d8ce..760bd967b9 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
@@ -16,7 +16,7 @@
class="font-mono border-2 border-dotted border-gray-200 dark:border-gray-700 rounded-md text-gray-600 dark:text-gray-200 text-lg bg-gray-100 dark:bg-gray-900 p-2 mt-6 flex flex-wrap"
>
<%= for code <- @recovery_codes do %>
- <div class="basis-1/2 text-center"><%= code %></div>
+ <div class="basis-1/2 text-center">{code}</div>
<% end %>
</div>
diff --git a/lib/plausible_web/templates/auth/login_form.html.heex b/lib/plausible_web/templates/auth/login_form.html.heex
index 7b30392117..d0d703f4d4 100644
--- a/lib/plausible_web/templates/auth/login_form.html.heex
+++ b/lib/plausible_web/templates/auth/login_form.html.heex
@@ -1,11 +1,11 @@
<.focus_box>
<:title>
- <%= Phoenix.Flash.get(@flash, :login_title) || "Enter your account credentials" %>
+ {Phoenix.Flash.get(@flash, :login_title) || "Enter your account credentials"}
</:title>
<:subtitle>
<%= if Phoenix.Flash.get(@flash, :login_instructions) do %>
<p class="text-gray-500 mt-1 mb-2">
- <%= Phoenix.Flash.get(@flash, :login_instructions) %>
+ {Phoenix.Flash.get(@flash, :login_instructions)}
</p>
<% end %>
</:subtitle>
@@ -30,7 +30,7 @@
</div>
<%= if @conn.assigns[:error] do %>
- <div class="text-red-500 mt-4"><%= @conn.assigns[:error] %></div>
+ <div class="text-red-500 mt-4">{@conn.assigns[:error]}</div>
<% end %>
<.button class="w-full" type="submit">Log in</.button>
diff --git a/lib/plausible_web/templates/auth/password_reset_form.html.heex b/lib/plausible_web/templates/auth/password_reset_form.html.heex
index 018aa78489..21b45a7634 100644
--- a/lib/plausible_web/templates/auth/password_reset_form.html.heex
+++ b/lib/plausible_web/templates/auth/password_reset_form.html.heex
@@ -1,4 +1,4 @@
-<%= live_render(@conn, PlausibleWeb.Live.ResetPasswordForm,
+{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.heex
index 6e9b65e7b0..b5c1076fe5 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
@@ -12,14 +12,14 @@
<.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>
+ <div class="text-red-500 my-2">{@conn.assigns[:error]}</div>
<% end %>
<%= if PlausibleWeb.Captcha.enabled?() do %>
<div class="mt-4">
<div class="h-captcha" data-sitekey={PlausibleWeb.Captcha.sitekey()}></div>
<%= if assigns[:captcha_error] do %>
- <div class="text-red-500 text-xs mt-3"><%= @captcha_error %></div>
+ <div class="text-red-500 text-xs mt-3">{@captcha_error}</div>
<% end %>
<script src="https://hcaptcha.com/1/api.js" async defer>
</script>
diff --git a/lib/plausible_web/templates/auth/password_reset_request_success.html.heex b/lib/plausible_web/templates/auth/password_reset_request_success.html.heex
index f345d761d5..bb6d81f3a8 100644
--- a/lib/plausible_web/templates/auth/password_reset_request_success.html.heex
+++ b/lib/plausible_web/templates/auth/password_reset_request_success.html.heex
@@ -1,7 +1,7 @@
<div class="bg-white dark:bg-gray-800 max-w-md w-full mx-auto shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8">
<h2 class="text-xl font-black dark:text-gray-100">Success!</h2>
<div class="my-4 leading-tight dark:text-gray-100">
- We've sent an email containing password reset instructions to <b><%= @email %></b>
+ We've sent an email containing password reset instructions to <b>{@email}</b>
if it's registered in our system.
</div>
<div class="mt-8 text-sm dark:text-gray-100">
diff --git a/lib/plausible_web/templates/billing/change_plan_preview.html.heex b/lib/plausible_web/templates/billing/change_plan_preview.html.heex
index 9febe88eb4..da955cef6e 100644
--- a/lib/plausible_web/templates/billing/change_plan_preview.html.heex
+++ b/lib/plausible_web/templates/billing/change_plan_preview.html.heex
@@ -25,12 +25,12 @@
<tbody class="bg-white dark:bg-gray-800">
<tr class="border-b border-gray-200">
<td class="px-6 py-4 text-sm leading-5 font-bold dark:text-gray-100">
- <%= present_currency(@preview_info["immediate_payment"]["currency"]) %><%= @preview_info[
+ {present_currency(@preview_info["immediate_payment"]["currency"])}{@preview_info[
"immediate_payment"
- ]["amount"] %>
+ ]["amount"]}
</td>
<td class="px-6 py-4 text-sm leading-5 dark:text-gray-100">
- <%= present_date(@preview_info["immediate_payment"]["date"]) %>
+ {present_date(@preview_info["immediate_payment"]["date"])}
</td>
</tr>
</tbody>
@@ -60,12 +60,12 @@
<tbody class="bg-white dark:bg-gray-800">
<tr class="border-b border-gray-200">
<td class="px-6 py-4 text-sm leading-5 font-bold dark:text-gray-100">
- <%= present_currency(@preview_info["immediate_payment"]["currency"]) %><%= @preview_info[
+ {present_currency(@preview_info["immediate_payment"]["currency"])}{@preview_info[
"next_payment"
- ]["amount"] %>
+ ]["amount"]}
</td>
<td class="px-6 py-4 text-sm leading-5 dark:text-gray-100">
- <%= present_date(@preview_info["next_payment"]["date"]) %>
+ {present_date(@preview_info["next_payment"]["date"])}
</td>
</tr>
</tbody>
diff --git a/lib/plausible_web/templates/billing/choose_plan.html.heex b/lib/plausible_web/templates/billing/choose_plan.html.heex
index b3042d7171..bac6137867 100644
--- a/lib/plausible_web/templates/billing/choose_plan.html.heex
+++ b/lib/plausible_web/templates/billing/choose_plan.html.heex
@@ -1,4 +1,4 @@
-<%= live_render(@conn, PlausibleWeb.Live.ChoosePlan,
+{live_render(@conn, PlausibleWeb.Live.ChoosePlan,
id: "choose-plan",
session: %{"remote_ip" => PlausibleWeb.RemoteIP.get(@conn)}
-) %>
+)}
diff --git a/lib/plausible_web/templates/billing/upgrade_to_enterprise_plan.html.heex b/lib/plausible_web/templates/billing/upgrade_to_enterprise_plan.html.heex
index 3eab3cc241..515a36c0d2 100644
--- a/lib/plausible_web/templates/billing/upgrade_to_enterprise_plan.html.heex
+++ b/lib/plausible_web/templates/billing/upgrade_to_enterprise_plan.html.heex
@@ -1,19 +1,19 @@
<div class="mx-auto mt-6 text-center">
<h1 class="text-3xl font-black text-black dark:text-gray-100">
- <%= if @subscription_resumable,
+ {if @subscription_resumable,
do: "Change subscription plan",
- else: "Upgrade to Enterprise" %>
+ else: "Upgrade to Enterprise"}
</h1>
</div>
<div class="w-full max-w-lg px-4 mx-auto mt-4 text-gray-900 dark:text-gray-100">
<div class="flex-1 p-8 mt-8 rounded bg-white shadow-md dark:bg-gray-800 dark:shadow-none">
<div class="w-full pb-4">
<span>
- <%= if @subscription_resumable,
+ {if @subscription_resumable,
do:
"We've prepared your account for an upgrade to custom limits outside the listed plans:",
else:
- "We've prepared a custom enterprise plan for your account with the following limits:" %>
+ "We've prepared a custom enterprise plan for your account with the following limits:"}
</span>
</div>
<PlausibleWeb.Components.Billing.present_enterprise_plan plan={@latest_enterprise_plan} />
@@ -21,19 +21,19 @@
<span>
The plan is priced at
<b>
- <%= case @price do
+ {case @price do
%Money{} = money -> Plausible.Billing.format_price(money)
nil -> "N/A"
- end %>
+ end}
</b>
</span>
<span>
- per <%= if @latest_enterprise_plan.billing_interval == :yearly,
+ per {if @latest_enterprise_plan.billing_interval == :yearly,
do: "year",
- else: "month" %> + VAT if applicable. <%= if @subscription_resumable,
+ else: "month"} + VAT if applicable. {if @subscription_resumable,
do:
"On the next page, our payment provider will calculate the prorated amount that your card will be charged if you decide to upgrade now.",
- else: "Click the button below to upgrade." %>
+ else: "Click the button below to upgrade."}
</span>
</ul>
<div class="w-max">
diff --git a/lib/plausible_web/templates/debug/clickhouse.html.heex b/lib/plausible_web/templates/debug/clickhouse.html.heex
index 9740cf5d9a..fd64ded6d7 100644
--- a/lib/plausible_web/templates/debug/clickhouse.html.heex
+++ b/lib/plausible_web/templates/debug/clickhouse.html.heex
@@ -3,9 +3,9 @@
<%= for log <- @queries do %>
<details class="group py-1">
<summary class="flex cursor-pointer flex-row items-center justify-between py-1 font-semibold text-gray-800 dark:text-gray-200 pt-4">
- <%= log["request_method"] %> <%= controller_name(log["phoenix_controller"]) %>.<%= log[
+ {log["request_method"]} {controller_name(log["phoenix_controller"])}.{log[
"phoenix_action"
- ] %> (<%= log[:query_duration_ms] %>ms)
+ ]} ({log[:query_duration_ms]}ms)
<svg
class="h-6 w-6 rotate-0 transform text-gray-400 dark:text-gray-200 group-open:rotate-180"
xmlns="http://www.w3.org/2000/svg"
@@ -22,7 +22,7 @@
<tbody>
<%= for {key, value} <- log do %>
<tr class="table-row">
- <td class="table-cell p-2"><%= key %></td>
+ <td class="table-cell p-2">{key}</td>
<td class="table-cell p-2">
<%= case key do %>
<% :query -> %>
@@ -30,7 +30,7 @@
<% "params" -> %>
<pre><%= Jason.encode!(value, pretty: true) %></pre>
<% _ -> %>
- <%= value %>
+ {value}
<% end %>
</td>
</tr>
diff --git a/lib/plausible_web/templates/email/activation_email.html.heex b/lib/plausible_web/templates/email/activation_email.html.heex
index 6373e81b85..ebc2fd851e 100644
--- a/lib/plausible_web/templates/email/activation_email.html.heex
+++ b/lib/plausible_web/templates/email/activation_email.html.heex
@@ -1 +1 @@
-Enter <%= @code %> to verify your email address. This code will expire in 4 hours.
+Enter {@code} to verify your email address. This code will expire in 4 hours.
diff --git a/lib/plausible_web/templates/email/approaching_accept_traffic_until.html.heex b/lib/plausible_web/templates/email/approaching_accept_traffic_until.html.heex
index 4cb3e664f3..4b42ee308b 100644
--- a/lib/plausible_web/templates/email/approaching_accept_traffic_until.html.heex
+++ b/lib/plausible_web/templates/email/approaching_accept_traffic_until.html.heex
@@ -1,6 +1,6 @@
-You used to have an active account with <%= Plausible.product_name() %>, a simple, lightweight, open source and privacy-first Google Analytics alternative.
+You used to have an active account with {Plausible.product_name()}, a simple, lightweight, open source and privacy-first Google Analytics alternative.
<br /><br />
-We've noticed that you're still sending us stats so we're writing to inform you that we'll stop accepting stats from your sites <%= @time %>. We're an independent, bootstrapped service and we don't sell your data, so this will reduce our server costs and help keep us sustainable.
+We've noticed that you're still sending us stats so we're writing to inform you that we'll stop accepting stats from your sites {@time}. We're an independent, bootstrapped service and we don't sell your data, so this will reduce our server costs and help keep us sustainable.
<br /><br /> If you'd like to continue counting your site stats in a privacy-friendly way, please
<a href={plausible_url()}>login to your Plausible account</a> and start a subscription.
<br /><br />
diff --git a/lib/plausible_web/templates/email/create_site_email.html.heex b/lib/plausible_web/templates/email/create_site_email.html.heex
index b17746e23f..0ebe47aeb8 100644
--- a/lib/plausible_web/templates/email/create_site_email.html.heex
+++ b/lib/plausible_web/templates/email/create_site_email.html.heex
@@ -2,8 +2,7 @@ You've activated
<%= if Plausible.ee?() do %>
your free 30-day trial of
<% end %>
-<%= Plausible.product_name() %>, a simple and privacy-friendly website analytics tool.
-<br /><br />
+{Plausible.product_name()}, a simple and privacy-friendly website analytics tool. <br /><br />
<a href={"#{plausible_url()}/sites/new"}>Click here</a>
to add your website URL, your timezone and install our one-line JavaScript snippet to start collecting visitor statistics.
<%= if Plausible.ee?() do %>
diff --git a/lib/plausible_web/templates/email/csv_import.html.heex b/lib/plausible_web/templates/email/csv_import.html.heex
index 6279b2f4a3..8fc1b160be 100644
--- a/lib/plausible_web/templates/email/csv_import.html.heex
+++ b/lib/plausible_web/templates/email/csv_import.html.heex
@@ -1,12 +1,12 @@
<%= if @success do %>
- Your CSV import has completed successfully. The Plausible dashboard for <%= @site_import.site.domain %> now contains historical imported data from <%= date_format(
+ Your CSV import has completed successfully. The Plausible dashboard for {@site_import.site.domain} now contains historical imported data from {date_format(
@site_import.start_date
- ) %> to <%= date_format(@site_import.end_date) %>
+ )} to {date_format(@site_import.end_date)}
<br /><br />
<a href={@link}>Click here</a>
to view your dashboard.
<% else %>
- Unfortunately, your CSV import for <%= @site_import.site.domain %> did not complete successfully. Sorry about that!
+ 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.
<%= if ee?() do %>
<br /> <br />
diff --git a/lib/plausible_web/templates/email/dashboard_locked.html.heex b/lib/plausible_web/templates/email/dashboard_locked.html.heex
index 2ee18d32f8..c4dad1ba24 100644
--- a/lib/plausible_web/templates/email/dashboard_locked.html.heex
+++ b/lib/plausible_web/templates/email/dashboard_locked.html.heex
@@ -1,18 +1,18 @@
-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.
+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(
+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(
+)}), 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
+)}), 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
<a href={PlausibleWeb.Router.Helpers.settings_url(PlausibleWeb.Endpoint, :subscription)}>account settings</a>, 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 %>
- <a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>Click here to upgrade your subscription</a>. 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.
+ <a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>Click here to upgrade your subscription</a>. 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.
<br /><br />
If your usage decreases in the future, you can switch to a lower plan at any time. Any credit balance will automatically apply to future payments.
<% end %>
diff --git a/lib/plausible_web/templates/email/drop_notification.html.heex b/lib/plausible_web/templates/email/drop_notification.html.heex
index cc4477bb5f..cc6b9c6834 100644
--- a/lib/plausible_web/templates/email/drop_notification.html.heex
+++ b/lib/plausible_web/templates/email/drop_notification.html.heex
@@ -1,7 +1,7 @@
-We've recorded <%= @current_visitors %> visitors on
+We've recorded {@current_visitors} visitors on
<a href={"https://" <> @site.domain}><%= @site.domain %></a> in the last 12 hours.
<%= if @dashboard_link do %>
- <br /><br /> View dashboard: <a href={@dashboard_link}><%= @dashboard_link %></a>
+ <br /><br /> View dashboard: <a href={@dashboard_link}>{@dashboard_link}</a>
<br /><br /> Something looks off? Please
<a href={@installation_link}>review your installation</a>
to verify that Plausible has been integrated correctly.
diff --git a/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.heex b/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.heex
index 159722e1e8..1372234f25 100644
--- a/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.heex
+++ b/lib/plausible_web/templates/email/enterprise_over_limit_internal.html.heex
@@ -1,15 +1,14 @@
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(
+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(
+)}<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(
+)} 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(
+)}<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 />
+)} billable pageviews<br /> Site usage: {@site_usage} / {@site_allowance} allowed sites<br />
diff --git a/lib/plausible_web/templates/email/error_report_email.html.heex b/lib/plausible_web/templates/email/error_report_email.html.heex
index a4dc5b8537..401efed07d 100644
--- a/lib/plausible_web/templates/email/error_report_email.html.heex
+++ b/lib/plausible_web/templates/email/error_report_email.html.heex
@@ -1,7 +1,7 @@
<h1>Error report</h1>
<p>
- Reported by: <%= @reported_by %>
- <br /> Sentry trace: <a href={sentry_link(@trace_id)}><%= @trace_id %></a>
+ Reported by: {@reported_by}
+ <br /> Sentry trace: <a href={sentry_link(@trace_id)}>{@trace_id}</a>
<br />
</p>
<h2>User feedback:</h2>
diff --git a/lib/plausible_web/templates/email/existing_user_invitation.html.heex b/lib/plausible_web/templates/email/existing_user_invitation.html.heex
index 3e5dca4fe7..4fbc525145 100644
--- a/lib/plausible_web/templates/email/existing_user_invitation.html.heex
+++ b/lib/plausible_web/templates/email/existing_user_invitation.html.heex
@@ -1,3 +1,3 @@
-<%= @inviter.email %> has invited you to the <%= @site.domain %> site on <%= Plausible.product_name() %>.
+{@inviter.email} has invited you to the {@site.domain} site on {Plausible.product_name()}.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</a> to view and respond to the invitation. The invitation
will expire 48 hours after this email is sent.
diff --git a/lib/plausible_web/templates/email/existing_user_team_invitation.html.heex b/lib/plausible_web/templates/email/existing_user_team_invitation.html.heex
index bde0c94b91..361d528ade 100644
--- a/lib/plausible_web/templates/email/existing_user_team_invitation.html.heex
+++ b/lib/plausible_web/templates/email/existing_user_team_invitation.html.heex
@@ -1,3 +1,3 @@
-<%= @inviter.email %> has invited you to the "<%= @team.name %>" team on <%= Plausible.product_name() %>.
+{@inviter.email} has invited you to the "{@team.name}" team on {Plausible.product_name()}.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</a> to view and respond to the invitation. The invitation
will expire 48 hours after this email is sent.
diff --git a/lib/plausible_web/templates/email/export_failure.html.heex b/lib/plausible_web/templates/email/export_failure.html.heex
index 2fa1c044a2..8f07e69cdb 100644
--- a/lib/plausible_web/templates/email/export_failure.html.heex
+++ b/lib/plausible_web/templates/email/export_failure.html.heex
@@ -1,4 +1,4 @@
-Your <%= Plausible.product_name() %> export for <%= @site.domain %> has encountered an error and was unsuccessful.
+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!
diff --git a/lib/plausible_web/templates/email/export_success.html.heex b/lib/plausible_web/templates/email/export_success.html.heex
index 03694f1462..2b6fe55679 100644
--- a/lib/plausible_web/templates/email/export_success.html.heex
+++ b/lib/plausible_web/templates/email/export_success.html.heex
@@ -1,6 +1,6 @@
-Your <%= Plausible.product_name() %> export for <%= @site.domain %> is now ready for download.
+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 %>.
+ 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.heex
index baa52141ee..4bffae8f19 100644
--- a/lib/plausible_web/templates/email/google_analytics_import.html.heex
+++ b/lib/plausible_web/templates/email/google_analytics_import.html.heex
@@ -1,12 +1,12 @@
<%= if @success do %>
- Your Google Analytics import has completed successfully. The Plausible dashboard for <%= @site_import.site.domain %> now contains historical imported data from <%= date_format(
+ Your Google Analytics import has completed successfully. The Plausible dashboard for {@site_import.site.domain} now contains historical imported data from {date_format(
@site_import.start_date
- ) %> to <%= date_format(@site_import.end_date) %>
+ )} to {date_format(@site_import.end_date)}
<br /><br />
<a href={@link}>Click here</a>
to view your dashboard.
<% else %>
- Unfortunately, your Google Analytics import for <%= @site_import.site.domain %> did not complete successfully. Sorry about that!
+ Unfortunately, your Google Analytics import for {@site_import.site.domain} did not complete successfully. Sorry about that!
<br /><br />
Please try to do the import once again. Sometimes the Google Analytics API just randomly returns empty data. It's intermittent and random. Trying to do the import again may return what you need.
<%= if ee?() do %>
diff --git a/lib/plausible_web/templates/email/guest_invitation_accepted.html.heex b/lib/plausible_web/templates/email/guest_invitation_accepted.html.heex
index c68d3cb49e..dbeacda628 100644
--- a/lib/plausible_web/templates/email/guest_invitation_accepted.html.heex
+++ b/lib/plausible_web/templates/email/guest_invitation_accepted.html.heex
@@ -1,2 +1,2 @@
-<%= @invitee_email %> has accepted your invitation to <%= @site.domain %>.
+{@invitee_email} has accepted your invitation to {@site.domain}.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @site.domain)}>Click here</a> to view site settings.
diff --git a/lib/plausible_web/templates/email/guest_invitation_rejected.html.heex b/lib/plausible_web/templates/email/guest_invitation_rejected.html.heex
index bac750d2db..6d7af67b40 100644
--- a/lib/plausible_web/templates/email/guest_invitation_rejected.html.heex
+++ b/lib/plausible_web/templates/email/guest_invitation_rejected.html.heex
@@ -1,2 +1,2 @@
-<%= @guest_invitation.team_invitation.email %> has rejected your invitation to <%= @guest_invitation.site.domain %>.
+{@guest_invitation.team_invitation.email} has rejected your invitation to {@guest_invitation.site.domain}.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @guest_invitation.site.domain)}>Click here</a> to view site settings.
diff --git a/lib/plausible_web/templates/email/new_user_invitation.html.heex b/lib/plausible_web/templates/email/new_user_invitation.html.heex
index 53f9affa30..32e3984d4b 100644
--- a/lib/plausible_web/templates/email/new_user_invitation.html.heex
+++ b/lib/plausible_web/templates/email/new_user_invitation.html.heex
@@ -1,4 +1,4 @@
-<%= @inviter.email %> has invited you to join the <%= @site.domain %> site on <%= Plausible.product_name() %>.
+{@inviter.email} has invited you to join the {@site.domain} site on {Plausible.product_name()}.
<a href={
Routes.auth_url(
PlausibleWeb.Endpoint,
diff --git a/lib/plausible_web/templates/email/new_user_team_invitation.html.heex b/lib/plausible_web/templates/email/new_user_team_invitation.html.heex
index c6e8a0122c..bbf0cc9d49 100644
--- a/lib/plausible_web/templates/email/new_user_team_invitation.html.heex
+++ b/lib/plausible_web/templates/email/new_user_team_invitation.html.heex
@@ -1,4 +1,4 @@
-<%= @inviter.email %> has invited you to join the "<%= @team.name %>" team on <%= Plausible.product_name() %>.
+{@inviter.email} has invited you to join the "{@team.name}" team on {Plausible.product_name()}.
<a href={
Routes.auth_url(
PlausibleWeb.Endpoint,
diff --git a/lib/plausible_web/templates/email/over_limit.html.heex b/lib/plausible_web/templates/email/over_limit.html.heex
index 462e49c594..6440d28272 100644
--- a/lib/plausible_web/templates/email/over_limit.html.heex
+++ b/lib/plausible_web/templates/email/over_limit.html.heex
@@ -1,19 +1,19 @@
-Thanks for being a <%= Plausible.product_name() %> subscriber! <br /><br />
+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(
+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(
+)}), 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
+)}), 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
<a href={plausible_url() <> PlausibleWeb.Router.Helpers.settings_path(PlausibleWeb.Endpoint, :subscription)}>account settings</a>, 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 %>
- <a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>Click here to upgrade your subscription</a>. 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.
+ <a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>Click here to upgrade your subscription</a>. 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.
<br /><br />
If your usage decreases in the future, you can switch to a lower plan at any time. Any credit balance will automatically apply to future payments.
<% end %>
diff --git a/lib/plausible_web/templates/email/ownership_transfer_accepted.html.heex b/lib/plausible_web/templates/email/ownership_transfer_accepted.html.heex
index a77705c1bf..cd85d5088d 100644
--- a/lib/plausible_web/templates/email/ownership_transfer_accepted.html.heex
+++ b/lib/plausible_web/templates/email/ownership_transfer_accepted.html.heex
@@ -1,3 +1,3 @@
-<%= @new_owner_email %> has accepted the ownership transfer of <%= @site.domain %>. They will be responsible for billing of it going
+{@new_owner_email} has accepted the ownership transfer of {@site.domain}. They will be responsible for billing of it going
forward and your role has been changed to <b>admin</b>.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @site.domain)}>Click here</a> 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.heex
index 81a4fdc9dc..091d9d338e 100644
--- a/lib/plausible_web/templates/email/ownership_transfer_rejected.html.heex
+++ b/lib/plausible_web/templates/email/ownership_transfer_rejected.html.heex
@@ -1,2 +1,2 @@
-<%= @site_transfer.email %> has rejected the ownership transfer of <%= @site_transfer.site.domain %>.
+{@site_transfer.email} has rejected the ownership transfer of {@site_transfer.site.domain}.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @site_transfer.site.domain)}>Click here</a> to view site settings.
diff --git a/lib/plausible_web/templates/email/ownership_transfer_request.html.heex b/lib/plausible_web/templates/email/ownership_transfer_request.html.heex
index 2cf4f0342c..9a198b8b05 100644
--- a/lib/plausible_web/templates/email/ownership_transfer_request.html.heex
+++ b/lib/plausible_web/templates/email/ownership_transfer_request.html.heex
@@ -1,4 +1,4 @@
-<%= @inviter.email %> has requested to transfer the ownership of <%= @site.domain %> site on <%= Plausible.product_name() %> to you.
+{@inviter.email} has requested to transfer the ownership of {@site.domain} site on {Plausible.product_name()} to you.
<%= if @new_owner_account do %>
<a href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</a>
to view and respond to the invitation.
diff --git a/lib/plausible_web/templates/email/site_member_removed.html.heex b/lib/plausible_web/templates/email/site_member_removed.html.heex
index 5e00cab2c4..62faf8efb6 100644
--- a/lib/plausible_web/templates/email/site_member_removed.html.heex
+++ b/lib/plausible_web/templates/email/site_member_removed.html.heex
@@ -1,4 +1,4 @@
-An administrator of <%= @guest_membership.site.domain %> has removed you as a member. You won't be able to see the stats anymore.
+An administrator of {@guest_membership.site.domain} has removed you as a member. You won't be able to see the stats anymore.
<br /><br />
<a href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</a>
to view your sites.
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.heex
index 04b4d5d185..ecc85c97da 100644
--- a/lib/plausible_web/templates/email/site_setup_help_email.html.heex
+++ b/lib/plausible_web/templates/email/site_setup_help_email.html.heex
@@ -2,7 +2,7 @@
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
+To finish your setup for {@site.domain}, review
<a href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}/installation"}>your installation</a> 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.
diff --git a/lib/plausible_web/templates/email/spike_notification.html.heex b/lib/plausible_web/templates/email/spike_notification.html.heex
index 458b4c6af5..295e016043 100644
--- a/lib/plausible_web/templates/email/spike_notification.html.heex
+++ b/lib/plausible_web/templates/email/spike_notification.html.heex
@@ -1,15 +1,15 @@
-There are currently <%= @current_visitors %> visitors on
+There are currently {@current_visitors} visitors on
<a href={"https://" <> @site.domain}><%= @site.domain %></a>.
<%= 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 />
+ {source} - {visitors} visitor{if visitors > 1, do: "s"}<br />
<% end %>
<% end %>
<%= if @link do %>
- <br /><br /> View dashboard: <a href={@link}><%= @link %></a>
+ <br /><br /> View dashboard: <a href={@link}>{@link}</a>
<% end %>
<br /><br /> Congrats on the spike in traffic!
<%= if Plausible.ce? do %>
diff --git a/lib/plausible_web/templates/email/team_invitation_accepted.html.heex b/lib/plausible_web/templates/email/team_invitation_accepted.html.heex
index d608ac8a8c..5c3a77442a 100644
--- a/lib/plausible_web/templates/email/team_invitation_accepted.html.heex
+++ b/lib/plausible_web/templates/email/team_invitation_accepted.html.heex
@@ -1,2 +1,2 @@
-<%= @invitee_email %> has accepted your invitation to "<%= @team.name %>" team.
+{@invitee_email} has accepted your invitation to "{@team.name}" team.
<a href={Routes.settings_url(PlausibleWeb.Endpoint, :team_general)}>Click here</a> to view team settings.
diff --git a/lib/plausible_web/templates/email/team_invitation_rejected.html.heex b/lib/plausible_web/templates/email/team_invitation_rejected.html.heex
index 980f5dcccc..d01a9023df 100644
--- a/lib/plausible_web/templates/email/team_invitation_rejected.html.heex
+++ b/lib/plausible_web/templates/email/team_invitation_rejected.html.heex
@@ -1,2 +1,2 @@
-<%= @team_invitation.email %> has rejected your invitation to \"<%= @team_invitation.team.name %>\" team.
+{@team_invitation.email} has rejected your invitation to \"{@team_invitation.team.name}\" team.
<a href={Routes.settings_url(PlausibleWeb.Endpoint, :team_general)}>Click here</a> to view team settings.
diff --git a/lib/plausible_web/templates/email/trial_over_email.html.heex b/lib/plausible_web/templates/email/trial_over_email.html.heex
index 219ab0cf80..f57245a46a 100644
--- a/lib/plausible_web/templates/email/trial_over_email.html.heex
+++ b/lib/plausible_web/templates/email/trial_over_email.html.heex
@@ -4,5 +4,4 @@ Your free Plausible trial has now expired. Upgrade your account to continue rece
<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>
Upgrade now
</a>
-<br /><br />
-We will keep recording stats for <%= @extra_offset %> days to give you time to upgrade.
+<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.heex b/lib/plausible_web/templates/email/trial_upgrade_email.html.heex
index e5332548d5..22a8b7d252 100644
--- a/lib/plausible_web/templates/email/trial_upgrade_email.html.heex
+++ b/lib/plausible_web/templates/email/trial_upgrade_email.html.heex
@@ -1,15 +1,15 @@
-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.
+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:
- "" %>.
+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 />
+ Based on that we recommend you select a {@suggested_plan.volume}/mo plan. <br /><br />
<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>
Upgrade now
</a>
diff --git a/lib/plausible_web/templates/email/yearly_expiration_notification.html.heex b/lib/plausible_web/templates/email/yearly_expiration_notification.html.heex
index 9f8b3fba1c..51dfd01054 100644
--- a/lib/plausible_web/templates/email/yearly_expiration_notification.html.heex
+++ b/lib/plausible_web/templates/email/yearly_expiration_notification.html.heex
@@ -1,7 +1,7 @@
-Time flies! This is a reminder that your annual subscription for <%= Plausible.product_name() %> will expire on <%= @next_bill_date %>.
+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
<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>renew your subscription</a> 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 %>.
+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 />
Have a question, feedback or need some guidance? Just reply to this email to get in touch!
diff --git a/lib/plausible_web/templates/email/yearly_renewal_notification.html.heex b/lib/plausible_web/templates/email/yearly_renewal_notification.html.heex
index 29dfd5dcaa..20e74d3a84 100644
--- a/lib/plausible_web/templates/email/yearly_renewal_notification.html.heex
+++ b/lib/plausible_web/templates/email/yearly_renewal_notification.html.heex
@@ -1,6 +1,6 @@
-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(
+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 />
+)}{@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
<a href={"#{plausible_url()}/settings"}>account settings page</a>. <br /><br />
diff --git a/lib/plausible_web/templates/error/404_error.html.heex b/lib/plausible_web/templates/error/404_error.html.heex
index 95f46c15a0..f93181f1cc 100644
--- a/lib/plausible_web/templates/error/404_error.html.heex
+++ b/lib/plausible_web/templates/error/404_error.html.heex
@@ -1,5 +1,5 @@
<div class="container flex flex-col items-center text-center mt-24">
- <h1 class="text-5xl font-black dark:text-gray-100"><%= @status %></h1>
+ <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
diff --git a/lib/plausible_web/templates/error/generic_error.html.heex b/lib/plausible_web/templates/error/generic_error.html.heex
index 78da8414e3..c51ff40f63 100644
--- a/lib/plausible_web/templates/error/generic_error.html.heex
+++ 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>
+ <h1 class="text-5xl font-black dark:text-gray-100">{@status}</h1>
+ <div class="my-4 text-xl dark:text-gray-100">{@message}</div>
<.button_link href={PlausibleWeb.LayoutView.home_dest(@conn)}>Go to homepage</.button_link>
</div>
diff --git a/lib/plausible_web/templates/google_analytics/confirm.html.heex b/lib/plausible_web/templates/google_analytics/confirm.html.heex
index 6f826f74c6..7a91216fef 100644
--- a/lib/plausible_web/templates/google_analytics/confirm.html.heex
+++ b/lib/plausible_web/templates/google_analytics/confirm.html.heex
@@ -19,7 +19,7 @@
<div class="mt-6">
<.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 %>
+ {@selected_property_name}
</span>
<.input type="hidden" value={@selected_property} field={f[:property]} readonly="true" />
</div>
@@ -27,7 +27,7 @@
<div class="w-36">
<.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) %>
+ {PlausibleWeb.EmailView.date_format(@start_date)}
</span>
<.input type="hidden" value={@start_date} field={f[:start_date]} readonly="true" />
</div>
@@ -35,7 +35,7 @@
<div class="w-36">
<.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) %>
+ {PlausibleWeb.EmailView.date_format(@end_date)}
</span>
<.input type="hidden" value={@end_date} field={f[:end_date]} readonly="true" />
</div>
diff --git a/lib/plausible_web/templates/google_analytics/property_form.html.heex b/lib/plausible_web/templates/google_analytics/property_form.html.heex
index c44b1de049..b9ff6cf26e 100644
--- a/lib/plausible_web/templates/google_analytics/property_form.html.heex
+++ b/lib/plausible_web/templates/google_analytics/property_form.html.heex
@@ -4,7 +4,7 @@
</:title>
<:subtitle>
- Choose the property in your Google Analytics account that will be imported to the <%= @site.domain %> dashboard.
+ Choose the property in your Google Analytics account that will be imported to the {@site.domain} dashboard.
</:subtitle>
<.form
:let={f}
@@ -27,7 +27,7 @@
/>
<p class="text-red-600 dark:text-red-700">
- <%= @conn.assigns[:selected_property_error] %>
+ {@conn.assigns[:selected_property_error]}
</p>
</div>
diff --git a/lib/plausible_web/templates/layout/_flash.html.heex b/lib/plausible_web/templates/layout/_flash.html.heex
index 1fb19f68c2..37bc021e36 100644
--- a/lib/plausible_web/templates/layout/_flash.html.heex
+++ b/lib/plausible_web/templates/layout/_flash.html.heex
@@ -33,10 +33,10 @@
</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!" %>
+ {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) %>
+ {Phoenix.Flash.get(@flash, :success)}
</p>
</div>
<div class="ml-4 flex-shrink-0 flex">
@@ -102,10 +102,10 @@
</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" %>
+ {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) %>
+ {Phoenix.Flash.get(@flash, :error)}
</p>
</div>
<div class="ml-4 flex-shrink-0 flex">
diff --git a/lib/plausible_web/templates/layout/_header.html.heex b/lib/plausible_web/templates/layout/_header.html.heex
index bd5aeabb5b..5b38e39f5f 100644
--- a/lib/plausible_web/templates/layout/_header.html.heex
+++ b/lib/plausible_web/templates/layout/_header.html.heex
@@ -51,14 +51,14 @@
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_notification(@conn.assigns[:my_team]) %>
+ {trial_notification(@conn.assigns[:my_team])}
</.styled_link>
</li>
<li class="w-full sm:w-auto">
<.dropdown>
<:button class="flex items-center gap-3 px-3 py-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800">
<span class="font-medium truncate dark:text-gray-100 hidden md:block">
- <%= @conn.assigns[:current_user].name %>
+ {@conn.assigns[:current_user].name}
</span>
<img
src={Plausible.Auth.User.profile_img_url(@conn.assigns[:current_user])}
@@ -69,7 +69,7 @@
<.dropdown_item>
<div class="text-xs text-gray-500 dark:text-gray-400">Signed in as</div>
<p class="truncate font-medium text-gray-900 dark:text-gray-100" role="none">
- <%= @conn.assigns[:current_user].email %>
+ {@conn.assigns[:current_user].email}
</p>
</.dropdown_item>
<.dropdown_divider />
diff --git a/lib/plausible_web/templates/layout/_notice.html.heex b/lib/plausible_web/templates/layout/_notice.html.heex
index 98e5372321..aff8e486a2 100644
--- a/lib/plausible_web/templates/layout/_notice.html.heex
+++ b/lib/plausible_web/templates/layout/_notice.html.heex
@@ -1,5 +1,5 @@
<%= if assigns[:flash] do %>
- <%= render("_flash.html", assigns) %>
+ {render("_flash.html", assigns)}
<% end %>
<div :if={assigns[:my_team]} class="flex flex-col gap-y-2">
diff --git a/lib/plausible_web/templates/layout/_settings_tab.html.heex b/lib/plausible_web/templates/layout/_settings_tab.html.heex
index a2d379dbc7..44eaa112bf 100644
--- a/lib/plausible_web/templates/layout/_settings_tab.html.heex
+++ b/lib/plausible_web/templates/layout/_settings_tab.html.heex
@@ -14,7 +14,7 @@
name={@icon}
class={["h-4 w-4 mr-2", is_current_tab(@conn, @this_tab) && "stroke-2"]}
/>
- <%= @text %>
+ {@text}
<Heroicons.chevron_down
:if={is_nil(@this_tab)}
class="h-3 w-3 ml-2 text-gray-400 dark:text-gray-500"
diff --git a/lib/plausible_web/templates/layout/_site_settings_tab.html.heex b/lib/plausible_web/templates/layout/_site_settings_tab.html.heex
index e87976b85d..146ed0622d 100644
--- a/lib/plausible_web/templates/layout/_site_settings_tab.html.heex
+++ b/lib/plausible_web/templates/layout/_site_settings_tab.html.heex
@@ -14,7 +14,7 @@
name={@icon}
class={["h-4 w-4 mr-2", is_current_tab(@conn, @this_tab) && "stroke-2"]}
/>
- <%= @text %>
+ {@text}
<Heroicons.chevron_down
:if={is_nil(@this_tab)}
class="h-3 w-3 ml-2 text-gray-400 dark:text-gray-500"
diff --git a/lib/plausible_web/templates/layout/app.html.heex b/lib/plausible_web/templates/layout/app.html.heex
index 731bd91f96..ac040c3b43 100644
--- a/lib/plausible_web/templates/layout/app.html.heex
+++ b/lib/plausible_web/templates/layout/app.html.heex
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en" class="h-full">
+<html lang="en" class="h-full plausible">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@@ -17,12 +17,12 @@
<PlausibleWeb.Components.Layout.favicon conn={@conn} />
<title>
- <%= assigns[:title] ||
- "Plausible · Simple, privacy-friendly alternative to Google Analytics" %>
+ {assigns[:title] ||
+ "Plausible · Simple, privacy-friendly alternative to Google Analytics"}
</title>
<link rel="stylesheet" href={Routes.static_path(@conn, "/css/app.css")} />
<PlausibleWeb.Components.Layout.theme_script {Map.take(assigns, [:current_user, :theme])} />
- <%= render("_tracking.html", assigns) %>
+ {render("_tracking.html", assigns)}
</head>
<body
class={[
@@ -34,12 +34,12 @@
style={if assigns[:background], do: "background-color: #{assigns[:background]}"}
>
<%= if !assigns[:embedded] do %>
- <%= render("_header.html", assigns) %>
- <%= render("_notice.html", assigns) %>
+ {render("_header.html", assigns)}
+ {render("_notice.html", assigns)}
<% end %>
<main class="flex-1">
- <%= Map.get(assigns, :inner_layout) || @inner_content %>
+ {Map.get(assigns, :inner_layout) || @inner_content}
</main>
<%= if assigns[:embedded] do %>
@@ -47,7 +47,7 @@
<script type="text/javascript" src={Routes.static_path(@conn, "/js/embed.content.js")}>
</script>
<% else %>
- <%= render("_footer.html", assigns) %>
+ {render("_footer.html", assigns)}
<% end %>
<script type="text/javascript" src={Routes.static_path(@conn, "/js/app.js")}>
</script>
diff --git a/lib/plausible_web/templates/layout/base_email.html.heex b/lib/plausible_web/templates/layout/base_email.html.heex
index f9a9ffc74b..0311dd88e5 100644
--- a/lib/plausible_web/templates/layout/base_email.html.heex
+++ b/lib/plausible_web/templates/layout/base_email.html.heex
@@ -1,16 +1,14 @@
-<%= PlausibleWeb.EmailView.greet_recipient(assigns) %>
+{PlausibleWeb.EmailView.greet_recipient(assigns)}
<br /><br />
-<%= @inner_content %>
+{@inner_content}
<br /><br />
<%= if ee?() do %>
Regards,<br /> The Plausible Team 💌 <br /><br />
<% end %>
-- <br /><br />
-<a href={plausible_url()}><%= plausible_url() %></a>
+<a href={plausible_url()}>{plausible_url()}</a>
<br />
-<%= if ee?() do %>
- {{{ pm:unsubscribe }}}
-<% end %>
+<p :if={ee?()} phx-no-curly-interpolation>{{{ pm:unsubscribe }}}</p>
diff --git a/lib/plausible_web/templates/layout/base_error.html.heex b/lib/plausible_web/templates/layout/base_error.html.heex
index 5df4459137..d631ff44fa 100644
--- a/lib/plausible_web/templates/layout/base_error.html.heex
+++ b/lib/plausible_web/templates/layout/base_error.html.heex
@@ -36,7 +36,7 @@
</a>
</div>
- <%= @inner_content %>
+ {@inner_content}
<script type="text/javascript" src={Routes.static_path(PlausibleWeb.Endpoint, "/js/app.js")}>
</script>
diff --git a/lib/plausible_web/templates/layout/embedded.html.heex b/lib/plausible_web/templates/layout/embedded.html.heex
index 8b13789179..e69de29bb2 100644
--- a/lib/plausible_web/templates/layout/embedded.html.heex
+++ b/lib/plausible_web/templates/layout/embedded.html.heex
@@ -1 +0,0 @@
-
diff --git a/lib/plausible_web/templates/layout/priority_email.html.heex b/lib/plausible_web/templates/layout/priority_email.html.heex
index bb0cfb50f3..4e4558b65c 100644
--- a/lib/plausible_web/templates/layout/priority_email.html.heex
+++ b/lib/plausible_web/templates/layout/priority_email.html.heex
@@ -1,12 +1,12 @@
-<%= PlausibleWeb.EmailView.greet_recipient(assigns) %>
+{PlausibleWeb.EmailView.greet_recipient(assigns)}
<br /><br />
-<%= @inner_content %>
+{@inner_content}
<br /><br />
<%= if ee?() do %>
Regards,<br /> The Plausible Team 💌 <br /><br />
<% end %>
-- <br /><br />
-<a href={plausible_url()}><%= plausible_url() %></a>
+<a href={plausible_url()}>{plausible_url()}</a>
<br />
diff --git a/lib/plausible_web/templates/layout/settings.html.heex b/lib/plausible_web/templates/layout/settings.html.heex
index d16bf2031b..3b5c3c0140 100644
--- a/lib/plausible_web/templates/layout/settings.html.heex
+++ b/lib/plausible_web/templates/layout/settings.html.heex
@@ -13,7 +13,7 @@
<div class="py-4 g:py-0 lg:col-span-3">
<div class="mb-4 hidden lg:block">
<h3 class="uppercase text-sm text-indigo-600 font-semibold">Account Settings</h3>
- <p class="text-xs dark:text-gray-400 truncate"><%= @current_user.email %></p>
+ <p class="text-xs dark:text-gray-400 truncate">{@current_user.email}</p>
</div>
<.mobile_nav_dropdown
@@ -26,38 +26,38 @@
<div class="hidden lg:block">
<%= for %{key: key, value: value, icon: icon} <- options["Account Settings"] do %>
- <%= render("_settings_tab.html",
+ {render("_settings_tab.html",
icon: icon,
this_tab: value,
text: key,
conn: @conn,
submenu?: false
- ) %>
+ )}
<% end %>
</div>
<div :if={Plausible.Teams.enabled?(@my_team)}>
<div class="mb-4 mt-4 hidden lg:block">
<h3 class="uppercase text-sm text-indigo-600 font-semibold">Team Settings</h3>
- <p class="text-xs dark:text-gray-400 truncate"><%= @my_team.name %></p>
+ <p class="text-xs dark:text-gray-400 truncate">{@my_team.name}</p>
</div>
<div class="hidden lg:block">
<%= for %{key: key, value: value, icon: icon} <- options["Team Settings"] do %>
- <%= render("_settings_tab.html",
+ {render("_settings_tab.html",
icon: icon,
this_tab: value,
text: key,
conn: @conn,
submenu?: false
- ) %>
+ )}
<% end %>
</div>
</div>
</div>
<div class="space-y-6 lg:col-span-9 lg:mt-4">
- <%= @inner_content %>
+ {@inner_content}
</div>
</div>
</div>
diff --git a/lib/plausible_web/templates/layout/site_settings.html.heex b/lib/plausible_web/templates/layout/site_settings.html.heex
index f0b7983cbd..81cfa8dc42 100644
--- a/lib/plausible_web/templates/layout/site_settings.html.heex
+++ b/lib/plausible_web/templates/layout/site_settings.html.heex
@@ -8,7 +8,7 @@
</.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 %>
+ Settings for {@site.domain}
</h2>
</div>
<div class="lg:grid lg:grid-cols-12 lg:gap-x-5 lg:mt-4">
@@ -25,33 +25,33 @@
<div class="hidden lg:block">
<%= for %{key: key, value: value, icon: icon} <- site_settings_sidebar(@conn) do %>
<%= if is_binary(value) do %>
- <%= render("_site_settings_tab.html",
+ {render("_site_settings_tab.html",
icon: icon,
this_tab: value,
text: key,
site: @site,
conn: @conn,
submenu?: false
- ) %>
+ )}
<% else %>
- <%= render("_site_settings_tab.html",
+ {render("_site_settings_tab.html",
icon: icon,
this_tab: nil,
text: key,
site: @site,
conn: @conn,
submenu?: false
- ) %>
+ )}
<div class="ml-6">
<%= for %{key: key, value: val} <- value do %>
- <%= render("_site_settings_tab.html",
+ {render("_site_settings_tab.html",
icon: nil,
this_tab: val,
text: key,
site: @site,
conn: @conn,
submenu?: true
- ) %>
+ )}
<% end %>
</div>
<% end %>
@@ -60,7 +60,7 @@
</div>
<div class="space-y-6 lg:col-span-9 lg:mt-4">
- <%= @inner_content %>
+ {@inner_content}
</div>
</div>
</div>
diff --git a/lib/plausible_web/templates/settings/api_keys.html.heex b/lib/plausible_web/templates/settings/api_keys.html.heex
index c54634b21f..c1d4a4ba5e 100644
--- a/lib/plausible_web/templates/settings/api_keys.html.heex
+++ b/lib/plausible_web/templates/settings/api_keys.html.heex
@@ -38,11 +38,11 @@
<:tbody :let={api_key}>
<.td truncate max_width="max-w-40">
- <%= api_key.name %>
+ {api_key.name}
</.td>
<.td hide_on_mobile>
- <%= api_key.key_prefix %>
- <%= String.duplicate("*", 32 - 6) %>
+ {api_key.key_prefix}
+ {String.duplicate("*", 32 - 6)}
</.td>
<.td actions>
<.delete_button
diff --git a/lib/plausible_web/templates/settings/invoices.html.heex b/lib/plausible_web/templates/settings/invoices.html.heex
index e71dc774b5..f53af1dffa 100644
--- a/lib/plausible_web/templates/settings/invoices.html.heex
+++ b/lib/plausible_web/templates/settings/invoices.html.heex
@@ -35,8 +35,8 @@
<.th>Invoice</.th>
</:thead>
<:tbody :let={{invoice, _idx}}>
- <.td><%= invoice.date %></.td>
- <.td><%= invoice.currency <> invoice.amount %></.td>
+ <.td>{invoice.date}</.td>
+ <.td>{invoice.currency <> invoice.amount}</.td>
<.td>
<.styled_link href={invoice.url} new_tab={true}>View</.styled_link>
</.td>
diff --git a/lib/plausible_web/templates/settings/new_api_key.html.heex b/lib/plausible_web/templates/settings/new_api_key.html.heex
index eb1f9968d2..96bcac8aaa 100644
--- a/lib/plausible_web/templates/settings/new_api_key.html.heex
+++ b/lib/plausible_web/templates/settings/new_api_key.html.heex
@@ -10,7 +10,7 @@
<.error :for={
msg <- Enum.map(f[:key].errors, &PlausibleWeb.Live.Components.Form.translate_error/1)
}>
- <%= msg %>
+ {msg}
</.error>
<p class="mt-2 text-gray-500 dark:text-gray-200">
diff --git a/lib/plausible_web/templates/settings/security.html.heex b/lib/plausible_web/templates/settings/security.html.heex
index 31345fd148..92285a64b7 100644
--- a/lib/plausible_web/templates/settings/security.html.heex
+++ b/lib/plausible_web/templates/settings/security.html.heex
@@ -230,8 +230,8 @@
<.th invisible>Actions</.th>
</:thead>
<:tbody :let={session}>
- <.td truncate max_width="max-w-40"><%= session.device %></.td>
- <.td hide_on_mobile><%= Plausible.Auth.UserSessions.last_used_humanize(session) %></.td>
+ <.td truncate max_width="max-w-40">{session.device}</.td>
+ <.td hide_on_mobile>{Plausible.Auth.UserSessions.last_used_humanize(session)}</.td>
<.td :if={@current_user_session.id == session.id} actions>Current session</.td>
<.td :if={@current_user_session.id != session.id} actions>
<.delete_button
diff --git a/lib/plausible_web/templates/settings/subscription.html.heex b/lib/plausible_web/templates/settings/subscription.html.heex
index 306ab6fece..52008ed437 100644
--- a/lib/plausible_web/templates/settings/subscription.html.heex
+++ b/lib/plausible_web/templates/settings/subscription.html.heex
@@ -22,7 +22,7 @@
subscription_colors(@subscription.status)
]}
>
- <%= present_subscription_status(@subscription.status) %>
+ {present_subscription_status(@subscription.status)}
</span>
</div>
@@ -40,7 +40,7 @@
<h4 class="font-black dark:text-gray-100">Next bill amount</h4>
<%= if Plausible.Billing.Subscription.Status.in?(@subscription, [Plausible.Billing.Subscription.Status.active(), Plausible.Billing.Subscription.Status.past_due()]) do %>
<div class="py-2 text-xl font-medium dark:text-gray-100">
- <%= PlausibleWeb.BillingView.present_currency(@subscription.currency_code) %><%= @subscription.next_bill_amount %>
+ {PlausibleWeb.BillingView.present_currency(@subscription.currency_code)}{@subscription.next_bill_amount}
</div>
<.styled_link :if={@subscription.update_url} href={@subscription.update_url}>
Update billing info
@@ -54,10 +54,10 @@
<%= if @subscription && @subscription.next_bill_date && Plausible.Billing.Subscription.Status.in?(@subscription, [Plausible.Billing.Subscription.Status.active(), Plausible.Billing.Subscription.Status.past_due()]) do %>
<div class="py-2 text-xl font-medium dark:text-gray-100">
- <%= Calendar.strftime(@subscription.next_bill_date, "%b %-d, %Y") %>
+ {Calendar.strftime(@subscription.next_bill_date, "%b %-d, %Y")}
</div>
<span class="text-gray-600 dark:text-gray-400">
- (<%= subscription_interval(@subscription) %> billing)
+ ({subscription_interval(@subscription)} billing)
</span>
<% else %>
<div class="py-2 text-xl font-medium dark:text-gray-100">---</div>
diff --git a/lib/plausible_web/templates/site/csv_import.html.heex b/lib/plausible_web/templates/site/csv_import.html.heex
index 7570d8a282..fcfa7c39ec 100644
--- a/lib/plausible_web/templates/site/csv_import.html.heex
+++ b/lib/plausible_web/templates/site/csv_import.html.heex
@@ -7,10 +7,10 @@
</.styled_link>
You can upload multiple files simultaneously by either selecting them in the file dialog or dragging and dropping them into the designated area.
</:subtitle>
- <%= live_render(@conn, PlausibleWeb.Live.CSVImport,
+ {live_render(@conn, PlausibleWeb.Live.CSVImport,
session: %{
"site_id" => @site.id,
"storage" => on_ee(do: "s3", else: "local")
}
- ) %>
+ )}
</.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.heex
index de7e53a176..34a2ca02f8 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,10 +1,10 @@
<.focus_box>
<:title>
- Invite member to <%= @site.domain %>
+ Invite member to {@site.domain}
</:title>
<:subtitle>
- Enter the email address and role of the person you want to invite. We will contact them over email to offer them access to <%= @site.domain %> analytics.<br /><br />
+ Enter the email address and role of the person you want to invite. We will contact them over email to offer them access to {@site.domain} analytics.<br /><br />
The invitation will expire in 48 hours
</:subtitle>
@@ -28,7 +28,7 @@
/>
<%= if @conn.assigns[:error] do %>
- <div class="text-red-500 mb-4"><%= @conn.assigns[:error] %></div>
+ <div class="text-red-500 mb-4">{@conn.assigns[:error]}</div>
<% end %>
</div>
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.heex
index 18afc3aafd..4899285db4 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,10 +1,10 @@
<.focus_box>
<:title>
- Transfer ownership of <%= @site.domain %>
+ Transfer ownership of {@site.domain}
</:title>
<:subtitle>
Enter the email address of the new owner. We will contact them over email to
- offer them the ownership of <%= @site.domain %>. If they don't respond in 48
+ offer them the ownership of {@site.domain}. If they don't respond in 48
hours, the request will expire automatically. <br /><br />
Do note that a subscription plan is not transferred alongside the site. If
they accept the transfer request, the new owner will need to have an active
@@ -18,7 +18,7 @@
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>
+ <div class="text-red-500 text-xs italic mt-4">{@conn.assigns[:error]}</div>
<% end %>
<div class="my-6">
diff --git a/lib/plausible_web/templates/site/settings_danger_zone.html.heex b/lib/plausible_web/templates/site/settings_danger_zone.html.heex
index 60c1656255..ff2787c8a2 100644
--- a/lib/plausible_web/templates/site/settings_danger_zone.html.heex
+++ b/lib/plausible_web/templates/site/settings_danger_zone.html.heex
@@ -10,7 +10,7 @@
href={Routes.membership_path(@conn, :transfer_ownership_form, @site.domain)}
theme="danger"
>
- Transfer <%= @site.domain %> ownership
+ Transfer {@site.domain} ownership
</.button_link>
</.tile>
@@ -23,7 +23,7 @@
data-confirm="Resetting the stats cannot be reversed. Are you sure?"
theme="danger"
>
- Reset <%= @site.domain %> stats
+ Reset {@site.domain} stats
</.button_link>
</.tile>
@@ -36,7 +36,7 @@
method="delete"
data-confirm="Deleting the site data cannot be reversed. Are you sure?"
>
- Delete <%= @site.domain %>
+ Delete {@site.domain}
</.button_link>
</.tile>
</.settings_tiles>
diff --git a/lib/plausible_web/templates/site/settings_email_reports.html.heex b/lib/plausible_web/templates/site/settings_email_reports.html.heex
index ff86bf00e0..3c666ba1d2 100644
--- a/lib/plausible_web/templates/site/settings_email_reports.html.heex
+++ b/lib/plausible_web/templates/site/settings_email_reports.html.heex
@@ -26,10 +26,10 @@
<.tile :for={{_type, meta} <- email_reports} docs="email-reports">
<:title>
- <%= meta.heading %>
+ {meta.heading}
</:title>
<:subtitle>
- <%= meta.subtitle %>
+ {meta.subtitle}
</:subtitle>
<.form
@@ -42,7 +42,7 @@
>
<div>
<.toggle_submit set_to={meta.report}>
- <%= meta.toggle %>
+ {meta.toggle}
</.toggle_submit>
</div>
</.form>
@@ -65,7 +65,7 @@
<div class="flex items-center gap-x-2">
<Heroicons.envelope_open class="w-6 h-6 feather" />
<div>
- <%= recipient %>
+ {recipient}
</div>
</div>
</.td>
@@ -128,10 +128,10 @@
<.tile :for={{type, meta} <- change_notifications} docs="traffic-spikes">
<:title>
- <%= meta.heading %>
+ {meta.heading}
</:title>
<:subtitle>
- <%= meta.subtitle %>
+ {meta.subtitle}
</:subtitle>
<.form
@@ -144,7 +144,7 @@
method="post"
>
<.toggle_submit set_to={meta.notification}>
- <%= meta.toggle %>
+ {meta.toggle}
</.toggle_submit>
</.form>
@@ -186,7 +186,7 @@
<div class="flex items-cetner gap-x-2">
<Heroicons.envelope_open class="w-6 h-6 feather" />
<div>
- <%= recipient %>
+ {recipient}
</div>
</div>
</.td>
diff --git a/lib/plausible_web/templates/site/settings_funnels.html.heex b/lib/plausible_web/templates/site/settings_funnels.html.heex
index 6c8ea379c3..756404f998 100644
--- a/lib/plausible_web/templates/site/settings_funnels.html.heex
+++ b/lib/plausible_web/templates/site/settings_funnels.html.heex
@@ -20,9 +20,9 @@
/>
<div :if={Plausible.Billing.Feature.Funnels.enabled?(@site)}>
- <%= live_render(@conn, PlausibleWeb.Live.FunnelSettings,
+ {live_render(@conn, PlausibleWeb.Live.FunnelSettings,
session: %{"site_id" => @site.id, "domain" => @site.domain}
- ) %>
+ )}
</div>
</.tile>
</.settings_tiles>
diff --git a/lib/plausible_web/templates/site/settings_goals.html.heex b/lib/plausible_web/templates/site/settings_goals.html.heex
index ca152d0c44..7f7732fd09 100644
--- a/lib/plausible_web/templates/site/settings_goals.html.heex
+++ b/lib/plausible_web/templates/site/settings_goals.html.heex
@@ -21,9 +21,9 @@
</:subtitle>
<div :if={Plausible.Billing.Feature.Goals.enabled?(@site)}>
- <%= live_render(@conn, PlausibleWeb.Live.GoalSettings,
+ {live_render(@conn, PlausibleWeb.Live.GoalSettings,
session: %{"site_id" => @site.id, "domain" => @site.domain}
- ) %>
+ )}
</div>
</.tile>
</.settings_tiles>
diff --git a/lib/plausible_web/templates/site/settings_imports_exports.html.heex b/lib/plausible_web/templates/site/settings_imports_exports.html.heex
index e756a44492..1f085ba189 100644
--- a/lib/plausible_web/templates/site/settings_imports_exports.html.heex
+++ b/lib/plausible_web/templates/site/settings_imports_exports.html.heex
@@ -6,12 +6,12 @@
<:subtitle>
Import existing data from external sources.
Pick one of the options below to start a new import. <br />
- A maximum of <%= Plausible.Imported.max_complete_imports() %> imports at any time is allowed.
+ A maximum of {Plausible.Imported.max_complete_imports()} imports at any time is allowed.
</:subtitle>
- <%= live_render(@conn, PlausibleWeb.Live.ImportsExportsSettings,
+ {live_render(@conn, PlausibleWeb.Live.ImportsExportsSettings,
session: %{"domain" => @site.domain}
- ) %>
+ )}
</.tile>
<.tile>
@@ -22,12 +22,12 @@
Export all your data into CSV format
</:subtitle>
- <%= live_render(@conn, PlausibleWeb.Live.CSVExport,
+ {live_render(@conn, PlausibleWeb.Live.CSVExport,
session: %{
"site_id" => @site.id,
"email_to" => @current_user.email,
"storage" => on_ee(do: "s3", else: "local")
}
- ) %>
+ )}
</.tile>
</.settings_tiles>
diff --git a/lib/plausible_web/templates/site/settings_integrations.html.heex b/lib/plausible_web/templates/site/settings_integrations.html.heex
index ae7aa92e17..2184212f00 100644
--- a/lib/plausible_web/templates/site/settings_integrations.html.heex
+++ b/lib/plausible_web/templates/site/settings_integrations.html.heex
@@ -13,12 +13,12 @@
Control Plugin Access
</:subtitle>
- <%= live_render(@conn, PlausibleWeb.Live.Plugins.API.Settings,
+ {live_render(@conn, PlausibleWeb.Live.Plugins.API.Settings,
session: %{
"site_id" => @site.id,
"domain" => @site.domain,
"new_token" => @conn.query_params["new_token"]
}
- ) %>
+ )}
</.tile>
</.settings_tiles>
diff --git a/lib/plausible_web/templates/site/settings_people.html.heex b/lib/plausible_web/templates/site/settings_people.html.heex
index e1f3a4a794..aabdac734f 100644
--- a/lib/plausible_web/templates/site/settings_people.html.heex
+++ b/lib/plausible_web/templates/site/settings_people.html.heex
@@ -26,11 +26,11 @@
<div class="flex-1 min-w-0">
<p class="text-sm truncate">
<span class="font-medium text-gray-900 dark:text-gray-50">
- <%= membership.user.name %>
+ {membership.user.name}
</span>
<br />
<span class="text-gray-500 dark:text-gray-400">
- <%= membership.user.email %>
+ {membership.user.email}
</span>
<.styled_link
:if={ee?() and Plausible.Auth.is_super_admin?(@current_user)}
@@ -44,7 +44,7 @@
<.dropdown class="relative">
<:button class="bg-transparent text-gray-800 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus-visible:outline-gray-100 whitespace-nowrap truncate inline-flex items-center gap-x-2 font-medium rounded-md px-3.5 py-2.5 text-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:bg-gray-400 dark:disabled:text-white dark:disabled:text-gray-400 dark:disabled:bg-gray-700">
- <%= membership.role |> to_string() |> String.capitalize() %>
+ {membership.role |> to_string() |> String.capitalize()}
<Heroicons.chevron_down mini class="size-4 mt-0.5" />
</:button>
<:menu class="max-w-60">
@@ -145,8 +145,8 @@
<.th invisible>Actions</.th>
</:thead>
<:tbody :let={invitation}>
- <.td><%= invitation.email %></.td>
- <.td hide_on_mobile><%= Phoenix.Naming.humanize(invitation.role) %></.td>
+ <.td>{invitation.email}</.td>
+ <.td hide_on_mobile>{Phoenix.Naming.humanize(invitation.role)}</.td>
<.td actions>
<.delete_button
href={
diff --git a/lib/plausible_web/templates/site/settings_props.html.heex b/lib/plausible_web/templates/site/settings_props.html.heex
index a0b233905c..b66cca331c 100644
--- a/lib/plausible_web/templates/site/settings_props.html.heex
+++ b/lib/plausible_web/templates/site/settings_props.html.heex
@@ -22,10 +22,10 @@
/>
<div :if={Plausible.Billing.Feature.Props.enabled?(@site)}>
- <%= live_render(@conn, PlausibleWeb.Live.PropsSettings,
+ {live_render(@conn, PlausibleWeb.Live.PropsSettings,
id: "props-form",
session: %{"site_id" => @site.id, "domain" => @site.domain}
- ) %>
+ )}
</div>
</.tile>
</.settings_tiles>
diff --git a/lib/plausible_web/templates/site/settings_search_console.html.heex b/lib/plausible_web/templates/site/settings_search_console.html.heex
index be7c898ff9..465925d99f 100644
--- a/lib/plausible_web/templates/site/settings_search_console.html.heex
+++ b/lib/plausible_web/templates/site/settings_search_console.html.heex
@@ -29,7 +29,7 @@
<% {:ok, domains} -> %>
<%= if @site.google_auth.property && !(@site.google_auth.property in domains) do %>
<.notice class="mt-4 mb-4">
- Your Google account does not have access to your currently configured property, <%= @site.google_auth.property %>. Please select a verified property from the list below.
+ Your Google account does not have access to your currently configured property, {@site.google_auth.property}. Please select a verified property from the list below.
</.notice>
<% else %>
<p class="text-sm mt-4">
@@ -117,7 +117,7 @@
</path>
</svg>
<p>
- An extra step is needed to set up your <%= Plausible.product_name() %> for the Google Search Console integration.
+ An extra step is needed to set up your {Plausible.product_name()} for the Google Search Console integration.
Find instructions
<.styled_link href="https://github.com/plausible/community-edition/wiki/google-integration">
here
diff --git a/lib/plausible_web/templates/site/settings_shields.html.heex b/lib/plausible_web/templates/site/settings_shields.html.heex
index a96814822b..a38f41ec22 100644
--- a/lib/plausible_web/templates/site/settings_shields.html.heex
+++ b/lib/plausible_web/templates/site/settings_shields.html.heex
@@ -1,31 +1,31 @@
<%= case @shield do %>
<% "ip_addresses" -> %>
- <%= live_render(@conn, PlausibleWeb.Live.Shields.IPAddresses,
+ {live_render(@conn, PlausibleWeb.Live.Shields.IPAddresses,
session: %{
"site_id" => @site.id,
"domain" => @site.domain,
"remote_ip" => PlausibleWeb.RemoteIP.get(@conn)
}
- ) %>
+ )}
<% "countries" -> %>
- <%= live_render(@conn, PlausibleWeb.Live.Shields.Countries,
+ {live_render(@conn, PlausibleWeb.Live.Shields.Countries,
session: %{
"site_id" => @site.id,
"domain" => @site.domain
}
- ) %>
+ )}
<% "pages" -> %>
- <%= live_render(@conn, PlausibleWeb.Live.Shields.Pages,
+ {live_render(@conn, PlausibleWeb.Live.Shields.Pages,
session: %{
"site_id" => @site.id,
"domain" => @site.domain
}
- ) %>
+ )}
<% "hostnames" -> %>
- <%= live_render(@conn, PlausibleWeb.Live.Shields.Hostnames,
+ {live_render(@conn, PlausibleWeb.Live.Shields.Hostnames,
session: %{
"site_id" => @site.id,
"domain" => @site.domain
}
- ) %>
+ )}
<% end %>
diff --git a/lib/plausible_web/templates/site/settings_visibility.html.heex b/lib/plausible_web/templates/site/settings_visibility.html.heex
index c6772e3253..85ab7d79d1 100644
--- a/lib/plausible_web/templates/site/settings_visibility.html.heex
+++ b/lib/plausible_web/templates/site/settings_visibility.html.heex
@@ -21,7 +21,7 @@
class="text-indigo-500"
href={Routes.stats_path(@conn, :stats, @site.domain, [])}
>
- <%= PlausibleWeb.StatsView.pretty_stats_url(@site) %>
+ {PlausibleWeb.StatsView.pretty_stats_url(@site)}
</.unstyled_link>
</.toggle_submit>
</.form>
@@ -53,7 +53,7 @@
</:thead>
<:tbody :let={link}>
<.td truncate hide_on_mobile>
- <%= link.name %>
+ {link.name}
<Heroicons.lock_closed :if={link.password_hash} class="w-6 h-6 feather ml-2" />
<Heroicons.lock_open :if={!link.password_hash} class="w-6 h-6 feather ml-2" />
</.td>
diff --git a/lib/plausible_web/templates/stats/shared_link_password.html.heex b/lib/plausible_web/templates/stats/shared_link_password.html.heex
index c0935bdfc3..a389994d45 100644
--- a/lib/plausible_web/templates/stats/shared_link_password.html.heex
+++ b/lib/plausible_web/templates/stats/shared_link_password.html.heex
@@ -8,7 +8,7 @@
<.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>
+ <div class="text-red-500 text-xs italic mt-4">{@conn.assigns[:error]}</div>
<% end %>
</div>
diff --git a/lib/plausible_web/templates/stats/site_locked.html.heex b/lib/plausible_web/templates/stats/site_locked.html.heex
index 3a10fb1569..40fb38ab49 100644
--- a/lib/plausible_web/templates/stats/site_locked.html.heex
+++ b/lib/plausible_web/templates/stats/site_locked.html.heex
@@ -44,14 +44,14 @@
<div class="mt-3 text-gray-600 dark:text-gray-300 text-center">
<p>
This dashboard is currently locked and cannot be accessed. The site owner
- <b><%= @site.owner.email %></b>
+ <b>{@site.owner.email}</b>
must upgrade their subscription plan in order to
unlock the stats.
</p>
<div class="mt-6 text-sm text-gray-500">
<p>Want to pay for this site with the account you're logged in with?</p>
<p class="mt-1">
- Contact <%= @site.owner.email %> and ask them to
+ Contact {@site.owner.email} and ask them to
<.styled_link href="https://plausible.io/docs/transfer-ownership" new_tab={true}>
transfer the ownership
</.styled_link>
diff --git a/lib/plausible_web/templates/unsubscribe/success.html.heex b/lib/plausible_web/templates/unsubscribe/success.html.heex
index c87f766169..f8a93f2921 100644
--- a/lib/plausible_web/templates/unsubscribe/success.html.heex
+++ b/lib/plausible_web/templates/unsubscribe/success.html.heex
@@ -4,6 +4,6 @@
</:title>
<:subtitle>
- You will no longer receive a <%= @interval %> analytics report for <%= @site.domain %>
+ You will no longer receive a {@interval} analytics report for {@site.domain}
</:subtitle>
</.focus_box>
diff --git a/lib/plausible_web/views/error_helpers.ex b/lib/plausible_web/views/error_helpers.ex
deleted file mode 100644
index 3c438316bc..0000000000
--- a/lib/plausible_web/views/error_helpers.ex
+++ /dev/null
@@ -1,34 +0,0 @@
-defmodule PlausibleWeb.ErrorHelpers do
- use Phoenix.HTML
-
- def error_tag(map_or_form, field, opts \\ [])
-
- def error_tag(%{errors: errors}, field, opts) do
- error_messages = Keyword.get_values(errors, field)
-
- error_messages =
- if Keyword.get(opts, :only_first?) do
- Enum.take(error_messages, 1)
- else
- error_messages
- end
-
- Enum.map(error_messages, fn error ->
- content_tag(:div, translate_error(error), class: "mt-2 text-sm text-red-500")
- end)
- end
-
- def error_tag(assigns, field, _opts) when is_map(assigns) do
- error = assigns[field]
-
- if error do
- content_tag(:div, error, class: "mt-2 text-sm text-red-500")
- end
- end
-
- def translate_error({msg, opts}) do
- Enum.reduce(opts, msg, fn {key, value}, acc ->
- String.replace(acc, "%{#{key}}", fn _ -> to_string(value) end)
- end)
- end
-end
diff --git a/mix.exs b/mix.exs
index bff10a52e8..1cc6fe0dfe 100644
--- a/mix.exs
+++ b/mix.exs
@@ -83,7 +83,7 @@ defmodule Plausible.MixProject do
{:ex_machina, "~> 2.3", only: [:dev, :test, :ce_dev, :ce_test]},
{:excoveralls, "~> 0.10", only: :test},
{:finch, "~> 0.17.0"},
- {:floki, "~> 0.35.0"},
+ {:floki, "~> 0.36"},
{:fun_with_flags, "~> 1.11.0"},
{:fun_with_flags_ui, "~> 1.0"},
{:locus, "~> 2.3"},
@@ -105,11 +105,11 @@ defmodule Plausible.MixProject do
{:opentelemetry_oban, "~> 1.0.0"},
{:phoenix, "~> 1.7.0"},
{:phoenix_view, "~> 2.0"},
- {:phoenix_ecto, "~> 4.0"},
- {:phoenix_html, "~> 3.3", override: true},
+ {:phoenix_ecto, "~> 4.5"},
+ {:phoenix_html, "~> 4.1"},
{:phoenix_live_reload, "~> 1.2", only: [:dev, :ce_dev]},
{:phoenix_pubsub, "~> 2.0"},
- {:phoenix_live_view, "~> 0.18"},
+ {:phoenix_live_view, "~> 1.0"},
{:php_serializer, "~> 2.0"},
{:plug, "~> 1.13", override: true},
{:plug_cowboy, "~> 2.3"},
@@ -147,7 +147,8 @@ defmodule Plausible.MixProject do
{:ex_json_schema, "~> 0.10.2"},
{:odgn_json_pointer, "~> 3.0.1"},
{:phoenix_bakery, "~> 0.1.2", only: [:ce, :ce_dev, :ce_test]},
- {:site_encrypt, github: "sasa1977/site_encrypt", only: [:ce, :ce_dev, :ce_test]}
+ {:site_encrypt, github: "sasa1977/site_encrypt", only: [:ce, :ce_dev, :ce_test]},
+ {:phoenix_storybook, "~> 0.8"}
]
end
@@ -161,9 +162,15 @@ defmodule Plausible.MixProject do
"assets.typecheck": ["cmd npm --prefix assets run typecheck"],
"assets.build": [
"tailwind default",
+ "tailwind storybook",
"esbuild default"
],
- "assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"]
+ "assets.deploy": [
+ "tailwind default --minify",
+ "tailwind storybook --minify",
+ "esbuild default --minify",
+ "phx.digest"
+ ]
]
end
diff --git a/mix.lock b/mix.lock
index 59456e4ff9..244b4b7da1 100644
--- a/mix.lock
+++ b/mix.lock
@@ -7,7 +7,7 @@
"bcrypt_elixir": {:hex, :bcrypt_elixir, "3.1.0", "0b110a9a6c619b19a7f73fa3004aa11d6e719a67e672d1633dc36b6b2290a0f7", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "2ad2acb5a8bc049e8d5aa267802631912bb80d5f4110a178ae7999e69dca1bf7"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"bypass": {:hex, :bypass, "2.1.0", "909782781bf8e20ee86a9cabde36b259d44af8b9f38756173e8f5e2e1fabb9b1", [:mix], [{:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:ranch, "~> 1.3", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "d9b5df8fa5b7a6efa08384e9bbecfe4ce61c77d28a4282f79e02f1ef78d96b80"},
- "castore": {:hex, :castore, "1.0.9", "5cc77474afadf02c7c017823f460a17daa7908e991b0cc917febc90e466a375c", [:mix], [], "hexpm", "5ea956504f1ba6f2b4eb707061d8e17870de2bee95fb59d512872c2ef06925e7"},
+ "castore": {:hex, :castore, "1.0.11", "4bbd584741601eb658007339ea730b082cc61f3554cf2e8f39bf693a11b49073", [:mix], [], "hexpm", "e03990b4db988df56262852f20de0f659871c35154691427a5047f4967a16a62"},
"certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"},
"ch": {:hex, :ch, "0.2.9", "8273e27b741f2a31410c0c6291700abfbd262d0d9bd70b51c0deef624d6079b8", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: false]}], "hexpm", "889a12ad2dae69a6136b7109cbc73ba4f0d719f48d1a4c567ad3f95ad752a9c9"},
"chatterbox": {:hex, :ts_chatterbox, "0.15.1", "5cac4d15dd7ad61fc3c4415ce4826fc563d4643dee897a558ec4ea0b1c835c9c", [:rebar3], [{:hpack, "~> 0.3.0", [hex: :hpack_erl, repo: "hexpm", optional: false]}], "hexpm", "4f75b91451338bc0da5f52f3480fa6ef6e3a2aeecfc33686d6b3d0a0948f31aa"},
@@ -25,12 +25,13 @@
"credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"},
"ctx": {:hex, :ctx, "0.6.0", "8ff88b70e6400c4df90142e7f130625b82086077a45364a78d208ed3ed53c7fe", [:rebar3], [], "hexpm", "a14ed2d1b67723dbebbe423b28d7615eb0bdcba6ff28f2d1f1b0a7e1d4aa5fc2"},
"db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"},
- "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
+ "decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"digital_token": {:hex, :digital_token, "0.6.0", "13e6de581f0b1f6c686f7c7d12ab11a84a7b22fa79adeb4b50eec1a2d278d258", [:mix], [{:cldr_utils, "~> 2.17", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "2455d626e7c61a128b02a4a8caddb092548c3eb613ac6f6a85e4cbb6caddc4d1"},
"double": {:hex, :double, "0.8.2", "8e1cfcccdaef76c18846bc08e555555a2a699b806fa207b6468572a60513cc6a", [:mix], [], "hexpm", "90287642b2ec86125e0457aaba2ab0e80f7d7050cc80a0cef733e59bd70aa67c"},
- "earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
- "ecto": {:hex, :ecto, "3.12.4", "267c94d9f2969e6acc4dd5e3e3af5b05cdae89a4d549925f3008b2b7eb0b93c3", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ef04e4101688a67d061e1b10d7bc1fbf00d1d13c17eef08b71d070ff9188f747"},
+ "earmark": {:hex, :earmark, "1.4.47", "7e7596b84fe4ebeb8751e14cbaeaf4d7a0237708f2ce43630cfd9065551f94ca", [:mix], [], "hexpm", "3e96bebea2c2d95f3b346a7ff22285bc68a99fbabdad9b655aa9c6be06c698f8"},
+ "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
+ "ecto": {:hex, :ecto, "3.12.5", "4a312960ce612e17337e7cefcf9be45b95a3be6b36b6f94dfb3d8c361d631866", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6eb18e80bef8bb57e17f5a7f068a1719fbda384d40fc37acb8eb8aeca493b6ea"},
"ecto_ch": {:hex, :ecto_ch, "0.5.0", "f65dcc3b7b0c85726259471a91c34045852ce8b8817ea29becb3afdb28b3e987", [:mix], [{:ch, "~> 0.2.7", [hex: :ch, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.12", [hex: :ecto_sql, repo: "hexpm", optional: false]}], "hexpm", "c8bb1c75e20983f16b285d7df21825ce2e3ba15d690bab930ea4133568ae2136"},
"ecto_network": {:hex, :ecto_network, "1.5.0", "a930c910975e7a91237b858ebf0f4ad7b2aae32fa846275aa203cb858459ec73", [:mix], [{:ecto_sql, ">= 3.0.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 0.0.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:postgrex, ">= 0.14.0", [hex: :postgrex, repo: "hexpm", optional: false]}], "hexpm", "4d614434ae3e6d373a2f693d56aafaa3f3349714668ffd6d24e760caf578aa2f"},
"ecto_sql": {:hex, :ecto_sql, "3.12.1", "c0d0d60e85d9ff4631f12bafa454bc392ce8b9ec83531a412c12a0d415a3a4d0", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aff5b958a899762c5f09028c847569f7dfb9cc9d63bdb8133bff8a5546de6bf5"},
@@ -44,7 +45,7 @@
"ex_cldr": {:hex, :ex_cldr, "2.39.2", "4a3a77797da8f900369822ea9353adfa035a5bbbbfff09b2d3d1b6fa461768e3", [:mix], [{:cldr_utils, "~> 2.25", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.19", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: true]}], "hexpm", "02fd8913ef28d1b2a4190fd8016c2dec1f2291c9ce56c17d7649848c0261a6eb"},
"ex_cldr_currencies": {:hex, :ex_cldr_currencies, "2.16.1", "29317f533cb5ec046d04523256cca4090291e9157028f28731395149b06ff8b2", [:mix], [{:ex_cldr, "~> 2.38", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "095d5e973bf0ee066dd1153990d10cb6fa6d8ff0e028295bdce7a7821c70a0e4"},
"ex_cldr_numbers": {:hex, :ex_cldr_numbers, "2.33.1", "49dc6e77e6d9ad22660aaa2480a7408ad3aedfbe517e4e83e5fe3a7bf5345770", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:digital_token, "~> 0.3 or ~> 1.0", [hex: :digital_token, repo: "hexpm", optional: false]}, {:ex_cldr, "~> 2.38", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_currencies, "~> 2.16", [hex: :ex_cldr_currencies, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "c003bfaa3fdee6bab5195f128b94038c2ce1cf4879a759eef431dd075d9a5dac"},
- "ex_doc": {:hex, :ex_doc, "0.31.1", "8a2355ac42b1cc7b2379da9e40243f2670143721dd50748bf6c3b1184dae2089", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "3178c3a407c557d8343479e1ff117a96fd31bafe52a039079593fb0524ef61b0"},
+ "ex_doc": {:hex, :ex_doc, "0.35.1", "de804c590d3df2d9d5b8aec77d758b00c814b356119b3d4455e4b8a8687aecaf", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "2121c6402c8d44b05622677b761371a759143b958c6c19f6558ff64d0aed40df"},
"ex_json_logger": {:hex, :ex_json_logger, "1.4.0", "ad1dcc1cfe6940ee1d9d489b20757c89769626ce34c4957548d6fbe155cd96f1", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "7548a1ecba290746e06214d2b3d8783c76760c779a8903a8e44bfd23a7340444"},
"ex_json_schema": {:hex, :ex_json_schema, "0.10.2", "7c4b8c1481fdeb1741e2ce66223976edfb9bccebc8014f6aec35d4efe964fb71", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "37f43be60f8407659d4d0155a7e45e7f406dab1f827051d3d35858a709baf6a6"},
"ex_machina": {:hex, :ex_machina, "2.7.0", "b792cc3127fd0680fecdb6299235b4727a4944a09ff0fa904cc639272cd92dc7", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "419aa7a39bde11894c87a615c4ecaa52d8f107bbdd81d810465186f783245bf8"},
@@ -53,7 +54,7 @@
"expo": {:hex, :expo, "0.5.2", "beba786aab8e3c5431813d7a44b828e7b922bfa431d6bfbada0904535342efe2", [:mix], [], "hexpm", "8c9bfa06ca017c9cb4020fabe980bc7fdb1aaec059fd004c2ab3bff03b1c599c"},
"file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"},
"finch": {:hex, :finch, "0.17.0", "17d06e1d44d891d20dbd437335eebe844e2426a0cd7e3a3e220b461127c73f70", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6 or ~> 1.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8d014a661bb6a437263d4b5abf0bcbd3cf0deb26b1e8596f2a271d22e48934c7"},
- "floki": {:hex, :floki, "0.35.2", "87f8c75ed8654b9635b311774308b2760b47e9a579dabf2e4d5f1e1d42c39e0b", [:mix], [], "hexpm", "6b05289a8e9eac475f644f09c2e4ba7e19201fd002b89c28c1293e7bd16773d9"},
+ "floki": {:hex, :floki, "0.37.0", "b83e0280bbc6372f2a403b2848013650b16640cd2470aea6701f0632223d719e", [:mix], [], "hexpm", "516a0c15a69f78c47dc8e0b9b3724b29608aa6619379f91b1ffa47109b5d0dd3"},
"fun_with_flags": {:hex, :fun_with_flags, "1.11.0", "a9019d0300e9755c53111cf5b2aba640d7f0de2a8a03a0bd0c593e943c3e9ec5", [:mix], [{:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: true]}, {:redix, "~> 1.0", [hex: :redix, repo: "hexpm", optional: true]}], "hexpm", "448ec640cd1ade4728979ae5b3e7592b0fc8b0f99cf40785d048515c27d09743"},
"fun_with_flags_ui": {:hex, :fun_with_flags_ui, "1.0.0", "d764a4d1cc1233bdbb18dfb416a6ef96d0ecf4a5dc5a0201f7aa0b13cf2e7802", [:mix], [{:cowboy, ">= 2.0.0", [hex: :cowboy, repo: "hexpm", optional: true]}, {:fun_with_flags, "~> 1.11", [hex: :fun_with_flags, repo: "hexpm", optional: false]}, {:plug, "~> 1.12", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 2.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "b0c145894c00d65d5dc20ee5b1f18457985d1fd0b87866f0b41894d5979e55e0"},
"gen_cycle": {:hex, :gen_cycle, "1.0.4", "2315199f1256116328fad6a9d4371c2fb0bc39c7f5111b88d2de582300c931cc", [:rebar3], [], "hexpm", "67817e31b352bb00715f80a5571b3c069e26e994b2ebafa376acf76a2d0f66d8"},
@@ -71,13 +72,15 @@
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"joken": {:hex, :joken, "2.6.0", "b9dd9b6d52e3e6fcb6c65e151ad38bf4bc286382b5b6f97079c47ade6b1bcc6a", [:mix], [{:jose, "~> 1.11.5", [hex: :jose, repo: "hexpm", optional: false]}], "hexpm", "5a95b05a71cd0b54abd35378aeb1d487a23a52c324fa7efdffc512b655b5aaa7"},
"jose": {:hex, :jose, "1.11.6", "613fda82552128aa6fb804682e3a616f4bc15565a048dabd05b1ebd5827ed965", [:mix, :rebar3], [], "hexpm", "6275cb75504f9c1e60eeacb771adfeee4905a9e182103aa59b53fed651ff9738"},
- "kaffy": {:hex, :kaffy, "0.10.2", "72e807c525323bd0cbc3ac0c127b7bde61caffdc576fb6554964d3fe6a2a6100", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0.2", [hex: :phoenix_view, repo: "hexpm", optional: false]}], "hexpm", "651cad5f3bcc91510a671c13c7a273b8b8195fdf2d809208708baecbb77300bf"},
+ "kaffy": {:hex, :kaffy, "0.10.3", "0056b31eac757ea10f012c9fd280976f0c301efe2b7ffb66c8041d5faa2479d9", [:mix], [{:decimal, "~> 2.2", [hex: :decimal, repo: "hexpm", optional: true]}, {:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.7.10", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_html_helpers, "~> 1.0", [hex: :phoenix_html_helpers, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0.2", [hex: :phoenix_view, repo: "hexpm", optional: false]}], "hexpm", "4bb65bd558c4495f9dda7f6ce2fe67cb25e2e299983fec1c577209c782ccab8e"},
"location": {:git, "https://github.com/plausible/location.git", "a89bf79985c3c3d0830477ae587001156a646ce8", []},
"locus": {:hex, :locus, "2.3.6", "c9f53fd5df872fca66a54dc0aa2f8b2d3640388e56a0c39a741be0df6d8854bf", [:rebar3], [{:tls_certificate_check, "~> 1.9", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "6087aa9a69673e7011837fb4b3d7f756560adde76892c32f5f93904ee30064e2"},
"mail": {:hex, :mail, "0.3.1", "cb0a14e4ed8904e4e5a08214e686ccf6f9099346885db17d8c309381f865cc5c", [:mix], [], "hexpm", "1db701e89865c1d5fa296b2b57b1cd587587cca8d8a1a22892b35ef5a8e352a6"},
- "makeup": {:hex, :makeup, "1.1.1", "fa0bc768698053b2b3869fa8a62616501ff9d11a562f3ce39580d60860c3a55e", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5dc62fbdd0de44de194898b6710692490be74baa02d9d108bc29f007783b0b48"},
- "makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
- "makeup_erlang": {:hex, :makeup_erlang, "0.1.3", "d684f4bac8690e70b06eb52dad65d26de2eefa44cd19d64a8095e1417df7c8fd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "b78dc853d2e670ff6390b605d807263bf606da3c82be37f9d7f68635bd886fc9"},
+ "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
+ "makeup_eex": {:hex, :makeup_eex, "1.0.0", "436d4c00204c250b17a775d64e197798aaf374627e6a4f2d3fd3074a8db61db4", [:mix], [{:makeup, "~> 1.2.1 or ~> 1.3", [hex: :makeup, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_html, "~> 0.1.0 or ~> 1.0", [hex: :makeup_html, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "3bb699bc519e4f509f1bf8a2e0ba0e08429edf3580053cd31a4f9c1bc5da86c8"},
+ "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
+ "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},
+ "makeup_html": {:hex, :makeup_html, "0.1.2", "19d4050c0978a4f1618ffe43054c0049f91fe5feeb9ae8d845b5dc79c6008ae5", [:mix], [{:makeup, "~> 1.2", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "b7fb9afedd617d167e6644a0430e49c1279764bfd3153da716d4d2459b0998c5"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},
"mimerl": {:hex, :mimerl, "1.3.0", "d0cd9fc04b9061f82490f6581e0128379830e78535e017f7780f37fea7545726", [:rebar3], [], "hexpm", "a1e15a50d1887217de95f0b9b0793e32853f7c258a5cd227650889b38839fe9d"},
@@ -110,13 +113,15 @@
"paginator": {:git, "https://github.com/duffelhq/paginator.git", "3508d6ad77a95ac1faf15d5fd7f959fab3e17da2", []},
"parent": {:hex, :parent, "0.12.1", "495c4386f06de0df492e0a7a7199c10323a55e9e933b27222060dd86dccd6d62", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2ab589ef1f37bfcedbfb5ecfbab93354972fb7391201b8907a866dadd20b39d1"},
"parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"},
- "phoenix": {:hex, :phoenix, "1.7.14", "a7d0b3f1bc95987044ddada111e77bd7f75646a08518942c72a8440278ae7825", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "c7859bc56cc5dfef19ecfc240775dae358cbaa530231118a9e014df392ace61a"},
+ "phoenix": {:hex, :phoenix, "1.7.18", "5310c21443514be44ed93c422e15870aef254cf1b3619e4f91538e7529d2b2e4", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "1797fcc82108442a66f2c77a643a62980f342bfeb63d6c9a515ab8294870004e"},
"phoenix_bakery": {:hex, :phoenix_bakery, "0.1.2", "ca57673caea1a98f1cc763f94032796a015774d27eaa3ce5feef172195470452", [:mix], [{:brotli, "~> 0.3.0", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "45cc8cecc5c3002b922447c16389761718c07c360432328b04680034e893ea5b"},
- "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.3", "86e9878f833829c3f66da03d75254c155d91d72a201eb56ae83482328dc7ca93", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "d36c401206f3011fefd63d04e8ef626ec8791975d9d107f9a0817d426f61ac07"},
- "phoenix_html": {:hex, :phoenix_html, "3.3.4", "42a09fc443bbc1da37e372a5c8e6755d046f22b9b11343bf885067357da21cb3", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "0249d3abec3714aff3415e7ee3d9786cb325be3151e6c4b3021502c585bf53fb"},
+ "phoenix_ecto": {:hex, :phoenix_ecto, "4.6.3", "f686701b0499a07f2e3b122d84d52ff8a31f5def386e03706c916f6feddf69ef", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.1", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "909502956916a657a197f94cc1206d9a65247538de8a5e186f7537c895d95764"},
+ "phoenix_html": {:hex, :phoenix_html, "4.2.0", "83a4d351b66f472ebcce242e4ae48af1b781866f00ef0eb34c15030d4e2069ac", [:mix], [], "hexpm", "9713b3f238d07043583a94296cc4bbdceacd3b3a6c74667f4df13971e7866ec8"},
+ "phoenix_html_helpers": {:hex, :phoenix_html_helpers, "1.0.1", "7eed85c52eff80a179391036931791ee5d2f713d76a81d0d2c6ebafe1e11e5ec", [:mix], [{:phoenix_html, "~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "cffd2385d1fa4f78b04432df69ab8da63dc5cf63e07b713a4dcf36a3740e3090"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.5.3", "f2161c207fda0e4fb55165f650f7f8db23f02b29e3bff00ff7ef161d6ac1f09d", [:mix], [{:file_system, "~> 0.3 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "b4ec9cd73cb01ff1bd1cac92e045d13e7030330b74164297d1aee3907b54803c"},
- "phoenix_live_view": {:hex, :phoenix_live_view, "0.20.3", "8b6406bc0a451f295407d7acff7f234a6314be5bbe0b3f90ed82b07f50049878", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a8e4385e05618b424779f894ed2df97d3c7518b7285fcd11979077ae6226466b"},
+ "phoenix_live_view": {:hex, :phoenix_live_view, "1.0.2", "e7b1dd68c86326e2c45cc81da41e332cc8aa7228a7161e2c811dcd7f1dd14db1", [:mix], [{:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8a40265b0cd7d3a35f136dfa3cc048e3b198fc3718763411a78c323a44ebebee"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"},
+ "phoenix_storybook": {:hex, :phoenix_storybook, "0.8.0", "10a78f1ae3885ba2ca75160390f1fd6d9cec96ee9da722274a7841c259e5931d", [:mix], [{:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: true]}, {:makeup_eex, "~> 1.0.0", [hex: :makeup_eex, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html_helpers, "~> 1.0", [hex: :phoenix_html_helpers, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}], "hexpm", "a955496db61bb43e0a64259464c01cbcfc043842ad11af9e6c3dfeb6068d5480"},
"phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"},
"phoenix_view": {:hex, :phoenix_view, "2.0.4", "b45c9d9cf15b3a1af5fb555c674b525391b6a1fe975f040fb4d913397b31abf4", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "4e992022ce14f31fe57335db27a28154afcc94e9983266835bb3040243eb620b"},
"php_serializer": {:hex, :php_serializer, "2.0.0", "b43f31aca22ed7321f32da2b94fe2ddf9b6739a965cb51541969119e572e821d", [:mix], [], "hexpm", "61e402e99d9062c0225a3f4fcf7e43b4cba1b8654944c0e7c139c3ca9de481da"},
@@ -151,7 +156,7 @@
"ua_inspector": {:git, "https://github.com/plausible/ua_inspector.git", "25cba4c910e80d7c34bbb1bbb939372260d088e8", [branch: "sanitize-pre"]},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
- "websock_adapter": {:hex, :websock_adapter, "0.5.7", "65fa74042530064ef0570b75b43f5c49bb8b235d6515671b3d250022cb8a1f9e", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "d0f478ee64deddfec64b800673fd6e0c8888b079d9f3444dd96d2a98383bdbd1"},
+ "websock_adapter": {:hex, :websock_adapter, "0.5.8", "3b97dc94e407e2d1fc666b2fb9acf6be81a1798a2602294aac000260a7c4a47d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "315b9a1865552212b5f35140ad194e67ce31af45bcee443d4ecb96b5fd3f3782"},
"x509": {:hex, :x509, "0.8.9", "03c47e507171507d3d3028d802f48dd575206af2ef00f764a900789dfbe17476", [:mix], [], "hexpm", "ea3fb16a870a199cb2c45908a2c3e89cc934f0434173dc0c828136f878f11661"},
"yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"},
"zstream": {:hex, :zstream, "0.6.4", "169ce887a443d4163085ee682ab1b0ad38db8fa45e843927b9b431a92f4b7d9e", [:mix], [], "hexpm", "acc6c35b6db9eb2cfe8b85e972cb9dc1b730f8efeb76c5bbe871216fe639d9a1"},
diff --git a/storybook/_root.index.exs b/storybook/_root.index.exs
new file mode 100644
index 0000000000..460c0dbdcc
--- /dev/null
+++ b/storybook/_root.index.exs
@@ -0,0 +1,8 @@
+defmodule Storybook.Root do
+ # See https://hexdocs.pm/phoenix_storybook/PhoenixStorybook.Index.html for full index
+ # documentation.
+
+ use PhoenixStorybook.Index
+
+ def folder_name, do: "Plausible Components"
+end
diff --git a/storybook/dropdown.story.exs b/storybook/dropdown.story.exs
new file mode 100644
index 0000000000..6a3bbc0193
--- /dev/null
+++ b/storybook/dropdown.story.exs
@@ -0,0 +1,31 @@
+defmodule PlausibleWeb.Storybook.Dropdown do
+ @moduledoc false
+ use PhoenixStorybook.Story, :component
+
+ # required
+ def function, do: &PlausibleWeb.Components.Generic.dropdown/1
+ def imports, do: [{PlausibleWeb.Components.Generic, dropdown_item: 1, dropdown_divider: 1}]
+
+ def attributes, do: []
+ def slots, do: []
+
+ def variations do
+ [
+ %Variation{
+ id: :default,
+ description: "Default dropdown",
+ slots: [
+ ~s|
+<:button class="bg-transparent text-gray-800 dark:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700 focus-visible:outline-gray-100 whitespace-nowrap truncate inline-flex items-center gap-x-2 font-medium rounded-md px-3.5 py-2.5 text-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2">Click me</:button>
+<:menu>
+ <.dropdown_item href="#">Option A</.dropdown_item>
+ <.dropdown_item href="#">Option B</.dropdown_item>
+ <.dropdown_divider />
+ <.dropdown_item href="#" class="text-red-600 dark:text-red-600">Nuclear option</.dropdown_item>
+</:menu>
+|
+ ]
+ }
+ ]
+ end
+end
diff --git a/storybook/input.story.exs b/storybook/input.story.exs
new file mode 100644
index 0000000000..aacad78fbc
--- /dev/null
+++ b/storybook/input.story.exs
@@ -0,0 +1,47 @@
+defmodule PlausibleWeb.Storybook.Input do
+ @moduledoc false
+ use PhoenixStorybook.Story, :component
+
+ # required
+ def function, do: &PlausibleWeb.Live.Components.Form.input/1
+ # def imports, do: [{PlausibleWeb.Components.Generic, dropdown_item: 1, dropdown_divider: 1}]
+
+ def attributes, do: []
+ def slots, do: []
+
+ def variations do
+ [
+ %Variation{
+ id: :default,
+ description: "Basic input",
+ attributes: %{
+ name: "user[name]",
+ value: "",
+ label: "Full name"
+ }
+ },
+ %Variation{
+ id: :errors,
+ description: "With help text and error",
+ attributes: %{
+ name: "user[name]",
+ value: "",
+ label: "Email",
+ help_text: "Get ready for spam!",
+ errors: ["Cannot be blank"]
+ }
+ },
+ %Variation{
+ id: :select,
+ description: "Select input",
+ attributes: %{
+ name: "user[color_mode]",
+ value: "System",
+ label: "Color mode",
+ type: "select",
+ options: ["System", "Light", "Dark"]
+ }
+ }
+ ]
+ end
+end
diff --git a/test/plausible_web/components/billing/notice_test.exs b/test/plausible_web/components/billing/notice_test.exs
index 822ec10108..8484839309 100644
--- a/test/plausible_web/components/billing/notice_test.exs
+++ b/test/plausible_web/components/billing/notice_test.exs
@@ -1,7 +1,7 @@
defmodule PlausibleWeb.Components.Billing.NoticeTest do
use Plausible.DataCase
use Plausible.Teams.Test
- import Plausible.LiveViewTest, only: [render_component: 2]
+ import Phoenix.LiveViewTest, only: [render_component: 2]
alias PlausibleWeb.Components.Billing.Notice
test "premium_feature/1 does not render a notice when user is on trial" do
diff --git a/test/plausible_web/components/flow_progress_test.exs b/test/plausible_web/components/flow_progress_test.exs
index 277a984776..5739d98f67 100644
--- a/test/plausible_web/components/flow_progress_test.exs
+++ b/test/plausible_web/components/flow_progress_test.exs
@@ -1,7 +1,7 @@
defmodule PlausibleWeb.Components.FlowProgressTest do
use Plausible.DataCase
- import Plausible.LiveViewTest, only: [render_component: 2]
+ import Phoenix.LiveViewTest, only: [render_component: 2]
import Plausible.Test.Support.HTML
alias PlausibleWeb.Components.FlowProgress
diff --git a/test/plausible_web/controllers/settings_controller_test.exs b/test/plausible_web/controllers/settings_controller_test.exs
index 0f592fffee..162b7526bf 100644
--- a/test/plausible_web/controllers/settings_controller_test.exs
+++ b/test/plausible_web/controllers/settings_controller_test.exs
@@ -830,7 +830,11 @@ defmodule PlausibleWeb.SettingsControllerTest do
test "fails to update with no input", %{conn: conn} do
conn =
post(conn, Routes.settings_path(conn, :update_password), %{
- "user" => %{}
+ "user" => %{
+ "password" => "",
+ "old_password" => "",
+ "password_confirmation" => ""
+ }
})
assert html = html_response(conn, 200)
@@ -893,7 +897,7 @@ defmodule PlausibleWeb.SettingsControllerTest do
end
test "renders form with error on no fields filled", %{conn: conn} do
- conn = post(conn, Routes.settings_path(conn, :update_email), %{"user" => %{}})
+ conn = post(conn, Routes.settings_path(conn, :update_email), %{"user" => %{"email" => ""}})
assert text(html_response(conn, 200)) =~ "can't be blank"
end
diff --git a/test/plausible_web/controllers/site_controller_test.exs b/test/plausible_web/controllers/site_controller_test.exs
index ba88a05bd8..f79cce7ec8 100644
--- a/test/plausible_web/controllers/site_controller_test.exs
+++ b/test/plausible_web/controllers/site_controller_test.exs
@@ -378,6 +378,7 @@ defmodule PlausibleWeb.SiteControllerTest do
conn =
post(conn, "/sites", %{
"site" => %{
+ "domain" => "",
"timezone" => "Europe/London"
}
})
diff --git a/test/plausible_web/live/components/combo_box_test.exs b/test/plausible_web/live/components/combo_box_test.exs
index 9e0841da34..d54872b69b 100644
--- a/test/plausible_web/live/components/combo_box_test.exs
+++ b/test/plausible_web/live/components/combo_box_test.exs
@@ -1,7 +1,6 @@
defmodule PlausibleWeb.Live.Components.ComboBoxTest do
use PlausibleWeb.ConnCase, async: true
- import Phoenix.LiveViewTest, except: [render_component: 2]
- import Plausible.LiveViewTest, only: [render_component: 2]
+ import Phoenix.LiveViewTest
import Plausible.Test.Support.HTML
alias PlausibleWeb.Live.Components.ComboBox
diff --git a/test/plausible_web/live/components/form_test.exs b/test/plausible_web/live/components/form_test.exs
index c344add904..53f8ef8913 100644
--- a/test/plausible_web/live/components/form_test.exs
+++ b/test/plausible_web/live/components/form_test.exs
@@ -1,6 +1,6 @@
defmodule PlausibleWeb.Live.Components.FormTest do
use PlausibleWeb.ConnCase, async: true
- import Plausible.LiveViewTest, only: [render_component: 2]
+ import Phoenix.LiveViewTest, only: [render_component: 2]
import Plausible.Test.Support.HTML
alias Plausible.Auth.User
diff --git a/test/plausible_web/live/components/verification_test.exs b/test/plausible_web/live/components/verification_test.exs
index 081781ad58..df71f84b4d 100644
--- a/test/plausible_web/live/components/verification_test.exs
+++ b/test/plausible_web/live/components/verification_test.exs
@@ -1,6 +1,6 @@
defmodule PlausibleWeb.Live.Components.VerificationTest do
use PlausibleWeb.ConnCase, async: true
- import Plausible.LiveViewTest, only: [render_component: 2]
+ import Phoenix.LiveViewTest, only: [render_component: 2]
import Plausible.Test.Support.HTML
@component PlausibleWeb.Live.Components.Verification
diff --git a/test/plausible_web/live/verification_test.exs b/test/plausible_web/live/verification_test.exs
index 4238b93ce9..2c61fbb9da 100644
--- a/test/plausible_web/live/verification_test.exs
+++ b/test/plausible_web/live/verification_test.exs
@@ -10,6 +10,7 @@ defmodule PlausibleWeb.Live.VerificationTest do
@retry_button ~s|a[phx-click="retry"]|
# @go_to_dashboard_button ~s|a[href$="?skip_to_dashboard=true"]|
@progress ~s|#progress-indicator p#progress|
+ @awaiting ~s|#progress-indicator p#awaiting|
@heading ~s|#progress-indicator h2|
describe "GET /:domain" do
@@ -66,7 +67,7 @@ defmodule PlausibleWeb.Live.VerificationTest do
html = render(lv)
{
- text_of_element(html, @progress) =~
+ text_of_element(html, @awaiting) =~
"Awaiting your first pageview",
html
}
@@ -99,7 +100,7 @@ defmodule PlausibleWeb.Live.VerificationTest do
html = render(lv)
- refute text_of_element(html, @progress) =~ "Awaiting your first pageview"
+ refute text_of_element(html, @awaiting) =~ "Awaiting your first pageview"
refute_redirected(lv, "http://localhost:8000/#{URI.encode_www_form(site.domain)}")
end
diff --git a/test/support/live_view_test_fix.ex b/test/support/live_view_test_fix.ex
deleted file mode 100644
index 2fba6e1858..0000000000
--- a/test/support/live_view_test_fix.ex
+++ /dev/null
@@ -1,42 +0,0 @@
-defmodule Plausible.LiveViewTest do
- @moduledoc """
- Temporary fix for `Phoenix.LiveViewTest.render_component/2` failing CI with warnings.
-
- This module can be removed once Plausible switches to `phoenix_live_view ~> 1.0.0`
- """
-
- @doc """
- Same as `Phoenix.LiveViewTest.render_component/2` but with backported fixes from
- https://github.com/phoenixframework/phoenix_live_view/commit/489e8de024e03976e9ae38138eec517fbd456d27
- """
- defmacro render_component(component, assigns \\ Macro.escape(%{}), opts \\ []) do
- endpoint = Module.get_attribute(__CALLER__.module, :endpoint)
-
- component =
- if is_atom(component) do
- quote do
- unquote(component).__live__()
- unquote(component)
- end
- else
- component
- end
-
- quote do
- Plausible.LiveViewTest.__render_component__(
- unquote(endpoint),
- unquote(component),
- unquote(assigns),
- unquote(opts)
- )
- end
- end
-
- def __render_component__(endpoint, component, assigns, opts) when is_atom(component) do
- Phoenix.LiveViewTest.__render_component__(endpoint, %{module: component}, assigns, opts)
- end
-
- def __render_component__(endpoint, component, assigns, opts) do
- Phoenix.LiveViewTest.__render_component__(endpoint, component, assigns, opts)
- end
-end