Skip to content

Commit 6d24ef0

Browse files
authored
Merge pull request #21 from coingaming/feat/live-view-10
feat: 🎸 live view 1.0
2 parents ca1670b + 05967c3 commit 6d24ef0

81 files changed

Lines changed: 443 additions & 449 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extra/lib/plausible_web/live/funnel_settings.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ defmodule PlausibleWeb.Live.FunnelSettings do
4343
<div id="funnel-settings-main">
4444
<.flash_messages flash={@flash} />
4545
<%= if @add_funnel? do %>
46-
<%= live_render(
46+
{live_render(
4747
@socket,
4848
PlausibleWeb.Live.FunnelSettings.Form,
4949
id: "funnels-form",
5050
session: %{
5151
"current_user_id" => @current_user_id,
5252
"domain" => @domain
5353
}
54-
) %>
54+
)}
5555
<% else %>
5656
<div :if={@goal_count >= Funnel.min_steps()}>
5757
<.live_component
@@ -64,11 +64,11 @@ defmodule PlausibleWeb.Live.FunnelSettings do
6464
6565
<div :if={@goal_count < Funnel.min_steps()}>
6666
<PlausibleWeb.Components.Generic.notice class="mt-4" title="Not enough goals">
67-
You need to define at least two goals to create a funnel. Go ahead and <%= link(
67+
You need to define at least two goals to create a funnel. Go ahead and {link(
6868
"add goals",
6969
to: PlausibleWeb.Router.Helpers.site_path(@socket, :settings_goals, @domain),
7070
class: "text-indigo-500 w-full text-center"
71-
) %> to proceed.
71+
)} to proceed.
7272
</PlausibleWeb.Components.Generic.notice>
7373
</div>
7474
<% end %>

extra/lib/plausible_web/live/funnel_settings/form.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do
121121
Last month conversion rate: <strong><%= List.last(@evaluation_result.steps).conversion_rate %></strong>%
122122
<% else %>
123123
<span class="text-red-600 text-sm">
124-
Choose minimum <%= Funnel.min_steps() %> steps to evaluate funnel.
124+
Choose minimum {Funnel.min_steps()} steps to evaluate funnel.
125125
</span>
126126
<% end %>
127127
</p>
@@ -196,11 +196,11 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do
196196
class="border-dotted border-b border-gray-400 "
197197
tooltip="Sample calculation for last month"
198198
>
199-
Entering Visitors: <strong><%= @result.entering_visitors %></strong>
199+
Entering Visitors: <strong>{@result.entering_visitors}</strong>
200200
</span>
201201
</span>
202202
<span :if={step && @at > 0}>
203-
Dropoff: <strong><%= Map.get(step, :dropoff_percentage) %>%</strong>
203+
Dropoff: <strong>{Map.get(step, :dropoff_percentage)}%</strong>
204204
</span>
205205
</span>
206206
"""

extra/lib/plausible_web/live/funnel_settings/list.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ defmodule PlausibleWeb.Live.FunnelSettings.List do
4949
<%= for funnel <- @funnels do %>
5050
<div class="border-b border-gray-300 dark:border-gray-500 py-3 flex justify-between">
5151
<span class="text-sm font-medium text-gray-900 dark:text-gray-100">
52-
<%= funnel.name %>
52+
{funnel.name}
5353
<span class="text-sm text-gray-400 font-normal block mt-1">
54-
<%= funnel.steps_count %>-step funnel
54+
{funnel.steps_count}-step funnel
5555
</span>
5656
</span>
5757
<button

lib/plausible_web/components/billing/billing.ex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ defmodule PlausibleWeb.Components.Billing do
116116
class="text-sm dark:text-gray-100"
117117
x-bind:class={"tab === '#{@tab}' ? 'text-indigo-600 dark:text-indigo-500 font-semibold' : 'font-medium'"}
118118
>
119-
<%= @name %>
119+
{@name}
120120
</span>
121121
<span class="flex text-xs text-gray-500 dark:text-gray-400">
122-
<%= if @disabled,
122+
{if @disabled,
123123
do: "Not available",
124-
else: PlausibleWeb.TextHelpers.format_date_range(@date_range) %>
124+
else: PlausibleWeb.TextHelpers.format_date_range(@date_range)}
125125
</span>
126126
</div>
127127
</button>
@@ -154,7 +154,7 @@ defmodule PlausibleWeb.Components.Billing do
154154
~H"""
155155
<table class="min-w-full text-gray-900 dark:text-gray-100" {@rest}>
156156
<tbody class="divide-y divide-gray-200 dark:divide-gray-600">
157-
<%= render_slot(@inner_block) %>
157+
{render_slot(@inner_block)}
158158
</tbody>
159159
</table>
160160
"""
@@ -170,11 +170,11 @@ defmodule PlausibleWeb.Components.Billing do
170170
~H"""
171171
<tr {@rest}>
172172
<td class={["py-4 pr-1 text-sm sm:whitespace-nowrap text-left", @pad && "pl-6"]}>
173-
<%= @title %>
173+
{@title}
174174
</td>
175175
<td class="py-4 text-sm sm:whitespace-nowrap text-right">
176-
<%= Cldr.Number.to_string!(@usage) %>
177-
<%= if is_number(@limit), do: "/ #{Cldr.Number.to_string!(@limit)}" %>
176+
{Cldr.Number.to_string!(@usage)}
177+
{if is_number(@limit), do: "/ #{Cldr.Number.to_string!(@limit)}"}
178178
</td>
179179
</tr>
180180
"""
@@ -189,7 +189,7 @@ defmodule PlausibleWeb.Components.Billing do
189189
>
190190
<h4 class="font-black dark:text-gray-100">Monthly quota</h4>
191191
<div class="py-2 text-xl font-medium dark:text-gray-100">
192-
<%= PlausibleWeb.AuthView.subscription_quota(@subscription, format: :long) %>
192+
{PlausibleWeb.AuthView.subscription_quota(@subscription, format: :long)}
193193
</div>
194194
<.styled_link
195195
:if={
@@ -198,7 +198,7 @@ defmodule PlausibleWeb.Components.Billing do
198198
id="#upgrade-or-change-plan-link"
199199
href={Routes.billing_path(PlausibleWeb.Endpoint, :choose_plan)}
200200
>
201-
<%= change_plan_or_upgrade_text(@subscription) %>
201+
{change_plan_or_upgrade_text(@subscription)}
202202
</.styled_link>
203203
</div>
204204
"""
@@ -208,13 +208,13 @@ defmodule PlausibleWeb.Components.Billing do
208208
~H"""
209209
<ul class="w-full py-4">
210210
<li>
211-
Up to <b><%= present_limit(@plan, :monthly_pageview_limit) %></b> monthly pageviews
211+
Up to <b>{present_limit(@plan, :monthly_pageview_limit)}</b> monthly pageviews
212212
</li>
213213
<li>
214-
Up to <b><%= present_limit(@plan, :site_limit) %></b> sites
214+
Up to <b>{present_limit(@plan, :site_limit)}</b> sites
215215
</li>
216216
<li>
217-
Up to <b><%= present_limit(@plan, :hourly_api_request_limit) %></b> hourly api requests
217+
Up to <b>{present_limit(@plan, :hourly_api_request_limit)}</b> hourly api requests
218218
</li>
219219
</ul>
220220
"""
@@ -249,7 +249,7 @@ defmodule PlausibleWeb.Components.Billing do
249249
@checkout_disabled && "pointer-events-none bg-gray-400 dark:bg-gray-600"
250250
]}
251251
>
252-
<%= render_slot(@inner_block) %>
252+
{render_slot(@inner_block)}
253253
</button>
254254
"""
255255
end

lib/plausible_web/components/billing/notice.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ defmodule PlausibleWeb.Components.Billing.Notice do
3030
~H"""
3131
<aside class="container">
3232
<.notice title="Please upgrade your account" class="shadow-md dark:shadow-none">
33-
In order to keep your stats running, we require you to upgrade your account. If you do not upgrade your account <%= @grace_period_end %>, we will lock your dashboard and it won't be accessible.
33+
In order to keep your stats running, we require you to upgrade your account. If you do not upgrade your account {@grace_period_end}, we will lock your dashboard and it won't be accessible.
3434
<.link
3535
href={Routes.billing_path(PlausibleWeb.Endpoint, :choose_plan)}
3636
class="whitespace-nowrap font-semibold"
@@ -75,7 +75,7 @@ defmodule PlausibleWeb.Components.Billing.Notice do
7575
title="Notice"
7676
{@rest}
7777
>
78-
<%= account_label(@current_user, @billable_user) %> does not have access to <%= @feature_mod.display_name() %>. To get access to this feature,
78+
{account_label(@current_user, @billable_user)} does not have access to {@feature_mod.display_name()}. To get access to this feature,
7979
<.upgrade_call_to_action current_user={@current_user} billable_user={@billable_user} />.
8080
</.notice>
8181
"""
@@ -90,7 +90,7 @@ defmodule PlausibleWeb.Components.Billing.Notice do
9090
def limit_exceeded(assigns) do
9191
~H"""
9292
<.notice {@rest} title="Notice">
93-
<%= account_label(@current_user, @billable_user) %> is limited to <%= @limit %> <%= @resource %>. To increase this limit,
93+
{account_label(@current_user, @billable_user)} is limited to {@limit} {@resource}. To increase this limit,
9494
<.upgrade_call_to_action current_user={@current_user} billable_user={@billable_user} />.
9595
</.notice>
9696
"""
@@ -229,7 +229,7 @@ defmodule PlausibleWeb.Components.Billing.Notice do
229229
~H"""
230230
<aside class={@class}>
231231
<.notice title="Pending ownership transfers" class="shadow-md dark:shadow-none mt-4">
232-
<%= @message %> To exclude pending sites from your usage, please go to
232+
{@message} To exclude pending sites from your usage, please go to
233233
<.link href="https://plausible.io/sites" class="whitespace-nowrap font-semibold">
234234
plausible.io/sites
235235
</.link>

lib/plausible_web/components/billing/pageview_slider.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule PlausibleWeb.Components.Billing.PageviewSlider do
2020
<output class="lg:w-1/4 lg:order-1 font-medium text-lg text-gray-600 dark:text-gray-200">
2121
<span :if={@volume != :enterprise}>Up to</span>
2222
<strong id="slider-value" class="text-gray-900 dark:text-gray-100">
23-
<%= format_volume(@volume, @available_volumes) %>
23+
{format_volume(@volume, @available_volumes)}
2424
</strong>
2525
monthly pageviews
2626
</output>
@@ -40,7 +40,7 @@ defmodule PlausibleWeb.Components.Billing.PageviewSlider do
4040
<form class="max-w-md lg:max-w-none w-full lg:w-1/2 lg:order-2">
4141
<div class="flex items-baseline space-x-2">
4242
<span class="text-xs font-medium text-gray-600 dark:text-gray-200">
43-
<%= List.first(@slider_labels) %>
43+
{List.first(@slider_labels)}
4444
</span>
4545
<div class="flex-1 relative">
4646
<input
@@ -65,7 +65,7 @@ defmodule PlausibleWeb.Components.Billing.PageviewSlider do
6565
/>
6666
</div>
6767
<span class="text-xs font-medium text-gray-600 dark:text-gray-200">
68-
<%= List.last(@slider_labels) %>
68+
{List.last(@slider_labels)}
6969
</span>
7070
</div>
7171
</form>

lib/plausible_web/components/billing/plan_benefits.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBenefits do
2828
<ul role="list" class={["mt-8 space-y-3 text-sm leading-6 xl:mt-10", @class]}>
2929
<li :for={benefit <- @benefits} class="flex gap-x-3">
3030
<Heroicons.check class="h-6 w-5 text-indigo-600 dark:text-green-600" />
31-
<%= if is_binary(benefit), do: benefit, else: benefit.(assigns) %>
31+
{if is_binary(benefit), do: benefit, else: benefit.(assigns)}
3232
</li>
3333
</ul>
3434
"""

lib/plausible_web/components/billing/plan_box.ex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
3232
!@highlight && "text-gray-900 dark:text-gray-100",
3333
@highlight && "text-indigo-600 dark:text-indigo-300"
3434
]}>
35-
<%= String.capitalize(to_string(@kind)) %>
35+
{String.capitalize(to_string(@kind))}
3636
</h3>
3737
<.pill :if={@highlight} text={@highlight} />
3838
</div>
@@ -79,7 +79,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
7979
id="highlight-pill"
8080
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"
8181
>
82-
<%= @text %>
82+
{@text}
8383
</p>
8484
</div>
8585
"""
@@ -123,7 +123,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
123123
id={"#{@kind}-price-tag-amount"}
124124
class="text-4xl font-bold tracking-tight text-gray-900 dark:text-gray-100"
125125
>
126-
<%= @plan_to_render.monthly_cost |> Plausible.Billing.format_price() %>
126+
{@plan_to_render.monthly_cost |> Plausible.Billing.format_price()}
127127
</span>
128128
<span
129129
id={"#{@kind}-price-tag-interval"}
@@ -137,13 +137,13 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
137137
defp price_tag(%{selected_interval: :yearly} = assigns) do
138138
~H"""
139139
<span class="text-2xl font-bold w-max tracking-tight line-through text-gray-500 dark:text-gray-600 mr-1">
140-
<%= @plan_to_render.monthly_cost |> Money.mult!(12) |> Plausible.Billing.format_price() %>
140+
{@plan_to_render.monthly_cost |> Money.mult!(12) |> Plausible.Billing.format_price()}
141141
</span>
142142
<span
143143
id={"#{@kind}-price-tag-amount"}
144144
class="text-4xl font-bold tracking-tight text-gray-900 dark:text-gray-100"
145145
>
146-
<%= @plan_to_render.yearly_cost |> Plausible.Billing.format_price() %>
146+
{@plan_to_render.yearly_cost |> Plausible.Billing.format_price()}
147147
</span>
148148
<span id={"#{@kind}-price-tag-interval"} class="text-sm font-semibold leading-6 text-gray-600">
149149
/year
@@ -218,16 +218,16 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
218218
>
219219
<%= if @exceeded_plan_limits != [] do %>
220220
<PlausibleWeb.Components.Generic.tooltip class="text-sm text-red-700 dark:text-red-500 mt-1 justify-center">
221-
<%= @disabled_message %>
221+
{@disabled_message}
222222
<:tooltip_content>
223223
Your usage exceeds the following limit(s):<br /><br />
224224
<p :for={limit <- @exceeded_plan_limits}>
225-
<%= Phoenix.Naming.humanize(limit) %><br />
225+
{Phoenix.Naming.humanize(limit)}<br />
226226
</p>
227227
</:tooltip_content>
228228
</PlausibleWeb.Components.Generic.tooltip>
229229
<% else %>
230-
<%= @disabled_message %>
230+
{@disabled_message}
231231
<% end %>
232232
</p>
233233
"""
@@ -320,7 +320,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
320320
@checkout_disabled && "pointer-events-none bg-gray-400 dark:bg-gray-600"
321321
]}
322322
>
323-
<%= @change_plan_link_text %>
323+
{@change_plan_link_text}
324324
</button>
325325
"""
326326
end

lib/plausible_web/components/first_dashboard_launch_banner.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ defmodule PlausibleWeb.Components.FirstDashboardLaunchBanner do
2828
x-bind:class="! show ? 'hidden' : ''"
2929
x-init={x_init(@site)}
3030
>
31-
<%= link("Team members, email reports and GA import. Explore more →",
31+
{link("Team members, email reports and GA import. Explore more →",
3232
to: "/#{URI.encode_www_form(@site.domain)}/settings/email-reports",
3333
class: "py-2 block"
34-
) %>
34+
)}
3535
</div>
3636
"""
3737
end

0 commit comments

Comments
 (0)