defmodule PlausibleWeb.Live.GoalSettings.List do @moduledoc """ Phoenix LiveComponent module that renders a list of goals """ use Phoenix.LiveComponent, global_prefixes: ~w(x-) use Phoenix.HTML alias PlausibleWeb.Live.Components.Modal attr(:goals, :list, required: true) attr(:domain, :string, required: true) attr(:filter_text, :string) attr(:site, Plausible.Site, required: true) def render(assigns) do revenue_goals_enabled? = Plausible.Billing.Feature.RevenueGoals.enabled?(assigns.site) assigns = assign(assigns, :revenue_goals_enabled?, revenue_goals_enabled?) ~H"""
+ Add Goal
<%= if Enum.count(@goals) > 0 do %>
<%= for goal <- @goals do %>
<%= if not @revenue_goals_enabled? && goal.currency do %>
<%= goal %>
<% else %> <%= goal %> <% end %> Pageview Custom Event Revenue Goal Unlock Revenue Goals by upgrading to a business plan - belongs to funnel(s)
<% end %>
<% else %>

No goals found for this site. Please refine or reset your search. No goals configured for this site.

<% end %>
""" end defp delete_confirmation_text(goal) do if Enum.empty?(goal.funnels) do """ Are you sure you want to remove the following goal: #{goal} This will just affect the UI, all of your analytics data will stay intact. """ else """ The goal: #{goal} is part of some funnel(s). If you are going to delete it, the associated funnels will be either reduced or deleted completely. Are you sure you want to remove the goal? """ end end end