card-mod-list 0.13.4 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/migrate_core_cards/20211107155032_out_with_the_brackets.rb +15 -0
- data/set/abstract/01_pointer/events.rb +0 -16
- data/set/abstract/01_pointer/html_views/filter/filtered_list_input.haml +1 -6
- data/set/abstract/01_pointer/html_views/filter.rb +1 -1
- data/set/abstract/01_pointer/html_views.rb +0 -4
- data/set/abstract/01_pointer/options_api.rb +15 -10
- data/set/abstract/01_pointer/other_views.rb +0 -12
- data/set/abstract/01_pointer.rb +29 -0
- data/set/abstract/id_pointer.rb +4 -0
- data/set/type/link_list.rb +1 -1
- data/set/type/list.rb +0 -6
- data/set/type/nest_list.rb +2 -3
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4316c5069bcd80afcd1dde8baea756840fb37fc4013f66b330bb59ec66ee7fcf
|
4
|
+
data.tar.gz: df0ad2e126df49366317487b18376f9b6021f3df38bc608a17fcde621e1cfaa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a022ba39e61db74a3497c5361a4bf3ea53d70e4b55db22a5bc30da0e24c200d4027af04280f67f473c78659c7c62b18b742cd65c2dfac9a9d4f7e430ec8372db
|
7
|
+
data.tar.gz: 99e1c1629c487d3a92f11f60741b1125ea0cc27cb3168b8265eac4dac75fa032a22979f87553c45e164a09076946f01bfe60d7683b3bd4f4e9629917bd07349a
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
# delete brackets from card content
|
4
|
+
class OutWithTheBrackets < Cardio::Migration
|
5
|
+
def up
|
6
|
+
Card["*getting started links"]&.update_column :type_id, :link_list.card_id
|
7
|
+
|
8
|
+
list_type_ids = %i[pointer list].map(&:card_id)
|
9
|
+
["[[", "]]"].each do |brackets|
|
10
|
+
Card.where(type_id: list_type_ids).in_batches.update_all(
|
11
|
+
"db_content = REPLACE(db_content, '#{brackets}', '')"
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -14,22 +14,6 @@ def item_to_insert
|
|
14
14
|
Env.params["insert_item"]
|
15
15
|
end
|
16
16
|
|
17
|
-
# If a card's type and content are updated in the same action, the new module
|
18
|
-
# will override the old module's events and functions. But this event is only
|
19
|
-
# on pointers -- other type cards do not have this event,
|
20
|
-
# Therefore if something is changed from a pointer and its content is changed
|
21
|
-
# in the same action, this event will be run and will treat the content like
|
22
|
-
# it' still pointer content. The "when" clause helps with that (but is a hack)
|
23
|
-
event :standardize_items, :prepare_to_validate,
|
24
|
-
on: :save, changed: :content, when: :still_pointer? do
|
25
|
-
items_to_content item_strings
|
26
|
-
end
|
27
|
-
|
28
|
-
def still_pointer?
|
29
|
-
type_id == PointerID
|
30
|
-
# Card.new(type_id: type_id).is_a? Abstract::Pointer
|
31
|
-
end
|
32
|
-
|
33
17
|
def changed_item_names
|
34
18
|
dropped_item_names + added_item_names
|
35
19
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
%div.filtered-list-editor
|
2
|
-
%ul.pointer-list.filtered-list-review._pointer-filtered-list.list-group.vertical.
|
2
|
+
%ul.pointer-list.filtered-list-review._pointer-filtered-list.list-group.vertical.p-0
|
3
3
|
- card.item_cards(context: :raw).each do |item_card|
|
4
4
|
%li._filtered-list-item.clearfix{ data: item_card.format.wrap_data(false) }
|
5
5
|
%span._handle.float-left.m-2
|
@@ -13,9 +13,4 @@
|
|
13
13
|
%br
|
14
14
|
.clearfix
|
15
15
|
= add_item_modal_link
|
16
|
-
-# "data-target": "#modal-filtered-list"
|
17
|
-
-# = modal_slot "filtered-list", "modal-lg"
|
18
16
|
|
19
|
-
// note: passing item and filter card because in some cases (eg Dataset+Metric on wikirate)
|
20
|
-
// the link was losing set-identifying information (type of left)
|
21
|
-
// would be preferable to have a more general solution to retain set-identifying info.
|
@@ -29,10 +29,6 @@ def option_cards
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
def options_rule_card
|
33
|
-
rule_card :content_options
|
34
|
-
end
|
35
|
-
|
36
32
|
def standard_option_names
|
37
33
|
if json_options?
|
38
34
|
options_hash.values.map(&:to_name)
|
@@ -44,21 +40,30 @@ end
|
|
44
40
|
def option_names_from_items
|
45
41
|
o_card = options_card
|
46
42
|
limit = o_card.try(:default_limit).to_i
|
47
|
-
|
43
|
+
context_name = right_type? ? nil : name
|
44
|
+
o_card.item_names context: context_name, limit: limit
|
48
45
|
end
|
49
46
|
|
50
47
|
def options_card
|
51
|
-
|
48
|
+
@options_card ||= rule_card(:content_options) || right_type_options || Card[:all]
|
52
49
|
end
|
53
50
|
|
54
51
|
def options_card_name
|
55
|
-
|
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
|
56
63
|
end
|
57
64
|
|
58
65
|
format do
|
59
|
-
|
60
|
-
card.options_card_name
|
61
|
-
end
|
66
|
+
delegate :options_card, :options_card_name, to: :card
|
62
67
|
end
|
63
68
|
|
64
69
|
format :html do
|
@@ -58,18 +58,6 @@ format :json do
|
|
58
58
|
params[:max_depth] || 1
|
59
59
|
end
|
60
60
|
|
61
|
-
def items_for_export
|
62
|
-
card.item_cards
|
63
|
-
end
|
64
|
-
|
65
|
-
def essentials
|
66
|
-
return {} if depth > max_depth
|
67
|
-
|
68
|
-
card.item_cards.map do |item|
|
69
|
-
nest item, view: :essentials
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
61
|
view :links do
|
74
62
|
[]
|
75
63
|
end
|
data/set/abstract/01_pointer.rb
CHANGED
@@ -8,3 +8,32 @@ end
|
|
8
8
|
def count
|
9
9
|
item_strings.size
|
10
10
|
end
|
11
|
+
|
12
|
+
def standardize_content value
|
13
|
+
value = item_strings(content: value) unless value.is_a? Array
|
14
|
+
super value
|
15
|
+
end
|
16
|
+
|
17
|
+
def each_item_name_with_options _content=nil
|
18
|
+
item_names.each { |name| yield name, {} }
|
19
|
+
end
|
20
|
+
|
21
|
+
def swap_names old_name, new_name
|
22
|
+
item_strings.map do |string|
|
23
|
+
if string.match?(/^[:~]/)
|
24
|
+
string
|
25
|
+
else
|
26
|
+
string.to_name.swap old_name, new_name
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def chunk_class
|
34
|
+
Card::Content::Chunk::Link
|
35
|
+
end
|
36
|
+
|
37
|
+
def each_reference_out
|
38
|
+
item_names.each { |name| yield name, chunk_class::CODE }
|
39
|
+
end
|
data/set/abstract/id_pointer.rb
CHANGED
data/set/type/link_list.rb
CHANGED
data/set/type/list.rb
CHANGED
data/set/type/nest_list.rb
CHANGED
@@ -8,9 +8,8 @@ def item_options
|
|
8
8
|
nest_chunks.map(&:raw_options)
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
|
13
|
-
self.content = items.join("\n")
|
11
|
+
def items_content array
|
12
|
+
standardized_items(array).join "\n"
|
14
13
|
end
|
15
14
|
|
16
15
|
format do
|
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.
|
4
|
+
version: 0.14.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: 2021-
|
13
|
+
date: 2021-12-22 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.
|
21
|
+
version: 1.104.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.
|
28
|
+
version: 1.104.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.
|
35
|
+
version: 0.14.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.
|
42
|
+
version: 0.14.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.
|
49
|
+
version: 0.14.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.
|
56
|
+
version: 0.14.0
|
57
57
|
description: ''
|
58
58
|
email:
|
59
59
|
- info@decko.org
|
@@ -62,6 +62,7 @@ extensions: []
|
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
64
|
- db/migrate_core_cards/20160804112340_add_pointer_cards.rb
|
65
|
+
- db/migrate_core_cards/20211107155032_out_with_the_brackets.rb
|
65
66
|
- set/abstract/01_pointer.rb
|
66
67
|
- set/abstract/01_pointer/events.rb
|
67
68
|
- set/abstract/01_pointer/html_views.rb
|
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
115
|
- !ruby/object:Gem::Version
|
115
116
|
version: '0'
|
116
117
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.2.15
|
118
119
|
signing_key:
|
119
120
|
specification_version: 4
|
120
121
|
summary: list of cards
|