card-mod-content 0.14.1 → 0.15.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: 6e83c52ae5a7b63e5428fc38eb57574761a3814613bd2212f39babc7aa38f08b
4
- data.tar.gz: da7f30ddfd337f834f3fe41d3e00f33791b5da453470ad342f4cb7aa306127fe
3
+ metadata.gz: 898002af2198d1a60f682509cd6fe7b47c37ea54a4a9b6f97d31625d26e37c82
4
+ data.tar.gz: 48f24b7e2f812f29e320cfb3dd2b15c8bd043bddc192e8c96ab0a10dde9bd255
5
5
  SHA512:
6
- metadata.gz: dca59e29bd5f962a070b6f03ece3abcf6c4646b3005ddef65e32625f4373f631ad43540c6a3e6b77ccada3b5958abc1752f6d191ec790a33f6dafd902f0048e4
7
- data.tar.gz: 74ba35afd802b77b039021d230def87f043b656ef057cc34bba7697b3c3e1a6fe9125229e7f0a7c72e041f6030a6b4b0914e4fbe000dcc0dd50edf0f2ff9e107
6
+ metadata.gz: 5b5f809221507e2ba3b23fc19bf2e8754511df1d1189c1b1e8c5857047b799aa3dc0dedfa43c4d07440232af20b0058377ba2d2842504dcd6b68e74ab158d163
7
+ data.tar.gz: c74a4d90f21bb0f5b27335d9f8c637f9ca0ebd7ea02fada1b9572fe967e401c55ff48590a4b65559627c1ff1ab07b6187d71216375140872a7ef792fd094afb5
data/data/real.yml ADDED
@@ -0,0 +1,27 @@
1
+ - :name: "*default"
2
+ :type: :setting
3
+ :codename: default
4
+ - :name: "*structure"
5
+ :type: :setting
6
+ :codename: structure
7
+ - :name:
8
+ - :all
9
+ - :default
10
+
11
+ - :name:
12
+ - :cardtype
13
+ - :type
14
+ - :structure
15
+ :content: |
16
+ {{+:description|content}}
17
+ {{_|add_button}}{{_|configure_button}}
18
+ {{+:type+:by_name|content}}
19
+
20
+ - :name:
21
+ - :cardtype
22
+ - :self
23
+ - :structure
24
+ :content: |-
25
+ {{+description|content}}
26
+ {{_|add_button}}{{_|configure_button}}\n
27
+ {{_|grouped_list}}\n"
data/data/test.yml ADDED
@@ -0,0 +1,32 @@
1
+ ---
2
+ - :name: UserForm
3
+ :type: :cardtype
4
+ - :name: Book
5
+ :type: :cardtype
6
+ - :name: Author
7
+ :type: :cardtype
8
+
9
+ - :name:
10
+ - UserForm
11
+ - :type
12
+ - :structure
13
+ :type: :nest_list
14
+ :content: "{{+name}} {{+age}} {{+description}}"
15
+ - :name:
16
+ - Book
17
+ - :type
18
+ - :structure
19
+ :type: :nest_list
20
+ :content: by {{+author}}, design by {{+illustrator}}
21
+
22
+ - :name: Stam Broker
23
+ :type: Author
24
+ - :name: Darles Chickens
25
+ :type: Author
26
+
27
+ - :name: Iliad
28
+ :type: Book
29
+ - :name: Parry Hotter
30
+ :type: Book
31
+ - :name: 50 grades of shy
32
+ :type: Book
@@ -11,40 +11,8 @@ class << self
11
11
  end
12
12
  end
13
13
 
14
- # FIXME: these should abstracted and configured on the types
15
- # (same codes for `rake card:create:codefile`)
16
-
17
- # @return [Array<String>, String] the name of file(s) to be loaded
18
- def source_files
19
- case type_id
20
- when CoffeeScriptID then "#{codename}.js.coffee"
21
- when JavaScriptID then "#{codename}.js"
22
- when CssID then "#{codename}.css"
23
- when ScssID then "#{codename}.scss"
24
- end
25
- end
26
-
27
- def source_dir
28
- case type_id
29
- when CoffeeScriptID, JavaScriptID then "lib/javascript"
30
- when CssID, ScssID then "lib/stylesheets"
31
- else
32
- "lib"
33
- end
34
- end
35
-
36
- def mod_path
37
- modname = file_content_mod_name
38
- if (match = modname.match(/^card-mod-(\w*)/))
39
- modname = match[1]
40
- end
41
- Cardio::Mod.dirs.path modname
42
- end
43
-
44
14
  def source_paths
45
- Array.wrap(source_files).map do |filename|
46
- ::File.join mod_path, source_dir, filename
47
- end
15
+ # OVERRIDE to use paths for content
48
16
  end
49
17
 
50
18
  def content
@@ -66,8 +34,12 @@ format :html do
66
34
  "#{card.name}: #{number_to_human_size card.content.bytesize}"
67
35
  end
68
36
 
37
+ view :bar_middle do
38
+ short_content
39
+ end
40
+
69
41
  def short_content
70
- fa_icon("exclamation-circle", class: "text-muted pr-2") +
42
+ fa_icon("exclamation-circle", class: "text-muted pe-2") +
71
43
  wrap_with(:span, "file", class: "text-muted")
72
44
  end
73
45
 
@@ -75,11 +47,3 @@ format :html do
75
47
  multi_card_editor? ? super : ""
76
48
  end
77
49
  end
78
-
79
- def coffee_files files
80
- files.map { |f| "script_#{f}.js.coffee" }
81
- end
82
-
83
- def scss_files files
84
- files.map { |f| "style_#{f}.scss" }
85
- end
@@ -4,7 +4,7 @@ format :html do
4
4
  end
5
5
 
6
6
  def short_content
7
- fa_icon("exclamation-circle", class: "text-muted pr-2") +
7
+ fa_icon("exclamation-circle", class: "text-muted pe-2") +
8
8
  wrap_with(:span, "read-only", class: "text-muted")
9
9
  end
10
10
 
data/set/all/chunk.rb CHANGED
@@ -124,21 +124,24 @@ format do
124
124
 
125
125
  def explicit_edit_fields_config
126
126
  edit_fields.map do |cardish, options|
127
- field_mark = normalized_edit_field_mark cardish, options
128
- options = normalized_edit_field_options options, Card::Name[field_mark]
129
- [field_mark, options]
127
+ normalized_edit_field_config cardish, options
130
128
  end
131
129
  end
132
130
 
133
- def normalized_edit_field_options options, cardname
134
- options ||= cardname
135
- options.is_a?(String) ? { title: options } : options
131
+ def normalized_edit_field_config cardish, options={}
132
+ options ||= {}
133
+ field_mark = normalized_edit_field_mark cardish, options
134
+ options[:title] ||= Card::Name[field_mark]
135
+ [field_mark, options]
136
136
  end
137
137
 
138
- def normalized_edit_field_mark cardish, options
139
- return cardish if cardish.is_a?(Card) ||
140
- (options.is_a?(Hash) && options.delete(:absolute))
138
+ def normalized_edit_field_mark cardish, options={}
139
+ return cardish if options.delete(:absolute) || normalized_edit_field_mark?(cardish)
141
140
 
142
141
  card.name.field cardish
143
142
  end
143
+
144
+ def normalized_edit_field_mark? cardish
145
+ cardish.is_a?(Card) || (cardish.is_a?(String) && cardish.to_name.compound?)
146
+ end
144
147
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.15.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: 2022-01-04 00:00:00.000000000 Z
13
+ date: 2023-01-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.104.1
21
+ version: 1.105.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.104.1
28
+ version: 1.105.0
29
29
  description: ''
30
30
  email:
31
31
  - info@decko.org
@@ -33,7 +33,8 @@ executables: []
33
33
  extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
36
- - db/migrate_core_cards/20201115133753_add_asset_file_card.rb
36
+ - data/real.yml
37
+ - data/test.yml
37
38
  - lib/card/content/chunk/escaped_literal.rb
38
39
  - lib/card/content/chunk/link.rb
39
40
  - lib/card/content/chunk/nest.rb
@@ -47,7 +48,6 @@ files:
47
48
  - set/abstract/lock.rb
48
49
  - set/abstract/read_only.rb
49
50
  - set/abstract/templated_nests.rb
50
- - set/abstract/vendor_code_file.rb
51
51
  - set/all/chunk.rb
52
52
  - set/all/contextual_content.rb
53
53
  - set/all/templating.rb
@@ -65,6 +65,7 @@ metadata:
65
65
  wiki_uri: https://decko.org
66
66
  documentation_url: http://docs.decko.org/
67
67
  card-mod: content
68
+ card-mod-group: gem-defaults
68
69
  post_install_message:
69
70
  rdoc_options: []
70
71
  require_paths:
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  - !ruby/object:Gem::Version
81
82
  version: '0'
82
83
  requirements: []
83
- rubygems_version: 3.2.15
84
+ rubygems_version: 3.3.11
84
85
  signing_key:
85
86
  specification_version: 4
86
87
  summary: card content handling
@@ -1,7 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- class AddAssetFileCard < Cardio::Migration::Core
4
- def up
5
- ensure_code_card "Asset file", type_id: Card::CardtypeID
6
- end
7
- end
@@ -1,9 +0,0 @@
1
- include_set Abstract::CodeFile
2
-
3
- def self.included host_class
4
- Abstract::CodeFile.track_mod_name host_class, caller
5
- end
6
-
7
- def source_dir
8
- "vendor"
9
- end