mirror of
https://github.com/plausible/analytics.git
synced 2024-12-21 08:31:29 +03:00
c40d532880
* Fix typo * Update landing page with components from TailwindUI * Update copy * Update FAQ and testimonials * Add feature section * Update copy for integration * Implement feedback * Remove github button JS * Update headings * Update gray values * Update CTA section * Add copy
38 lines
2.3 KiB
Elixir
38 lines
2.3 KiB
Elixir
<%= form_for @changeset, "/#{URI.encode_www_form(@site.domain)}/goals", [class: "max-w-md w-full mx-auto bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
|
<h2 class="text-xl font-black">Add goal for <%= @site.domain %></h2>
|
|
<div class="mt-6 text-sm font-bold">Goal trigger</div>
|
|
<div class="my-3 w-full flex rounded border border-gray-300">
|
|
<div class="w-1/2 text-center py-2 border-r border-gray-300 shadow-inner font-bold bg-gray-100 cursor-pointer" id="pageview-tab">Pageview</div>
|
|
<div class="w-1/2 text-center py-2 bg-gray-100 cursor-pointer" id="event-tab">Custom event</div>
|
|
</div>
|
|
<div class="my-6">
|
|
<div id="pageview-fields">
|
|
<%= label f, :page_path, class: "block text-sm font-bold" %>
|
|
<%= text_input f, :page_path, class: "transition mt-3 bg-gray-100 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:bg-white focus:border-gray-300", placeholder: "/success" %>
|
|
<%= error_tag f, :page_path %>
|
|
</div>
|
|
<div id="event-fields" class="hidden">
|
|
<%= label f, :event_name, class: "block text-sm font-bold" %>
|
|
<%= text_input f, :event_name, class: "transition mt-3 bg-gray-100 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:bg-white focus:border-gray-300", placeholder: "Signup" %>
|
|
<%= error_tag f, :event_name %>
|
|
</div>
|
|
</div>
|
|
|
|
<%= submit "Add goal →", class: "button mt-4 w-full" %>
|
|
<% end %>
|
|
|
|
<script>
|
|
document.getElementById('pageview-tab').onclick = function() {
|
|
document.getElementById('pageview-fields').classList.remove('hidden')
|
|
document.getElementById('pageview-tab').classList.add('shadow-inner', 'font-bold')
|
|
document.getElementById('event-fields').classList.add('hidden')
|
|
document.getElementById('event-tab').classList.remove('shadow-inner', 'font-bold')
|
|
}
|
|
document.getElementById('event-tab').onclick = function() {
|
|
document.getElementById('event-fields').classList.remove('hidden')
|
|
document.getElementById('event-tab').classList.add('shadow-inner', 'font-bold')
|
|
document.getElementById('pageview-fields').classList.add('hidden')
|
|
document.getElementById('pageview-tab').classList.remove('shadow-inner', 'font-bold')
|
|
}
|
|
</script>
|