Introduced Physical Ticket

Added PhysicalTicket model and controller. It holds the information about each physical ticket bought at the purchase. Physical Tickets are created after every successfull payment.
This commit is contained in:
Siddhant Bajaj 2017-06-03 16:05:59 +05:30 committed by siddhantbajaj
parent 1c38b091cc
commit 5c56683ae8
17 changed files with 115 additions and 12 deletions

View file

@ -38,3 +38,5 @@
= link_to 'Subscribe', conference_subscriptions_path(conference.short_title), method: :post, class: 'btn btn-default'
- else
= link_to 'Unsubscribe', conference_subscriptions_path(conference.short_title), method: :delete, class: 'btn btn-default'
- if current_user && current_user.physical_tickets.by_conference(conference).any?
= link_to "My Tickets", conference_physical_ticket_index_path(conference.short_title), class: 'btn btn-default'

View file

@ -0,0 +1,35 @@
.container
.row
.col-md-12.page-header
%h2
Tickets
.text-muted
Your tickets for the conference
.col-md-12
- if @physical_tickets.present?
%table.table.table-bordered.table-striped.table-hover#roles
%thead
%th ID
%th Type
%th User
%th Actions
%tbody
- @physical_tickets.each do |physical_ticket|
%tr
%td= physical_ticket.id
%td= physical_ticket.ticket.title
%td= physical_ticket.user.name
%td
.btn-group
= link_to 'Show',
conference_physical_ticket_path(@conference.short_title,
physical_ticket.id),
class: 'btn btn-primary'
= link_to 'Generate PDF',
conference_physical_ticket_path(@conference.short_title,
physical_ticket.id,
format: :pdf),
class: 'button btn btn-default btn-info'
- else
%h5 No Tickets found!

View file