mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 01:54:34 +03:00
25 lines
518 B
Elixir
25 lines
518 B
Elixir
defmodule PlausibleWeb.LayoutView do
|
|
use PlausibleWeb, :view
|
|
|
|
def home_dest(conn) do
|
|
if conn.assigns[:current_user] do
|
|
"/sites"
|
|
else
|
|
"/"
|
|
end
|
|
end
|
|
|
|
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
|