super_tools 0.0.10 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +1 -1
- data/lib/super_form/concerns/atomic_save.rb +23 -12
- data/lib/super_interaction/command.rb +1 -1
- data/lib/super_interaction/engine.rb +7 -0
- data/lib/super_interaction/views/layouts/interaction_modal.html.haml +24 -0
- data/lib/super_tools.rb +1 -0
- data/lib/super_tools/version.rb +1 -1
- data/super_tools.gemspec +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 37be0626d7ebf5618e509581d4493e001ddf95ca
|
4
|
+
data.tar.gz: fe0ef27a8c0e9c3e68f8219a23bf8912a3c32bc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b704f4409c86eef79d88cf4cc0461dcb30facf45f743a4faf9d024e0054c0024bb67344b77edd196e5580c15b0bf48074e6a4b2fc47f5884e92f648de2874b78
|
7
|
+
data.tar.gz: be2a3df596dbda74630634eedbf863aea5c03294187be6007d73e282955b73354b176826c2b3f3f650b6d38a0daf21a624fee1e4ff828a4544bf4d210ea40e07
|
data/Gemfile.lock
CHANGED
@@ -7,28 +7,39 @@ module SuperForm
|
|
7
7
|
|
8
8
|
define_callbacks :transaction, :queries, :validations
|
9
9
|
|
10
|
-
def self.before_transaction(method_name)
|
11
|
-
|
10
|
+
def self.before_transaction(method_name=nil, &block)
|
11
|
+
set_defined_callback(:transaction, :before, method_name, &block)
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.before_queries(method_name)
|
15
|
-
|
14
|
+
def self.before_queries(method_name=nil, &block)
|
15
|
+
set_defined_callback(:queries, :before, method_name, &block)
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.before_commit(method_name)
|
19
|
-
|
18
|
+
def self.before_commit(method_name=nil, &block)
|
19
|
+
set_defined_callback(:queries, :after, method_name, &block)
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.after_commit(method_name)
|
23
|
-
|
22
|
+
def self.after_commit(method_name=nil, &block)
|
23
|
+
set_defined_callback(:transaction, :after, method_name, &block)
|
24
24
|
end
|
25
25
|
|
26
|
-
def self.before_validations(method_name)
|
27
|
-
|
26
|
+
def self.before_validations(method_name=nil, &block)
|
27
|
+
set_defined_callback(:validations, :before, method_name, &block)
|
28
28
|
end
|
29
29
|
|
30
|
-
def self.after_validations(method_name)
|
31
|
-
|
30
|
+
def self.after_validations(method_name=nil, &block)
|
31
|
+
set_defined_callback(:validations, :after, method_name, &block)
|
32
|
+
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
|
36
|
+
def self.set_defined_callback(event, callback, method_name=nil, &block)
|
37
|
+
raise "wrong number of arguments ('method_name' or 'block' choose one)" if method_name.nil? == false && block.present?
|
38
|
+
if block_given?
|
39
|
+
set_callback event, callback, &block
|
40
|
+
else
|
41
|
+
set_callback event, callback, method_name
|
42
|
+
end
|
32
43
|
end
|
33
44
|
end
|
34
45
|
|
@@ -32,7 +32,7 @@ module SuperInteraction
|
|
32
32
|
# 注意:不要包 respond_to :js 會有問題
|
33
33
|
def modal(partial: nil, size: 'md', title: '', desc: '')
|
34
34
|
partial ||= context.action_name
|
35
|
-
modal_html = context.render_to_string(partial, layout:
|
35
|
+
modal_html = context.render_to_string(partial, layout: "interaction_modal.html.haml", locals: { bs_modal_size: size, title: title, desc: desc })
|
36
36
|
cmd("$(function() { $.modal.show('#{helpers.j(modal_html)}'); });")
|
37
37
|
end
|
38
38
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
- if Rails.version[0].to_i >= 5
|
2
|
+
- bs_modal_size = local_assigns[:bs_modal_size]
|
3
|
+
- title = local_assigns[:title]
|
4
|
+
- desc = local_assigns[:desc]
|
5
|
+
.modal
|
6
|
+
= yield :wrapper
|
7
|
+
.modal-dialog{ class: "modal-#{bs_modal_size}" }
|
8
|
+
.modal-content
|
9
|
+
.modal-header
|
10
|
+
%button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
|
11
|
+
= fa_icon('times')
|
12
|
+
= yield :header
|
13
|
+
- if title.present?
|
14
|
+
%h4.modal-title= title
|
15
|
+
= yield
|
16
|
+
= yield :before_body
|
17
|
+
- body_html = capture { yield :body }
|
18
|
+
- if body_html.present?
|
19
|
+
.modal-body= body_html
|
20
|
+
= yield :after_body
|
21
|
+
|
22
|
+
- footer_html = capture { yield :footer }
|
23
|
+
- if footer_html.present?
|
24
|
+
.modal-footer= footer_html
|
data/lib/super_tools.rb
CHANGED
data/lib/super_tools/version.rb
CHANGED
data/super_tools.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
# spec.add_dependency "activemodel", '>= 4', '<= 6'
|
37
37
|
# spec.add_dependency "activesupport", '>= 4', '<= 6'
|
38
38
|
# spec.add_dependency "activeview"
|
39
|
-
spec.add_dependency "nokogiri", ">= 1.6", "<= 1.
|
39
|
+
spec.add_dependency "nokogiri", ">= 1.6", "<= 1.10.7"
|
40
40
|
spec.add_dependency "fast_excel"
|
41
41
|
spec.add_dependency "roo"
|
42
42
|
spec.add_dependency "roo-xls"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- eddie
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,7 +89,7 @@ dependencies:
|
|
89
89
|
version: '1.6'
|
90
90
|
- - "<="
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: 1.
|
92
|
+
version: 1.10.7
|
93
93
|
type: :runtime
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
version: '1.6'
|
100
100
|
- - "<="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 1.
|
102
|
+
version: 1.10.7
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: fast_excel
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -318,6 +318,8 @@ files:
|
|
318
318
|
- lib/super_formatter/tcat/row.rb
|
319
319
|
- lib/super_interaction/command.rb
|
320
320
|
- lib/super_interaction/controller_helper.rb
|
321
|
+
- lib/super_interaction/engine.rb
|
322
|
+
- lib/super_interaction/views/layouts/interaction_modal.html.haml
|
321
323
|
- lib/super_logger/formatter.rb
|
322
324
|
- lib/super_process/core.rb
|
323
325
|
- lib/super_search/scroll.rb
|
@@ -352,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
352
354
|
version: '0'
|
353
355
|
requirements: []
|
354
356
|
rubyforge_project:
|
355
|
-
rubygems_version: 2.
|
357
|
+
rubygems_version: 2.4.8
|
356
358
|
signing_key:
|
357
359
|
specification_version: 4
|
358
360
|
summary: Rails 開發環境常用工具 Forms/Process/Spreadsheet
|