effective_resources 0.6.4 → 0.6.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a87b01a9c51ff1343a94289520ae4eefa1a7945
|
4
|
+
data.tar.gz: 0ffe44c2a4fe358869fdc11a53c5c18af9ad1da3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = {
|
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
|
-
|
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 = {
|
45
|
-
|
46
|
-
|
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
|
|
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
|
+
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-
|
11
|
+
date: 2017-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|