add payment views, styling and its helper methods
This commit is contained in:
parent
81ef41be8b
commit
14594c7a4d
7 changed files with 118 additions and 0 deletions
34
app/views/payments/_payment.html.haml
Normal file
34
app/views/payments/_payment.html.haml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
= semantic_form_for(@payment, url: conference_payments_path) do |f|
|
||||
.form-group
|
||||
= f.label :first_name, 'First name(as on card)'
|
||||
= f.text_field :first_name, class: "form-control", placeholder: "John"
|
||||
.form-group
|
||||
= f.label :last_name, 'Last name(as on card)'
|
||||
= f.text_field :last_name,class: "form-control", placeholder: "Doe"
|
||||
%span.pull-right
|
||||
%img.img-responsive{:src => image_url('credit_card.png')}
|
||||
.form-group
|
||||
= f.label :credit_card_number, "Credit Card number(without spaces)"
|
||||
.input-group
|
||||
= f.text_field :credit_card_number, class: "form-control", placeholder: "XXXX XXXX XXXX XXXX"
|
||||
%span.input-group-addon
|
||||
%i.fa.fa-credit-card
|
||||
.form-group.col-md-6
|
||||
= f.label :expiration_month
|
||||
= f.select :expiration_month, months, {}, class: "form-control"
|
||||
.form-group.col-md-6
|
||||
= f.label :expiration_year
|
||||
= f.select :expiration_year, years, {}, class: "form-control"
|
||||
.form-group.col-md-10
|
||||
= f.label :card_verification_value, 'Security Code(3 on back, AmEx: 4 on front)'
|
||||
= f.text_field :card_verification_value, class: "form-control", placeholder: "XXX"
|
||||
= f.number_field :amount, value: @total_amount_to_pay, class: "form-control", type: 'hidden'
|
||||
%ul.price-tags.pull-right
|
||||
%li.text-muted
|
||||
you will pay
|
||||
%li
|
||||
%a
|
||||
= number_to_currency @total_amount_to_pay
|
||||
.form-group
|
||||
= f.submit "Charge Card", class: "btn btn-primary"
|
||||
= link_to "Cancel", conference_conference_registrations_path, class: "btn btn-danger"
|
||||
32
app/views/payments/index.html.haml
Normal file
32
app/views/payments/index.html.haml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Payment Attempts for
|
||||
= @conference.title
|
||||
- if !flash[:notice].blank?
|
||||
.alert.alert-success
|
||||
= flash[:notice]
|
||||
%table.table.table-bordered.table-striped
|
||||
%tr
|
||||
%th First Name
|
||||
%th Last Name
|
||||
%th Last 4
|
||||
%th Amount
|
||||
%th Status
|
||||
%th Authorization Code
|
||||
- if @payments.size > 0
|
||||
- @payments.each do |payment|
|
||||
%tr
|
||||
%td= payment.first_name
|
||||
%td= payment.last_name
|
||||
%td= payment.last4
|
||||
%td= number_to_currency payment.amount
|
||||
%td= payment.status
|
||||
%td= payment.authorization_code
|
||||
- else
|
||||
%tr
|
||||
%td{:colspan => "5"} No payments have been attempted.
|
||||
.pull-right
|
||||
= link_to "Conference Registration", conference_conference_registrations_path(@conference.short_title), class: 'btn btn-primary'
|
||||
14
app/views/payments/new.html.haml
Normal file
14
app/views/payments/new.html.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
.container
|
||||
.row
|
||||
.col-xs-6.col-xs-offset-3
|
||||
%h1
|
||||
Buy tickets for
|
||||
= @total_amount_to_pay.symbol
|
||||
= humanized_money @total_amount_to_pay
|
||||
- if @payment.errors.any?
|
||||
.alert.alert-danger
|
||||
%ul
|
||||
- @payment.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
.col-xs-6.col-xs-offset-3.well
|
||||
= render partial: 'payment'
|
||||
Loading…
Add table
Add a link
Reference in a new issue