effective_orders 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/effective/orders_controller.rb +2 -3
- data/app/helpers/effective_carts_helper.rb +1 -1
- data/app/helpers/effective_orders_helper.rb +4 -4
- data/app/views/effective/carts/show.html.haml +1 -2
- data/app/views/effective/orders/_order_note_fields.html.haml +1 -1
- data/app/views/effective/orders/index.html.haml +13 -0
- data/lib/effective_orders/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44ad2e1c15d7e9257ce8517cdb3637cf63c83d53
|
4
|
+
data.tar.gz: 8b1d66707077365edfe37c1c1d69392807492684
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54dfe24a820d5759ff2708472a498a435b63bc76ea60b681ef297243297dc7b8bafeeb5854f64ab83c78dbddb18a9d25c11818cf32122a2f6962d79ef563aad3
|
7
|
+
data.tar.gz: 8f8030d38899be69d6349551be5ba96075bfc69f2e57437a1aa812730578faee9fb9351667f6f9652f63fe56819323ce25eabcac0db60ef435f45c2f2e462194
|
@@ -130,10 +130,9 @@ module Effective
|
|
130
130
|
|
131
131
|
def index
|
132
132
|
@orders = Effective::Order.purchased_by(current_user)
|
133
|
+
@pending_orders = Effective::Order.pending.where(user: current_user)
|
133
134
|
|
134
135
|
EffectiveOrders.authorized?(self, :index, Effective::Order.new(user: current_user))
|
135
|
-
|
136
|
-
render action: :my_purchases
|
137
136
|
end
|
138
137
|
|
139
138
|
# Basically an index page.
|
@@ -230,7 +229,7 @@ module Effective
|
|
230
229
|
|
231
230
|
def set_page_title
|
232
231
|
@page_title ||= case params[:action]
|
233
|
-
when 'index' ; '
|
232
|
+
when 'index' ; 'Orders'
|
234
233
|
when 'my_purchases' ; 'Order History'
|
235
234
|
when 'my_sales' ; 'Sales History'
|
236
235
|
when 'purchased' ; 'Thank You'
|
@@ -56,7 +56,7 @@ module EffectiveCartsHelper
|
|
56
56
|
label = options.delete(:label)
|
57
57
|
options[:class] = ((options[:class] || '') + ' btn-add-to-cart')
|
58
58
|
|
59
|
-
link_to
|
59
|
+
link_to(label, effective_orders.add_to_cart_path(purchasable_type: purchasable.class.name, purchasable_id: purchasable.id.to_i), options)
|
60
60
|
end
|
61
61
|
|
62
62
|
def link_to_remove_from_cart(cart_item, opts = {})
|
@@ -118,7 +118,7 @@ module EffectiveOrdersHelper
|
|
118
118
|
end
|
119
119
|
alias_method :link_to_order_history, :link_to_my_purchases
|
120
120
|
|
121
|
-
def
|
121
|
+
def render_orders(user_or_orders, opts = {})
|
122
122
|
if user_or_orders.kind_of?(User)
|
123
123
|
orders = Effective::Order.purchased_by(user_or_orders)
|
124
124
|
elsif user_or_orders.respond_to?(:to_a)
|
@@ -130,9 +130,9 @@ module EffectiveOrdersHelper
|
|
130
130
|
render(partial: 'effective/orders/orders_table', locals: {orders: orders}.merge(opts))
|
131
131
|
end
|
132
132
|
|
133
|
-
alias_method :render_purchases, :
|
134
|
-
alias_method :render_my_purchases, :
|
135
|
-
alias_method :render_order_history, :
|
133
|
+
alias_method :render_purchases, :render_orders
|
134
|
+
alias_method :render_my_purchases, :render_orders
|
135
|
+
alias_method :render_order_history, :render_orders
|
136
136
|
|
137
137
|
# Used by the _payment_details partial
|
138
138
|
def tableize_order_payment(hash, options = {class: 'table table-bordered'})
|
@@ -11,8 +11,7 @@
|
|
11
11
|
|
12
12
|
- if @pending_orders.present?
|
13
13
|
%h3 Pending Orders
|
14
|
-
|
15
|
-
= render_orders_table(@pending_orders)
|
14
|
+
= render_orders(@pending_orders)
|
16
15
|
|
17
16
|
- if EffectiveOrders.show_order_history_button
|
18
17
|
= link_to_my_purchases(label: 'Order History')
|
@@ -0,0 +1,13 @@
|
|
1
|
+
%h2.effective-orders-page-title= (@page_title || 'Orders')
|
2
|
+
|
3
|
+
%h3 Pending Orders
|
4
|
+
- if @pending_orders.present?
|
5
|
+
= render_orders(@pending_orders)
|
6
|
+
- else
|
7
|
+
%p You have no pending orders.
|
8
|
+
|
9
|
+
%h3 Purchased Orders
|
10
|
+
- if @orders.present?
|
11
|
+
= render_orders(@orders)
|
12
|
+
- else
|
13
|
+
%p You have no purchased orders.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_orders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -348,6 +348,7 @@ files:
|
|
348
348
|
- app/views/effective/orders/cheque/_form.html.haml
|
349
349
|
- app/views/effective/orders/cheque/pay_by_cheque.html.haml
|
350
350
|
- app/views/effective/orders/declined.html.haml
|
351
|
+
- app/views/effective/orders/index.html.haml
|
351
352
|
- app/views/effective/orders/moneris/_form.html.haml
|
352
353
|
- app/views/effective/orders/my_purchases.html.haml
|
353
354
|
- app/views/effective/orders/my_sales.html.haml
|