Business tier bug smash (#3493)
* price formatting * fix space underlined * add a redirect from :upgrade to :choose_plan * Add premium feature notice to revenue goals * add the number of API request to plan benefits * be more explicit about Stats API requests * start linking to the new upgrade page if FF enabled * add redirect to :upgrade_to_enterprise_plan from :choose_plan This commit intends to keep the existing behaviour of redirecting users directly to the enterprise upgrade page when they click on an upgrade link in an email and have an enterprise plan configured. Hence, we can also simplify the /settings template and only link to '/billing/choose-plan', even for enterprise plans. * deprecate /billing/change-plan route based on FF * Move new site template to HEEX * Move new team member invitation template to HEEX * Standardize exceeded limits error message * Fix failing tests * Limit Stats API access to unlimited trials --------- Co-authored-by: Vinicius Brasil <vini@hey.com>pull/3502/head r2023.11.08-237
parent
c9bf5827e9
commit
7036332db2
@ -1,6 +1,6 @@
|
||||
Your free Plausible trial has now expired. Upgrade your account to continue receiving valuable website traffic insights at a glance while respecting the privacy of your visitors and still having a fast loading site. <br /><br />
|
||||
|
||||
<%= link("Upgrade now", to: "#{plausible_url()}/billing/upgrade") %>
|
||||
<%= link("Upgrade now", to: plausible_url() <> Plausible.Billing.upgrade_route_for(@user)) %>
|
||||
<br /><br />
|
||||
|
||||
We will keep recording stats for another month to give you time to upgrade.
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
<%= form_for @conn, Routes.membership_path(@conn, :invite_member, @site.domain), [class: "max-w-lg w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Invite member to <%= @site.domain %></h2>
|
||||
|
||||
<p class="mt-4 max-w-2xl text-sm text-gray-500 dark:text-gray-200">
|
||||
Enter the email address and role of the person you want to invite. We will contact them over email to offer them access to
|
||||
<%= @site.domain %> analytics.
|
||||
</p>
|
||||
|
||||
<p class="mt-4 max-w-2xl text-sm text-gray-500 dark:text-gray-200">
|
||||
The invitation will expire in 48 hours
|
||||
</p>
|
||||
|
||||
<%= if @conn.assigns[:error] do %>
|
||||
<div class="text-red-500 text-xs italic mt-4"><%= @conn.assigns[:error] %></div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-6">
|
||||
<%= label f, :email, "Email address", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
|
||||
<div class="mt-1 relative rounded-md shadow-sm">
|
||||
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
||||
<svg class="h-5 w-5 text-gray-500 dark:text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z" /><path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" /></svg>
|
||||
</div>
|
||||
<%= email_input(f, :email, class: "focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-900 dark:text-gray-300 block w-full rounded-md pl-10 sm:text-sm border-gray-300 dark:border-gray-500", placeholder: "john.doe@example.com", required: "true") %>
|
||||
</div>
|
||||
<%= error_tag f, :email %>
|
||||
</div>
|
||||
|
||||
<fieldset x-data="{selectedOption: null}">
|
||||
<%= label f, :role, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
|
||||
<div class="mt-1 bg-white rounded-md -space-y-px dark:bg-gray-800">
|
||||
<label class="border-gray-200 dark:border-gray-500 rounded-tl-md rounded-tr-md relative border p-4 flex cursor-pointer" :class="{'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': selectedOption === 'admin', 'border-gray-200': selectedOption !== 'admin'}">
|
||||
<%= radio_button(f, :role, "admin", class: "dark:bg-gray-900 h-4 w-4 mt-0.5 cursor-pointer text-indigo-600 border-gray-300 dark:border-gray-500 focus:ring-indigo-500", "x-model": "selectedOption", required: "true") %>
|
||||
<div class="ml-3 flex flex-col">
|
||||
<span class="text-gray-900 dark:text-gray-100 block text-sm font-medium" :class="{'text-indigo-900 dark:text-white': selectedOption === 'admin', 'text-gray-900 dark:text-gray-100': selectedOption !== 'admin'}">
|
||||
Admin
|
||||
</span>
|
||||
<span class="text-gray-500 dark:text-gray-200 block text-sm" :class="{'text-indigo-700 dark:text-gray-100': selectedOption === 'admin', 'text-gray-500 dark:text-gray-200': selectedOption !== 'admin'}">
|
||||
Can view stats, change site settings and invite other members
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<label class="border-gray-200 dark:border-gray-500 rounded-bl-md rounded-br-md relative border p-4 flex cursor-pointer" :class="{'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': selectedOption === 'viewer', 'border-gray-200': selectedOption !== 'viewer'}">
|
||||
<%= radio_button(f, :role, "viewer", class: "dark:bg-gray-900 h-4 w-4 mt-0.5 cursor-pointer text-indigo-600 border-gray-300 dark:border-gray-500 focus:ring-indigo-500", "x-model": "selectedOption", required: "true") %>
|
||||
<div class="ml-3 flex flex-col">
|
||||
<span class="text-gray-900 dark:text-gray-100 block text-sm font-medium" :class="{'text-indigo-900 dark:text-white': selectedOption === 'viewer', 'text-gray-900 dark:text-gray-100': selectedOption !== 'viewer'}">
|
||||
Viewer
|
||||
</span>
|
||||
<span class="text-gray-500 dark:text-gray-200 block text-sm" :class="{'text-indigo-700 dark:text-gray-100': selectedOption === 'viewer', 'text-gray-500 dark:text-gray-200': selectedOption !== 'viewer'}">
|
||||
Can view stats but cannot access settings or invite members
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="mt-6">
|
||||
<%= submit(class: "button w-full") do %>
|
||||
<svg class="w-5 h-5 mr-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"></path></svg>
|
||||
<span>Invite</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
@ -0,0 +1,121 @@
|
||||
<%= form_for @conn, Routes.membership_path(@conn, :invite_member, @site.domain), [class: "max-w-lg w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100 mb-4">Invite member to <%= @site.domain %></h2>
|
||||
|
||||
<PlausibleWeb.Components.Billing.limit_exceeded_notice
|
||||
:if={Map.get(assigns, :is_at_limit, false)}
|
||||
current_user={@current_user}
|
||||
billable_user={@site.owner}
|
||||
limit={Map.get(assigns, :team_member_limit, 0)}
|
||||
resource="team members"
|
||||
/>
|
||||
|
||||
<p class="mt-4 max-w-2xl text-sm text-gray-500 dark:text-gray-200">
|
||||
Enter the email address and role of the person you want to invite. We will contact them over email to offer them access to <%= @site.domain %> analytics.
|
||||
</p>
|
||||
|
||||
<p class="mt-4 max-w-2xl text-sm text-gray-500 dark:text-gray-200">
|
||||
The invitation will expire in 48 hours
|
||||
</p>
|
||||
|
||||
<%= if @conn.assigns[:error] do %>
|
||||
<div class="text-red-500 text-xs italic mt-4"><%= @conn.assigns[:error] %></div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-6">
|
||||
<%= label(f, :email, "Email address",
|
||||
class: "block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
) %>
|
||||
<div class="mt-1 relative rounded-md shadow-sm">
|
||||
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
||||
<svg
|
||||
class="h-5 w-5 text-gray-500 dark:text-gray-400"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z" /><path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" />
|
||||
</svg>
|
||||
</div>
|
||||
<%= email_input(f, :email,
|
||||
class:
|
||||
"focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-900 dark:text-gray-300 block w-full rounded-md pl-10 sm:text-sm border-gray-300 dark:border-gray-500",
|
||||
placeholder: "john.doe@example.com",
|
||||
required: "true"
|
||||
) %>
|
||||
</div>
|
||||
<%= error_tag(f, :email) %>
|
||||
</div>
|
||||
|
||||
<fieldset x-data="{selectedOption: null}">
|
||||
<%= label(f, :role, class: "block text-sm font-medium text-gray-700 dark:text-gray-300") %>
|
||||
<div class="mt-1 bg-white rounded-md -space-y-px dark:bg-gray-800">
|
||||
<label
|
||||
class="border-gray-200 dark:border-gray-500 rounded-tl-md rounded-tr-md relative border p-4 flex cursor-pointer"
|
||||
x-class="{'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': selectedOption === 'admin', 'border-gray-200': selectedOption !== 'admin'}"
|
||||
>
|
||||
<%= radio_button(f, :role, "admin",
|
||||
class:
|
||||
"dark:bg-gray-900 h-4 w-4 mt-0.5 cursor-pointer text-indigo-600 border-gray-300 dark:border-gray-500 focus:ring-indigo-500",
|
||||
"x-model": "selectedOption",
|
||||
required: "true"
|
||||
) %>
|
||||
<div class="ml-3 flex flex-col">
|
||||
<span
|
||||
class="text-gray-900 dark:text-gray-100 block text-sm font-medium"
|
||||
x-class="{'text-indigo-900 dark:text-white': selectedOption === 'admin', 'text-gray-900 dark:text-gray-100': selectedOption !== 'admin'}"
|
||||
>
|
||||
Admin
|
||||
</span>
|
||||
<span
|
||||
class="text-gray-500 dark:text-gray-200 block text-sm"
|
||||
x-class="{'text-indigo-700 dark:text-gray-100': selectedOption === 'admin', 'text-gray-500 dark:text-gray-200': selectedOption !== 'admin'}"
|
||||
>
|
||||
Can view stats, change site settings and invite other members
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<label
|
||||
class="border-gray-200 dark:border-gray-500 rounded-bl-md rounded-br-md relative border p-4 flex cursor-pointer"
|
||||
x-class="{'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': selectedOption === 'viewer', 'border-gray-200': selectedOption !== 'viewer'}"
|
||||
>
|
||||
<%= radio_button(f, :role, "viewer",
|
||||
class:
|
||||
"dark:bg-gray-900 h-4 w-4 mt-0.5 cursor-pointer text-indigo-600 border-gray-300 dark:border-gray-500 focus:ring-indigo-500",
|
||||
"x-model": "selectedOption",
|
||||
required: "true"
|
||||
) %>
|
||||
<div class="ml-3 flex flex-col">
|
||||
<span
|
||||
class="text-gray-900 dark:text-gray-100 block text-sm font-medium"
|
||||
x-class="{'text-indigo-900 dark:text-white': selectedOption === 'viewer', 'text-gray-900 dark:text-gray-100': selectedOption !== 'viewer'}"
|
||||
>
|
||||
Viewer
|
||||
</span>
|
||||
<span
|
||||
class="text-gray-500 dark:text-gray-200 block text-sm"
|
||||
x-class="{'text-indigo-700 dark:text-gray-100': selectedOption === 'viewer', 'text-gray-500 dark:text-gray-200': selectedOption !== 'viewer'}"
|
||||
>
|
||||
Can view stats but cannot access settings or invite members
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="mt-6">
|
||||
<%= submit(class: "button w-full disabled:cursor-not-allowed", disabled: Map.get(assigns, :is_at_limit, false)) do %>
|
||||
<svg
|
||||
class="w-5 h-5 mr-1"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path d="M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z">
|
||||
</path>
|
||||
</svg>
|
||||
<span>Invite</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
@ -1,89 +0,0 @@
|
||||
<div class="w-full max-w-3xl mt-4 mx-auto flex">
|
||||
<%= form_for @changeset, "/sites", [class: "max-w-lg w-full mx-auto bg-white dark:bg-gray-800 shadow-lg rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Your website details</h2>
|
||||
|
||||
<%= if @is_at_limit do %>
|
||||
<div class="rounded-md bg-yellow-50 dark:bg-transparent dark:border border-yellow-200 p-4 mt-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-yellow-400 dark:text-yellow-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-yellow-800 dark:text-yellow-400">
|
||||
Upgrade required
|
||||
</h3>
|
||||
<div class="mt-2 text-sm text-yellow-700 dark:text-yellow-300">
|
||||
<p>
|
||||
Your account is limited to <%= @site_limit %> sites. Please contact support@plausible.io to add more sites.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= if is_nil(@current_user.trial_expiry_date) do %>
|
||||
<div class="rounded-md bg-blue-50 dark:bg-transparent dark:border border-blue-200 p-4 mt-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-blue-500 dark:text-blue-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<div class="text-sm text-blue-700 dark:text-blue-300">
|
||||
<p>
|
||||
When you create your first site, your account will enter a 30 day free trial.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-6">
|
||||
<%= label f, :domain, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-xs mt-1">Just the naked domain or subdomain without 'www'</p>
|
||||
<div class="mt-2 flex rounded-md shadow-sm">
|
||||
<span class="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 dark:border-gray-500 bg-gray-50 dark:bg-gray-850 text-gray-500 dark:text-gray-400 sm:text-sm">
|
||||
https://
|
||||
</span>
|
||||
<%= text_input f, :domain, class: "focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-800 flex-1 block w-full px-3 py-2 rounded-none rounded-r-md sm:text-sm border-gray-300 dark:border-gray-500 dark:bg-gray-900 dark:text-gray-300", placeholder: "example.com", disabled: @is_at_limit %>
|
||||
</div>
|
||||
<%= error_tag f, :domain %>
|
||||
</div>
|
||||
<div class="my-6">
|
||||
<%= label f, :timezone, "Reporting Timezone", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-xs mt-1">To make sure we agree on what 'today' means</p>
|
||||
|
||||
<div class="inline-block relative w-full">
|
||||
<%= select f, :timezone, Plausible.Timezones.options(), id: "tz-select", selected: "Etc/Greenwich", class: "mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 dark:border-gray-500 dark:bg-gray-900 dark:text-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md", disabled: @is_at_limit %>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var option;
|
||||
|
||||
if (typeof Intl !== "undefined") {
|
||||
var timezoneName = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
option = document.querySelector('#tz-select option[value="' + timezoneName + '"]')
|
||||
}
|
||||
|
||||
if (!option) {
|
||||
var offset = (new Date()).getTimezoneOffset()
|
||||
option = document.querySelector('#tz-select option[offset="' + offset + '"]')
|
||||
}
|
||||
|
||||
if (option) { option.selected = "selected"}
|
||||
</script>
|
||||
|
||||
<%= submit "Add snippet →", class: "button mt-4 w-full", disabled: @is_at_limit %>
|
||||
<% end %>
|
||||
|
||||
<%= if @is_first_site do %>
|
||||
<div class="pt-12 pl-8 hidden md:block">
|
||||
<%= render(PlausibleWeb.AuthView, "_onboarding_steps.html", current_step: 2) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@ -0,0 +1,104 @@
|
||||
<div class="w-full max-w-3xl mt-4 mx-auto flex">
|
||||
<%= form_for @changeset, "/sites", [class: "max-w-lg w-full mx-auto bg-white dark:bg-gray-800 shadow-lg rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100 mb-4">Your website details</h2>
|
||||
|
||||
<PlausibleWeb.Components.Billing.limit_exceeded_notice
|
||||
current_user={@current_user}
|
||||
billable_user={@current_user}
|
||||
limit={Map.get(assigns, :site_limit, 0)}
|
||||
resource="sites"
|
||||
/>
|
||||
|
||||
<%= if is_nil(@current_user.trial_expiry_date) do %>
|
||||
<div class="rounded-md bg-blue-50 dark:bg-transparent dark:border border-blue-200 p-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg
|
||||
class="h-5 w-5 text-blue-500 dark:text-blue-300"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
|
||||
clip-rule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<div class="text-sm text-blue-700 dark:text-blue-300">
|
||||
<p>
|
||||
When you create your first site, your account will enter a 30 day free trial.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-6">
|
||||
<%= label(f, :domain, class: "block text-sm font-medium text-gray-700 dark:text-gray-300") %>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-xs mt-1">
|
||||
Just the naked domain or subdomain without 'www'
|
||||
</p>
|
||||
<div class="mt-2 flex rounded-md shadow-sm">
|
||||
<span class="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 dark:border-gray-500 bg-gray-50 dark:bg-gray-850 text-gray-500 dark:text-gray-400 sm:text-sm">
|
||||
https://
|
||||
</span>
|
||||
<%= text_input(f, :domain,
|
||||
class:
|
||||
"focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-800 flex-1 block w-full px-3 py-2 rounded-none rounded-r-md sm:text-sm border-gray-300 dark:border-gray-500 dark:bg-gray-900 dark:text-gray-300",
|
||||
placeholder: "example.com",
|
||||
disabled: Map.get(assigns, :is_at_limit, false)
|
||||
) %>
|
||||
</div>
|
||||
<%= error_tag(f, :domain) %>
|
||||
</div>
|
||||
<div class="my-6">
|
||||
<%= label(f, :timezone, "Reporting Timezone",
|
||||
class: "block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
) %>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-xs mt-1">
|
||||
To make sure we agree on what 'today' means
|
||||
</p>
|
||||
|
||||
<div class="inline-block relative w-full">
|
||||
<%= select(f, :timezone, Plausible.Timezones.options(),
|
||||
id: "tz-select",
|
||||
selected: "Etc/Greenwich",
|
||||
class:
|
||||
"mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 dark:border-gray-500 dark:bg-gray-900 dark:text-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",
|
||||
disabled: Map.get(assigns, :is_at_limit, false)
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var option;
|
||||
|
||||
if (typeof Intl !== "undefined") {
|
||||
var timezoneName = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
option = document.querySelector('#tz-select option[value="' + timezoneName + '"]')
|
||||
}
|
||||
|
||||
if (!option) {
|
||||
var offset = (new Date()).getTimezoneOffset()
|
||||
option = document.querySelector('#tz-select option[offset="' + offset + '"]')
|
||||
}
|
||||
|
||||
if (option) { option.selected = "selected"}
|
||||
</script>
|
||||
|
||||
<%= submit("Add snippet →",
|
||||
class: "button mt-4 w-full disabled:cursor-not-allowed",
|
||||
disabled: Map.get(assigns, :is_at_limit, false)
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
<%= if @is_first_site do %>
|
||||
<div class="pt-12 pl-8 hidden md:block">
|
||||
<%= render(PlausibleWeb.AuthView, "_onboarding_steps.html", current_step: 2) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
Loading…
Reference in New Issue