card-mod-layout 0.11.4 → 0.11.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/card/layout.rb +1 -0
- data/set/abstract/account_dropdown.rb +2 -4
- data/set/all/modal.rb +1 -0
- data/set/all/overlay.rb +6 -8
- data/set/all/process_layout.rb +31 -29
- data/set/all/tabs.rb +1 -0
- data/set/self/account_links.rb +2 -2
- data/set/self/foot.rb +0 -1
- data/set/self/head.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb8094b7e8439f3eef947f48b7be254635363a42f8ca62ada110bf9197fdc134
|
4
|
+
data.tar.gz: e36c74e6592a2786f4458972c20946b4e69162f014eeb2537e74dfa5acdd1ba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10715b11e4cc2e8247e255e84c0977b2d2a3e4a6eb1477ba48aee9b50b70e64b9b526a5775b75a943c1d4a9767d2ea8aeb1a4de4b374c1c01aef23c36e8a581
|
7
|
+
data.tar.gz: 9d5a1f944fff78fe8ded42bd0987676d82844b77c2fcce042bf5669c03ec6589fc88ef0bafa968b4ab0fb453280d538097a431bd84b6f863c4d1b4d4fcd0845c
|
data/lib/card/layout.rb
CHANGED
data/set/all/modal.rb
CHANGED
data/set/all/overlay.rb
CHANGED
@@ -79,25 +79,23 @@ format :html do
|
|
79
79
|
header_wrap [title, _render_overlay_menu]
|
80
80
|
end
|
81
81
|
|
82
|
-
def overlay_frame slot=true, header=render_overlay_header, slot_opts=nil
|
82
|
+
def overlay_frame slot=true, header=render_overlay_header, slot_opts=nil, &block
|
83
83
|
slot_opts ||= {}
|
84
84
|
overlay_framer slot, header, slot_opts do
|
85
|
-
wrap_body
|
85
|
+
wrap_body(&block)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
-
def haml_overlay_frame slot=true, header=render_overlay_header
|
89
|
+
def haml_overlay_frame slot=true, header=render_overlay_header, &block
|
90
90
|
overlay_framer slot, header, {} do
|
91
|
-
haml_wrap_body
|
91
|
+
haml_wrap_body(&block)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
95
|
private
|
96
96
|
|
97
|
-
def overlay_framer slot, header, slot_opts
|
97
|
+
def overlay_framer slot, header, slot_opts, &block
|
98
98
|
class_up "card-slot", "_overlay"
|
99
|
-
with_frame slot, header, slot_opts
|
100
|
-
yield
|
101
|
-
end
|
99
|
+
with_frame slot, header, slot_opts, &block
|
102
100
|
end
|
103
101
|
end
|
data/set/all/process_layout.rb
CHANGED
@@ -14,13 +14,6 @@ format :html do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def main_render_args view, args
|
18
|
-
args[:view] = view if view
|
19
|
-
args[:main] = true
|
20
|
-
args[:main_view] = true
|
21
|
-
args
|
22
|
-
end
|
23
|
-
|
24
17
|
def page_layout
|
25
18
|
params[:layout] || layout_name_from_rule || :default
|
26
19
|
end
|
@@ -33,28 +26,43 @@ format :html do
|
|
33
26
|
render! view, view_opts.reverse_merge(args)
|
34
27
|
end
|
35
28
|
|
36
|
-
def render_outside_of_layout view, args
|
37
|
-
body = render_with_layout(nil, page_layout, {})
|
38
|
-
modal = render!(view, args)
|
39
|
-
if body.include?("</body>")
|
40
|
-
# a bit hacky
|
41
|
-
# the problem is that the body tag has to be in the layout
|
42
|
-
# so that you can add layout css classes like <body class="right-sidebar">
|
43
|
-
body.sub!("</body>", "#{modal}</body>")
|
44
|
-
else
|
45
|
-
body += modal
|
46
|
-
end
|
47
|
-
body
|
48
|
-
end
|
49
|
-
|
50
29
|
def show_layout?
|
51
30
|
!Env.ajax? || params[:layout]
|
52
31
|
end
|
53
32
|
|
54
33
|
def explicit_modal_wrapper? view
|
55
|
-
return unless view_setting
|
34
|
+
return unless (wrap_view = view_setting :wrap, view)
|
35
|
+
|
36
|
+
(wrapper_names(wrap_view) & %i[modal bridge]).any?
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def main_render_args view, args
|
42
|
+
args[:view] = view if view
|
43
|
+
args[:main] = true
|
44
|
+
args[:main_view] = true
|
45
|
+
args
|
46
|
+
end
|
47
|
+
|
48
|
+
def layout_name_from_rule
|
49
|
+
card.rule_card(:layout)&.try :item_name
|
50
|
+
end
|
51
|
+
|
52
|
+
def render_outside_of_layout view, args
|
53
|
+
body = render_with_layout nil, page_layout, {}
|
54
|
+
body_with_modal body, render!(view, args)
|
55
|
+
end
|
56
56
|
|
57
|
-
|
57
|
+
def body_with_modal body, modal
|
58
|
+
if body.include? "</body>"
|
59
|
+
# a bit hacky
|
60
|
+
# the problem is that the body tag has to be in the layout
|
61
|
+
# so that you can add layout css classes like <body class="right-sidebar">
|
62
|
+
body.sub "</body>", "#{modal}</body>"
|
63
|
+
else
|
64
|
+
body + modal
|
65
|
+
end
|
58
66
|
end
|
59
67
|
|
60
68
|
def wrapper_names wrappers
|
@@ -65,12 +73,6 @@ format :html do
|
|
65
73
|
end
|
66
74
|
end
|
67
75
|
|
68
|
-
def layout_name_from_rule
|
69
|
-
card.rule_card(:layout)&.try :item_name
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
76
|
def wrapper_names_from_array wrapper_array
|
75
77
|
wrapper_array.map { |w| w.is_a?(Array) ? w.first : w }
|
76
78
|
end
|
data/set/all/tabs.rb
CHANGED
data/set/self/account_links.rb
CHANGED
@@ -24,9 +24,9 @@ format :html do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def self.link_options opts={}
|
27
|
+
def self.link_options opts={}, &block
|
28
28
|
options = { denial: :blank, cache: :never }.merge opts
|
29
|
-
options[:perms] =
|
29
|
+
options[:perms] = block if block_given?
|
30
30
|
options.clone
|
31
31
|
end
|
32
32
|
|
data/set/self/foot.rb
CHANGED
data/set/self/head.rb
CHANGED
@@ -9,7 +9,7 @@ format :html do
|
|
9
9
|
view :core, cache: :never do
|
10
10
|
escape_in_main do
|
11
11
|
nest root.card, view: :head
|
12
|
-
#
|
12
|
+
# NOTE: that the head tag for each card is different
|
13
13
|
# (different title, different style rules, etc)
|
14
14
|
# so we don't cache the core of *head, but we _do_ cache some
|
15
15
|
# views within each head (see all/head.rb)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-05-
|
13
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,42 +18,42 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.101.
|
21
|
+
version: 1.101.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.101.
|
28
|
+
version: 1.101.5
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: card-mod-account
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.11.
|
35
|
+
version: 0.11.5
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.11.
|
42
|
+
version: 0.11.5
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: card-mod-session
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.11.
|
49
|
+
version: 0.11.5
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.11.
|
56
|
+
version: 0.11.5
|
57
57
|
description: ''
|
58
58
|
email:
|
59
59
|
- info@decko.org
|