Privacy page and consent checkbox

This commit is contained in:
2023-03-19 21:28:28 +02:00
parent 98a7e1403e
commit 53bf7eaa82
10 changed files with 182 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
<div>
<div class="form-conta">
<h2><%= @title %></h2>
<.form
@@ -39,6 +39,18 @@
%>
<%= error_tag f, :location %>
<div class="privacy-checkbox-container">
<%= checkbox f, :is_member, class: "checkbox" %>
<%= label f, :is_member, "Olen jo Livonsaaren Osuuspuutarhan jäsen" %>
<%= error_tag f, :is_member %>
</div>
<div class="privacy-checkbox-container">
<%= checkbox f, :split_invoice, class: "checkbox" %>
<%= label f, :split_invoice, "Haluan maksaa laskun kahdessa erässä" %>
<%= error_tag f, :split_invoice %>
</div>
<%= label f, :fname, "Etunimi" %>
<%= text_input f, :fname %>
<%= error_tag f, :fname %>
@@ -66,14 +78,17 @@
<%= label f, :email, "Sähköpostiosoite" %>
<%= text_input f, :email %>
<%= error_tag f, :email %>
<%= label f, :is_member, "Olen jo Livonsaaren Osuuspuutarhan jäsen" %>
<%= checkbox f, :is_member %>
<%= error_tag f, :is_member %>
<%= label f, :split_invoice, "Haluan maksaa laskun kahdessa erässä" %>
<%= checkbox f, :split_invoice %>
<%= error_tag f, :split_invoice %>
<%= if @has_privacy_consent do %>
<div class="privacy-checkbox-container">
<input type="checkbox" required="true" id="privacy-consent"/>
<label for="privacy-consent" class="privacy-consent-text" title="Syö paskaa">
Olen lukenut ja hyväksyn yhteystietojeni käsittelyn
<a href="/privacy">rekisteri- ja tietosuojaselosteessa</a>
määritellyin tavoin.
</label>
</div>
<% end %>
<div>
<%= submit @submit_text, phx_disable_with: "Tallennetaan..." %>

View File

@@ -7,6 +7,7 @@
id={@order.id || :new}
title={@page_title}
submit_text={@submit_text}
has_privacy_consent={false}
action={@live_action}
order={@order}
return_to={Routes.order_index_path(@socket, :index)}

View File

@@ -7,6 +7,7 @@
id={:new}
title={@page_title}
submit_text="Lähetä tilaus"
has_privacy_consent={true}
action={@live_action}
order={@order}
return_to={Routes.order_registration_path(@socket, :index)}