super_tools 0.0.17 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/super_interaction/command.rb +1 -1
- data/lib/super_interaction/layout.rb +17 -0
- data/lib/super_interaction/views/layouts/{interaction_modal.html.haml → modal_bs3.haml} +1 -0
- data/lib/super_interaction/views/layouts/modal_bs4.haml +28 -0
- data/lib/super_tools/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41d7945480a82c03f7e6afbd423bcda41607f8ea
|
4
|
+
data.tar.gz: 4e40a316717481bbc4f366cc5c9603f7af8a4611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
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
|
@@ -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
|
data/lib/super_tools/version.rb
CHANGED
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.
|
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/
|
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
|