effective_orders 4.0.0beta15 → 4.0.0beta16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a0e364b3f29eb0d7dedd6924f79f88238e53f4e
4
- data.tar.gz: 565609c4fe438073afae83e024d5293c8c74f573
3
+ metadata.gz: bfed4c5207c463fed6c3d0adfe543cdf6d7179b0
4
+ data.tar.gz: 34169145a782863e3714d19c623b023b8e93cd6c
5
5
  SHA512:
6
- metadata.gz: 0f9da56ad6b265343c14085799645fa2317a0bae30cfd663798ce3e3c51fa12e77c3f5d5febf75b879c9a0d6bd4225895ffba43a70a4d47bd1705b09ed37b1d6
7
- data.tar.gz: baf112b92894922d3dd4ca968430a1e39ec310e1b145990e580d057e55994e87ba640807556bd18c5edb8a720e8a9ce935e315593df77fe9372bb0b75c40ceda
6
+ metadata.gz: 4c6b21fb32445e76d6d8b4921d6f15923f8cd1c60c2aa969b605735d38ab3a95aed776ea3bc1c17cdcf95798a794ed0dfd7efabcc5662e13965f8c698ba30dfe
7
+ data.tar.gz: f219625d20fda0dbc0f2b8d1b085f9dc1a04391cfdeb8753dd8b1947ca58cb3c91126a540947d0f33697b923195003796a78719436350d02223e278017ebd136
@@ -1,5 +1,19 @@
1
1
  module EffectiveSubscriptionsHelper
2
2
 
3
+ def render_plan(plan, subscribed: true)
4
+ render(render_plan_partial(plan), plan: plan, subscribed: subscribed)
5
+ end
6
+
7
+ def render_plan_partial(plan)
8
+ if lookup_context.template_exists?("effective/subscriptions/#{plan[:id].downcase}", [], true)
9
+ "effective/subscriptions/#{plan[:id].downcase}" # Render the app's views/effective/subscriptions/_gold.html.haml
10
+ elsif lookup_context.template_exists?("effective/subscriptions/#{plan[:name].downcase}", [], true)
11
+ "effective/subscriptions/#{plan[:name].downcase}" # Render the app's views/effective/subscriptions/_gold.html.haml
12
+ else
13
+ 'effective/subscriptions/plan' # Render effective_orders default plan panel
14
+ end
15
+ end
16
+
3
17
  def stripe_plans_collection(form)
4
18
  raise 'expected an Effective::FormBuilder object' unless form.class.name == 'Effective::FormBuilder'
5
19
 
@@ -16,17 +30,7 @@ module EffectiveSubscriptionsHelper
16
30
  end
17
31
 
18
32
  plans.map do |plan|
19
- partial = (
20
- if lookup_context.template_exists?("effective/subscriptions/#{plan[:id].downcase}", [], true)
21
- "effective/subscriptions/#{plan[:id].downcase}" # Render the app's views/effective/subscriptions/_gold.html.haml
22
- elsif lookup_context.template_exists?("effective/subscriptions/#{plan[:name].downcase}", [], true)
23
- "effective/subscriptions/#{plan[:name].downcase}" # Render the app's views/effective/subscriptions/_gold.html.haml
24
- else
25
- 'effective/subscriptions/plan' # Render effective_orders default plan panel
26
- end
27
- )
28
-
29
- content = render(partial: partial, locals: {
33
+ content = render(partial: render_plan_partial(plan), locals: {
30
34
  f: form,
31
35
  plan: plan,
32
36
  selected: Array(form.object.stripe_plan_id).include?(plan[:id]),
@@ -1,3 +1,3 @@
1
1
  .effective-radios.card-deck
2
2
  .card.active
3
- = render 'effective/subscriptions/plan', plan: subscription.plan, subscribed: true
3
+ = render_plan(subscription.plan)
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '4.0.0beta15'.freeze
2
+ VERSION = '4.0.0beta16'.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: 4.0.0beta15
4
+ version: 4.0.0beta16
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: 2018-07-04 00:00:00.000000000 Z
11
+ date: 2018-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails