You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analytics/lib/plausible_web/views/layout_view.ex

17 lines
406 B
Elixir

defmodule PlausibleWeb.LayoutView do
use PlausibleWeb, :view
def trial_notificaton(user) do
case Plausible.Billing.trial_days_left(user) do
days when days > 1 ->
"#{days} trial days left"
days when days == 1 ->
"Trial ends tomorrow"
days when days == 0 ->
"Trial ends today"
days when days < 0 ->
"Trial over, upgrade now"
end
end
end