From 61ca626df14627b3818448e4771f99c25f2ae001 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 13 Jul 2020 04:21:31 -0700 Subject: [PATCH] Improve the physical_tickets page --- app/controllers/physical_tickets_controller.rb | 1 + app/views/physical_tickets/index.html.haml | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/controllers/physical_tickets_controller.rb b/app/controllers/physical_tickets_controller.rb index b4404aa7..96fffb09 100644 --- a/app/controllers/physical_tickets_controller.rb +++ b/app/controllers/physical_tickets_controller.rb @@ -8,6 +8,7 @@ class PhysicalTicketsController < ApplicationController def index @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 @user = current_user end diff --git a/app/views/physical_tickets/index.html.haml b/app/views/physical_tickets/index.html.haml index cc7dbae2..f05215d7 100644 --- a/app/views/physical_tickets/index.html.haml +++ b/app/views/physical_tickets/index.html.haml @@ -9,14 +9,17 @@ .text-muted Your tickets for the conference - - if !@conference.user_registered?(@user) - .row - .col-md-12 + -# TODO: And if they have a registration ticket? + - if !@conference.user_registered?(@user) && @has_registration_ticket + .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 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 - if @physical_tickets.present?