card-mod-list 0.16.0 → 0.17.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: 4fe7b5bf87587ddfbbf67bcc52fc094f8a696af0cbae42244620d4024dcaf355
4
- data.tar.gz: 2d0f6b64cb2add03f17439841dfa60b112043349ca11d00ca337de6267ccecd2
3
+ metadata.gz: 2c1f3fb4e25fafbf3292058af388937179d3137dc2218dfeb91f7265f915ef17
4
+ data.tar.gz: d74579fe55c4de641ebb00db9fa63a7123f90da10c341be1c4924d6e93b1309c
5
5
  SHA512:
6
- metadata.gz: 4ac8c7bcfcbe0002f7148b991605656a0aa865a3196fda5ca293c0110c45af92eb462180667bafd399f29035c46fd2f8150e2bfe1edba85580bf26f7fa95461a
7
- data.tar.gz: 025ced79a28fef7ffbf8a1f6955c470690b6a78a2cafffd21c4190e316729af2d228b54bd899ca766931df919f00d3408ff4db798524f0245761e9eff6c168aa
6
+ metadata.gz: efab59b282f1b86d857eb33d66f6cf4f8dc471b005273a50bd721e93000445eed6b3f0ebd1ea7cc32d326a17be81eb748e37a038e1a88135887f552f4d8c56bb
7
+ data.tar.gz: 8c478da1c0e29074f73f6d5ea5bb7a835ded446985dbfc4f49a3dd7f57ed81faacb4e534ffb80386f63c0293729c178ab34211cf36d68b379cbc397b43940763
data/config/admin.yml ADDED
@@ -0,0 +1,10 @@
1
+ settings:
2
+ - content_options
3
+ - content_option_view
4
+
5
+ cardtypes:
6
+ organize:
7
+ - list
8
+ - pointer
9
+ - nest_list
10
+ - link_list
@@ -28,11 +28,6 @@ event :validate_item_uniqueness, :validate, on: :save, when: :unique_items? do
28
28
  errors.add :content, t(:list_duplicate_items_names, duplicates: dupes.to_sentence)
29
29
  end
30
30
 
31
- def duplicate_item_names
32
- names = item_names
33
- names.uniq.select { |n| names.count(n) > 1 }
34
- end
35
-
36
31
  # for override
37
32
  def unique_items?
38
33
  false
@@ -5,12 +5,6 @@ format do
5
5
  20
6
6
  end
7
7
 
8
- def nest_item_array
9
- card.item_cards.map do |item|
10
- nest_item item
11
- end
12
- end
13
-
14
8
  view :core do
15
9
  pointer_items.join ", "
16
10
  end
@@ -23,6 +17,12 @@ end
23
17
 
24
18
  # JavaScript views
25
19
 
20
+ format :csv do
21
+ view :core do
22
+ pointer_items.join ";"
23
+ end
24
+ end
25
+
26
26
  format :js do
27
27
  view :core do
28
28
  nest_item_array.join "\n\n"
@@ -33,6 +33,10 @@ end
33
33
 
34
34
  format :data do
35
35
  view :core do
36
+ card.known? ? render_content : []
37
+ end
38
+
39
+ view :content do
36
40
  nest_item_array
37
41
  end
38
42
  end
@@ -69,11 +73,9 @@ format :css do
69
73
  %(#{major_comment "STYLE GROUP: \"#{card.name}\"", '='}#{_render_core})
70
74
  end
71
75
 
72
- view :core do
76
+ view :content do
73
77
  nest_item_array.join "\n\n"
74
78
  end
75
-
76
- view :content, :core
77
79
  end
78
80
 
79
81
  # RSS views
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.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: 2023-11-18 00:00:00.000000000 Z
13
+ date: 2024-06-12 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.106.0
21
+ version: 1.107.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.106.0
28
+ version: 1.107.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-format
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.16.0
35
+ version: 0.17.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.16.0
42
+ version: 0.17.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-collection
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.16.0
49
+ version: 0.17.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.16.0
56
+ version: 0.17.0
57
57
  description: ''
58
58
  email:
59
59
  - info@decko.org
@@ -66,6 +66,7 @@ files:
66
66
  - assets/script/pointer_config.js.coffee
67
67
  - assets/script/pointer_list_editor.js.coffee
68
68
  - assets/style/list.scss
69
+ - config/admin.yml
69
70
  - config/locales/de.yml
70
71
  - config/locales/en.yml
71
72
  - data/files/mod_list_script_asset_output/file.js
@@ -81,7 +82,6 @@ files:
81
82
  - set/abstract/01_list/html_views/list_input.haml
82
83
  - set/abstract/01_list/html_views/list_item.haml
83
84
  - set/abstract/01_list/html_views/radio_input.haml
84
- - set/abstract/01_list/options_api.rb
85
85
  - set/abstract/01_list/other_views.rb
86
86
  - set/abstract/codename_list.rb
87
87
  - set/abstract/delist.rb
@@ -119,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="
121
121
  - !ruby/object:Gem::Version
122
- version: '2.5'
122
+ version: '3.0'
123
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
125
  - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 3.4.10
129
+ rubygems_version: 3.5.10
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: list of cards
@@ -1,85 +0,0 @@
1
- # TODO: some of this should be moved to right/options!!
2
- # or to type/JSON?
3
-
4
- def options_hash
5
- json_options? ? options_card.parse_content : option_hash_from_names
6
- end
7
-
8
- def json_options?
9
- options_card&.type_id == JsonID
10
- end
11
-
12
- def option_hash_from_names
13
- option_names.each_with_object({}) do |name, hash|
14
- hash[name] = name
15
- end
16
- end
17
-
18
- def option_names
19
- if (selected_options = item_names)
20
- (standard_option_names + selected_options).uniq
21
- else
22
- standard_option_names
23
- end
24
- end
25
-
26
- def option_cards
27
- option_names.map do |name|
28
- Card.fetch name, new: {}
29
- end
30
- end
31
-
32
- def standard_option_names
33
- if json_options?
34
- options_hash.values.map(&:to_name)
35
- else
36
- option_names_from_items
37
- end
38
- end
39
-
40
- def option_names_from_items
41
- o_card = options_card
42
- limit = o_card.try(:default_limit).to_i
43
- context_name = right_type? ? nil : name
44
- o_card.item_names context: context_name, limit: limit
45
- end
46
-
47
- def options_card
48
- @options_card ||= rule_card(:content_options) || right_type_options || Card[:all]
49
- end
50
-
51
- def options_card_name
52
- options_card&.name&.url_key
53
- end
54
-
55
- private
56
-
57
- def right_type_options
58
- Card.fetch [right.name, :type, :by_name] if right_type?
59
- end
60
-
61
- def right_type?
62
- right&.type_id == CardtypeID
63
- end
64
-
65
- format do
66
- delegate :options_card, :options_card_name, to: :card
67
- end
68
-
69
- format :html do
70
- def option_label option_name, id
71
- wrap_with :label, class: "form-check-label", for: id do
72
- option_label_text option_name
73
- end
74
- end
75
-
76
- def option_view
77
- @option_view ||= card.rule(:content_option_view) || :smart_label
78
- end
79
-
80
- def option_label_text option_name
81
- return option_name unless (option_card = Card.fetch option_name)
82
-
83
- nest option_card, view: option_view
84
- end
85
- end