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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a1297dcbb14c49c194aa9573568cabda9f59054
4
- data.tar.gz: 4adc9e432d25558315f906ff80b92e217b5c11fd
3
+ metadata.gz: 44ad2e1c15d7e9257ce8517cdb3637cf63c83d53
4
+ data.tar.gz: 8b1d66707077365edfe37c1c1d69392807492684
5
5
  SHA512:
6
- metadata.gz: 071868aabb5d8cf49c75bde7d71850343b3565317420ee369b5d3f5ebff3469447f2f17671de28096aa3d3d78919e662801b44bc747398ea834fa8f796bbd35f
7
- data.tar.gz: 900466161445c4e200890a7b1982888cd316b222416be323a2d13839d82dd80551bca6e8801b54335600ee1d3e90d57ed4b85751b1c572ff61a52420c441f3fc
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' ; 'Order History'
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 label, effective_orders.add_to_cart_path(purchasable_type: purchasable.class.name, purchasable_id: purchasable.id.to_i), options
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 render_orders_table(user_or_orders, opts = {})
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, :render_orders_table
134
- alias_method :render_my_purchases, :render_orders_table
135
- alias_method :render_order_history, :render_orders_table
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
- %p The following orders are ready for you to purchase:
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')
@@ -1,5 +1,5 @@
1
1
  %h3 Note
2
2
  - if EffectiveOrders.collect_note_message.present?
3
- %p= EffectiveOrders.collect_note_message
3
+ %p= EffectiveOrders.collect_note_message.html_safe
4
4
 
5
5
  = form.input :note, required: (EffectiveOrders.collect_note_required == true)
@@ -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.
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '2.1.3'.freeze
2
+ VERSION = '2.1.4'.freeze
3
3
  end
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.3
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-05 00:00:00.000000000 Z
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