Skip to content

Commit

Permalink
Merge pull request #254 from fnf-org/mfl/fix-zero-addons
Browse files Browse the repository at this point in the history
Mfl/fix zero addons
  • Loading branch information
beingmattlevy authored Jul 31, 2024
2 parents 8267190 + d176d0b commit 6077f0d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.3.2
8 changes: 4 additions & 4 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ def active_event_addons?
event_addons.where('price > ?', 0).count.positive?
end

def active_event_addons_passes?
@active_event_addons_passes ||= active_event_addons_by_category(Addon::CATEGORY_PASS).count
def active_event_addons_passes_count
active_event_addons_by_category(Addon::CATEGORY_PASS).count
end

def active_event_addons_camping?
@active_event_addons_camping ||= active_event_addons_by_category(Addon::CATEGORY_CAMP).count
def active_event_addons_camping_count
active_event_addons_by_category(Addon::CATEGORY_CAMP).count
end

def active_event_addons_by_category(category)
Expand Down
20 changes: 10 additions & 10 deletions app/views/ticket_requests/_table_ticket_request_statuses.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
%th.bg-dark-subtle.text-end Tickets
- if event.kid_ticket_price
%th.bg-dark-subtle.text-end Kids
- if event.active_event_addons_passes?
- if event.active_event_addons_passes_count > 0
%th.bg-dark-subtle.text-end
=Addon::HUMANIZED_CATEGORIES[Addon::CATEGORY_PASS]
- if event.active_event_addons_camping?
- if event.active_event_addons_camping_count > 0
%th.bg-dark-subtle.text-end
=Addon::HUMANIZED_CATEGORIES[Addon::CATEGORY_CAMP]
%th.bg-dark-subtle.text-end Earn
Expand All @@ -41,10 +41,10 @@
- if event.kid_ticket_price
%td.text-end.bg-success-subtle
%span= stats[:completed][:kids]
- if event.active_event_addons_passes?
- if event.active_event_addons_passes_count > 0
%td.text-end.bg-success-subtle
%span= stats[:completed][:addon_passes]
- if event.active_event_addons_camping?
- if event.active_event_addons_camping_count > 0
%td.text-end.bg-success-subtle
%span= stats[:completed][:addon_camping]
%td.text-end.bg-success-subtle
Expand All @@ -58,9 +58,9 @@
%td.text-end.bg-warning= stats[:pending][:adults]
- if event.kid_ticket_price
%td.text-end.bg-warning= stats[:pending][:kids]
- if event.active_event_addons_passes?
- if event.active_event_addons_passes_count > 0
%td.text-end.bg-warning= stats[:pending][:addon_passes]
- if event.active_event_addons_camping?
- if event.active_event_addons_camping_count > 0
%td.text-end.bg-warning= stats[:pending][:addon_camping]
%td.text-end.bg-warning.fs-6
= number_to_currency(stats[:pending][:raised], precision: 0)
Expand All @@ -72,9 +72,9 @@
%td.text-end.bg-warning-subtle= stats[:awaiting_payment][:adults]
- if event.kid_ticket_price
%td.text-end.bg-warning-subtle= stats[:awaiting_payment][:kids]
- if event.active_event_addons_passes?
- if event.active_event_addons_passes_count > 0
%td.text-end.bg-warning-subtle= stats[:awaiting_payment][:addon_passes]
- if event.active_event_addons_camping?
- if event.active_event_addons_camping_count > 0
%td.text-end.bg-warning-subtle= stats[:awaiting_payment][:addon_camping]
%td.text-end.bg-warning-subtle.fs-6
= number_to_currency(stats[:awaiting_payment][:raised], precision: 0)
Expand All @@ -87,8 +87,8 @@
%td.bg-dark-subtle.text-end= stats[:total][:adults]
- if event.kid_ticket_price
%td.bg-dark-subtle.text-end= stats[:total][:kids]
- if event.active_event_addons_passes?
- if event.active_event_addons_passes_count > 0
%td.bg-dark-subtle.text-end= stats[:total][:addon_passes]
- if event.active_event_addons_camping?
- if event.active_event_addons_camping_count > 0
%td.bg-dark-subtle.text-end= stats[:total][:addon_camping]
%td.bg-dark-subtle.text-end.fs-5= number_to_currency(stats[:total][:raised], precision: 0)
4 changes: 2 additions & 2 deletions app/views/ticket_requests/_table_ticket_requests.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
- if ticket_request.needs_assistance
= tooltip_box('Financial Assistance was requested.') do
= image_tag('icons/dollar.png', width: 20, class: 'hover-tooltip')
- if ticket_request.active_addon_camp_sum
- if ticket_request.active_addon_camp_sum > 0
= tooltip_box(ticket_request.active_addon_camp_sum, title: "Camping:") do
= image_tag('icons/car.png', width: 20, class: 'hover-tooltip')
- if ticket_request.active_addon_pass_sum
- if ticket_request.active_addon_pass_sum > 0
= tooltip_box(ticket_request.active_addon_pass_sum, title: "Passes:") do
= image_tag('icons/pass.png', width: 20, class: 'hover-tooltip')
- if ticket_request.admin_notes.present?
Expand Down

0 comments on commit 6077f0d

Please sign in to comment.