Merge 45154a8703 into 301ad1c722
This commit is contained in:
commit
16a7f11e75
4 changed files with 41 additions and 17 deletions
|
|
@ -16,6 +16,7 @@ class TicketPurchase < ActiveRecord::Base
|
||||||
delegate :price, to: :ticket
|
delegate :price, to: :ticket
|
||||||
delegate :price_cents, to: :ticket
|
delegate :price_cents, to: :ticket
|
||||||
delegate :price_currency, to: :ticket
|
delegate :price_currency, to: :ticket
|
||||||
|
delegate :payment_mode, to: :ticket
|
||||||
|
|
||||||
def self.purchase(conference, user, purchases)
|
def self.purchase(conference, user, purchases)
|
||||||
errors = []
|
errors = []
|
||||||
|
|
|
||||||
|
|
@ -89,29 +89,48 @@
|
||||||
%span.fa-stack
|
%span.fa-stack
|
||||||
%i.fa.fa-square-o.fa-stack-2x
|
%i.fa.fa-square-o.fa-stack-2x
|
||||||
%i.fa.fa-ticket.fa-stack-1x
|
%i.fa.fa-ticket.fa-stack-1x
|
||||||
Tickets
|
Booked Tickets
|
||||||
-if @tickets.any?
|
-if @tickets.any?
|
||||||
= "(#{@total_price} #{@tickets.first.price.symbol})"
|
= "(#{@total_price} #{@tickets.first.price.symbol})"
|
||||||
|
Offline Payments
|
||||||
%ul
|
%ul
|
||||||
- @tickets.each do |ticket|
|
- @tickets.each do |ticket|
|
||||||
%li
|
-if ticket.payment_mode == "Offline"
|
||||||
= ticket.quantity
|
%li
|
||||||
= ticket.title
|
= ticket.quantity
|
||||||
= word_pluralize(ticket.quantity, 'Ticket')
|
= ticket.title
|
||||||
for
|
= word_pluralize(ticket.quantity, 'Ticket')
|
||||||
= humanized_money ticket.price
|
for
|
||||||
= ticket.price.symbol
|
= humanized_money ticket.price
|
||||||
= link_to conference_ticket_purchase_path(@conference.short_title, ticket.id), method: :delete,
|
= ticket.price.symbol
|
||||||
|
= link_to conference_ticket_purchase_path(@conference.short_title, ticket.id), method: :delete,
|
||||||
id: "ticket-#{ticket.id}-delete",
|
id: "ticket-#{ticket.id}-delete",
|
||||||
class: 'btn btn-danger btn-xs',
|
class: 'btn btn-danger btn-xs',
|
||||||
data: { confirm: "Do you really want to delete the #{ticket.title} ticket for #{@conference.title}?" } do
|
data: { confirm: "Do you really want to delete the #{ticket.title} ticket for #{@conference.title}?" } do
|
||||||
%i.fa.fa-trash-o
|
%i.fa.fa-trash-o
|
||||||
%li
|
|
||||||
- if @tickets.any?
|
Online Payments
|
||||||
= link_to 'Buy more tickets', conference_tickets_path(@conference.short_title)
|
%ul
|
||||||
- else
|
- @tickets.each do |ticket|
|
||||||
You haven't bought any tickets.
|
-if ticket.payment_mode == "Online"
|
||||||
= link_to 'Please buy some tickets to support us!', conference_tickets_path(@conference.short_title)
|
%li
|
||||||
|
= ticket.quantity
|
||||||
|
= ticket.title
|
||||||
|
= word_pluralize(ticket.quantity, 'Ticket')
|
||||||
|
for
|
||||||
|
= humanized_money ticket.price
|
||||||
|
= ticket.price.symbol
|
||||||
|
= link_to conference_ticket_purchase_path(@conference.short_title, ticket.id), method: :delete,
|
||||||
|
id: "ticket-#{ticket.id}-delete",
|
||||||
|
class: 'btn btn-danger btn-xs',
|
||||||
|
data: { confirm: "Do you really want to delete the #{ticket.title} ticket for #{@conference.title}?" } do
|
||||||
|
%i.fa.fa-trash-o
|
||||||
|
|
||||||
|
- if @tickets.any?
|
||||||
|
= link_to 'Buy more tickets', conference_tickets_path(@conference.short_title)
|
||||||
|
- else
|
||||||
|
You haven't bought any tickets.
|
||||||
|
= link_to 'Please buy some tickets to support us!', conference_tickets_path(@conference.short_title)
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
%h5.media-heading
|
%h5.media-heading
|
||||||
-if !ticket.description.blank?
|
-if !ticket.description.blank?
|
||||||
= markdown(ticket.description)
|
= markdown(ticket.description)
|
||||||
|
%td.col-sm-q.col-md-1
|
||||||
|
= ticket.payment_mode
|
||||||
%td.col-sm-1.col-md-1
|
%td.col-sm-1.col-md-1
|
||||||
- if ticket.bought?(current_user)
|
- if ticket.bought?(current_user)
|
||||||
= text_field_tag("tickets[][#{ticket.id}]", ticket.quantity_bought_by(current_user),
|
= text_field_tag("tickets[][#{ticket.id}]", ticket.quantity_bought_by(current_user),
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th Ticket
|
%th Ticket
|
||||||
|
%th Payment
|
||||||
%th Quantity
|
%th Quantity
|
||||||
%th Price
|
%th Price
|
||||||
%th Total
|
%th Total
|
||||||
|
|
@ -21,6 +22,7 @@
|
||||||
- @conference.tickets.each do |ticket|
|
- @conference.tickets.each do |ticket|
|
||||||
= render partial: 'ticket', f: f, locals: {ticket: ticket}
|
= render partial: 'ticket', f: f, locals: {ticket: ticket}
|
||||||
%tr
|
%tr
|
||||||
|
%td
|
||||||
%td
|
%td
|
||||||
%td
|
%td
|
||||||
%td.col-sm-1.col-md-1.text-center
|
%td.col-sm-1.col-md-1.text-center
|
||||||
|
|
@ -43,4 +45,4 @@
|
||||||
.col-md-13
|
.col-md-13
|
||||||
%p.text-muted.text-center
|
%p.text-muted.text-center
|
||||||
%small
|
%small
|
||||||
* Buying a ticket is not mandatory. Checkout will be at the conference registration.
|
* Buying a ticket is not mandatory. Checkout will be at the conference registration.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue