card-mod-format 0.17.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/style/menu.scss +3 -0
- data/assets/style/messaging.scss +3 -1
- data/lib/card/format/csv_format.rb +5 -1
- data/set/all/demo.rb +1 -1
- data/set/all/html/head.rb +25 -46
- data/set/all/html/show.rb +8 -0
- data/set/all/html/views.rb +4 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ae4393c5ae29783e57eeb17d4840da0af745fa793c4d5f13dec9472ac7afe4d
|
4
|
+
data.tar.gz: 24d7a9768c4865c532ba0da5e0a11841e6d3ddab744dbcaab25ab283a7c0a6a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 158b8bb6ba805b03972fca92ab9c31642f21ce53927213459d200209b2732e4121ef7bbf67b46a3289ca340dc017231ac10ac613085bda1f4d729d2b4713ff36
|
7
|
+
data.tar.gz: f2e54e5296fe3826060a917c74dc514f0843de103c8b0b879ff66c8f18e7ab2acfcff8df147e6864973d401c67ba6cb609fa06b6f977f1ab254e3ee30c7466a5
|
data/assets/style/menu.scss
CHANGED
data/assets/style/messaging.scss
CHANGED
data/set/all/demo.rb
CHANGED
data/set/all/html/head.rb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
basket[:head_views] =
|
2
2
|
%i[page_title_tag meta_tags favicon_tag
|
3
|
-
|
3
|
+
stylesheet_tags
|
4
4
|
universal_edit_button rss_links]
|
5
5
|
# TODO: the last two should be in mods
|
6
6
|
|
7
|
+
basket[:cache_seed_names] += [
|
8
|
+
%i[all head],
|
9
|
+
%i[all style],
|
10
|
+
%i[all style asset_output],
|
11
|
+
%i[all script],
|
12
|
+
%i[script right content_options]
|
13
|
+
]
|
14
|
+
|
7
15
|
format do
|
8
16
|
view :page_title, unknown: true, perms: :none do
|
9
17
|
title_parts = [Card::Rule.global_setting(:title)]
|
@@ -13,7 +21,7 @@ format do
|
|
13
21
|
end
|
14
22
|
|
15
23
|
format :html do
|
16
|
-
view :head, unknown: true, perms: :none do
|
24
|
+
view :head, unknown: true, perms: :none, cache: :yes do
|
17
25
|
basket[:head_views].map { |viewname| render viewname }.flatten.compact.join "\n"
|
18
26
|
end
|
19
27
|
|
@@ -27,6 +35,7 @@ format :html do
|
|
27
35
|
nest :favicon, view: :link_tag
|
28
36
|
end
|
29
37
|
|
38
|
+
# TODO: move to mod
|
30
39
|
view :universal_edit_button, unknown: :blank, denial: :blank, perms: :update do
|
31
40
|
return if card.new?
|
32
41
|
|
@@ -34,61 +43,31 @@ format :html do
|
|
34
43
|
title: "Edit this page!", href: path(view: :edit)
|
35
44
|
end
|
36
45
|
|
46
|
+
# TODO: move to rss mod
|
47
|
+
view :rss_links, unknown: true, perms: :none do
|
48
|
+
render :rss_link_tag if rss_link?
|
49
|
+
end
|
50
|
+
|
37
51
|
# these should render a view of the rule card
|
38
52
|
# it would then be safe to cache if combined with param handling
|
39
53
|
# (but note that machine clearing would need to reset card cache...)
|
40
|
-
view :
|
41
|
-
|
42
|
-
|
43
|
-
tag("link", href: href, media: "all", rel: "stylesheet", type: "text/css")
|
54
|
+
view :stylesheet_tags, cache: :never, unknown: true, perms: :none do
|
55
|
+
[nest(:style_mods, view: :remote_style_tags), head_stylesheet_path]
|
44
56
|
end
|
45
57
|
|
46
|
-
|
47
|
-
|
58
|
+
def head_stylesheet_path
|
59
|
+
@head_stylesheet_path ||=
|
60
|
+
tag "link", media: "all",
|
61
|
+
rel: "stylesheet",
|
62
|
+
type: "text/css",
|
63
|
+
href: nest(param_or_rule_card(:style), view: :stylesheet_path)
|
48
64
|
end
|
49
65
|
|
50
66
|
def param_or_rule_card setting
|
51
|
-
|
52
|
-
Card[params[setting]]
|
53
|
-
else
|
54
|
-
root.card.rule_card setting
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def debug_or_machine_path setting, debug_lambda, machine_path_lambda
|
59
|
-
return unless (asset_card = param_or_rule_card setting)
|
60
|
-
debug_path(setting, asset_card, &debug_lambda) ||
|
61
|
-
machine_path_lambda.call(asset_card.asset_output_url)
|
62
|
-
end
|
63
|
-
|
64
|
-
def debug_path setting, asset_card
|
65
|
-
return unless params[:debug] == setting.to_s
|
66
|
-
|
67
|
-
yield asset_card
|
68
|
-
end
|
69
|
-
|
70
|
-
# TODO: move to rss mod
|
71
|
-
view :rss_links, unknown: true, perms: :none do
|
72
|
-
render :rss_link_tag if rss_link?
|
67
|
+
params[setting]&.card || root.card.rule_card(setting)
|
73
68
|
end
|
74
69
|
|
75
70
|
def rss_link?
|
76
71
|
Card.config.rss_enabled && respond_to?(:rss_link_tag)
|
77
72
|
end
|
78
|
-
|
79
|
-
def remote_style_tags
|
80
|
-
return unless (asset_card = Card[:style_mods])
|
81
|
-
|
82
|
-
asset_card.item_cards.map do |mod_style_card|
|
83
|
-
nest mod_style_card, view: :remote_include_tags
|
84
|
-
end.select(&:present?)
|
85
|
-
end
|
86
|
-
|
87
|
-
def head_stylesheet_path
|
88
|
-
debug_or_machine_path(
|
89
|
-
:style,
|
90
|
-
->(style_card) { path mark: style_card.name, item: :import, format: :css },
|
91
|
-
->(machine_path) { machine_path }
|
92
|
-
)
|
93
|
-
end
|
94
73
|
end
|
data/set/all/html/show.rb
CHANGED
@@ -25,7 +25,15 @@ format :html do
|
|
25
25
|
render! view, args
|
26
26
|
end
|
27
27
|
|
28
|
+
def default_page_view
|
29
|
+
default_nest_view
|
30
|
+
end
|
31
|
+
|
28
32
|
def show_method
|
29
33
|
"show_#{show_layout? ? :with : :without}_page_layout"
|
30
34
|
end
|
35
|
+
|
36
|
+
def show_layout?
|
37
|
+
!Env.ajax? || params[:layout]
|
38
|
+
end
|
31
39
|
end
|
data/set/all/html/views.rb
CHANGED
@@ -7,7 +7,7 @@ format :html do
|
|
7
7
|
|
8
8
|
before(:content) { prepare_content_slot }
|
9
9
|
|
10
|
-
view :content do
|
10
|
+
view :content, cache: :yes do
|
11
11
|
wrap do
|
12
12
|
[
|
13
13
|
render_menu(optional: :hide),
|
@@ -52,7 +52,7 @@ format :html do
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
view :titled do
|
55
|
+
view :titled, cache: :yes do
|
56
56
|
@content_body = true
|
57
57
|
wrap do
|
58
58
|
[
|
@@ -64,7 +64,7 @@ format :html do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
# unlike unknown: true, unknown: (same view) can be overridden
|
67
|
-
view :labeled, unknown: :labeled do
|
67
|
+
view :labeled, unknown: :labeled, cache: :yes do
|
68
68
|
@content_body = true
|
69
69
|
wrap(true, class: "row") do
|
70
70
|
[labeled(render_title, wrap_body { render_labeled_content }), render_menu]
|
@@ -76,7 +76,7 @@ format :html do
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def labeled_field field, item_view=:name, opts={}
|
79
|
-
opts[:title] ||=
|
79
|
+
opts[:title] ||= field.cardname
|
80
80
|
field_nest field, opts.merge(view: :labeled,
|
81
81
|
items: (opts[:items] || {}).merge(view: item_view))
|
82
82
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.1
|
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-
|
13
|
+
date: 2024-11-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,28 +18,28 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.108.1
|
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.
|
28
|
+
version: 1.108.1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: card-mod-content
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
35
|
+
version: 0.18.1
|
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.
|
42
|
+
version: 0.18.1
|
43
43
|
description: ''
|
44
44
|
email:
|
45
45
|
- info@decko.org
|
@@ -207,7 +207,7 @@ files:
|
|
207
207
|
- vendor/jquery_rails/vendor/assets/javascripts/jquery_ujs.js
|
208
208
|
homepage: https://decko.org
|
209
209
|
licenses:
|
210
|
-
- GPL-3.0
|
210
|
+
- GPL-3.0-or-later
|
211
211
|
metadata:
|
212
212
|
source_code_uri: https://github.com/decko-commons/decko
|
213
213
|
homepage_uri: https://decko.org
|