Skip to content

Commit

Permalink
remove eald, cabins
Browse files Browse the repository at this point in the history
  • Loading branch information
beingmattlevy committed Jul 28, 2024
1 parent 730941f commit 852c3ca
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 504 deletions.
89 changes: 0 additions & 89 deletions app/controllers/eald_payments_controller.rb

This file was deleted.

8 changes: 0 additions & 8 deletions app/helpers/ticket_requests_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ def help_text_for(sym)
Kids 12 and under are free. They do need to be registered with name and age on the
ticket request form. Reach out to [email protected] if you have any questions.
HELP
when :cabins
<<-HELP
There are a limited number of wood and tent cabins available.
Both the cabins and the tents are the same price. We encourage everyone to
bring their own tents and camping gear so that they don't need a cabin.
Due to limited availability, we will obviously not be able to grant all
requests.
HELP
when :address
"We'll mail your tickets to this address."
when :needs_assistance
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/controllers/tickets_request_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class TicketsRequestController extends Controller {
evt.preventDefault();
});

$('#ticket_request_adults, #ticket_request_kids, #ticket_request_cabins, #ticket_request_early_arrival_passes, #ticket_request_late_departure_passes')
$('#ticket_request_adults, #ticket_request_kids')
.on('change keyup mouseup', function (evt) {
const numberField = $(this),
priceDisplay = numberField.find('+ .inline-price'),
Expand Down
12 changes: 0 additions & 12 deletions app/mailers/eald_payment_mailer.rb

This file was deleted.

1 change: 1 addition & 0 deletions app/mailers/ticket_request_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def request_approved(ticket_request)

@payment_url = new_event_ticket_request_payment_url(@event, @ticket_request, @auth_token)

# XXX Clean me up and make Event Addons / Ticket Request
if @event.eald?
@extra_params = {}.tap do |params|
params[:early_arrival_passes] = @ticket_request.early_arrival_passes
Expand Down
64 changes: 0 additions & 64 deletions app/models/eald_payment.rb

This file was deleted.

32 changes: 2 additions & 30 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ class Event < ApplicationRecord
GUEST_LIST_FINAL_WITHIN = 2.days

attr_accessible :name, :start_time, :end_time, :adult_ticket_price,
:early_arrival_price, :late_departure_price,
:kid_ticket_price, :cabin_price, :max_adult_tickets_per_request,
:max_kid_tickets_per_request, :max_cabins_per_request, :max_cabin_requests,
:kid_ticket_price, :max_adult_tickets_per_request, :max_kid_tickets_per_request,
:photo, :photo_cache, :tickets_require_approval, :require_mailing_address,
:require_role, :allow_financial_assistance, :allow_donations,
:ticket_sales_start_time, :ticket_sales_end_time,
Expand All @@ -67,11 +65,8 @@ class Event < ApplicationRecord
validates :end_time, presence: true
validates :adult_ticket_price, presence: true, numericality: { greater_than_or_equal_to: 0 }
validates :kid_ticket_price, allow_nil: true, numericality: { greater_than_or_equal_to: 0 }
validates :cabin_price, allow_nil: true, numericality: { greater_than_or_equal_to: 0 }
validates :max_adult_tickets_per_request, allow_nil: true, numericality: { only_integer: true, greater_than: 0 }
validates :max_kid_tickets_per_request, allow_nil: true, numericality: { only_integer: true, greater_than: 0 }
validates :max_cabins_per_request, allow_nil: true, numericality: { only_integer: true, greater_than: 0 }
validates :max_cabin_requests, allow_nil: true, numericality: { only_integer: true, greater_than: 0 }

validate :end_time_after_start_time, :sales_end_time_after_start_time, :ensure_prices_set_if_maximum_specified

Expand All @@ -88,9 +83,7 @@ class Event < ApplicationRecord
ticket_sales_end_time: START_DATE_WITH_OFFSET[7.days],

adult_ticket_price: 220,
early_arrival_price: 0,
kid_ticket_price: 0,
late_departure_price: 30,

max_adult_tickets_per_request: 6,
max_kid_tickets_per_request: 4,
Expand All @@ -100,11 +93,7 @@ class Event < ApplicationRecord
allow_donations: true,

require_mailing_address: false,
require_role: true,

max_cabins_per_request: nil,
max_cabin_requests: nil,
cabin_price: nil
require_role: true
}.freeze

def admissible_requests
Expand Down Expand Up @@ -135,13 +124,6 @@ def make_admin(user)
EventAdmin.create(user_id: user.id, event_id: id)
end

def cabins_available?
return false unless cabin_price
return true unless max_cabin_requests

ticket_requests.not_declined.sum(:cabins) < max_cabin_requests
end

StatusWidget = Struct.new(:name, :css_class)

def status
Expand Down Expand Up @@ -286,16 +268,6 @@ def ensure_prices_set_if_maximum_specified
errors.add(:max_kid_tickets_per_request,
'can be set only if a kid ticket price is set')
end

if max_cabins_per_request && cabin_price.blank?
errors.add(:max_cabins_per_request,
'can be set only if a cabin price is set')
end

if max_cabin_requests && cabin_price.blank?
errors.add(:max_cabin_requests,
'can be set only if a cabin price is set')
end
end

def ensure_require_role_set_default
Expand Down
20 changes: 5 additions & 15 deletions app/models/ticket_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def csv_columns
id
adults
kids
cabins
needs_assistance
notes
status
Expand All @@ -95,10 +94,6 @@ def csv_columns
zip_code
country_code
admin_notes
car_camping
car_camping_explanation
early_arrival_passes
late_departure_passes
guests
]
end
Expand Down Expand Up @@ -153,17 +148,15 @@ def csv_columns
# Serialize guest emails as an array in a text field.
serialize :guests, coder: Psych, type: Array

attr_accessible :user_id, :adults, :kids, :cabins, :needs_assistance,
attr_accessible :user_id, :adults, :kids, :needs_assistance,
:notes, :status, :special_price, :event_id,
:user_attributes, :user, :donation, :role, :role_explanation,
:car_camping, :car_camping_explanation, :previous_contribution,
:user_attributes, :user, :donation, :role,
:role_explanation, :previous_contribution,
:address_line1, :address_line2, :city, :state, :zip_code,
:country_code, :admin_notes, :agrees_to_terms,
:early_arrival_passes, :late_departure_passes, :guests,
:ticket_request_event_addons_attributes
:guests, :ticket_request_event_addons_attributes

normalize_attributes :notes, :role_explanation, :previous_contribution,
:admin_notes, :car_camping_explanation
normalize_attributes :notes, :role_explanation, :previous_contribution, :admin_notes

accepts_nested_attributes_for :user
accepts_nested_attributes_for :ticket_request_event_addons
Expand All @@ -175,10 +168,7 @@ def csv_columns
validates :status, presence: true, inclusion: { in: STATUSES }
validates :address_line1, :city, :state, :zip_code, :country_code, presence: { if: -> { event.try(:require_mailing_address) } }
validates :adults, presence: true, numericality: { only_integer: true, greater_than: 0 }
validates :early_arrival_passes, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :late_departure_passes, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :kids, allow_nil: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :cabins, allow_nil: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :role, presence: true, inclusion: { in: ROLES.keys }
validates :role_explanation, presence: { if: -> { role == ROLE_OTHER } }, length: { maximum: 400 }
validates :previous_contribution, length: { maximum: 250 }
Expand Down
26 changes: 0 additions & 26 deletions app/views/eald_payment_mailer/eald_payment_received.html.haml

This file was deleted.

Loading

0 comments on commit 852c3ca

Please sign in to comment.