Skip to content

Commit 0bbb8ce

Browse files
committed
feat: add warning message and transport default to true
1 parent dbae875 commit 0bbb8ce

6 files changed

Lines changed: 19 additions & 6 deletions

File tree

lib/gallium/ticketing/attendee.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule Gallium.Ticketing.Attendee do
1313
field :student_number, :string
1414
field :nif, :string
1515
field :is_cesium_member, :boolean, default: false
16-
field :wants_transport, :boolean, default: false
16+
field :wants_transport, :boolean, default: true
1717
field :table_preference, :string
1818
field :allergies, :string
1919
belongs_to :user, Gallium.Accounts.User, type: :binary_id

lib/gallium/ticketing/checkout_form.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Gallium.Ticketing.CheckoutForm do
1212
field :nif, :string
1313
field :mbway_number, :string
1414
field :is_cesium_member, :boolean
15-
field :wants_transport, :boolean, default: false
15+
field :wants_transport, :boolean, default: true
1616
field :table_preference, :string
1717
field :allergies, :string
1818
field :terms_accepted, :boolean, default: false, virtual: true

lib/gallium_web/live/backoffice/attendees_live/index.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@ defmodule GalliumWeb.BackOffice.AttendeesLive.Index do
2626

2727
def handle_params(_params, _uri, socket) do
2828
attendees = Ticketing.list_attendees_with_details()
29+
accompany_count = Enum.count(attendees, & &1.accompany)
2930

3031
socket =
3132
socket
3233
|> assign(:attendees, attendees)
33-
|> assign(:total_count, length(attendees))
34+
|> assign(:total_count, length(attendees) + accompany_count)
3435
|> assign(:paid_count, Enum.count(attendees, &(&1.payment && &1.payment.status == :paid)))
3536
|> assign(
3637
:member_count,
3738
Enum.count(attendees, &(&1.user.ticket && &1.user.ticket.type == :member))
3839
)
39-
|> assign(:accompany_count, Enum.count(attendees, & &1.accompany))
40+
|> assign(:accompany_count, accompany_count)
4041

4142
{:noreply, socket}
4243
end

lib/gallium_web/live/ticketing_purchase/steps/payment.html.heex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
<p class="font-cormorant text-gray-600 my-2">
55
Insere o teu número de telemóvel para pagar via MB WAY
66
</p>
7+
<div class="mt-4 flex gap-3 rounded-box border border-amber-200 bg-amber-50 p-4 text-amber-800">
8+
<.icon name="hero-exclamation-triangle" class="mt-0.5 size-5 shrink-0" />
9+
<p class="font-cormorant text-sm sm:text-base leading-relaxed">
10+
Se já efetuaste o pagamento, aguarda alguns minutos e atualiza a página. Não repitas o processo de pagamento.
11+
</p>
12+
</div>
713
</div>
814

915
<div>

lib/gallium_web/live/ticketing_purchase/steps/personal_data.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
type="radio"
135135
name={@form_data[:wants_transport].name}
136136
value="true"
137-
checked={@form_data[:wants_transport].value == true}
137+
checked={@form_data[:wants_transport].value in [true, "true"]}
138138
class="radio radio-sm radio-primary"
139139
/> Sim
140140
</label>
@@ -143,7 +143,7 @@
143143
type="radio"
144144
name={@form_data[:wants_transport].name}
145145
value="false"
146-
checked={@form_data[:wants_transport].value != true}
146+
checked={@form_data[:wants_transport].value in [false, "false"]}
147147
class="radio radio-sm radio-primary"
148148
/> Não
149149
</label>

lib/gallium_web/live/user_live/profile.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ defmodule GalliumWeb.UserLive.Profile do
100100
<p class="text-gray-800 text-xl">{@user_info.nif}</p>
101101
</div>
102102
<% end %>
103+
<%= if @user_info.table_preference do %>
104+
<div>
105+
<p class="text-gray-400 text-xs uppercase tracking-widest mb-1">Nome da Mesa</p>
106+
<p class="text-gray-800 text-xl">{@user_info.table_preference}</p>
107+
</div>
108+
<% end %>
103109
</div>
104110
105111
<%= if @user_info.payment do %>

0 commit comments

Comments
 (0)