Skip to content

Commit 4ca1c4e

Browse files
committed
change design
1 parent 8e5905d commit 4ca1c4e

File tree

5 files changed

+34
-14
lines changed

5 files changed

+34
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<%= action_authorized_link_to(
2+
:join,
3+
meeting_registration_path(model),
4+
resource: model,
5+
method: :delete,
6+
class: button_classes,
7+
data: { disable: true, confirm: i18n_modal_confirmation_text }
8+
) do %>
9+
<% if style == :simple %>
10+
<%= cancel_button_text %>
11+
<%= icon icon_name %>
12+
<% elsif style == :detailed %>
13+
<span class="icon-wrap">
14+
<%= icon icon_name %>
15+
</span>
16+
<span class="text-wrap">
17+
<%= cancel_button_text %>
18+
</span>
19+
<% end %>
20+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
<%= waiting_list_info %>
22
<div class="text-center">
3-
<%= action_authorized_link_to(
4-
:join,
5-
meeting_registration_path(model),
6-
resource: model,
7-
method: :delete,
8-
class: button_classes,
9-
data: { disable: true, confirm: i18n_modal_confirmation_text }
10-
) do %>
11-
<%= cancel_button_text %>
12-
<%= icon icon_name %>
13-
<% end %>
3+
<%= cancel_registration_button(style: :simple) unless registration_status == "on_waiting_list" %>
144
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div class="card extra">
2+
<div class="card__content">
3+
<%= t("waitlist_info", scope: "decidim.meetings.meetings.show") %>
4+
<%= cancel_registration_button(style: :detailed) %>
5+
</div>
6+
</div>

decidim-meetings/app/cells/decidim/meetings/cancel_registration_meeting_button_cell.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ def show
1515
end
1616

1717
def waiting_list_info
18-
cell("decidim/announcement", t("waitlist_info", scope: "decidim.meetings.meetings.show")) if registration_status == "on_waiting_list"
18+
render if registration_status == "on_waiting_list"
19+
end
20+
21+
def cancel_registration_button(style: :simple)
22+
render locals: { style: style }
1923
end
2024

2125
private
@@ -57,7 +61,7 @@ def i18n_modal_confirmation_text
5761
end
5862

5963
def button_classes
60-
""
64+
registration_status == "on_waiting_list" ? "button expanded button--icon follow-button secondary hollow active small" : ""
6165
end
6266

6367
def icon_name

decidim-meetings/config/locales/en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ en:
583583
view: View
584584
visit_finished: View past meeting
585585
waitlist_confirmation: Are you sure you want to cancel your waitlist registration for this meeting?
586-
waitlist_info: You have joined the waiting list for this meeting. If a spot became available you will be automatically registered and you will receive a notification.
586+
waitlist_info: You have joined the waiting list for this meeting. If a spot for this meeting becomes available, you will register automatically and receive a notification.
587587
waitlist_title: Cancel your waitlist registration
588588
withdraw_btn_hint: You can withdraw your meeting if you change your mind. The meeting is not deleted, it will appear in the list of withdrawn meetings.
589589
withdraw_confirmation_html: Are you sure you want to withdraw this meeting?<br><br><strong>This action cannot be cancelled!</strong>

0 commit comments

Comments
 (0)