Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore icons & tooltips on Ticket Request Page + Highlight Needing Approval #182

Merged
merged 5 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ RSpecRails/InferredSpecType:
Metrics/ClassLength:
Max: 300

Metrics/ModuleLength:
Enabled: false

Layout/HashAlignment:
Enabled: true
EnforcedColonStyle: table
Expand Down
7 changes: 1 addition & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-05-20 07:05:31 UTC using RuboCop version 1.63.5.
# on 2024-05-20 17:20:36 UTC using RuboCop version 1.63.5.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -37,11 +37,6 @@ Metrics/CyclomaticComplexity:
Metrics/MethodLength:
Max: 58

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 112

# Offense count: 10
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Expand Down
6 changes: 4 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ GEM
awesome_print (1.9.2)
base64 (0.2.0)
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.0)
bcrypt_pbkdf (1.1.1)
bcrypt_pbkdf (1.1.1-arm64-darwin)
bcrypt_pbkdf (1.1.1-x86_64-darwin)
better_errors (2.10.1)
erubi (>= 1.0.0)
rack (>= 0.9.0)
Expand Down Expand Up @@ -283,7 +285,7 @@ GEM
colorize (~> 0.8)
net_http_unix (~> 0.2)
parallel (~> 1)
racc (1.7.3)
racc (1.8.0)
rack (3.0.11)
rack-session (2.0.0)
rack (>= 3.0.0)
Expand Down
File renamed without changes
File renamed without changes
Binary file added app/assets/images/icons/comments-admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/icons/comments-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/icons/dollar-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/icons/dollar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/icons/rv-wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
4 changes: 4 additions & 0 deletions app/assets/stylesheets/site/global.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,7 @@ body {
#footer-text {
margin: 20px 0;
}

img.hover-tooltip {
cursor: pointer;
}
4 changes: 3 additions & 1 deletion app/helpers/ticket_requests_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def class_for_table_row(ticket_request)

def text_class_for_status(ticket_request)
case ticket_request.status
when 'P', 'A'
when 'P'
'bg-warning'
when 'A'
'bg-warning-subtle'
when 'D', 'R'
'bg-danger-subtle'
Expand Down
4 changes: 2 additions & 2 deletions app/views/devise/shared/_login.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

.row
.col-12
.btn-group-sm
= f.submit "Log in", class: 'btn btn-primary btn-md'
.btn-group-md
= f.submit "Log in", class: 'btn btn-primary btn-lg'
= render partial: "devise/shared/links", layout: false, locals: { resource: devise_mapping.singular, resource_name: devise_mapping.name, redirect_to: redirect_to }

10 changes: 3 additions & 7 deletions app/views/devise/shared/_register.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@

.row
.col-12
.actions
= f.submit "Register", class: 'btn btn-primary btn-large'


.row
.col-12
= link_to "Go Back ↩".html_safe, :back
.actions.btn-group-md
= f.submit "Register", class: 'btn btn-primary btn-lg'
= link_to "Go Back ↩".html_safe, :back, class: 'btn btn-warning btn-md'

6 changes: 3 additions & 3 deletions app/views/shared/_marketing.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
.container.marketing
.row
.span4.feature
%img{ src: image_path('design-tools.png') }
%img{ src: image_path('home/design-tools.png') }
%h2
Tools
%p.lead
Use tools specifically designed for organizing community and
volunteer-driven events.
.span4.feature
%img{ src: image_path('payment-savings.png') }
%img{ src: image_path('home/payment-savings.png') }
%h2
Payments
%p.lead
Accept credit card payments for your event, avoiding more-expensive
alternatives like PayPal.
.span4.feature
%img{ src: image_path('communications.png') }
%img{ src: image_path('home/communications.png') }
%h2
Communications
%p.lead
Expand Down
73 changes: 73 additions & 0 deletions app/views/ticket_requests/_table_ticket_request_statuses.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

.card
.card-header.bg-primary-subtle
.btn-group.mx-4
= link_to download_event_ticket_requests_path(event), class: 'btn btn-warning ' do
%i.icon-th-list
Download CSV ▼
.card-body
.vertical-20
%table.table.border-1.overflow-scroll.w-100
%thead.border-1.border-dark-subtle
%tr
%th.text-nowrap.bg-dark-subtle.text-left Ticket Status
%th.bg-dark-subtle.text-end.optional-medium Requests
%th.bg-dark-subtle.text-end
Tickets
- if event.kid_ticket_price
%th.bg-dark-subtle.text-end Kids
- if event.cabin_price
%th.bg-dark-subtle.text-end Cabins
%th.bg-dark-subtle.text-end Earn
%tbody
%tr
%td
%span.text-nowrap Paid
%td.text-end.optional-medium
%span= stats[:completed][:requests]
%td.text-end
%span= stats[:completed][:adults]
- if event.kid_ticket_price
%td.text-end
%span= stats[:completed][:kids]
- if event.cabin_price
%td.text-end
%span= stats[:completed][:cabins]
%td.text-end
%span
= number_to_currency(stats[:completed][:raised], precision: 0)
%tr.warning
%td.text-nowrap
Pending Approval
%td.text-end.optional-medium= stats[:pending][:requests]
%td.text-end= stats[:pending][:adults]
- if event.kid_ticket_price
%td.text-end= stats[:pending][:kids]
- if event.cabin_price
%td.text-end= stats[:pending][:cabins]
%td.text-end
%span.muted
= number_to_currency(stats[:pending][:raised], precision: 0)
%tr.success
%td.text-nowrap
Awaiting Payment
%td.text-end.optional-medium= stats[:awaiting_payment][:requests]
%td.text-end= stats[:awaiting_payment][:adults]
- if event.kid_ticket_price
%td.text-end= stats[:awaiting_payment][:kids]
- if event.cabin_price
%td.text-end= stats[:awaiting_payment][:cabins]
%td.text-end
%span.muted
= number_to_currency(stats[:awaiting_payment][:raised], precision: 0)
%tr.muted.border-1.border-dark-subtle
%td.bg-dark-subtle.text-start.fs-6
%strong
Total
%td.bg-dark-subtle.text-end.optional-medium= stats[:total][:requests]
%td.bg-dark-subtle.text-end.fs-6= stats[:total][:adults]
- if event.kid_ticket_price
%td.bg-dark-subtle.text-end.fs-6= stats[:total][:kids]
- if event.cabin_price
%td.bg-dark-subtle.text-end.fs-6= stats[:total][:cabins]
%td.bg-dark-subtle.text-end.fs-6= number_to_currency(stats[:total][:raised], precision: 0)
115 changes: 115 additions & 0 deletions app/views/ticket_requests/_table_ticket_requests.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

.card
.card-body.overflow-x-scroll
%table.table
%thead.border-1.border-dark-subtle
%tr
%th.bg-dark-subtle Name
%th.bg-dark-subtle.optional-medium Role
%th.bg-dark-subtle
%th.bg-dark-subtle.text-end.optional-medium Tickets
- if event.kid_ticket_price
%th.bg-dark-subtle.text-end.optional-medium Kids
- if event.cabin_price
%th.bg-dark-subtle.text-end.optional-medium Cabins
- if event.eald?
%th.bg-dark-subtle.text-end.optional-medium EA/LD
%th.bg-dark-subtle.text-end Total
%th.bg-dark-subtle.text-end.optional-medium Date Requested
%th.bg-dark-subtle.text-center Status
%th.bg-dark-subtle.text-end Payment
%tbody
- ticket_requests.each do |ticket_request|
%tr{ class: class_for_table_row(ticket_request) }
%td.align-content-center.ticket-user
= link_to event_ticket_request_path(event, ticket_request) do
= ticket_request.user.name

%td.muted.align-content-center.optional-medium
= TicketRequest::ROLES[ticket_request.role]
- if ticket_request.role_explanation.present?
%i.icon-comment.hover-tooltip{ title: ticket_request.role_explanation }

%td.align-content-center
- if ticket_request.admin_notes.present?
= image_tag('icons/comments-admin.png', width: 20, class: 'hover-tooltip', title: "Admin Notes:\n" + ticket_request.admin_notes)
- if ticket_request.car_camping
= image_tag('icons/car.png', width: 20, class: 'hover-tooltip', title: "Car/RV Request:\n" + ticket_request.car_camping_explanation)
- if ticket_request.needs_assistance
= image_tag('icons/dollar.png', width: 20, class: 'hover-tooltip', title: 'Financial Assistance was requested.')
- if ticket_request.notes.present?
= image_tag('icons/comments-user.png', width: 20, class: 'hover-tooltip', title: "User Comments:\n" + ticket_request.notes)

%td.align-content-center.text-end.optional-medium= ticket_request.adults

- if event.kid_ticket_price
%td.align-content-center.text-end.optional-medium= ticket_request.kids

- if event.cabin_price
%td.align-content-center.text-end.optional-medium= ticket_request.cabins

- if event.eald?
%td.align-content-center.text-end.optional-medium
#{ticket_request.early_arrival_passes} / #{ticket_request.late_departure_passes}
-# %br
-# - if eald_requested?(ticket_request)
-# - if eald_paid?(ticket_request)
-# ✔︎ EALD Paid
-# - else
-# ✘ Not All EALD Bought
-# - else
-# ✘ Not Requested
%td.align-content-center.text-end
%span{ class: ('label label-info' if ticket_request.special_price) }
= number_to_currency(ticket_request.price, precision: 0)

%td.align-content-center.text-end.optional-medium.text-nowrap.small
= ticket_request.created_at.to_date

%td.align-content-center.text-center.ticket-status
%span.p-2.rounded.small.bi-credit-card.text-black{ class: text_class_for_status(ticket_request) }
= text_for_status ticket_request
- if ticket_request.payment && !ticket_request.payment.received?
%i.icon-comment.hover-tooltip{ title: ticket_request.payment.explanation }

%td.align-content-end.text-end
- if event.tickets_require_approval && ticket_request.pending?
.btn-group
= button_to approve_event_ticket_request_path(event, ticket_request),
method: :post,
class: 'btn btn-primary btn-sm text-nowrap' do
✔︎ Approve
= button_to decline_event_ticket_request_path(event, ticket_request),
method: :post,
class: 'btn btn-danger btn-sm text-nowrap',
data: { confirm: "Are you sure you want to decline #{ticket_request.user.name}'s request?" } do
✘ Decline
- elsif !ticket_request.payment
.btn-group
- if ticket_request.declined?
= button_to revert_to_pending_event_ticket_request_path(event, ticket_request),
method: :post,
class: 'btn btn-danger btn-sm text-nowrap' do
↩︎ Revert
- elsif !ticket_request.completed?
= button_to resend_approval_event_ticket_request_path(event, ticket_request),
method: :post,
class: 'btn btn-primary btn-sm text-nowrap' do
↺ Re-Approve
= button_to manual_confirmation_event_ticket_request_payments_path(event, ticket_request),
method: :post,
class: 'btn btn-success btn-sm text-nowrap' do
$ Received
= button_to decline_event_ticket_request_path(event, ticket_request),
method: :post,
class: 'btn btn-danger btn-sm text-nowrap',
data: { confirm: "Are you sure you want to decline #{ticket_request.user.name}'s already approved request?" } do
✘ Decline

- elsif ticket_request.payment && ticket_request.awaiting_payment? && !ticket_request.payment_received?
.btn-group.pull-right
= button_to manual_confirmation_event_ticket_request_payments_path(event, ticket_request),
method: :post,
class: 'btn btn-primary btn-sm ' do
Mark as Received
%i.icon-ok
Loading