card-mod-layout 0.17.0 → 0.18.0

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
2
  SHA256:
3
- metadata.gz: 1ec837afb468af7b7cb4e750530af0e9a4969c25790b1d6bd38ae925a911d206
4
- data.tar.gz: 9a250e05b0c1de8923dc5ec3625293e4f1944dcdd0e7245606da6ed082a6dcc1
3
+ metadata.gz: 312f14d0e2d9cff16ea45cd52f0c5912d4a88150bd2b9c2ed9035772d7c36775
4
+ data.tar.gz: 28e9728f028b3c088ebf45eaf4c94d91a307954a06352e8f6af422c487e547cf
5
5
  SHA512:
6
- metadata.gz: 9afc1d38fdd83efd10eebae08ceffee72849209db77a7e48e03808d16cbf60b47bc0c5e780628d9d48df0f693485c9373eda8decdef16cebd6e511a99e178e16
7
- data.tar.gz: '081c2125e0fd671a18f0f9b0ccf69aedeb3f957cec1281cfb5367974ef153776acc56e7cf90b03e840e97b9dffab586ef0fa5259edf2f2730b4f91bc142681a1'
6
+ metadata.gz: f843062447f1586b31c359b929130f9671ad08c0b1ccafa67e793bf734c184aa0eb297490df915e4da353ed12fc80ffcec6afcd4dfa8d443cfe72469cf1860d5
7
+ data.tar.gz: f7d4d86b5de8757cd09348d163acdfb6c65bc3b6101737b8e1d9d5a8b095b018092babb18f978b2d8068d0b881a15282390a74a00f15a05feffec58d7012ee3b
data/set/all/modal.rb CHANGED
@@ -16,24 +16,9 @@ format :html do
16
16
  ""
17
17
  end
18
18
 
19
- def show_in_modal_link link_text, body
20
- link_to_view :modal, link_text, "data-modal-body": body, "data-slotter-mode": "modal"
21
- end
22
-
23
- def modal_close_button link_text="Close", opts={}
24
- classes = opts.delete(:class)
25
- button_opts = opts.merge(MODAL_CLOSE_OPTS)
26
- add_class button_opts, classes if classes
27
- button_tag link_text, button_opts
28
- end
29
-
30
- def modal_submit_button opts={}
31
- add_class opts, "submit-button _close-modal"
32
- submit_button opts
33
- end
34
-
35
19
  view :modal_menu, unknown: true, wrap: :modal_menu do
36
- [close_modal_window, pop_out_modal_window]
20
+ [render_close_modal_link,
21
+ render_pop_out_modal_link(optional: :show)]
37
22
  end
38
23
 
39
24
  wrapper :modal_menu, :div, class: "modal-menu _modal-menu ms-auto"
@@ -52,6 +37,32 @@ format :html do
52
37
  modal_link _render_title, size: voo.size
53
38
  end
54
39
 
40
+ view :close_modal_link, unknown: true do
41
+ link_to icon_tag(:close), path: "",
42
+ class: "_close-modal btn-close",
43
+ "data-bs-dismiss": "modal"
44
+ end
45
+
46
+ view :pop_out_modal_link, unknown: :blank do
47
+ link_to icon_tag(:modal), path: {}, class: "pop-out-modal btn-close"
48
+ end
49
+
50
+ def show_in_modal_link link_text, body
51
+ link_to_view :modal, link_text, "data-modal-body": body, "data-slotter-mode": "modal"
52
+ end
53
+
54
+ def modal_close_button link_text="Close", opts={}
55
+ classes = opts.delete(:class)
56
+ button_opts = opts.merge(MODAL_CLOSE_OPTS)
57
+ add_class button_opts, classes if classes
58
+ button_tag link_text, button_opts
59
+ end
60
+
61
+ def modal_submit_button opts={}
62
+ add_class opts, "submit-button _close-modal"
63
+ submit_button opts
64
+ end
65
+
55
66
  def modal_link text=nil, opts={}
56
67
  opts = modal_link_opts(opts)
57
68
  opts[:path][:layout] ||= :modal
@@ -87,18 +98,6 @@ format :html do
87
98
  size.in?(MODAL_SIZE.keys) ? size : cast_modal_option(size)
88
99
  end
89
100
 
90
- def close_modal_window
91
- link_to icon_tag(:close), path: "",
92
- class: "_close-modal btn-close",
93
- "data-bs-dismiss": "modal"
94
- end
95
-
96
- def pop_out_modal_window
97
- return unless card.known?
98
-
99
- link_to icon_tag(:modal), path: {}, class: "pop-out-modal btn-close"
100
- end
101
-
102
101
  private
103
102
 
104
103
  def normalize_modal_option key, opts
@@ -1,8 +1,19 @@
1
+ basket[:cache_seed_names] << %i[all layout]
2
+
1
3
  format :html do
2
- # TODO: use CodeFile cards for these
3
- # builtin layouts allow for rescue / testing
4
- # HTML_LAYOUTS = Mod::Loader.load_layouts(:html).merge "none" => "{{_main}}"
5
- # HAML_LAYOUTS = Mod::Loader.load_layouts(:haml)
4
+ # for override
5
+ def layout_for_view _view
6
+ nil
7
+ end
8
+
9
+ # public for testing
10
+ def explicit_modal_wrapper? view
11
+ return unless (wrap_view = view_setting :wrap, view)
12
+
13
+ (wrapper_names(wrap_view) & %i[modal board]).any?
14
+ end
15
+
16
+ private
6
17
 
7
18
  def show_with_page_layout view, args
8
19
  main!
@@ -19,35 +30,10 @@ format :html do
19
30
  params[:layout] || layout_for_view(view) || layout_name_from_rule || :default
20
31
  end
21
32
 
22
- # for override
23
- def layout_for_view _view
24
- nil
25
- end
26
-
27
- def render_with_layout view, layout, args={}
28
- view_opts = Layout.main_nest_opts(layout, self)
29
- view ||= view_opts.delete(:view) || default_page_view
30
- view_opts[:home_view] = view
31
- view_opts[:layout] = layout
32
- render! view, view_opts.reverse_merge(args)
33
- end
34
-
35
- def default_page_view
36
- default_nest_view
37
- end
38
-
39
- def show_layout?
40
- !Env.ajax? || params[:layout]
41
- end
42
-
43
- def explicit_modal_wrapper? view
44
- return unless (wrap_view = view_setting :wrap, view)
45
-
46
- (wrapper_names(wrap_view) & %i[modal board]).any?
33
+ def layout_name_from_rule
34
+ card.rule_card(:layout)&.try :first_name
47
35
  end
48
36
 
49
- private
50
-
51
37
  def main_render_args view, args
52
38
  args[:view] = view if view
53
39
  args[:main] = true
@@ -55,15 +41,19 @@ format :html do
55
41
  args
56
42
  end
57
43
 
58
- def layout_name_from_rule
59
- card.rule_card(:layout)&.try :first_name
60
- end
61
-
62
44
  def render_outside_of_layout view, args
63
45
  body = render_with_layout nil, page_layout(view), {}
64
46
  body_with_modal body, render!(view, args)
65
47
  end
66
48
 
49
+ def render_with_layout view, layout, args={}
50
+ view_opts = Layout.main_nest_opts(layout, self)
51
+ view ||= view_opts.delete(:view) || default_page_view
52
+ view_opts[:home_view] = view
53
+ view_opts[:layout] = layout
54
+ render! view, view_opts.reverse_merge(args)
55
+ end
56
+
67
57
  def body_with_modal body, modal
68
58
  if body.include? "</body>"
69
59
  # a bit hacky
data/set/right/head.rb CHANGED
@@ -5,7 +5,7 @@ def ok_to_read?
5
5
  end
6
6
 
7
7
  format :html do
8
- view :head_content do
8
+ view :head_content, cache: :yes do
9
9
  process_content render_raw
10
10
  end
11
11
 
data/set/right/layout.rb CHANGED
@@ -1 +1,5 @@
1
1
  assign_type :pointer
2
+
3
+ # def item_references?
4
+ # false
5
+ # end
@@ -72,7 +72,7 @@ format :html do
72
72
 
73
73
  def can_disable_roles?
74
74
  Auth.current_roles.size > 1 &&
75
- Card::Codename.exists?(:enabled_roles) # workaround for broken migrations
75
+ Card::Codename.exist?(:enabled_roles) # workaround for broken migrations
76
76
  end
77
77
 
78
78
  def account_link_text purpose
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.17.0
4
+ version: 0.18.0
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: 2024-06-12 00:00:00.000000000 Z
13
+ date: 2024-10-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,56 +18,56 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.107.0
21
+ version: 1.108.0
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.107.0
28
+ version: 1.108.0
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.17.0
35
+ version: 0.18.0
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.17.0
42
+ version: 0.18.0
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.17.0
49
+ version: 0.18.0
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.17.0
56
+ version: 0.18.0
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: card-mod-tabs
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.17.0
63
+ version: 0.18.0
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.17.0
70
+ version: 0.18.0
71
71
  description: ''
72
72
  email:
73
73
  - info@decko.org
@@ -123,7 +123,7 @@ files:
123
123
  - set/type/layout_type.rb
124
124
  homepage: https://decko.org
125
125
  licenses:
126
- - GPL-3.0
126
+ - GPL-3.0-or-later
127
127
  metadata:
128
128
  source_code_uri: https://github.com/decko-commons/decko
129
129
  homepage_uri: https://decko.org
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.5.10
150
+ rubygems_version: 3.5.7
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: decko layouts