Subscription Plan

Current plan

<%= if @subscription do %>
<%= subscription_name(@subscription) %>
<%= link("Change plan", to: "/billing/change-plan", class: "text-sm text-indigo font-medium") %> <% else %>
Free trial
<%= link("Upgrade", to: "/billing/upgrade", class: "text-sm text-indigo font-medium") %> <% end %>

Next bill amount

<%= if @subscription do %>
$<%= @subscription.next_bill_amount %>
<%= if @subscription.update_url do %> <%= link("Update billing info", to: @subscription.update_url, class: "text-sm text-indigo font-medium") %> <% end %> <% else %>
$0
<% end %>

Next bill date

<%= if @subscription && @subscription.next_bill_date do %>
<%= Timex.format!(@subscription.next_bill_date, "{Mshort} {D}, {YYYY}") %>
<% else %>
–
<% end %>

Your usage

<%= delimit_integer(Plausible.Billing.usage(@conn.assigns[:current_user])) %> pageviews in the last 30 days
<%= if @subscription && @subscription.cancel_url do %>
<%= link("Cancel my subscription", to: @subscription.cancel_url, class: "text-indigo text-sm") %>
<% end %>

Account settings

<%= form_for @changeset, "/settings", [class: "max-w-xs"], fn f -> %>
<%= label f, :name, class: "block text-grey-darker text-sm font-bold mb-2" %> <%= text_input f, :name, class: "transition bg-grey-lighter appearance-none border border-transparent rounded w-full p-2 text-grey-darker leading-normal appearance-none focus:outline-none focus:border-grey-light" %> <%= error_tag f, :name %>
<%= label f, :email, class: "block text-grey-darker text-sm font-bold mb-2" %> <%= email_input f, :email, class: "transition bg-grey-lighter appearance-none border border-transparent rounded w-full p-2 text-grey-darker leading-normal appearance-none focus:outline-none focus:border-grey-light" %> <%= error_tag f, :email %>
<%= submit "Save changes", class: "button mt-4" %> <% end %>

Delete account

Deleting your account removes all sites and stats you've collected

<%= link "Delete my account ", to: "/me", method: :delete, class: "button bg-red-dark mt-4", data: [confirm: "Deleting your account cannot be reversed. Are you sure?"] %>