card 1.93.3 → 1.93.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/db/migrate/20170908114452_increase_text_size_for_delayed_jobs.rb +9 -0
- data/db/migrate_core_cards/data/cards/*header +2 -2
- data/lib/card/format/nest.rb +12 -5
- data/lib/card/format/nest/fetch.rb +1 -2
- data/lib/card/format/render.rb +2 -2
- data/lib/card/model/save_helper.rb +1 -1
- data/lib/card/set/format/haml_views.rb +7 -3
- data/lib/card/subcards.rb +27 -228
- data/lib/card/subcards/add.rb +121 -0
- data/lib/card/subcards/relate.rb +27 -0
- data/lib/card/subcards/remove.rb +42 -0
- data/lib/card/tasks/card/create.rake +35 -132
- data/lib/card/tasks/card/file_card_creator.rb +25 -0
- data/lib/card/tasks/card/file_card_creator/abstract_file_card.rb +44 -0
- data/lib/card/tasks/card/file_card_creator/abstract_file_card/migration_file.rb +49 -0
- data/lib/card/tasks/card/file_card_creator/abstract_file_card/ruby_file.rb +30 -0
- data/lib/card/tasks/card/file_card_creator/abstract_file_card/source_file.rb +36 -0
- data/lib/card/tasks/card/file_card_creator/haml_card.rb +42 -0
- data/lib/card/tasks/card/file_card_creator/output_helper.rb +50 -0
- data/lib/card/tasks/card/file_card_creator/script_card.rb +33 -0
- data/lib/card/tasks/card/file_card_creator/style_card.rb +25 -0
- data/lib/generators/card/template/template_generator.rb +1 -1
- data/mod/account/set/self/account_links.rb +1 -1
- data/mod/basic_formats/set/all/all_csv.rb +63 -0
- data/mod/basic_formats/set/all/json.rb +4 -1
- data/mod/bootstrap/db/migrate_cards/20170719163733_update_bootswatch_themes_to_4_beta.rb +5 -2
- data/mod/carrierwave/set/abstract/attachment.rb +1 -2
- data/mod/core/set/abstract/haml_file.rb +20 -0
- data/mod/core/set/all/chunk.rb +125 -0
- data/mod/core/set/all/collection.rb +2 -351
- data/mod/core/set/all/content.rb +26 -7
- data/mod/core/set/all/extended.rb +45 -0
- data/mod/core/set/all/haml.rb +3 -7
- data/mod/core/set/all/item.rb +92 -0
- data/mod/core/set/all/name.rb +36 -0
- data/mod/core/set/all/subcards.rb +21 -12
- data/mod/core/set/all/tabs.rb +50 -0
- data/mod/core/set/all/trash.rb +4 -0
- data/mod/core/spec/set/all/chunk_spec.rb +45 -0
- data/mod/core/spec/set/all/collection_spec.rb +6 -6
- data/mod/history/set/all/action_view.rb +1 -1
- data/mod/machines/lib/javascript/decko.js.coffee +3 -0
- data/mod/pointer/set/abstract/02_pointer/edit.rb +0 -2
- data/mod/search/set/abstract/search.rb +1 -1
- data/mod/search/set/all/filter.rb +0 -2
- data/mod/search/template/all/filter/_filter_input.haml +1 -1
- data/mod/search/template/all/filter/filter_form.haml +1 -1
- data/mod/standard/set/all/rich_html/editing.rb +1 -1
- data/mod/standard/set/all/rich_html/form.rb +6 -7
- data/mod/standard/set/all/rich_html/menu.rb +2 -3
- data/mod/standard/set/all/rich_html/toolbar.rb +3 -4
- data/mod/standard/set/type/cardtype.rb +1 -1
- data/mod/standard/spec/set/all/rich_html/editing_spec.rb +15 -4
- data/mod/tinymce_editor/db/migrate_cards/{20171113233150_update_tinymce_config.rb → 20171113233151_update_tinymce_config.rb} +1 -0
- metadata +25 -161
- data/.rspec +0 -4
- data/card.gemspec +0 -87
- data/db/seed/test/fixtures/.gitkeep +0 -0
- data/mod/bootstrap/vendor/bootstrap/.babelrc.js +0 -16
- data/mod/bootstrap/vendor/bootstrap/.editorconfig +0 -17
- data/mod/bootstrap/vendor/bootstrap/.eslintignore +0 -3
- data/mod/bootstrap/vendor/bootstrap/.gitattributes +0 -16
- data/mod/bootstrap/vendor/bootstrap/.github/CONTRIBUTING.md +0 -252
- data/mod/bootstrap/vendor/bootstrap/.github/ISSUE_TEMPLATE.md +0 -22
- data/mod/bootstrap/vendor/bootstrap/.gitignore +0 -46
- data/mod/bootstrap/vendor/bootstrap/.hound.yml +0 -19
- data/mod/bootstrap/vendor/bootstrap/.houndignore +0 -4
- data/mod/bootstrap/vendor/bootstrap/.travis.yml +0 -32
- data/mod/bootstrap/vendor/bootstrap/build/.htmllintrc +0 -19
- data/mod/bootstrap/vendor/bootstrap/build/.stylelintrc +0 -248
- data/mod/bootstrap/vendor/bootstrap/docs/4.0/examples/.stylelintrc +0 -12
- data/mod/bootstrap/vendor/bootstrap/js/.eslintrc.json +0 -240
- data/mod/bootstrap/vendor/bootstrap/js/tests/.eslintrc.json +0 -46
- data/mod/bootstrap/vendor/bootswatch/.gitignore +0 -7
- data/mod/bootstrap/vendor/bootswatch/.npmignore +0 -12
- data/mod/bootstrap/vendor/bootswatch/.travis.yml +0 -21
- data/mod/bootstrap/vendor/bootswatch/docs/.nojekyll +0 -0
- data/mod/bootstrap/vendor/bootswatch/docs/2/.travis.yml +0 -15
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.bower.json +0 -20
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.gitignore +0 -37
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.travis.yml +0 -3
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/js/.jshintrc +0 -12
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/jquery/.bower.json +0 -20
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/jquery/.gitignore +0 -1
- data/mod/bootstrap/vendor/bootswatch/docs/2/swatchmaker/.gitignore +0 -1
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/.bower.json +0 -45
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/.bower.json +0 -44
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/grunt/.jshintrc +0 -7
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/.jscsrc +0 -42
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/.jshintrc +0 -15
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/.csscomb.json +0 -304
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/.csslintrc +0 -19
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/font-awesome/.bower.json +0 -14
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/font-awesome/.gitignore +0 -32
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/html5shiv/.bower.json +0 -25
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/.bower.json +0 -38
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/respond/.bower.json +0 -20
- data/mod/bootstrap/vendor/select2/.editorconfig +0 -6
- data/mod/bootstrap/vendor/select2/.github/CONTRIBUTING.md +0 -204
- data/mod/bootstrap/vendor/select2/.github/ISSUE_TEMPLATE.md +0 -46
- data/mod/bootstrap/vendor/select2/.github/PULL_REQUEST_TEMPLATE.md +0 -13
- data/mod/bootstrap/vendor/select2/.gitignore +0 -3
- data/mod/bootstrap/vendor/select2/.jshintignore +0 -4
- data/mod/bootstrap/vendor/select2/.jshintrc +0 -25
- data/mod/bootstrap/vendor/select2/.travis.yml +0 -22
- data/script/fetch_bootswatch_themes.rb +0 -38
- data/spec/config/initializers/core_extensions_spec.rb +0 -47
- data/spec/config/initializers/patches/active_job_spec.rb +0 -7
- data/spec/lib/card/action_spec.rb +0 -15
- data/spec/lib/card/auth_spec.rb +0 -58
- data/spec/lib/card/cache_spec.rb +0 -116
- data/spec/lib/card/chunk_spec.rb +0 -18
- data/spec/lib/card/codename_spec.rb +0 -66
- data/spec/lib/card/content_spec.rb +0 -428
- data/spec/lib/card/diff_spec.rb +0 -208
- data/spec/lib/card/format/nest_spec.rb +0 -13
- data/spec/lib/card/format/render_spec.rb +0 -26
- data/spec/lib/card/format_spec.rb +0 -117
- data/spec/lib/card/i18n_spec.rb +0 -24
- data/spec/lib/card/loader/Modfile +0 -2
- data/spec/lib/card/loader_spec.rb +0 -98
- data/spec/lib/card/migration/import_spec.rb +0 -80
- data/spec/lib/card/mod/loader/mod_dirs.rb +0 -8
- data/spec/lib/card/mod/loader/set_loader_spec.rb +0 -19
- data/spec/lib/card/mod/loader/set_pattern_loader_spec.rb +0 -19
- data/spec/lib/card/name/fields_and_traits_spec.rb +0 -18
- data/spec/lib/card/name_spec.rb +0 -70
- data/spec/lib/card/query/sorting_spec.rb +0 -68
- data/spec/lib/card/query_spec.rb +0 -574
- data/spec/lib/card/reference_spec.rb +0 -212
- data/spec/lib/card/set/event_spec.rb +0 -22
- data/spec/lib/card/set/trait_spec.rb +0 -80
- data/spec/lib/card/set_pattern_spec.rb +0 -59
- data/spec/lib/card/set_spec.rb +0 -89
- data/spec/lib/card/stage_director_spec.rb +0 -482
- data/spec/lib/card/subcards_spec.rb +0 -177
- data/spec/lib/card/success_spec.rb +0 -148
- data/spec/lib/card/view_cache_spec.rb +0 -27
- data/spec/mailers/mailer_spec.rb +0 -62
- data/spec/models/card/create_spec.rb +0 -119
- data/spec/models/card/trash_spec.rb +0 -189
- data/spec/models/card_spec.rb +0 -136
- data/spec/spec_helper.rb +0 -45
- data/spec/support/card_spec_helper.rb +0 -74
- data/spec/support/card_spec_loader.rb +0 -112
- data/spec/support/helper/card_helper.rb +0 -58
- data/spec/support/helper/event_helper.rb +0 -94
- data/spec/support/helper/render_helper.rb +0 -44
- data/spec/support/helper/save_helper.rb +0 -30
- data/spec/support/helper/set_helper.rb +0 -80
- data/spec/support/matchers/card_matchers.rb +0 -160
- data/spec/support/matchers/expectations.rb +0 -5
- data/spec/support/matchers/file_matchers.rb +0 -71
- data/spec/support/matchers/html_matchers.rb +0 -29
- data/spec/support/matchers/negated_matchers.rb +0 -2
- data/spec/support/simplecov_helper.rb +0 -70
- data/spec/support/test_mods/mod1/set/all/test_set.rb +0 -3
- data/spec/support/test_mods/mod2/set_pattern/test_pattern.rb +0 -0
data/mod/core/set/all/haml.rb
CHANGED
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
#set_scope = "haml"
|
3
|
-
|
4
1
|
format do
|
5
|
-
|
6
2
|
include Card::Set::Format::HamlViews
|
7
3
|
|
8
4
|
define_method :the_scope do
|
@@ -44,9 +40,9 @@ format do
|
|
44
40
|
|
45
41
|
def haml *args, &block
|
46
42
|
if args.first.is_a? Symbol
|
47
|
-
process_haml_template
|
43
|
+
process_haml_template(*args)
|
48
44
|
else
|
49
|
-
process_haml
|
45
|
+
process_haml(*args, &block)
|
50
46
|
end
|
51
47
|
end
|
52
48
|
|
@@ -59,7 +55,7 @@ format do
|
|
59
55
|
|
60
56
|
def process_haml *args
|
61
57
|
args.unshift yield if block_given?
|
62
|
-
haml_to_html
|
58
|
+
haml_to_html(*args)
|
63
59
|
end
|
64
60
|
|
65
61
|
def process_haml_template template_name, locals={}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
def item_names _args={}
|
2
|
+
format._render_raw.split(/[,\n]/)
|
3
|
+
end
|
4
|
+
|
5
|
+
def item_cards _args={} # FIXME: this is inconsistent with item_names
|
6
|
+
[self]
|
7
|
+
end
|
8
|
+
|
9
|
+
def item_type
|
10
|
+
nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def item_keys args={}
|
14
|
+
item_names(args).map do |item|
|
15
|
+
item.to_name.key
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def include_item? item
|
20
|
+
key = item.is_a?(Card) ? item.name.key : item.to_name.key
|
21
|
+
item_names.map { |name| name.to_name.key }.member? key
|
22
|
+
end
|
23
|
+
|
24
|
+
def add_item item
|
25
|
+
return if include_item? item
|
26
|
+
self.content = "#{content}\n#{name}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def drop_item item
|
30
|
+
return unless include_item? item
|
31
|
+
new_names = item_names.reject { |i| i == item }
|
32
|
+
self.content = new_names.empty? ? "" : new_names.join("\n")
|
33
|
+
end
|
34
|
+
|
35
|
+
def insert_item index, name
|
36
|
+
new_names = item_names
|
37
|
+
new_names.delete name
|
38
|
+
new_names.insert index, name
|
39
|
+
self.content = new_names.join "\n"
|
40
|
+
end
|
41
|
+
|
42
|
+
def add_id id
|
43
|
+
add_item "~#{id}"
|
44
|
+
end
|
45
|
+
|
46
|
+
def drop_id id
|
47
|
+
drop_item "~#{id}"
|
48
|
+
end
|
49
|
+
|
50
|
+
def insert_id index, id
|
51
|
+
insert_item index, "~#{id}"
|
52
|
+
end
|
53
|
+
|
54
|
+
format do
|
55
|
+
def item_links _args={}
|
56
|
+
raw(render_core).split(/[,\n]/)
|
57
|
+
end
|
58
|
+
|
59
|
+
def nest_item cardish, options={}, &block
|
60
|
+
options = item_view_options options
|
61
|
+
options[:nest_name] = Card::Name[cardish].s
|
62
|
+
nest cardish, options, &block
|
63
|
+
end
|
64
|
+
|
65
|
+
def implicit_item_view
|
66
|
+
view = params[:item] || voo_items_view || default_item_view
|
67
|
+
Card::View.canonicalize view
|
68
|
+
end
|
69
|
+
|
70
|
+
def voo_items_view
|
71
|
+
return unless voo && (items = voo.items)
|
72
|
+
items[:view]
|
73
|
+
end
|
74
|
+
|
75
|
+
def default_item_view
|
76
|
+
:name
|
77
|
+
end
|
78
|
+
|
79
|
+
def item_view_options new_options={}
|
80
|
+
options = (voo.items || {}).clone
|
81
|
+
options = options.merge new_options
|
82
|
+
options[:view] ||= implicit_item_view
|
83
|
+
determine_item_view_options_type options
|
84
|
+
options
|
85
|
+
end
|
86
|
+
|
87
|
+
def determine_item_view_options_type options
|
88
|
+
return if options[:type]
|
89
|
+
type_from_rule = card.item_type
|
90
|
+
options[:type] = type_from_rule if type_from_rule
|
91
|
+
end
|
92
|
+
end
|
data/mod/core/set/all/name.rb
CHANGED
@@ -200,6 +200,42 @@ rescue
|
|
200
200
|
self
|
201
201
|
end
|
202
202
|
|
203
|
+
|
204
|
+
def right_id= card_or_id
|
205
|
+
write_card_or_id :right_id, card_or_id
|
206
|
+
end
|
207
|
+
|
208
|
+
def left_id= card_or_id
|
209
|
+
write_card_or_id :left_id, card_or_id
|
210
|
+
end
|
211
|
+
|
212
|
+
def type_id= card_or_id
|
213
|
+
write_card_or_id :type_id, card_or_id
|
214
|
+
end
|
215
|
+
|
216
|
+
def write_card_or_id attribute, card_or_id
|
217
|
+
if card_or_id.is_a? Card
|
218
|
+
write_attribute_to_card attribute, card_or_id
|
219
|
+
else
|
220
|
+
write_attribute attribute, card_or_id
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
def write_attribute_to_card attribute, card
|
225
|
+
if card.id
|
226
|
+
write_attribute attribute, card.id
|
227
|
+
else
|
228
|
+
add_subcard card
|
229
|
+
card.director.prior_store = true
|
230
|
+
with_id_when_exists(card) do |id|
|
231
|
+
write_attribute attribute, id
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
def with_id_when_exists card, &block
|
237
|
+
card.director.call_after_store(&block)
|
238
|
+
end
|
203
239
|
event :set_autoname, :prepare_to_validate, on: :create do
|
204
240
|
if name.blank? && (autoname_card = rule_card(:autoname))
|
205
241
|
self.name = autoname autoname_card.db_content
|
@@ -10,6 +10,18 @@ def subfield field_name
|
|
10
10
|
subcards.field field_name
|
11
11
|
end
|
12
12
|
|
13
|
+
def subcards
|
14
|
+
@subcards ||= Card::Subcards.new self
|
15
|
+
end
|
16
|
+
|
17
|
+
def subcards?
|
18
|
+
subcards.present?
|
19
|
+
end
|
20
|
+
|
21
|
+
def expire_subcards
|
22
|
+
subcards.clear
|
23
|
+
end
|
24
|
+
|
13
25
|
# phase_method :attach_subcard, before: :store do |name_or_card, args=nil|
|
14
26
|
# TODO: handle differently in different stages
|
15
27
|
def attach_subcard name_or_card, args={}
|
@@ -57,26 +69,23 @@ def deep_clear_subcards
|
|
57
69
|
subcards.deep_clear
|
58
70
|
end
|
59
71
|
|
60
|
-
def unfilled?
|
61
|
-
(content.empty? || content.strip.empty?) &&
|
62
|
-
(comment.blank? || comment.strip.blank?) &&
|
63
|
-
!subcards.present?
|
64
|
-
end
|
65
|
-
|
66
72
|
event :handle_subcard_errors do
|
67
73
|
subcards.each do |subcard|
|
68
74
|
subcard.errors.each do |field, err|
|
69
|
-
|
70
|
-
errors.add subcard.name.from(name), err
|
75
|
+
subcard_error subcard, field, err
|
71
76
|
end
|
72
77
|
end
|
73
78
|
end
|
74
79
|
|
80
|
+
def subcard_error subcard, field, err
|
81
|
+
err = "#{field} #{err}" unless %i[content abort].member? field
|
82
|
+
errors.add subcard.name.from(name), err
|
83
|
+
end
|
84
|
+
|
75
85
|
event :reject_empty_subcards, :prepare_to_validate do
|
76
86
|
subcards.each_with_key do |subcard, key|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
end
|
87
|
+
next unless subcard.new? && subcard.unfilled?
|
88
|
+
remove_subcard(key)
|
89
|
+
director.subdirectors.delete(subcard)
|
81
90
|
end
|
82
91
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
format :html do
|
2
|
+
view :tabs do
|
3
|
+
construct_tabs "tabs"
|
4
|
+
end
|
5
|
+
|
6
|
+
def construct_tabs tab_type
|
7
|
+
tabs = { active: {}, paths: {} }
|
8
|
+
voo.items[:view] ||= :content
|
9
|
+
card.each_item_name_with_options(_render_raw) do |name, options|
|
10
|
+
construct_tab tabs, name, options
|
11
|
+
end
|
12
|
+
lazy_loading_tabs tabs[:paths], tabs[:active][:name],
|
13
|
+
tabs[:active][:content], type: tab_type
|
14
|
+
end
|
15
|
+
|
16
|
+
def construct_tab tabs, name, explicit_options
|
17
|
+
tab_options = item_view_options explicit_options
|
18
|
+
tabs[:paths][name] = {
|
19
|
+
title: nest(name, view: :title, title: tab_options[:title]),
|
20
|
+
path: nest_path(name, tab_options).html_safe
|
21
|
+
}
|
22
|
+
return unless tabs[:active].empty?
|
23
|
+
tabs[:active] = { name: name, content: nest(name, tab_options) }
|
24
|
+
end
|
25
|
+
|
26
|
+
# def tab_title title, name
|
27
|
+
# return name unless title
|
28
|
+
# name.to_name.title title, @context_names
|
29
|
+
# end
|
30
|
+
|
31
|
+
view :pills do
|
32
|
+
construct_tabs "pills"
|
33
|
+
end
|
34
|
+
|
35
|
+
view :tabs_static do
|
36
|
+
construct_static_tabs "tabs"
|
37
|
+
end
|
38
|
+
|
39
|
+
view :pills_static do
|
40
|
+
construct_static_tabs "pills"
|
41
|
+
end
|
42
|
+
|
43
|
+
def construct_static_tabs tab_type
|
44
|
+
tabs = {}
|
45
|
+
card.item_cards.each do |item|
|
46
|
+
tabs[item.name] = nest item, item_view_options(args)
|
47
|
+
end
|
48
|
+
static_tabs tabs, tab_type
|
49
|
+
end
|
50
|
+
end
|
data/mod/core/set/all/trash.rb
CHANGED
@@ -99,6 +99,10 @@ end
|
|
99
99
|
event :validate_delete_children, after: :validate_delete, on: :delete do
|
100
100
|
return if errors.any?
|
101
101
|
children.each do |child|
|
102
|
+
next unless child
|
103
|
+
# prevents errors in cases where a child is deleted prior to this point
|
104
|
+
# and thus is not returned by the fetch in #children
|
105
|
+
|
102
106
|
child.trash = true
|
103
107
|
add_subcard child
|
104
108
|
# next if child.valid?
|
@@ -0,0 +1,45 @@
|
|
1
|
+
RSpec.describe Card::Set::All::Chunk do
|
2
|
+
describe "#edit_fields" do
|
3
|
+
def format_with_edit_fields args
|
4
|
+
Card["A"].format_with(:html) do
|
5
|
+
define_method :edit_fields do
|
6
|
+
args
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it "interprets strings as field names" do
|
12
|
+
format = format_with_edit_fields ["B", "+C"]
|
13
|
+
expect(format.render_edit).to have_tag ".card-slot" do
|
14
|
+
with_tag ".card-editor.RIGHT-b", with: { card_name: "A+B" }
|
15
|
+
with_tag ".card-editor.RIGHT-c", with: { card_name: "A+C" }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
it "doesn't make card objects to fields" do
|
20
|
+
format = format_with_edit_fields [Card["B"]]
|
21
|
+
expect(format.render_edit).to have_tag ".card-editor", with: { card_name: "B" }
|
22
|
+
end
|
23
|
+
|
24
|
+
it "treats symbols as codenames", as_bot: true do
|
25
|
+
format = format_with_edit_fields [:write, :basic]
|
26
|
+
expect(format.render_edit).to have_tag ".card-slot" do
|
27
|
+
with_tag ".card-editor.RIGHT-Xwrite", with: { card_name: "A+*write" }
|
28
|
+
with_tag ".card-editor.RIGHT-basic", with: { card_name: "A+Basic" }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
example "absolute option", as_bot: true do
|
33
|
+
format = format_with_edit_fields [[:self, { absolute: true }]]
|
34
|
+
expect(format.render_edit).to have_tag ".card-editor", with: { card_name: "*self" }
|
35
|
+
end
|
36
|
+
|
37
|
+
example "title argument" do
|
38
|
+
format = format_with_edit_fields [["B", "custom title"]]
|
39
|
+
expect(format.render_edit)
|
40
|
+
.to have_tag ".card-editor.RIGHT-b", with: { card_name: "A+B" } do
|
41
|
+
with_tag ".card-title", text: "custom title"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -26,12 +26,12 @@ describe Card::Set::All::Collection do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
describe "#extended_list" do
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
29
|
+
# describe "#extended_list" do
|
30
|
+
# it "returns item's content for pointer setting" do
|
31
|
+
# c = Card.new(name: "foo", type: "Pointer", content: "[[Z]]")
|
32
|
+
# expect(c.extended_list).to eq(["I'm here to be referenced to"])
|
33
|
+
# end
|
34
|
+
# end
|
35
35
|
|
36
36
|
describe "#extended_item_cards" do
|
37
37
|
it "returns the 'leaf cards' of a tree of pointer cards" do
|
@@ -194,6 +194,9 @@ $(window).ready ->
|
|
194
194
|
return false if !$.rails.allowAction $(this)
|
195
195
|
$.rails.handleRemote $(this)
|
196
196
|
|
197
|
+
$('body').on 'click', '._clickable.slotter', (event)->
|
198
|
+
$.rails.handleRemote $(this)
|
199
|
+
|
197
200
|
$('body').on 'ajax:beforeSend', '.slotter', (event, xhr, opt)->
|
198
201
|
return if opt.skip_before_send
|
199
202
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.input-group.mb-2.card-outline-primary.mr-2._filter-input{"data-category" => key}
|
2
2
|
%span.input-group-btn
|
3
|
-
%button.btn.btn-
|
3
|
+
%button.btn.btn-secondary.btn._delete-filter-input{:type => "button"}
|
4
4
|
%strong
|
5
5
|
%i.material-icons close
|
6
6
|
%span.input-group-addon._selected-category
|
@@ -25,7 +25,7 @@
|
|
25
25
|
= haml_partial :filter_input, key: key, category: category
|
26
26
|
|
27
27
|
.dropdown._add-filter-dropdown
|
28
|
-
%button.btn.btn-
|
28
|
+
%button.btn.btn-secondary.dropdown-toggle{"aria-expanded" => "false",
|
29
29
|
"aria-haspopup" => "true",
|
30
30
|
"data-toggle" => "dropdown",
|
31
31
|
:type => "button"}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
format :html do
|
4
2
|
# FIELDSET VIEWS
|
5
3
|
view :content_formgroup, cache: :never do
|
@@ -81,7 +79,7 @@ format :html do
|
|
81
79
|
def edit_slot
|
82
80
|
case
|
83
81
|
when inline_nests_editor? then _render_core
|
84
|
-
when multi_card_editor? then
|
82
|
+
when multi_card_editor? then multi_card_edit(true)
|
85
83
|
when in_multi_card_editor? then editor_in_multi_card
|
86
84
|
else single_card_edit_field
|
87
85
|
end
|
@@ -96,7 +94,8 @@ format :html do
|
|
96
94
|
def multi_card_editor?
|
97
95
|
nests_editor? || # editor configured in voo
|
98
96
|
voo.structure || voo.edit_structure || # structure configured in voo
|
99
|
-
card.structure
|
97
|
+
card.structure || # structure in card rule
|
98
|
+
edit_fields.present? # list of fields in card rule
|
100
99
|
end
|
101
100
|
|
102
101
|
# test: are we already within a multi-card form?
|
@@ -125,8 +124,9 @@ format :html do
|
|
125
124
|
end
|
126
125
|
end
|
127
126
|
|
128
|
-
def
|
129
|
-
|
127
|
+
def multi_card_edit fields_only=false
|
128
|
+
nested_cards_for_edit(fields_only).map do |name, options|
|
129
|
+
options ||= {}
|
130
130
|
options[:hide] = [options[:hide], :toolbar].compact
|
131
131
|
nest name, options
|
132
132
|
end.join "\n"
|
@@ -236,7 +236,6 @@ format :html do
|
|
236
236
|
end
|
237
237
|
end
|
238
238
|
|
239
|
-
|
240
239
|
# FIELD VIEWS
|
241
240
|
|
242
241
|
def add_junction_class
|