-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpersonal_data.html.heex
More file actions
237 lines (222 loc) · 6.92 KB
/
Copy pathpersonal_data.html.heex
File metadata and controls
237 lines (222 loc) · 6.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<div class="border border-blue-500 p-8 bg-white rounded-box relative my-4">
<.form
for={@form_data}
phx-change="save_draft_form_info_step1"
phx-submit="save_step1"
class="flex flex-col gap-4"
>
<%= if @has_accompany? do %>
<div>
<div class="flex flex-col sm:flex-row justify-between gap-2">
<h2 class="text-4xl font-amarante text-blue-500 mb-3 uppercase ">
Dados <span class="hidden md:inline">Acompanhante</span>
</h2>
<div>
<.primary_button
type="button"
phx-click="toggle_accompany"
text="Remover Acompanhante"
color={:blue}
class="font-cormorant w-fit! h-auto! py-1.5! px-4! text-sm tracking-tight"
/>
</div>
</div>
<p class="font-cormorant text-gray-600 my-2">
Por favor preenche os dados do teu acompanhante
</p>
</div>
<.inputs_for :let={accompany_form} field={@form_data[:accompany]}>
<.input
field={accompany_form[:full_name]}
type="text"
label="Nome Completo *"
placeholder="Insere o nome"
>
<:icon>
<.icon name="hero-user" class="size-5" />
</:icon>
</.input>
<.input
field={accompany_form[:email]}
type="email"
label="Email *"
placeholder="email.acompanhante@uminho.pt"
>
<:icon>
<.icon name="hero-envelope" class="size-5" />
</:icon>
</.input>
<.input
field={accompany_form[:phone_number]}
type="tel"
label="Número de telefone *"
placeholder="+351912345678"
>
<:icon>
<.icon name="hero-phone" class="size-5" />
</:icon>
</.input>
</.inputs_for>
<hr class="border-gray-300 my-4" />
<% end %>
<div>
<div class="flex flex-col sm:flex-row justify-between gap-2">
<h2 class="text-4xl font-amarante text-blue-500 mb-3 uppercase">Dados Pessoais</h2>
<%= if !@has_accompany? do %>
<div>
<.primary_button
type="button"
phx-click="toggle_accompany"
text="Adicionar Acompanhante"
color={:blue}
class="font-cormorant !w-fit! h-auto! py-3! px-8! text-base tracking-tight"
/>
</div>
<% end %>
</div>
<p class="font-cormorant text-gray-600 my-2">
Por favor preenche os teus dados para completar a compra
</p>
</div>
<.input
field={@form_data[:full_name]}
type="text"
label="Nome Completo *"
placeholder="Insere o teu nome completo"
>
<:icon>
<.icon name="hero-user" class="size-5" />
</:icon>
</.input>
<.input
field={@form_data[:student_number]}
type="text"
label="Número de Aluno *"
placeholder="ex: A12345"
>
<:icon>
<.icon name="hero-hashtag" class="size-5" />
</:icon>
</.input>
<.input
field={@form_data[:phone_number]}
type="tel"
label="Telefone *"
placeholder="+351912345678"
>
<:icon>
<.icon name="hero-phone" class="size-5" />
</:icon>
</.input>
<.input field={@form_data[:nif]} type="text" label="NIF (opcional)" placeholder="299999999">
<:icon>
<.icon name="hero-hashtag" class="size-5" />
</:icon>
</.input>
<div class="flex flex-col gap-2">
<label class="font-cormorant text-base font-semibold text-gray-700">Transporte *</label>
<p class="font-cormorant text-sm text-gray-500 -mt-1">
O transporte é de ida e volta. Pretendes transporte?
</p>
<div class="flex gap-4 mt-1">
<label class="flex items-center gap-2 font-cormorant text-base cursor-pointer">
<input
type="radio"
name={@form_data[:wants_transport].name}
value="true"
checked={@form_data[:wants_transport].value in [true, "true"]}
class="radio radio-sm radio-primary"
/> Sim
</label>
<label class="flex items-center gap-2 font-cormorant text-base cursor-pointer">
<input
type="radio"
name={@form_data[:wants_transport].name}
value="false"
checked={@form_data[:wants_transport].value in [false, "false"]}
class="radio radio-sm radio-primary"
/> Não
</label>
</div>
</div>
<.input
field={@form_data[:table_preference]}
type="text"
label="Se queres reservar mesa com os teus amigos, indica aqui o nome"
placeholder="Nome da mesa (opcional)"
maxlength="30"
>
<:icon>
<.icon name="hero-table-cells" class="size-5" />
</:icon>
</.input>
<p class="font-cormorant text-sm text-gray-500 -mt-5">
Limite máximo de 10 pessoas por mesa.
</p>
<.input
field={@form_data[:allergies]}
type="text"
label="Alergias ou restrições alimentares (opcional)"
placeholder="ex: vegetariano, alergia a amendoins..."
>
<:icon>
<.icon name="hero-exclamation-triangle" class="size-5" />
</:icon>
</.input>
<div class="flex flex-col gap-1 mt-2">
<label class="flex items-start gap-3 font-cormorant text-base text-gray-700 cursor-pointer">
<input type="hidden" name={@form_data[:terms_accepted].name} value="false" />
<input
type="checkbox"
id={@form_data[:terms_accepted].id}
name={@form_data[:terms_accepted].name}
value="true"
checked={@form_data[:terms_accepted].value == true}
class="checkbox checkbox-sm checkbox-primary mt-1 shrink-0"
/>
<span>
Li e aceito os
<.link
navigate={~p"/terms"}
target="_blank"
class="text-blue-500 underline hover:text-blue-700"
>
Termos e Condições
</.link>
da compra do bilhete. *
</span>
</label>
<p
:for={{msg, _} <- @form_data[:terms_accepted].errors}
:if={@form_data.action == :validate}
class="mt-1.5 flex gap-2 items-center text-sm text-error font-cormorant"
>
<.icon name="hero-exclamation-circle-mini" class="size-4 shrink-0" />
{msg}
</p>
</div>
<div class="flex flex-row justify-between mt-4">
<div>
<.primary_button
type="button"
phx-click="to_tickets"
text="Voltar"
color={:light_muted}
icon="hero-arrow-left"
iconpos={:left}
class="font-amarante"
/>
</div>
<div>
<.primary_button
type="submit"
text="Seguinte"
color={:blue}
icon="hero-arrow-right"
iconpos={:right}
class="font-cormorant"
/>
</div>
</div>
</.form>
</div>