effective_resources 0.6.4 → 0.6.5

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: 242ed65ef4c998474921ac8dfac92d10e378278f
4
- data.tar.gz: 47a06cd06ed40ec273e0b39a6c891b7ee7ffdbea
3
+ metadata.gz: 3a87b01a9c51ff1343a94289520ae4eefa1a7945
4
+ data.tar.gz: 0ffe44c2a4fe358869fdc11a53c5c18af9ad1da3
5
5
  SHA512:
6
- metadata.gz: 1976ae2d176a347561a8e46be0d0d807bc76d0b28051cbc366e1df787597e84d3c86fe4dab9bc9a50e4401a164cfe36189f4754919ae0a6c75da355ea7572907
7
- data.tar.gz: d60fb69be39ab249983e1f0c0de0be33d08c8bdeecc7349492f702285b938500638b6de3a6362b62e28e31323ace75d57fad8b5c7636e0f0551b09c3640540de
6
+ metadata.gz: 4fec545b778f1f190adaa1825a4efc98505d7e53f86c4ca5480b2ac959b7f3000d058fb92cb131f00e7d91ef442774afb2074f0801e84a09649e77610e68f032
7
+ data.tar.gz: d8b42dd69ee0533a69f510c76506a527fab95c7aa8f49cf3a309c8fb1506f7aebb5fb6d273c98b8ff7f653d0bb68fadb0dd86f14e66c658cbf3cb855c1b89053
@@ -271,7 +271,6 @@ module Effective
271
271
 
272
272
  danger || save_action || 0
273
273
  end.inject({}) do |h, (commit, args)|
274
- Rails.logger.info commit
275
274
  h[commit] = args.except(:action, :if, :unless, :redirect); h
276
275
  end
277
276
  end
@@ -313,9 +312,9 @@ module Effective
313
312
  case params[:commit].to_s
314
313
  when 'Save'
315
314
  [resource_edit_path, resource_show_path, resource_index_path].compact.first
316
- when 'Save and Add New'
315
+ when 'Save and Add New', 'Add New'
317
316
  [resource_new_path, resource_index_path].compact.first
318
- when 'Save and Continue'
317
+ when 'Continue', 'Save and Continue'
319
318
  resource_index_path
320
319
  else
321
320
  [referer_redirect_path, resource_index_path].compact.first
@@ -1,6 +1,6 @@
1
1
  module EffectiveResourcesHelper
2
2
 
3
- def simple_form_submit(form, options = {class: 'form-actions'}, &block)
3
+ def simple_form_submit(form, options = {}, &block)
4
4
  resource = (@_effective_resource || Effective::Resource.new(controller_path))
5
5
 
6
6
  # Apply btn-primary to the first item, only if the class isn't already present
@@ -23,7 +23,9 @@ module EffectiveResourcesHelper
23
23
  end
24
24
  end
25
25
 
26
- content_tag(:div, class: options[:class]) do
26
+ wrapper_options = { class: 'form-actions' }.merge(options.delete(:wrapper_html) || {})
27
+
28
+ content_tag(:div, wrapper_options) do
27
29
  buttons = actions.group_by { |(_, args)| args[:class] }.flat_map do |_, action|
28
30
  action.map { |action| form.button(:submit, *action) } + ['']
29
31
  end
@@ -41,9 +43,12 @@ module EffectiveResourcesHelper
41
43
  end
42
44
  end
43
45
 
44
- def simple_form_save(form, label = 'Save', options = {class: 'form-actions'}, &block)
45
- content_tag(:div, class: options[:class]) do
46
- form.button(:submit, label, data: { disable_with: 'Saving...' }) + (capture(&block) if block_given?)
46
+ def simple_form_save(form, label = 'Save', options = {}, &block)
47
+ wrapper_options = { class: 'form-actions' }.merge(options.delete(:wrapper_html) || {})
48
+ options = { class: 'btn btn-primary', data: { disable_with: 'Saving...'} }.merge(options)
49
+
50
+ content_tag(:div, wrapper_options) do
51
+ form.button(:submit, label, options) + (capture(&block) if block_given?)
47
52
  end
48
53
  end
49
54
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '0.6.4'.freeze
2
+ VERSION = '0.6.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
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: 2017-10-27 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails