card 1.93.3 → 1.93.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/db/migrate/20170908114452_increase_text_size_for_delayed_jobs.rb +9 -0
  4. data/db/migrate_core_cards/data/cards/*header +2 -2
  5. data/lib/card/format/nest.rb +12 -5
  6. data/lib/card/format/nest/fetch.rb +1 -2
  7. data/lib/card/format/render.rb +2 -2
  8. data/lib/card/model/save_helper.rb +1 -1
  9. data/lib/card/set/format/haml_views.rb +7 -3
  10. data/lib/card/subcards.rb +27 -228
  11. data/lib/card/subcards/add.rb +121 -0
  12. data/lib/card/subcards/relate.rb +27 -0
  13. data/lib/card/subcards/remove.rb +42 -0
  14. data/lib/card/tasks/card/create.rake +35 -132
  15. data/lib/card/tasks/card/file_card_creator.rb +25 -0
  16. data/lib/card/tasks/card/file_card_creator/abstract_file_card.rb +44 -0
  17. data/lib/card/tasks/card/file_card_creator/abstract_file_card/migration_file.rb +49 -0
  18. data/lib/card/tasks/card/file_card_creator/abstract_file_card/ruby_file.rb +30 -0
  19. data/lib/card/tasks/card/file_card_creator/abstract_file_card/source_file.rb +36 -0
  20. data/lib/card/tasks/card/file_card_creator/haml_card.rb +42 -0
  21. data/lib/card/tasks/card/file_card_creator/output_helper.rb +50 -0
  22. data/lib/card/tasks/card/file_card_creator/script_card.rb +33 -0
  23. data/lib/card/tasks/card/file_card_creator/style_card.rb +25 -0
  24. data/lib/generators/card/template/template_generator.rb +1 -1
  25. data/mod/account/set/self/account_links.rb +1 -1
  26. data/mod/basic_formats/set/all/all_csv.rb +63 -0
  27. data/mod/basic_formats/set/all/json.rb +4 -1
  28. data/mod/bootstrap/db/migrate_cards/20170719163733_update_bootswatch_themes_to_4_beta.rb +5 -2
  29. data/mod/carrierwave/set/abstract/attachment.rb +1 -2
  30. data/mod/core/set/abstract/haml_file.rb +20 -0
  31. data/mod/core/set/all/chunk.rb +125 -0
  32. data/mod/core/set/all/collection.rb +2 -351
  33. data/mod/core/set/all/content.rb +26 -7
  34. data/mod/core/set/all/extended.rb +45 -0
  35. data/mod/core/set/all/haml.rb +3 -7
  36. data/mod/core/set/all/item.rb +92 -0
  37. data/mod/core/set/all/name.rb +36 -0
  38. data/mod/core/set/all/subcards.rb +21 -12
  39. data/mod/core/set/all/tabs.rb +50 -0
  40. data/mod/core/set/all/trash.rb +4 -0
  41. data/mod/core/spec/set/all/chunk_spec.rb +45 -0
  42. data/mod/core/spec/set/all/collection_spec.rb +6 -6
  43. data/mod/history/set/all/action_view.rb +1 -1
  44. data/mod/machines/lib/javascript/decko.js.coffee +3 -0
  45. data/mod/pointer/set/abstract/02_pointer/edit.rb +0 -2
  46. data/mod/search/set/abstract/search.rb +1 -1
  47. data/mod/search/set/all/filter.rb +0 -2
  48. data/mod/search/template/all/filter/_filter_input.haml +1 -1
  49. data/mod/search/template/all/filter/filter_form.haml +1 -1
  50. data/mod/standard/set/all/rich_html/editing.rb +1 -1
  51. data/mod/standard/set/all/rich_html/form.rb +6 -7
  52. data/mod/standard/set/all/rich_html/menu.rb +2 -3
  53. data/mod/standard/set/all/rich_html/toolbar.rb +3 -4
  54. data/mod/standard/set/type/cardtype.rb +1 -1
  55. data/mod/standard/spec/set/all/rich_html/editing_spec.rb +15 -4
  56. data/mod/tinymce_editor/db/migrate_cards/{20171113233150_update_tinymce_config.rb → 20171113233151_update_tinymce_config.rb} +1 -0
  57. metadata +25 -161
  58. data/.rspec +0 -4
  59. data/card.gemspec +0 -87
  60. data/db/seed/test/fixtures/.gitkeep +0 -0
  61. data/mod/bootstrap/vendor/bootstrap/.babelrc.js +0 -16
  62. data/mod/bootstrap/vendor/bootstrap/.editorconfig +0 -17
  63. data/mod/bootstrap/vendor/bootstrap/.eslintignore +0 -3
  64. data/mod/bootstrap/vendor/bootstrap/.gitattributes +0 -16
  65. data/mod/bootstrap/vendor/bootstrap/.github/CONTRIBUTING.md +0 -252
  66. data/mod/bootstrap/vendor/bootstrap/.github/ISSUE_TEMPLATE.md +0 -22
  67. data/mod/bootstrap/vendor/bootstrap/.gitignore +0 -46
  68. data/mod/bootstrap/vendor/bootstrap/.hound.yml +0 -19
  69. data/mod/bootstrap/vendor/bootstrap/.houndignore +0 -4
  70. data/mod/bootstrap/vendor/bootstrap/.travis.yml +0 -32
  71. data/mod/bootstrap/vendor/bootstrap/build/.htmllintrc +0 -19
  72. data/mod/bootstrap/vendor/bootstrap/build/.stylelintrc +0 -248
  73. data/mod/bootstrap/vendor/bootstrap/docs/4.0/examples/.stylelintrc +0 -12
  74. data/mod/bootstrap/vendor/bootstrap/js/.eslintrc.json +0 -240
  75. data/mod/bootstrap/vendor/bootstrap/js/tests/.eslintrc.json +0 -46
  76. data/mod/bootstrap/vendor/bootswatch/.gitignore +0 -7
  77. data/mod/bootstrap/vendor/bootswatch/.npmignore +0 -12
  78. data/mod/bootstrap/vendor/bootswatch/.travis.yml +0 -21
  79. data/mod/bootstrap/vendor/bootswatch/docs/.nojekyll +0 -0
  80. data/mod/bootstrap/vendor/bootswatch/docs/2/.travis.yml +0 -15
  81. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.bower.json +0 -20
  82. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.gitignore +0 -37
  83. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.travis.yml +0 -3
  84. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/js/.jshintrc +0 -12
  85. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/jquery/.bower.json +0 -20
  86. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/jquery/.gitignore +0 -1
  87. data/mod/bootstrap/vendor/bootswatch/docs/2/swatchmaker/.gitignore +0 -1
  88. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/.bower.json +0 -45
  89. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/.bower.json +0 -44
  90. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/grunt/.jshintrc +0 -7
  91. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/.jscsrc +0 -42
  92. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/.jshintrc +0 -15
  93. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/.csscomb.json +0 -304
  94. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/.csslintrc +0 -19
  95. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/font-awesome/.bower.json +0 -14
  96. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/font-awesome/.gitignore +0 -32
  97. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/html5shiv/.bower.json +0 -25
  98. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/.bower.json +0 -38
  99. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/respond/.bower.json +0 -20
  100. data/mod/bootstrap/vendor/select2/.editorconfig +0 -6
  101. data/mod/bootstrap/vendor/select2/.github/CONTRIBUTING.md +0 -204
  102. data/mod/bootstrap/vendor/select2/.github/ISSUE_TEMPLATE.md +0 -46
  103. data/mod/bootstrap/vendor/select2/.github/PULL_REQUEST_TEMPLATE.md +0 -13
  104. data/mod/bootstrap/vendor/select2/.gitignore +0 -3
  105. data/mod/bootstrap/vendor/select2/.jshintignore +0 -4
  106. data/mod/bootstrap/vendor/select2/.jshintrc +0 -25
  107. data/mod/bootstrap/vendor/select2/.travis.yml +0 -22
  108. data/script/fetch_bootswatch_themes.rb +0 -38
  109. data/spec/config/initializers/core_extensions_spec.rb +0 -47
  110. data/spec/config/initializers/patches/active_job_spec.rb +0 -7
  111. data/spec/lib/card/action_spec.rb +0 -15
  112. data/spec/lib/card/auth_spec.rb +0 -58
  113. data/spec/lib/card/cache_spec.rb +0 -116
  114. data/spec/lib/card/chunk_spec.rb +0 -18
  115. data/spec/lib/card/codename_spec.rb +0 -66
  116. data/spec/lib/card/content_spec.rb +0 -428
  117. data/spec/lib/card/diff_spec.rb +0 -208
  118. data/spec/lib/card/format/nest_spec.rb +0 -13
  119. data/spec/lib/card/format/render_spec.rb +0 -26
  120. data/spec/lib/card/format_spec.rb +0 -117
  121. data/spec/lib/card/i18n_spec.rb +0 -24
  122. data/spec/lib/card/loader/Modfile +0 -2
  123. data/spec/lib/card/loader_spec.rb +0 -98
  124. data/spec/lib/card/migration/import_spec.rb +0 -80
  125. data/spec/lib/card/mod/loader/mod_dirs.rb +0 -8
  126. data/spec/lib/card/mod/loader/set_loader_spec.rb +0 -19
  127. data/spec/lib/card/mod/loader/set_pattern_loader_spec.rb +0 -19
  128. data/spec/lib/card/name/fields_and_traits_spec.rb +0 -18
  129. data/spec/lib/card/name_spec.rb +0 -70
  130. data/spec/lib/card/query/sorting_spec.rb +0 -68
  131. data/spec/lib/card/query_spec.rb +0 -574
  132. data/spec/lib/card/reference_spec.rb +0 -212
  133. data/spec/lib/card/set/event_spec.rb +0 -22
  134. data/spec/lib/card/set/trait_spec.rb +0 -80
  135. data/spec/lib/card/set_pattern_spec.rb +0 -59
  136. data/spec/lib/card/set_spec.rb +0 -89
  137. data/spec/lib/card/stage_director_spec.rb +0 -482
  138. data/spec/lib/card/subcards_spec.rb +0 -177
  139. data/spec/lib/card/success_spec.rb +0 -148
  140. data/spec/lib/card/view_cache_spec.rb +0 -27
  141. data/spec/mailers/mailer_spec.rb +0 -62
  142. data/spec/models/card/create_spec.rb +0 -119
  143. data/spec/models/card/trash_spec.rb +0 -189
  144. data/spec/models/card_spec.rb +0 -136
  145. data/spec/spec_helper.rb +0 -45
  146. data/spec/support/card_spec_helper.rb +0 -74
  147. data/spec/support/card_spec_loader.rb +0 -112
  148. data/spec/support/helper/card_helper.rb +0 -58
  149. data/spec/support/helper/event_helper.rb +0 -94
  150. data/spec/support/helper/render_helper.rb +0 -44
  151. data/spec/support/helper/save_helper.rb +0 -30
  152. data/spec/support/helper/set_helper.rb +0 -80
  153. data/spec/support/matchers/card_matchers.rb +0 -160
  154. data/spec/support/matchers/expectations.rb +0 -5
  155. data/spec/support/matchers/file_matchers.rb +0 -71
  156. data/spec/support/matchers/html_matchers.rb +0 -29
  157. data/spec/support/matchers/negated_matchers.rb +0 -2
  158. data/spec/support/simplecov_helper.rb +0 -70
  159. data/spec/support/test_mods/mod1/set/all/test_set.rb +0 -3
  160. data/spec/support/test_mods/mod2/set_pattern/test_pattern.rb +0 -0
@@ -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 *args
43
+ process_haml_template(*args)
48
44
  else
49
- process_haml *args, &block
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 *args
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
@@ -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
- err = "#{field} #{err}" unless %i[content abort].member? field
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
- if subcard.new? && subcard.unfilled?
78
- remove_subcard(key)
79
- director.subdirectors.delete(subcard)
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
@@ -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
- 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
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
@@ -5,7 +5,7 @@ format :html do
5
5
  end
6
6
 
7
7
  view :action_expanded do |args|
8
- render_action_content args[:action], :expanded
8
+ action_content args[:action], :expanded
9
9
  end
10
10
 
11
11
  def default_action_summary_args args
@@ -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
 
@@ -105,8 +105,6 @@ format :html do
105
105
  raw %(<ul class="pointer-radio-list">#{options}</ul>)
106
106
  end
107
107
 
108
-
109
-
110
108
  view :select do |_args|
111
109
  select_input
112
110
  end
@@ -93,7 +93,7 @@ format :data do
93
93
  end
94
94
 
95
95
  format :csv do
96
- view :core, mod: All::Collection::CsvFormat
96
+ view :core, mod: All::AllCsv::CsvFormat
97
97
 
98
98
  view :card_list do
99
99
  items = super()
@@ -6,6 +6,4 @@ format :html do
6
6
  sort_input_field: sort_input_field,
7
7
  form_args: form_args
8
8
  end
9
-
10
9
  end
11
-
@@ -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-default.btn._delete-filter-input{:type => "button"}
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-default.dropdown-toggle{"aria-expanded" => "false",
28
+ %button.btn.btn-secondary.dropdown-toggle{"aria-expanded" => "false",
29
29
  "aria-haspopup" => "true",
30
30
  "data-toggle" => "dropdown",
31
31
  :type => "button"}
@@ -162,7 +162,7 @@ format :html do
162
162
  voo.show :toolbar
163
163
  frame do
164
164
  with_nest_mode :edit do
165
- process_nested_fields
165
+ multi_card_edit
166
166
  end
167
167
  end
168
168
  end
@@ -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 multi_card_edit_fields
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 # structure in card rule
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 multi_card_edit_fields
129
- nested_fields_for_edit.map do |name, options|
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