Improve the physical_tickets page

This commit is contained in:
Michael Ball 2020-07-13 04:21:31 -07:00
parent 0dffc20ad1
commit 61ca626df1
2 changed files with 10 additions and 6 deletions

View file

@ -8,6 +8,7 @@ class PhysicalTicketsController < ApplicationController
def index def index
@physical_tickets = current_user.physical_tickets.by_conference(@conference) @physical_tickets = current_user.physical_tickets.by_conference(@conference)
@has_registration_ticket = current_user.ticket_purchases.where(ticket: @conference.registration_tickets, paid: true).any?
@unpaid_ticket_purchases = current_user.ticket_purchases.by_conference(@conference).unpaid @unpaid_ticket_purchases = current_user.ticket_purchases.by_conference(@conference).unpaid
@user = current_user @user = current_user
end end

View file

@ -9,14 +9,17 @@
.text-muted .text-muted
Your tickets for the conference Your tickets for the conference
- if !@conference.user_registered?(@user) -# TODO: And if they have a registration ticket?
.row - if !@conference.user_registered?(@user) && @has_registration_ticket
.col-md-12 .col-md-12
.alert.alert-success{role: 'alert'}
= link_to 'Complete Registration',
new_conference_conference_registration_path(@conference),
class: 'btn btn-info pull-right btn-lg'
%h3
🎉 Thanks for getting a #{@conference.title} ticket! One last step...
%strong %strong
You are not yet registered for the conference. You are not yet registered for the conference.
= link_to 'Complete Registration',
conference_conference_registration_path(@conference),
class: 'btn btn-success pull-right'
.col-md-12 .col-md-12
- if @physical_tickets.present? - if @physical_tickets.present?