-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: add guests_kids seralized column
- Loading branch information
Showing
11 changed files
with
190 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,41 +31,60 @@ | |
- else | ||
= form_for @ticket_request, | ||
url: { controller: :ticket_requests, action: form_action_name }, data: { "turbo-target": "_top", turbo: false } do |f| | ||
= f.hidden_field :event_id, value: @event.id | ||
- if is_update | ||
%hr | ||
%h4 Guests | ||
%p | ||
Please list everyone in your party including the kids. We do not (currently) send automated emails to any of the guests you specify. | ||
%p | ||
For adults — please list their full name, and an email address as shown in the below example. | ||
.content-fluid | ||
.row | ||
.col-lg-6.col-xl-6.col-md-12.col-sm-12 | ||
.container-fluid | ||
.row | ||
.col-12 | ||
= f.hidden_field :event_id, value: @event.id | ||
- if is_update | ||
%a{name: "guests"}/ | ||
%p | ||
.control-group | ||
%h4 Guests | ||
%p | ||
Please list everyone in your party including the kids. We do not (currently) send automated emails to any of the guests you specify. | ||
%p | ||
For adults — please list their full name, and an email address as shown in the below example. | ||
%p | ||
DJs should write their DJ Name, as well as the regular name and email address. | ||
- list_finalized = (@event.start_time - Time.current) < ::Event::GUEST_LIST_FINAL_WITHIN | ||
- if list_finalized | ||
%span.text-error | ||
Guest list has already been finalized. If you need to update your guests, please email | ||
= mail_to '[email protected]' | ||
%br | ||
- else | ||
%h4 Adult Guests | ||
%h5 Examples: | ||
%ul | ||
%li DJ Carl Cox (as himself) <[email protected]> | ||
%li John Digweed <[email protected]> | ||
- total_guests = @ticket_request.guest_count | ||
- adult_guests = @ticket_request.adults - 1 | ||
- adult_guests.times do |guest_id| | ||
- next if @ticket_request.guests[guest_id] == "#{@ticket_request.user.name} <#{@ticket_request.user.email}>" | ||
= f.label "Adult Guest #{guest_id + 1}" | ||
= f.text_field :guest_list, readonly: list_finalized, multiple: true, value: Array(@ticket_request.guests[0...adult_guests])[guest_id], style: 'width: 80%' | ||
|
||
- if @ticket_request.kids.positive? | ||
.col-lg-6.col-xl-6.col-md-12.col-sm-12 | ||
.row | ||
- if list_finalized | ||
%span.text-error | ||
Guest list has already been finalized. If you need to update your guests, please email | ||
= mail_to '[email protected]' | ||
%br | ||
- else | ||
.col-sm-12.col-md-12.col-lg-6.col-xl-6 | ||
%h5 Adults | ||
%p.text-success | ||
%strong Adult Name Examples | ||
%ul | ||
%li DJ Carl Cox (as himself) <[email protected]> | ||
%li John Digweed <[email protected]> | ||
- total_guests = @ticket_request.guests_expected_count | ||
- adult_guests = @ticket_request.adults | ||
- adult_guests.times do |guest_id| | ||
= f.label "Adult Guest #{guest_id + 1}" | ||
- default_value = guest_id == 0 ? @ticket_request.user.name_and_email : '' | ||
= f.text_field :adult_guest_list, readonly: list_finalized, multiple: true, value: @ticket_request.guests[guest_id] || default_value, style: 'width: 80%' | ||
|
||
- if @ticket_request.kids.positive? | ||
.col-sm-12.col-md-12.col-lg-6.col-xl-6 | ||
%h5 Kids | ||
%p.text-success | ||
%strong Kid Name Examples | ||
%ul | ||
%li Taylor Swift, 12 | ||
%li Jonah Hill, 8 | ||
%li Channing Tatum, 5 | ||
.small Please enter "Full Name, Age" eg "Justin Bieber, 12" | ||
- kid_guests = @ticket_request.kids | ||
- kid_guests.times do |guest_id| | ||
= f.label "Kid Number #{guest_id + 1}" | ||
= f.text_field :kid_guest_list, readonly: list_finalized, multiple: true, value: @ticket_request.guests_kids[guest_id], style: 'width: 80%' | ||
|
||
%h4 Kid Guests | ||
%h5 Examples: | ||
|
@@ -77,35 +96,33 @@ | |
= f.label "Kid Guest #{guest_id + 1}" | ||
= f.text_field :guest_list, readonly: list_finalized, multiple: true, value: Array(@ticket_request.guests[(adult_guests)...total_guests])[guest_id], style: 'width: 80%' | ||
|
||
%hr | ||
%h4 How are you contributing to the event? | ||
.content-fluid | ||
%h5 How are you contributing to the event? | ||
.row | ||
.col-lg-6.col-xl-6.col-md-12.col-sm-12 | ||
.input-group-large | ||
%fieldset | ||
%p | ||
= f.label :role_volunteer do | ||
= f.label :role_volunteer, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_VOLUNTEER, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_VOLUNTEER] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_VOLUNTEER] | ||
= f.label :role_contributor, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_CONTRIBUTOR, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_CONTRIBUTOR] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_CONTRIBUTOR] | ||
= f.label :role_coordinator, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_COORDINATOR, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_COORDINATOR] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_COORDINATOR] | ||
= f.label :role_uber_coordinator, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_UBER_COORDINATOR, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_UBER_COORDINATOR] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_UBER_COORDINATOR] | ||
= f.label :role_other, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_OTHER, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_OTHER] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_OTHER] | ||
= f.label :role_volunteer, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_VOLUNTEER, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_VOLUNTEER] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_VOLUNTEER] | ||
= f.label :role_contributor, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_CONTRIBUTOR, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_CONTRIBUTOR] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_CONTRIBUTOR] | ||
= f.label :role_coordinator, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_COORDINATOR, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_COORDINATOR] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_COORDINATOR] | ||
= f.label :role_uber_coordinator, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_UBER_COORDINATOR, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_UBER_COORDINATOR] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_UBER_COORDINATOR] | ||
= f.label :role_other, class: 'radio inline' do | ||
= f.radio_button :role, TicketRequest::ROLE_OTHER, | ||
data: { 'max-tickets' => TicketRequest::TICKET_LIMITS[TicketRequest::ROLE_OTHER] } | ||
= TicketRequest::ROLES[TicketRequest::ROLE_OTHER] | ||
|
||
.col-lg-6.col-xl-6.col-md-12.col-sm-12.align-content-md-center | ||
%p.muted.role-explanation{ class: TicketRequest::ROLE_VOLUNTEER } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
db/migrate/20240520043030_add_guest_kids_to_ticket_requests.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddGuestKidsToTicketRequests < ActiveRecord::Migration[7.1] | ||
def change | ||
add_column :ticket_requests, :guests_kids, :text | ||
end | ||
end |
Oops, something went wrong.