use full_name instead of first and last name, test changes, schema improvements

This commit is contained in:
Rishabh Saxena 2016-07-21 22:43:43 +05:30
parent f00e051eff
commit 6d8605073f
10 changed files with 25 additions and 81 deletions

View file

@ -1,14 +1,11 @@
= 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", id: "first_name"
.form-group
= f.label :last_name, 'Last name(as on card)'
= f.text_field :last_name,class: "form-control", placeholder: "Doe", id: "last_name"
= f.label :full_name, 'Full name (as on card)'
= f.text_field :full_name, class: "form-control", placeholder: "John Doe", id: "full_name"
%span.pull-right
%img.img-responsive{:src => image_url('credit_card.png')}
.form-group
= f.label :credit_card_number, "Credit Card number(without spaces)"
= 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", id: "credit_card_number"
%span.input-group-addon
@ -20,7 +17,7 @@
= f.label :expiration_year
= f.select :expiration_year, years, {}, class: "form-control", id: "expiration_year"
.form-group.col-md-10
= f.label :card_verification_value, 'Security Code(3 on back, AmEx: 4 on front)'
= 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", id: "card_verification_value"
= f.number_field :amount, value: @total_amount_to_pay, class: "form-control", type: 'hidden'
%ul.price-tags.pull-right

View file

@ -1,32 +0,0 @@
.container
.row
.col-md-12
.page-header
%h1
Payment Attempts for
= @conference.title
- if flash[:notice].present?
.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_registration_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -8,12 +8,8 @@
-if !ticket.description.blank?
= markdown(ticket.description)
%td.col-sm-1.col-md-1
- if ticket.bought?(current_user)
= text_field_tag("tickets[][#{ticket.id}]", 0,
= text_field_tag("tickets[][#{ticket.id}]", 0,
type: 'number', min: 0, class: "form-control quantity", 'data-id' => ticket.id)
- else
= text_field_tag("tickets[][#{ticket.id}]", 0, type: 'number', min: 0,
class: "form-control quantity", 'data-id' => ticket.id)
%td.col-sm-1.col-md-1.text-center
= ticket.price.symbol
%span{id: "price_#{ticket.id}"}