super_tools 0.0.15 → 0.0.26

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
- SHA1:
3
- metadata.gz: 37be0626d7ebf5618e509581d4493e001ddf95ca
4
- data.tar.gz: fe0ef27a8c0e9c3e68f8219a23bf8912a3c32bc1
2
+ SHA256:
3
+ metadata.gz: 322fbf567fd072ca0f6179bf982130730ce2e40922a900c2a1281c0887268de7
4
+ data.tar.gz: 042ab308449ea31fda56b40c620862a206abcd04353df18923702d19d36f17d4
5
5
  SHA512:
6
- metadata.gz: b704f4409c86eef79d88cf4cc0461dcb30facf45f743a4faf9d024e0054c0024bb67344b77edd196e5580c15b0bf48074e6a4b2fc47f5884e92f648de2874b78
7
- data.tar.gz: be2a3df596dbda74630634eedbf863aea5c03294187be6007d73e282955b73354b176826c2b3f3f650b6d38a0daf21a624fee1e4ff828a4544bf4d210ea40e07
6
+ metadata.gz: 2066127e56a36c72e20d5958fa9a55fb077263f7e4819a32fa6c4c50443ca2bc97294b422f99bdc30a30416b0519245e432f5358ae05ba9c675cb6a7da3a5131
7
+ data.tar.gz: 00276c75db7fdaa0d228edfb1dd503fac914670dfb1f2ce02a1a16764596b448100a86f60b48a23fbacb78665af38aa66dfeff736ce95b5c2034dedf5b465d6a
@@ -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: "interaction_modal.html.haml", locals: { bs_modal_size: size, title: title, desc: desc })
35
+ modal_html = context.render_to_string(partial, layout: ::SuperInteraction::Layout.modal_layout, 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,29 @@
1
+ module SuperInteraction
2
+ module Layout
3
+
4
+ FRAMEWORKS = [ :bootstrap3, :bootstrap4, :beyond ]
5
+
6
+ def self.framework=(f)
7
+ raise "Not support framework: #{f}" if FRAMEWORKS.include?(f) == false
8
+ @@framework = f
9
+ end
10
+
11
+ def self.framework
12
+ @@framework
13
+ end
14
+
15
+ def self.modal_layout
16
+ case @@framework
17
+ when :bootstrap3
18
+ "modal_bs3.haml"
19
+ when :bootstrap4
20
+ "modal_bs4.haml"
21
+ when :beyond
22
+ "modal_beyond.haml"
23
+ else
24
+ # Default
25
+ "modal_bs3.haml"
26
+ end
27
+ end
28
+ end
29
+ end
@@ -8,10 +8,14 @@
8
8
  .modal-content
9
9
  .modal-header
10
10
  %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
11
- = fa_icon('times')
11
+ - if respond_to?(:fa_icon)
12
+ = fa_icon('times')
13
+ - else
14
+ = fas_icon('times')
12
15
  = yield :header
13
16
  - if title.present?
14
17
  %h4.modal-title= title
18
+
15
19
  = yield
16
20
  = yield :before_body
17
21
  - body_html = capture { yield :body }
@@ -0,0 +1,28 @@
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
+ = yield :header
11
+ - if title.present?
12
+ %h5.modal-title
13
+ = title
14
+ - if desc.present?
15
+ %small.text-secondary= desc
16
+ %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
17
+ = fas_icon('times')
18
+
19
+ = yield
20
+ = yield :before_body
21
+ - body_html = capture { yield :body }
22
+ - if body_html.present?
23
+ .modal-body= body_html
24
+ = yield :after_body
25
+
26
+ - footer_html = capture { yield :footer }
27
+ - if footer_html.present?
28
+ .modal-footer= footer_html
@@ -42,6 +42,7 @@ require 'super_search/scroll'
42
42
  # ZIP CODE
43
43
  require 'super_zipcode/taiwan'
44
44
  # INTERACTION
45
+ require 'super_interaction/layout'
45
46
  require 'super_interaction/engine'
46
47
  require 'super_interaction/command'
47
48
  require 'super_interaction/controller_helper'
@@ -1,3 +1,3 @@
1
1
  module SuperTools
2
- VERSION = '0.0.15'
2
+ VERSION = '0.0.26'
3
3
  end
@@ -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.10.7"
39
+ spec.add_dependency "nokogiri", ">= 1.6"
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.15
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - eddie
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-21 00:00:00.000000000 Z
11
+ date: 2021-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -87,9 +87,6 @@ dependencies:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.6'
90
- - - "<="
91
- - !ruby/object:Gem::Version
92
- version: 1.10.7
93
90
  type: :runtime
94
91
  prerelease: false
95
92
  version_requirements: !ruby/object:Gem::Requirement
@@ -97,9 +94,6 @@ dependencies:
97
94
  - - ">="
98
95
  - !ruby/object:Gem::Version
99
96
  version: '1.6'
100
- - - "<="
101
- - !ruby/object:Gem::Version
102
- version: 1.10.7
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: fast_excel
105
99
  requirement: !ruby/object:Gem::Requirement
@@ -319,7 +313,9 @@ files:
319
313
  - lib/super_interaction/command.rb
320
314
  - lib/super_interaction/controller_helper.rb
321
315
  - lib/super_interaction/engine.rb
322
- - lib/super_interaction/views/layouts/interaction_modal.html.haml
316
+ - lib/super_interaction/layout.rb
317
+ - lib/super_interaction/views/layouts/modal_bs3.haml
318
+ - lib/super_interaction/views/layouts/modal_bs4.haml
323
319
  - lib/super_logger/formatter.rb
324
320
  - lib/super_process/core.rb
325
321
  - lib/super_search/scroll.rb
@@ -338,7 +334,7 @@ homepage: https://github.com/superlanding/super_tools
338
334
  licenses:
339
335
  - MIT
340
336
  metadata: {}
341
- post_install_message:
337
+ post_install_message:
342
338
  rdoc_options: []
343
339
  require_paths:
344
340
  - lib
@@ -353,9 +349,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
349
  - !ruby/object:Gem::Version
354
350
  version: '0'
355
351
  requirements: []
356
- rubyforge_project:
357
- rubygems_version: 2.4.8
358
- signing_key:
352
+ rubygems_version: 3.0.8
353
+ signing_key:
359
354
  specification_version: 4
360
355
  summary: Rails 開發環境常用工具 Forms/Process/Spreadsheet
361
356
  test_files: []