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/templates/auth/user_settings.html.eex

89 lines
4.3 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<div class="max-w-2xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-orange-200 px-8 pt-6 pb-8 mt-24">
<h2 class="text-xl font-black">Subscription Plan</h2>
<div class="mt-4 border-b border-gray-400"></div>
<div class="flex flex-col items-center sm:flex-row sm:items-start justify-between mt-8">
<div class="text-center bg-gray-100 py-4 px-2 rounded h-32 my-4" style="width: 11.75rem;">
<h4 class="font-black">Current plan</h4>
<%= if @subscription do %>
<div class="text-xl py-2 font-medium"><%= subscription_name(@subscription) %></div>
<%= link("Change plan", to: "/billing/change-plan", class: "text-sm text-indigo-500 font-medium") %>
<% else %>
<div class="text-xl py-2 font-medium">Free trial</div>
<%= link("Upgrade", to: "/billing/upgrade", class: "text-sm text-indigo-500 font-medium") %>
<% end %>
</div>
<div class="text-center bg-gray-100 py-4 px-2 rounded h-32 my-4" style="width: 11.75rem;">
<h4 class="font-black">Next bill amount</h4>
<%= if @subscription do %>
<div class="text-xl py-2 font-medium">$<%= @subscription.next_bill_amount %></div>
<%= if @subscription.update_url do %>
<%= link("Update billing info", to: @subscription.update_url, class: "text-sm text-indigo-500 font-medium") %>
<% end %>
<% else %>
<div class="text-xl py-2 font-medium">$0</div>
<% end %>
</div>
<div class="text-center bg-gray-100 py-4 px-2 rounded h-32 my-4" style="width: 11.75rem;">
<h4 class="font-black">Next bill date</h4>
<%= if @subscription && @subscription.next_bill_date do %>
<div class="text-xl py-2 font-medium"><%= Timex.format!(@subscription.next_bill_date, "{Mshort} {D}, {YYYY}") %></div>
<% else %>
<div class="text-xl py-2 font-medium">–</div>
<% end %>
</div>
</div>
<h3 class="text-xl font-bold mt-8">Your usage</h3>
<div class="py-2">
<b><%= delimit_integer(Plausible.Billing.usage(@conn.assigns[:current_user])) %></b>
pageviews in the last 30 days
</div>
<%= if @subscription && @subscription.cancel_url do %>
<div class="mt-8">
<%= link("Cancel my subscription", to: @subscription.cancel_url, class: "text-indigo-500 text-sm") %>
</div>
<% end %>
</div>
<div class="max-w-2xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-indigo-100 px-8 pt-6 pb-8 mt-16">
<h2 class="text-xl font-black">Account settings</h2>
<div class="my-4 border-b border-gray-300"></div>
<%= form_for @changeset, "/settings", [class: "max-w-sm"], fn f -> %>
<div class="my-4">
<%= label f, :name, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= text_input f, :name, class: "transition bg-gray-100 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:border-gray-300" %>
<%= error_tag f, :name %>
</div>
<div class="my-4">
<%= label f, :email, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= email_input f, :email, class: "transition bg-gray-100 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:border-gray-300" %>
<%= error_tag f, :email %>
</div>
<%= submit "Save changes", class: "button mt-4" %>
<% end %>
</div>
<div class="max-w-2xl mx-auto bg-white shadow-md rounded rounded-t-none border-t-2 border-red-600 px-8 pt-6 pb-8 mt-16 mb-24">
<div class="flex items-center justify-between">
<h2 class="text-xl font-black">Delete account</h2>
</div>
<div class="my-4 border-b border-gray-300"></div>
<p>Deleting your account removes all sites and stats you've collected</p>
<%= if @subscription && @subscription.status == "active" do %>
<span class="button bg-gray-300 mt-6 hover:shadow-none">Delete my account</span>
<p class="text-gray-600 text-sm mt-2">Your account cannot be deleted because you have an active subscription. If you want to delete your account, please cancel your subscription first.</p>
<% else %>
<%= link "Delete my account ", to: "/me", method: :delete, class: "button bg-red-600 mt-6", data: [confirm: "Deleting your account cannot be reversed. Are you sure?"] %>
<% end %>
</div>