super_tools 0.0.17 → 0.0.20

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: e8f4cea2632f6d8712a085a3448aa82fef714b9b
4
- data.tar.gz: 6aab879d3139d822467fab9d16307f3b639d07ab
3
+ metadata.gz: 41d7945480a82c03f7e6afbd423bcda41607f8ea
4
+ data.tar.gz: 4e40a316717481bbc4f366cc5c9603f7af8a4611
5
5
  SHA512:
6
- metadata.gz: ae7a3bb6e1bfb1ee93898a27586610f7c8fdad296660370fd83788e214ba9154e3139c6bbd77238536125646dc83ff96c97e38ebb1ed304871f77026fccea64d
7
- data.tar.gz: a06f5b4c11240c3fdc6a684cc500c8e78ac39de06deac9e5a622a8a8dd6b8eb73e4d8b2b08708cff3ef1b9514f6d0abdf0ab24cec6b38acb85271414e8b1483e
6
+ metadata.gz: cac1811d25e492be858f703289d333f1ff2a0295d1c506f6d7c1f56f91c8206f6a740d05bc519f0d861bfee0b4c9c72d7f17f4a3587638820cdc1175041d62fe
7
+ data.tar.gz: 9edc0d15e4c4e174b3a5edfe902079325e6d21848851ce47b9648324fec0d9cd22fb0c2bf6ef264c0fc842c71e1d6b29fd3b60fc2e15df8342d622ff7129a05f
@@ -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,17 @@
1
+ module SuperInteraction
2
+ module Layout
3
+ mattr_accessor :framework
4
+ self.framework = :bootstrap3
5
+
6
+ def self.modal_layout
7
+ case framework
8
+ when :bootstrap3
9
+ "modal_bs3.haml"
10
+ when :bootstrap4
11
+ "modal_bs4.haml"
12
+ when :beyond
13
+ "modal_beyond.haml"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -15,6 +15,7 @@
15
15
  = yield :header
16
16
  - if title.present?
17
17
  %h4.modal-title= title
18
+
18
19
  = yield
19
20
  = yield :before_body
20
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
@@ -1,3 +1,3 @@
1
1
  module SuperTools
2
- VERSION = '0.0.17'
2
+ VERSION = '0.0.20'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - eddie
@@ -319,7 +319,9 @@ files:
319
319
  - lib/super_interaction/command.rb
320
320
  - lib/super_interaction/controller_helper.rb
321
321
  - lib/super_interaction/engine.rb
322
- - lib/super_interaction/views/layouts/interaction_modal.html.haml
322
+ - lib/super_interaction/layout.rb
323
+ - lib/super_interaction/views/layouts/modal_bs3.haml
324
+ - lib/super_interaction/views/layouts/modal_bs4.haml
323
325
  - lib/super_logger/formatter.rb
324
326
  - lib/super_process/core.rb
325
327
  - lib/super_search/scroll.rb