cartify 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +69 -0
- data/Rakefile +32 -0
- data/app/assets/config/cartify_manifest.js +2 -0
- data/app/assets/javascripts/cartify/application.js +14 -0
- data/app/assets/javascripts/cartify/checkout.js +11 -0
- data/app/assets/javascripts/cartify/masks.js +10 -0
- data/app/assets/javascripts/cartify/orders.js +7 -0
- data/app/assets/stylesheets/cartify/application.css +15 -0
- data/app/concerns/cartify/authenticatable.rb +17 -0
- data/app/concerns/cartify/current_session.rb +52 -0
- data/app/concerns/cartify/showable.rb +41 -0
- data/app/concerns/cartify/updatable.rb +39 -0
- data/app/controllers/cartify/addresses_controller.rb +18 -0
- data/app/controllers/cartify/application_controller.rb +6 -0
- data/app/controllers/cartify/carts_controller.rb +20 -0
- data/app/controllers/cartify/checkout_controller.rb +29 -0
- data/app/controllers/cartify/order_items_controller.rb +35 -0
- data/app/controllers/cartify/orders_controller.rb +17 -0
- data/app/decorator/cartify/order_decorator.rb +39 -0
- data/app/forms/cartify/addresses_form.rb +71 -0
- data/app/helpers/cartify/application_helper.rb +18 -0
- data/app/helpers/cartify/carts_helper.rb +10 -0
- data/app/helpers/cartify/checkout_helper.rb +22 -0
- data/app/helpers/cartify/order_helper.rb +12 -0
- data/app/models/cartify/address.rb +23 -0
- data/app/models/cartify/application_record.rb +5 -0
- data/app/models/cartify/billing.rb +4 -0
- data/app/models/cartify/coupon.rb +10 -0
- data/app/models/cartify/credit_card.rb +25 -0
- data/app/models/cartify/delivery.rb +8 -0
- data/app/models/cartify/order.rb +64 -0
- data/app/models/cartify/order_item.rb +39 -0
- data/app/models/cartify/order_status.rb +18 -0
- data/app/models/cartify/shipping.rb +4 -0
- data/app/queries/cartify/orders_query.rb +17 -0
- data/app/views/cartify/addresses/index.haml +9 -0
- data/app/views/cartify/carts/_order_items.haml +17 -0
- data/app/views/cartify/carts/_order_summary.haml +15 -0
- data/app/views/cartify/carts/_quantity.haml +7 -0
- data/app/views/cartify/carts/_xs_order_items.haml +24 -0
- data/app/views/cartify/carts/show.html.haml +22 -0
- data/app/views/cartify/checkout/_order_summary.haml +4 -0
- data/app/views/cartify/checkout/_progress.haml +21 -0
- data/app/views/cartify/checkout/addresses.haml +35 -0
- data/app/views/cartify/checkout/complete.haml +19 -0
- data/app/views/cartify/checkout/confirm.haml +27 -0
- data/app/views/cartify/checkout/delivery.haml +11 -0
- data/app/views/cartify/checkout/login.haml +39 -0
- data/app/views/cartify/checkout/partials/_addresses_short.haml +12 -0
- data/app/views/cartify/checkout/partials/_delivery-lg.haml +22 -0
- data/app/views/cartify/checkout/partials/_delivery-xs.haml +22 -0
- data/app/views/cartify/checkout/partials/_list_of_items.haml +54 -0
- data/app/views/cartify/checkout/payment.haml +27 -0
- data/app/views/cartify/order_items/create.js.erb +5 -0
- data/app/views/cartify/order_items/destroy.js.erb +3 -0
- data/app/views/cartify/order_items/update.js.erb +3 -0
- data/app/views/cartify/orders/_filters.haml +16 -0
- data/app/views/cartify/orders/_orders-lg.haml +10 -0
- data/app/views/cartify/orders/_orders-xs.haml +23 -0
- data/app/views/cartify/orders/index.haml +21 -0
- data/app/views/cartify/orders/show.haml +28 -0
- data/app/views/cartify/shared/_address.haml +28 -0
- data/app/views/cartify/shared/_addresses_form.haml +31 -0
- data/app/views/cartify/shared/_checkout_summary_numbers.haml +15 -0
- data/app/views/cartify/shared/_order_summary_numbers.haml +15 -0
- data/config/locales/en.yml +135 -0
- data/config/routes.rb +9 -0
- data/db/migrate/20171005130857_create_cartify_coupons.rb +8 -0
- data/db/migrate/20171005131198_create_cartify_credit_cards.rb +12 -0
- data/db/migrate/20171005131199_create_cartify_deliveries.rb +9 -0
- data/db/migrate/20171005131200_create_cartify_order_statuses.rb +7 -0
- data/db/migrate/20171005131201_create_cartify_orders.rb +19 -0
- data/db/migrate/20171005131202_create_cartify_order_items.rb +14 -0
- data/db/migrate/20171006133037_create_cartify_addresses.rb +17 -0
- data/lib/cartify.rb +19 -0
- data/lib/cartify/engine.rb +30 -0
- data/lib/cartify/version.rb +5 -0
- data/lib/generators/initializer/USAGE +49 -0
- data/lib/generators/initializer/initializer_generator.rb +17 -0
- data/lib/generators/initializer/templates/initializer.rb +10 -0
- data/lib/tasks/cartify_tasks.rake +4 -0
- metadata +478 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
- @order_items.each do |order_item|
|
2
|
+
%tr
|
3
|
+
%td
|
4
|
+
.general-img-wrap-table
|
5
|
+
= link_to main_app.book_path(order_item.product) do
|
6
|
+
= image_tag img_of(order_item.product), alt: 'design-book', class: 'cart-img-shadow pull-left'
|
7
|
+
%td
|
8
|
+
= link_to main_app.book_path(order_item.product), class: 'text-as-link' do
|
9
|
+
%p.title= order_item.product.title
|
10
|
+
%td
|
11
|
+
%span.font-16.in-gold-500= number_to_currency(order_item.product.price)
|
12
|
+
= render 'cartify/carts/quantity', order_item: order_item
|
13
|
+
%td
|
14
|
+
%span.font-16.in-gold-500= number_to_currency(order_item.total_price)
|
15
|
+
%td
|
16
|
+
= button_to cartify.order_item_path(order_item), { data: { confirm: "Are you sure you wish to delete the book '#{order_item.product.title}' from your cart?" }, method: :delete, remote: true, class: "close general-cart-close", 'aria-label': 'Close' } do
|
17
|
+
%span{'aria-hidden': "true"} ×
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.general-order-wrap
|
2
|
+
.row
|
3
|
+
.col-sm-4
|
4
|
+
.input-group.general-input-group
|
5
|
+
= form_tag cart_path, method: :put
|
6
|
+
= label_tag :name, t('cart.coupon'), class: 'input-label'
|
7
|
+
= text_field_tag(:name, nil, placeholder: t('cart.coupon'), class: 'form-control mb-30')
|
8
|
+
%div
|
9
|
+
%button.btn.btn-primary.mr-5.mb-15.visible-xs-inline-block= t('cart.apply_coupon')
|
10
|
+
= submit_tag t('cart.update'), class: 'btn btn-primary mb-15 res-block'
|
11
|
+
.col-sm-8
|
12
|
+
.res-mr-200.text-center.general-text-right
|
13
|
+
%p.in-gold-500.font-18= t('cart.summary')
|
14
|
+
%table.general-summary-table.general-summary-table-right.general-text-right
|
15
|
+
= render 'cartify/shared/order_summary_numbers'
|
@@ -0,0 +1,7 @@
|
|
1
|
+
%td
|
2
|
+
.input-group
|
3
|
+
= link_to cartify.order_item_path(id: order_item.id, order_item: {quantity: order_item.quantity-1}), class: 'input-link', id: "order_#{order_item.id}_minus", method: :put, remote: true do
|
4
|
+
%i.fa.fa-minus.line-height-40
|
5
|
+
%input.form-control.quantity-input{type: 'text', value: order_item.quantity}
|
6
|
+
= link_to cartify.order_item_path(id: order_item.id, order_item: {quantity: order_item.quantity+1}), class: 'input-link', id: "order_#{order_item.id}_plus", method: :put, remote: true do
|
7
|
+
%i.fa.fa-plus.line-height-40
|
@@ -0,0 +1,24 @@
|
|
1
|
+
- @order_items.each do |order_item|
|
2
|
+
.general-cart-item.divider-lg-bottom
|
3
|
+
= button_to order_items_path(order_item), { data: { confirm: "Are you sure you wish to delete the book '#{order_item.product.title}' from your cart?" }, method: :delete, remote: true, class: "close general-cart-close", 'aria-label': 'Close' } do
|
4
|
+
%span{'aria-hidden': "true"} ×
|
5
|
+
.general-img-wrap-table
|
6
|
+
= link_to main_app.book_path(order_item.product) do
|
7
|
+
= image_tag img_of(order_item.product), alt: 'design-book', class: 'cart-img-shadow'
|
8
|
+
= link_to main_app.book_path(order_item.product), class: 'text-as-link' do
|
9
|
+
%p.title= order_item.product.title
|
10
|
+
%table.table
|
11
|
+
%tr
|
12
|
+
%td
|
13
|
+
%span.in-grey-600= t('cart.price')
|
14
|
+
%td
|
15
|
+
%span.font-16.in-gold-500= number_to_currency(order_item.product.price)
|
16
|
+
%tr
|
17
|
+
%td.vertical-middle
|
18
|
+
%span.in-grey-600= t('cart.quantity')
|
19
|
+
= render 'cartify/carts/quantity', order_item: order_item
|
20
|
+
%tr
|
21
|
+
%td
|
22
|
+
%span.in-grey-600= t('cart.subtotal')
|
23
|
+
%td
|
24
|
+
%span.font-16.in-gold-500= number_to_currency(order_item.total_price)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
%main.container.general-main-wrap
|
2
|
+
%h1.general-title-margin= t('cart.cart')
|
3
|
+
.visible-xs
|
4
|
+
= render 'cartify/carts/xs_order_items', locals: @order_items
|
5
|
+
.hidden-xs
|
6
|
+
%table.table.table-hover
|
7
|
+
%thead
|
8
|
+
%tr
|
9
|
+
%th.col-pic.pl-0
|
10
|
+
%span.in-grey-600= t('cart.product')
|
11
|
+
%th.col-title
|
12
|
+
%th.col-price
|
13
|
+
%span.in-grey-600= t('cart.price')
|
14
|
+
%th.col-quantity
|
15
|
+
%span.in-grey-600= t('cart.quantity')
|
16
|
+
%th.col-total
|
17
|
+
%span.in-grey-600= t('cart.subtotal')
|
18
|
+
%th.col-close
|
19
|
+
= render 'cartify/carts/order_items', locals: @order_items
|
20
|
+
= render 'cartify/carts/order_summary'
|
21
|
+
.text-center
|
22
|
+
= link_to t('cart.checkout'), checkout_index_path, class: 'btn btn-default mb-20'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
%h1.general-title-margin= t('cart.checkout')
|
2
|
+
%ul.steps.list-inline
|
3
|
+
%li.step.clickable-step{ class: active_step?(:addresses), 'data-href': wizard_path(:addresses) }
|
4
|
+
%span.step-number 1
|
5
|
+
%span.step-text.hidden-xs= t('settings.address')
|
6
|
+
%li.step-divider
|
7
|
+
%li.step.clickable-step{ class: active_step?(:delivery), 'data-href': wizard_path(:delivery) }
|
8
|
+
%span.step-number 2
|
9
|
+
%span.step-text.hidden-xs=t('confirm.delivery')
|
10
|
+
%li.step-divider
|
11
|
+
%li.step.clickable-step{ class: active_step?(:payment), 'data-href': wizard_path(:payment) }
|
12
|
+
%span.step-number 3
|
13
|
+
%span.step-text.hidden-xs=t('confirm.paymant')
|
14
|
+
%li.step-divider
|
15
|
+
%li.step.clickable-step{ class: active_step?(:confirm), 'data-href': wizard_path(:confirm) }
|
16
|
+
%span.step-number 4
|
17
|
+
%span.step-text.hidden-xs=t('confirm.confirm')
|
18
|
+
%li.step-divider
|
19
|
+
%li.step.clickable-step{ class: active_step?(:complete), 'data-href': wizard_path(:complete) }
|
20
|
+
%span.step-number 5
|
21
|
+
%span.step-text.hidden-xs=t('confirm.complete')
|
@@ -0,0 +1,35 @@
|
|
1
|
+
%main.container
|
2
|
+
= render 'cartify/checkout/progress'
|
3
|
+
= form_for @addresses, url: wizard_path, method: :put, class: 'res-mb-100' do |f|
|
4
|
+
.hidden-xs.hidden-sm
|
5
|
+
.row
|
6
|
+
.col-md-5
|
7
|
+
%h3.general-subtitle= t('settings.billing')
|
8
|
+
%p.general-info-text all fields are required
|
9
|
+
.col-md-5.col-md-offset-1
|
10
|
+
%h3.general-subtitle= t('settings.shipping')
|
11
|
+
.row
|
12
|
+
.col-md-5.mb-40
|
13
|
+
.visible-xs.visible-sm
|
14
|
+
%h3.general-subtitle= t('settings.billing')
|
15
|
+
%p.general-info-text all fields are required
|
16
|
+
= f.fields_for @addresses.billing do |ff|
|
17
|
+
- bill_errors = @addresses.billing.errors
|
18
|
+
= render 'cartify/shared/address', ff: ff, errors: bill_errors
|
19
|
+
= f.hidden_field "[billing][order_id]", value: current_order.id
|
20
|
+
.col-md-5.col-md-offset-1.mb-60
|
21
|
+
.visible-xs.visible-sm
|
22
|
+
%h3.general-subtitle= t('settings.shipping')
|
23
|
+
= f.fields_for @addresses.shipping do |ff|
|
24
|
+
- ship_errors = @addresses.shipping.errors
|
25
|
+
= render 'cartify/shared/address', ff: ff, errors: ship_errors
|
26
|
+
= f.hidden_field "[shipping][order_id]", value: current_order.id
|
27
|
+
.form-group.checkbox
|
28
|
+
%label.checkbox-label
|
29
|
+
= f.check_box :use_billing, class: 'checkbox-input', id: 'use_billing', hidden: true
|
30
|
+
%span.checkbox-icon
|
31
|
+
%i.fa.fa-check
|
32
|
+
%span.checkbox-text= t('settings.use_billing')
|
33
|
+
.general-text-align.mb-60
|
34
|
+
= render 'cartify/checkout/order_summary'
|
35
|
+
= f.submit t('checkout.save_and_continue'), class: 'btn btn-default center-block mb-20'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
%main.container.general-main-wrap
|
2
|
+
= render 'cartify/checkout/progress'
|
3
|
+
.text-center.mb-40
|
4
|
+
%h3.general-subtitle= t('complete.thanks')
|
5
|
+
%p.fw-300= t('complete.has_been_sent_to') + @order.user.email.capitalize
|
6
|
+
.row.mb-20
|
7
|
+
.col-sm-6
|
8
|
+
.visible-xs
|
9
|
+
%p.general-order-number.mb-0= @order.sharp_number
|
10
|
+
%p.general-address.mb-30= @order.creation_date
|
11
|
+
= render 'cartify/checkout/partials/addresses_short', address: @order.shipping
|
12
|
+
.col-sm-6.hidden-xs.text-right
|
13
|
+
%p.general-order-number.mb-0= @order.sharp_number
|
14
|
+
%p.general-address.mb-30= @order.creation_date
|
15
|
+
= render 'cartify/checkout/partials/list_of_items', current_order: @order
|
16
|
+
.mb-55
|
17
|
+
= render 'cartify/checkout/order_summary', current_order: @order
|
18
|
+
.text-center
|
19
|
+
= link_to t('button.back_to_store'), next_wizard_path, class: 'btn btn-default mb-20'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
%main.container.general-main-wrap
|
2
|
+
= render 'cartify/checkout/progress'
|
3
|
+
.row.mb-20
|
4
|
+
.col-sm-3
|
5
|
+
%h3.general-subtitle= t('settings.shipping')
|
6
|
+
= render 'cartify/checkout/partials/addresses_short', address: @addresses.shipping
|
7
|
+
.col-sm-3
|
8
|
+
%h3.general-subtitle= t('settings.billing')
|
9
|
+
= render 'cartify/checkout/partials/addresses_short', address: @addresses.billing
|
10
|
+
.col-sm-3
|
11
|
+
%h3.general-subtitle= t('confirm.shipments')
|
12
|
+
%p.general-address
|
13
|
+
= current_order.delivery.name
|
14
|
+
%span.general-edit.clickable-step{ 'data-href': wizard_path(:delivery) }=t('confirm.edit')
|
15
|
+
%br
|
16
|
+
= current_order.delivery.duration
|
17
|
+
.col-sm-3
|
18
|
+
%h3.general-subtitle= t('confirm.payment_info')
|
19
|
+
%p.general-address
|
20
|
+
= current_order.secret_card_number
|
21
|
+
%span.general-edit.clickable-step{ 'data-href': wizard_path(:payment) }=t('confirm.edit')
|
22
|
+
%br
|
23
|
+
= current_order.credit_card.mm_yy
|
24
|
+
/ = render 'cartify/checkout/partials/list_of_items'
|
25
|
+
= render 'cartify/checkout/order_summary'
|
26
|
+
.text-center
|
27
|
+
= button_to t('checkout.place_order'), wizard_path, method: :put, class: 'btn btn-default mb-20'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%main.container.general-main-wrap
|
2
|
+
= render 'cartify/checkout/progress'
|
3
|
+
%h3.general-subtitle= t('delivery.delivery_method')
|
4
|
+
= form_for current_order, url: wizard_path do |f|
|
5
|
+
.visible-xs
|
6
|
+
= render 'cartify/checkout/partials/delivery-xs', f: f if false
|
7
|
+
.hidden-xs.mb-res-50
|
8
|
+
= render 'cartify/checkout/partials/delivery-lg', f: f
|
9
|
+
= render 'cartify/checkout/order_summary'
|
10
|
+
.text-center
|
11
|
+
= f.submit t('checkout.save_and_continue'), class: 'btn btn-default mb-20'
|
@@ -0,0 +1,39 @@
|
|
1
|
+
%main.container.general-main-wrap
|
2
|
+
.hidden-xs.hidden-sm
|
3
|
+
.row
|
4
|
+
.col-md-5.mb-40
|
5
|
+
.visible-xs.visible-sm
|
6
|
+
.text-center
|
7
|
+
%h3.general-subtitle.mt-0= t('checkout.returning_customer')
|
8
|
+
%a.general-login-icon{ href: main_app.user_facebook_omniauth_authorize_path }
|
9
|
+
%i.fa.fa-facebook-official
|
10
|
+
%p.general-login-text= t('checkout.or')
|
11
|
+
= form_for(Cartify.user_class.new, url: main_app.user_session_path, html: { class: 'general-form' }) do |f|
|
12
|
+
.form-group.mb-40
|
13
|
+
%p.fw-600= t('checkout.login_with_password')
|
14
|
+
= f.label :email, t('checkout.enter_email'), class: 'control-label input-label'
|
15
|
+
= f.email_field :email, placeholder: t('checkout.enter_email'), autofocus: true, class: 'form-control'
|
16
|
+
.form-group.mb-40
|
17
|
+
= f.label :password, t('settings.password'), class: 'control-label input-label'
|
18
|
+
= f.password_field :password, placeholder: t('settings.password'), class: 'form-control'
|
19
|
+
%a.help-block.in-gold-500{ href: main_app.new_user_password_path }= t('button.forgot_password')
|
20
|
+
.text-left
|
21
|
+
= f.submit t('checkout.login_with_password'), class: 'button btn btn-default mb-20'
|
22
|
+
.col-md-5.mb-40
|
23
|
+
.visible-xs.visible-sm
|
24
|
+
.text-center
|
25
|
+
%h3.general-subtitle.mt-0= t('checkout.new_customer')
|
26
|
+
%a.general-login-icon{href: main_app.user_facebook_omniauth_authorize_path}
|
27
|
+
%i.fa.fa-facebook-official
|
28
|
+
%p.general-login-text= t('checkout.or')
|
29
|
+
= form_for(Cartify.user_class.new, url: main_app.user_registration_path, html: { class: 'general-form' }) do |f|
|
30
|
+
.form-group.mb-40
|
31
|
+
%p.fw-600= t('checkout.quick_register')
|
32
|
+
%p.fw-300= t('checkout.quick_description')
|
33
|
+
= f.label :email, t('checkout.enter_email'), class: 'control-label input-label'
|
34
|
+
= f.email_field :email, placeholder: t('checkout.enter_email'), class: 'form-control'
|
35
|
+
- password = Devise.friendly_token.first(10) + '1zZ'
|
36
|
+
= f.hidden_field :password, value: password
|
37
|
+
= f.hidden_field :password_confirmation, value: password
|
38
|
+
.text-left
|
39
|
+
= f.submit t('checkout.continue'), class: 'button btn btn-default mb-20'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
%p.general-address
|
2
|
+
= address.first_name + ' ' + address.last_name
|
3
|
+
- if step != :complete
|
4
|
+
%span.general-edit.clickable-step{ 'data-href': wizard_path(:addresses) }=t('confirm.edit')
|
5
|
+
%br
|
6
|
+
= address.address
|
7
|
+
%br
|
8
|
+
= address.city + ' ' + address.zip.to_s
|
9
|
+
%br
|
10
|
+
= country_name address
|
11
|
+
%br
|
12
|
+
= 'Phone ' + address.phone
|
@@ -0,0 +1,22 @@
|
|
1
|
+
%table.table.table-hover
|
2
|
+
%thead
|
3
|
+
%tr
|
4
|
+
%th.col-method
|
5
|
+
%span.in-grey-600.ml-40= t('delivery.method')
|
6
|
+
%th
|
7
|
+
%span.in-grey-600= t('delivery.days')
|
8
|
+
%th
|
9
|
+
%span.in-grey-600= t('delivery.price')
|
10
|
+
%tbody
|
11
|
+
= f.collection_radio_buttons :delivery_id, @deliveries, :id, :name do |b|
|
12
|
+
%tr
|
13
|
+
%td
|
14
|
+
.form-group.radio.mt-0.mb-0
|
15
|
+
= b.label(class: 'radio-label') do
|
16
|
+
= b.radio_button(class: 'radio-input', hidden: "true")
|
17
|
+
%span.radio-icon
|
18
|
+
%span.radio-text= b.text
|
19
|
+
%td
|
20
|
+
%span= b.object.duration
|
21
|
+
%td
|
22
|
+
%span.font-16.in-gold-500= number_to_currency b.object.price
|
@@ -0,0 +1,22 @@
|
|
1
|
+
= f.collection_radio_buttons :delivery_id, @deliveries, :id, :name do |b|
|
2
|
+
.general-cart-item.divider-lg-bottom
|
3
|
+
%table.table
|
4
|
+
%tr
|
5
|
+
%td.col-half
|
6
|
+
%span.in-grey-600= t('delivery.method')
|
7
|
+
%td.col-half
|
8
|
+
.form-group.radio.mt-0.mb-0
|
9
|
+
= b.label(class: 'radio-label') do
|
10
|
+
= b.radio_button(class: 'radio-input', hidden: "true")
|
11
|
+
%span.radio-icon
|
12
|
+
%span.radio-text= b.text
|
13
|
+
%tr
|
14
|
+
%td
|
15
|
+
%span.in-grey-600= t('delivery.days')
|
16
|
+
%td
|
17
|
+
%span.font-16.fw-300= b.object.duration
|
18
|
+
%tr
|
19
|
+
%td
|
20
|
+
%span.in-grey-600= t('delivery.price')
|
21
|
+
%td
|
22
|
+
%span.font-16.in-gold-500= number_to_currency b.object.price
|
@@ -0,0 +1,54 @@
|
|
1
|
+
.visible-xs
|
2
|
+
- current_order.order_items.each do |item|
|
3
|
+
.general-cart-item.divider-lg
|
4
|
+
.general-img-wrap-table
|
5
|
+
= link_to main_app.book_path(item.product) do
|
6
|
+
= image_tag img_of(item.product), alt: 'design-book', class: 'cart-img-shadow'
|
7
|
+
%p.title= item.product.title
|
8
|
+
%P.in-grey-600.fw-300= item.product.description.split('. ').first + '.'
|
9
|
+
%table.table
|
10
|
+
%tr
|
11
|
+
%td
|
12
|
+
%span.in-grey-600= t('cart.price')
|
13
|
+
%td
|
14
|
+
%span.font-16.in-gold-500= number_to_currency item.product.price
|
15
|
+
%tr
|
16
|
+
%td.vertical-middle
|
17
|
+
%span.in-grey-600= t('cart.quantity')
|
18
|
+
%td
|
19
|
+
%span= item.quantity
|
20
|
+
%tr
|
21
|
+
%td
|
22
|
+
%span.in-grey-600= t('order.total')
|
23
|
+
%td
|
24
|
+
%span.font-16.in-gold-500= number_to_currency item.total_price
|
25
|
+
.hidden-xs.divider-lg.pt-20
|
26
|
+
%table.table.table-hover
|
27
|
+
%thead
|
28
|
+
%tr
|
29
|
+
%th
|
30
|
+
%span.in-grey-600= t('complete.book')
|
31
|
+
%th.col-method
|
32
|
+
%th
|
33
|
+
%span.in-grey-600= t('cart.price')
|
34
|
+
%th
|
35
|
+
%span.in-grey-600= t('cart.quantity')
|
36
|
+
%th
|
37
|
+
%span.in-grey-600= t('order.total')
|
38
|
+
%tbody
|
39
|
+
- current_order.order_items.each do |item|
|
40
|
+
%tr
|
41
|
+
%td
|
42
|
+
.general-img-wrap-table
|
43
|
+
= link_to main_app.book_path(item.product) do
|
44
|
+
= image_tag img_of(item.product), alt: 'design-book', class: 'cart-img-shadow pull-left'
|
45
|
+
%td
|
46
|
+
= link_to main_app.book_path(item.product), class: 'text-as-link' do
|
47
|
+
%p.title= item.product.title
|
48
|
+
%p.in-grey-600.fw-300= item.product.description.split('. ').first + '.'
|
49
|
+
%td
|
50
|
+
%span.font-16.in-gold-500= number_to_currency item.product.price
|
51
|
+
%td
|
52
|
+
%span.ml-30= item.quantity
|
53
|
+
%td
|
54
|
+
%span.font-16.in-gold-500= number_to_currency item.total_price
|
@@ -0,0 +1,27 @@
|
|
1
|
+
%main.container.mb-res-50
|
2
|
+
= render 'cartify/checkout/progress'
|
3
|
+
%h3.general-subtitle= t('checkout.credit_card')
|
4
|
+
= form_for @credit_card, url: wizard_path, method: :put, html: { class: 'max-600 mb-80' } do |f|
|
5
|
+
.form-group{ class: "#{@credit_card.errors[:number].empty? ? '' : 'has-error'}" }
|
6
|
+
= f.label :number, t('checkout.cart_number'), class: 'control-label input-label'
|
7
|
+
= f.text_field :number, class: 'form-control', placeholder: t('checkout.cart_number')
|
8
|
+
%span.help-block= @credit_card.errors[:number].to_sentence
|
9
|
+
.row
|
10
|
+
.col-sm-6
|
11
|
+
.form-group{ class: "#{@credit_card.errors[:name].empty? ? '' : 'has-error'}" }
|
12
|
+
= f.label :name, t('checkout.name_on_card'), class: 'control-label input-label'
|
13
|
+
= f.text_field :name, class: 'form-control', placeholder: t('checkout.name_on_card')
|
14
|
+
%span.help-block= @credit_card.errors[:name].to_sentence
|
15
|
+
.col-sm-3
|
16
|
+
.form-group{ class: "#{@credit_card.errors[:mm_yy].empty? ? '' : 'has-error'}" }
|
17
|
+
= f.label :mm_yy, t('checkout.mm_yy'), class: 'control-label input-label'
|
18
|
+
= f.text_field :mm_yy, class: 'form-control', placeholder: t('checkout.mm_yy')
|
19
|
+
%span.help-block= @credit_card.errors[:mm_yy].to_sentence
|
20
|
+
.col-sm-3
|
21
|
+
.form-group.relative{ class: "#{@credit_card.errors[:cvv].empty? ? '' : 'has-error'}" }
|
22
|
+
= f.label :cvv, t('checkout.cvv'), class: 'control-label input-label'
|
23
|
+
= f.password_field :cvv, class: 'form-control', placeholder: t('checkout.cvv'), autocomplete: 'off'
|
24
|
+
%span.help-block= @credit_card.errors[:cvv].to_sentence
|
25
|
+
%i.fa.fa-question-circle.general-form-help{'data-toggle': 'tooltip', 'data-placement': :top, title: t('credit_card.tooltip')}
|
26
|
+
= render 'cartify/checkout/order_summary'
|
27
|
+
= f.submit t('checkout.save_and_continue'), class: 'btn btn-default center-block mb-80'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
%a.dropdown-toggle.lead.small{href: "#", 'data-toggle': "dropdown", role: "button", 'aria-haspopup': "true", 'aria-expanded': "false"}
|
2
|
+
= order_active_filter
|
3
|
+
%i.fa.fa-angle-down.dropdown-icon.pull-right
|
4
|
+
%ul.dropdown-menu
|
5
|
+
%li
|
6
|
+
= link_to t('order.status.in_queue'), orders_path(filter: :in_queue)
|
7
|
+
%li
|
8
|
+
= link_to t('order.status.in_progress'), orders_path(filter: :in_progress)
|
9
|
+
%li
|
10
|
+
= link_to t('order.status.in_delivery'), orders_path(filter: :in_delivery)
|
11
|
+
%li
|
12
|
+
= link_to t('order.status.delivered'), orders_path(filter: :delivered)
|
13
|
+
%li
|
14
|
+
= link_to t('order.status.canceled'), orders_path(filter: :canceled)
|
15
|
+
%li
|
16
|
+
= link_to t('order.status.all'), orders_path
|
@@ -0,0 +1,10 @@
|
|
1
|
+
- @orders.each do |order|
|
2
|
+
%tr.clickable-row{ 'data-href': order_path(order) }
|
3
|
+
%td
|
4
|
+
%span.general-order-number= order.number
|
5
|
+
%td
|
6
|
+
%span.in-grey-900.font-16.fw-300= order.complited_at
|
7
|
+
%td
|
8
|
+
%span.font-16.in-grey-900.fw-300= order.status
|
9
|
+
%td
|
10
|
+
%strong.font-16= number_to_currency order.total
|