card 1.96.5 → 1.96.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/db/migrate_core_cards/{20150510031118_fix_skin_images.rb → 20150510031118_fix_skin_codenames.rb} +1 -1
  4. data/db/migrate_core_cards/{20170720093738_update_layout.rb → 20181120200937_update_layout.rb} +0 -0
  5. data/db/migrate_core_cards/data/cards/Xheader +17 -16
  6. data/db/seed/new/card_actions.yml +1162 -1162
  7. data/db/seed/new/card_acts.yml +2 -2
  8. data/db/seed/new/card_references.yml +155 -148
  9. data/db/seed/new/cards.yml +1613 -1613
  10. data/db/seed/new/schema_migrations_core_cards.yml +4 -0
  11. data/db/seed/test/fixtures/card_actions.yml +2152 -2152
  12. data/db/seed/test/fixtures/card_acts.yml +447 -447
  13. data/db/seed/test/fixtures/card_changes.yml +66 -66
  14. data/db/seed/test/fixtures/card_references.yml +985 -978
  15. data/db/seed/test/fixtures/cards.yml +2617 -2617
  16. data/db/seed/test/fixtures/schema_migrations_core_cards.yml +4 -0
  17. data/db/version_core_cards.txt +1 -1
  18. data/lib/card/format.rb +1 -1
  19. data/lib/card/format/permission.rb +1 -1
  20. data/lib/card/set/event/callbacks.rb +11 -3
  21. data/mod/bootstrap/db/migrate_core_cards/20181129140917_fix_skin_images.rb +12 -0
  22. data/{db/migrate_core_cards → mod/bootstrap/db/migrate_core_cards/data}/20181108181219_migrate_classic_skins_to_bootstrap.rb +9 -1
  23. data/mod/bootstrap/db/migrate_core_cards/lib/skin.rb +1 -1
  24. data/mod/bootstrap/file/cerulean_skin_image/image-icon.png +0 -0
  25. data/mod/bootstrap/file/cerulean_skin_image/image-large.png +0 -0
  26. data/mod/bootstrap/file/cerulean_skin_image/image-medium.png +0 -0
  27. data/mod/bootstrap/file/cerulean_skin_image/image-original.png +0 -0
  28. data/mod/bootstrap/file/cerulean_skin_image/image-small.png +0 -0
  29. data/mod/bootstrap/file/cosmo_skin_image/image-icon.png +0 -0
  30. data/mod/bootstrap/file/cosmo_skin_image/image-large.png +0 -0
  31. data/mod/bootstrap/file/cosmo_skin_image/image-medium.png +0 -0
  32. data/mod/bootstrap/file/cosmo_skin_image/image-original.png +0 -0
  33. data/mod/bootstrap/file/cosmo_skin_image/image-small.png +0 -0
  34. data/mod/bootstrap/file/cyborg_skin_image/image-icon.png +0 -0
  35. data/mod/bootstrap/file/cyborg_skin_image/image-large.png +0 -0
  36. data/mod/bootstrap/file/cyborg_skin_image/image-medium.png +0 -0
  37. data/mod/bootstrap/file/cyborg_skin_image/image-original.png +0 -0
  38. data/mod/bootstrap/file/cyborg_skin_image/image-small.png +0 -0
  39. data/mod/bootstrap/file/darkly_skin_image/image-icon.png +0 -0
  40. data/mod/bootstrap/file/darkly_skin_image/image-large.png +0 -0
  41. data/mod/bootstrap/file/darkly_skin_image/image-medium.png +0 -0
  42. data/mod/bootstrap/file/darkly_skin_image/image-original.png +0 -0
  43. data/mod/bootstrap/file/darkly_skin_image/image-small.png +0 -0
  44. data/mod/bootstrap/file/flatly_skin_image/image-icon.png +0 -0
  45. data/mod/bootstrap/file/flatly_skin_image/image-large.png +0 -0
  46. data/mod/bootstrap/file/flatly_skin_image/image-medium.png +0 -0
  47. data/mod/bootstrap/file/flatly_skin_image/image-original.png +0 -0
  48. data/mod/bootstrap/file/flatly_skin_image/image-small.png +0 -0
  49. data/mod/bootstrap/file/journal_skin_image/image-icon.png +0 -0
  50. data/mod/bootstrap/file/journal_skin_image/image-large.png +0 -0
  51. data/mod/bootstrap/file/journal_skin_image/image-medium.png +0 -0
  52. data/mod/bootstrap/file/journal_skin_image/image-original.png +0 -0
  53. data/mod/bootstrap/file/journal_skin_image/image-small.png +0 -0
  54. data/mod/bootstrap/file/litera_skin_image/image-icon.png +0 -0
  55. data/mod/bootstrap/file/litera_skin_image/image-large.png +0 -0
  56. data/mod/bootstrap/file/litera_skin_image/image-medium.png +0 -0
  57. data/mod/bootstrap/file/litera_skin_image/image-original.png +0 -0
  58. data/mod/bootstrap/file/litera_skin_image/image-small.png +0 -0
  59. data/mod/bootstrap/file/lumen_skin_image/image-icon.png +0 -0
  60. data/mod/bootstrap/file/lumen_skin_image/image-large.png +0 -0
  61. data/mod/bootstrap/file/lumen_skin_image/image-medium.png +0 -0
  62. data/mod/bootstrap/file/lumen_skin_image/image-original.png +0 -0
  63. data/mod/bootstrap/file/lumen_skin_image/image-small.png +0 -0
  64. data/mod/bootstrap/file/lux_skin_image/image-icon.png +0 -0
  65. data/mod/bootstrap/file/lux_skin_image/image-large.png +0 -0
  66. data/mod/bootstrap/file/lux_skin_image/image-medium.png +0 -0
  67. data/mod/bootstrap/file/lux_skin_image/image-original.png +0 -0
  68. data/mod/bootstrap/file/lux_skin_image/image-small.png +0 -0
  69. data/mod/bootstrap/file/materia_skin_image/image-icon.png +0 -0
  70. data/mod/bootstrap/file/materia_skin_image/image-large.png +0 -0
  71. data/mod/bootstrap/file/materia_skin_image/image-medium.png +0 -0
  72. data/mod/bootstrap/file/materia_skin_image/image-original.png +0 -0
  73. data/mod/bootstrap/file/materia_skin_image/image-small.png +0 -0
  74. data/mod/bootstrap/file/minty_skin_image/image-icon.png +0 -0
  75. data/mod/bootstrap/file/minty_skin_image/image-large.png +0 -0
  76. data/mod/bootstrap/file/minty_skin_image/image-medium.png +0 -0
  77. data/mod/bootstrap/file/minty_skin_image/image-original.png +0 -0
  78. data/mod/bootstrap/file/minty_skin_image/image-small.png +0 -0
  79. data/mod/bootstrap/file/paper_skin_image/image-large.png +0 -0
  80. data/mod/bootstrap/file/paper_skin_image/image-medium.png +0 -0
  81. data/mod/bootstrap/file/paper_skin_image/image-small.png +0 -0
  82. data/mod/bootstrap/file/pulse_skin_image/image-icon.png +0 -0
  83. data/mod/bootstrap/file/pulse_skin_image/image-large.png +0 -0
  84. data/mod/bootstrap/file/pulse_skin_image/image-medium.png +0 -0
  85. data/mod/bootstrap/file/pulse_skin_image/image-original.png +0 -0
  86. data/mod/bootstrap/file/pulse_skin_image/image-small.png +0 -0
  87. data/mod/bootstrap/file/readable_skin_image/image-large.png +0 -0
  88. data/mod/bootstrap/file/readable_skin_image/image-medium.png +0 -0
  89. data/mod/bootstrap/file/readable_skin_image/image-small.png +0 -0
  90. data/mod/bootstrap/file/sandstone_skin_image/image-icon.png +0 -0
  91. data/mod/bootstrap/file/sandstone_skin_image/image-large.png +0 -0
  92. data/mod/bootstrap/file/sandstone_skin_image/image-medium.png +0 -0
  93. data/mod/bootstrap/file/sandstone_skin_image/image-original.png +0 -0
  94. data/mod/bootstrap/file/sandstone_skin_image/image-small.png +0 -0
  95. data/mod/bootstrap/file/simplex_skin_image/image-icon.png +0 -0
  96. data/mod/bootstrap/file/simplex_skin_image/image-large.png +0 -0
  97. data/mod/bootstrap/file/simplex_skin_image/image-medium.png +0 -0
  98. data/mod/bootstrap/file/simplex_skin_image/image-original.png +0 -0
  99. data/mod/bootstrap/file/simplex_skin_image/image-small.png +0 -0
  100. data/mod/bootstrap/file/sketchy_skin_image/image-icon.png +0 -0
  101. data/mod/bootstrap/file/sketchy_skin_image/image-large.png +0 -0
  102. data/mod/bootstrap/file/sketchy_skin_image/image-medium.png +0 -0
  103. data/mod/bootstrap/file/sketchy_skin_image/image-original.png +0 -0
  104. data/mod/bootstrap/file/sketchy_skin_image/image-small.png +0 -0
  105. data/mod/bootstrap/file/slate_skin_image/image-icon.png +0 -0
  106. data/mod/bootstrap/file/slate_skin_image/image-large.png +0 -0
  107. data/mod/bootstrap/file/slate_skin_image/image-medium.png +0 -0
  108. data/mod/bootstrap/file/slate_skin_image/image-original.png +0 -0
  109. data/mod/bootstrap/file/slate_skin_image/image-small.png +0 -0
  110. data/mod/bootstrap/file/solar_skin_image/image-icon.png +0 -0
  111. data/mod/bootstrap/file/solar_skin_image/image-large.png +0 -0
  112. data/mod/bootstrap/file/solar_skin_image/image-medium.png +0 -0
  113. data/mod/bootstrap/file/solar_skin_image/image-original.png +0 -0
  114. data/mod/bootstrap/file/solar_skin_image/image-small.png +0 -0
  115. data/mod/bootstrap/file/spacelab_skin_image/image-icon.png +0 -0
  116. data/mod/bootstrap/file/spacelab_skin_image/image-large.png +0 -0
  117. data/mod/bootstrap/file/spacelab_skin_image/image-medium.png +0 -0
  118. data/mod/bootstrap/file/spacelab_skin_image/image-original.png +0 -0
  119. data/mod/bootstrap/file/spacelab_skin_image/image-small.png +0 -0
  120. data/mod/bootstrap/file/superhero_skin_image/image-icon.png +0 -0
  121. data/mod/bootstrap/file/superhero_skin_image/image-large.png +0 -0
  122. data/mod/bootstrap/file/superhero_skin_image/image-medium.png +0 -0
  123. data/mod/bootstrap/file/superhero_skin_image/image-original.png +0 -0
  124. data/mod/bootstrap/file/superhero_skin_image/image-small.png +0 -0
  125. data/mod/bootstrap/file/united_skin_image/image-icon.png +0 -0
  126. data/mod/bootstrap/file/united_skin_image/image-large.png +0 -0
  127. data/mod/bootstrap/file/united_skin_image/image-medium.png +0 -0
  128. data/mod/bootstrap/file/united_skin_image/image-original.png +0 -0
  129. data/mod/bootstrap/file/united_skin_image/image-small.png +0 -0
  130. data/mod/bootstrap/file/yeti_skin_image/image-icon.png +0 -0
  131. data/mod/bootstrap/file/yeti_skin_image/image-large.png +0 -0
  132. data/mod/bootstrap/file/yeti_skin_image/image-medium.png +0 -0
  133. data/mod/bootstrap/file/yeti_skin_image/image-original.png +0 -0
  134. data/mod/bootstrap/file/yeti_skin_image/image-small.png +0 -0
  135. data/mod/carrierwave/lib/carrier_wave/cardmount.rb +8 -1
  136. data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +7 -2
  137. data/mod/carrierwave/spec/set/type/file_spec.rb +1 -0
  138. data/mod/core/spec/format/html_format_spec.rb +1 -1
  139. data/mod/history/lib/card/act/act_renderer.rb +3 -3
  140. data/mod/history/lib/card/action.rb +18 -3
  141. data/mod/machines/public/assets/jquery-ui-smoothness/ui-icons_222222_256x240.png +0 -0
  142. data/mod/machines/public/assets/jquery-ui-smoothness/ui-icons_2e83ff_256x240.png +0 -0
  143. data/mod/machines/public/assets/jquery-ui-smoothness/ui-icons_454545_256x240.png +0 -0
  144. data/mod/machines/public/assets/jquery-ui-smoothness/ui-icons_888888_256x240.png +0 -0
  145. data/mod/machines/public/assets/jquery-ui-smoothness/ui-icons_cd0a0a_256x240.png +0 -0
  146. data/mod/standard/file/credit_image/image-icon.png +0 -0
  147. data/mod/standard/file/credit_image/image-large.png +0 -0
  148. data/mod/standard/file/credit_image/image-medium.png +0 -0
  149. data/mod/standard/file/credit_image/image-original.png +0 -0
  150. data/mod/standard/file/credit_image/image-small.png +0 -0
  151. data/mod/standard/file/favicon/image-icon.png +0 -0
  152. data/mod/standard/file/favicon/image-small.png +0 -0
  153. data/mod/standard/file/logo/image-icon.png +0 -0
  154. data/mod/standard/file/logo/image-large.png +0 -0
  155. data/mod/standard/file/logo/image-medium.png +0 -0
  156. data/mod/standard/file/logo/image-original.png +0 -0
  157. data/mod/standard/file/logo/image-small.png +0 -0
  158. data/mod/standard/set/all/rich_html/error.rb +1 -1
  159. data/mod/standard/set/all/rich_html/frame.rb +1 -1
  160. data/mod/standard/set/all/rich_html/new.rb +6 -1
  161. data/mod/tinymce_editor/public/assets/tinymce/skins/lightgray/skin.min.css.map +0 -0
  162. metadata +9 -7
@@ -183,3 +183,7 @@ schema_migrations_core_cards_091:
183
183
  version: '20180601133753'
184
184
  schema_migrations_core_cards_092:
185
185
  version: '20181108181219'
186
+ schema_migrations_core_cards_093:
187
+ version: '20181120200937'
188
+ schema_migrations_core_cards_094:
189
+ version: '20181129140917'
@@ -1 +1 @@
1
- 20181108181219
1
+ 20181129140917
@@ -126,7 +126,7 @@ class Card
126
126
  end
127
127
 
128
128
  def mime_type
129
- "text/text"
129
+ "text/plain"
130
130
  end
131
131
 
132
132
  def to_sym
@@ -24,7 +24,7 @@ class Card
24
24
 
25
25
  def unknown_disqualifies_view? view
26
26
  # view can't handle unknown cards (and card is unknown)
27
- return if tagged view, :unknown_ok
27
+ return false if tagged view, :unknown_ok
28
28
  card.unknown?
29
29
  end
30
30
 
@@ -10,11 +10,19 @@ class Card
10
10
  end
11
11
 
12
12
  def set_event_callback object_method, kind
13
- Card.class_exec(self) do |event|
14
- set_callback object_method, kind, event.name,
15
- prepend: true, if: proc { |c| c.event_applies?(event) }
13
+ valid_event_callback kind, object_method do
14
+ Card.class_exec(self) do |event|
15
+ set_callback object_method, kind, event.name,
16
+ prepend: true, if: proc { |c| c.event_applies?(event) }
17
+ end
16
18
  end
17
19
  end
20
+
21
+ def valid_event_callback kind, method
22
+ yield
23
+ rescue NoMethodError
24
+ raise "invalid event callback: `#{kind}: #{method}`"
25
+ end
18
26
  end
19
27
  end
20
28
  end
@@ -0,0 +1,12 @@
1
+
2
+ require_relative "lib/skin"
3
+
4
+ class FixSkinImages < ActiveRecord::Migration[5.2]
5
+ def change
6
+ Card::Auth.as_bot do
7
+ Skin.themes.each do |theme_name|
8
+ Skin.new(theme_name).update_thumbnail
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
+ # fix sites still using no-longer supported skins and layouts
1
2
  class MigrateClassicSkinsToBootstrap < ActiveRecord::Migration[5.2]
2
-
3
3
  UNSUPPORTED_SKINS = %w[
4
4
  classic_skin
5
5
  customized_classic_skin
@@ -10,10 +10,18 @@ class MigrateClassicSkinsToBootstrap < ActiveRecord::Migration[5.2]
10
10
 
11
11
  DEFAULT_SKIN = "yeti skin".freeze
12
12
 
13
+ UNSUPPORTED_LAYOUT = "classic_layout".freeze
14
+
15
+ DEFAULT_LAYOUT = "Default Layout".freeze
16
+
13
17
  def change
14
18
  style_rule = Card[:all, :style]
15
19
  if style_rule.item_names.first.key.in? UNSUPPORTED_SKINS
16
20
  style_rule.update_attributes! content: DEFAULT_SKIN
17
21
  end
22
+
23
+ layout_rule = Card[:all, :layout]
24
+ return unless layout_rule.item_names.first.key == UNSUPPORTED_LAYOUT
25
+ layout_rule.update_attributes! content: DEFAULT_LAYOUT
18
26
  end
19
27
  end
@@ -60,7 +60,7 @@ class Skin
60
60
  end
61
61
 
62
62
  def update_thumbnail
63
- update_card "#{@skin_name}+Image", thumbnail_args
63
+ ensure_card "#{@skin_name}+Image", thumbnail_args
64
64
  end
65
65
 
66
66
  private
@@ -17,7 +17,8 @@ module CarrierWave
17
17
  super
18
18
 
19
19
  class_eval <<-RUBY, __FILE__, __LINE__ + 1
20
- event :store_#{column}_event, :finalize, on: :save do
20
+ event :store_#{column}_event, :finalize,
21
+ on: :save, when: :store_#{column}_event? do
21
22
  store_#{column}!
22
23
  end
23
24
 
@@ -39,6 +40,11 @@ module CarrierWave
39
40
  remove_previously_stored_#{column}
40
41
  end
41
42
 
43
+ # don't attempt to store coded images unless ENV specifies it
44
+ def store_#{column}_event?
45
+ !coded? || ENV["STORE_CODED_FILES"]
46
+ end
47
+
42
48
  def attachment
43
49
  #{column}
44
50
  end
@@ -68,6 +74,7 @@ module CarrierWave
68
74
  assign_file(url) { super }
69
75
  end
70
76
 
77
+
71
78
  def assign_file file
72
79
  db_column = _mounter(:#{column}).serialization_column
73
80
  send(:"\#{db_column}_will_change!") # unless attribute_is_changing? db_column
@@ -205,6 +205,7 @@ module CarrierWave
205
205
  end
206
206
  end
207
207
 
208
+ # @option opts [Symbol] :absolute - return absolute url
208
209
  def url opts={}
209
210
  if model.cloud?
210
211
  file&.url
@@ -216,8 +217,12 @@ module CarrierWave
216
217
  end
217
218
 
218
219
  def local_url opts={}
219
- "%s/%s/%s" % [card_path(Card.config.files_web_path), file_dir,
220
- full_filename(url_filename(opts))]
220
+ "%s/%s/%s" % [local_url_base(opts), file_dir, full_filename(url_filename(opts))]
221
+ end
222
+
223
+ def local_url_base opts={}
224
+ web_path = Card.config.files_web_path
225
+ opts.delete(:absolute) ? card_url(web_path) : card_path(web_path)
221
226
  end
222
227
 
223
228
  def public_path
@@ -2,6 +2,7 @@
2
2
 
3
3
  RSpec.describe Card::Set::Type::File do
4
4
  DIRECTORY = "deckodev-test"
5
+ ENV["STORE_CODED_FILES"] = "true"
5
6
 
6
7
  def test_file no=1
7
8
  File.new(File.join(CARD_TEST_SEED_PATH, "file#{no}.txt"))
@@ -33,7 +33,7 @@ RSpec.describe Card::Format::HtmlFormat do
33
33
  it "renders top menu" do
34
34
  is_expected.to have_tag "header" do
35
35
  with_tag 'a.nav-link.internal-link[href="/"]', text: "Home"
36
- with_tag 'a.nav-link.internal-link[href=":recent"]', text: "Recent"
36
+ with_tag 'a.nav-link.internal-link[href="/:recent"]', text: "Recent"
37
37
  with_tag 'form.navbox-form[action="/*search"]' do
38
38
  with_tag 'select[name="query[keyword]"]'
39
39
  end
@@ -122,7 +122,7 @@ class Card
122
122
  def act_accordion
123
123
  context = @act.main_action.draft ? :warning : :default
124
124
  <<-HTML
125
- <div class="card card-#{context}">
125
+ <div class="card card-#{context} nodblclick">
126
126
  #{act_accordion_panel}
127
127
  </div>
128
128
  HTML
@@ -131,7 +131,6 @@ class Card
131
131
  def accordion_expand_options
132
132
  {
133
133
  "data-toggle" => "collapse",
134
- "data-parent" => "#accordion-#{collapse_id}",
135
134
  "data-target" => ".#{collapse_id}",
136
135
  "aria-expanded" => true,
137
136
  "aria-controls" => collapse_id
@@ -154,7 +153,8 @@ class Card
154
153
 
155
154
  def act_accordion_body
156
155
  wrap_with :div, id: collapse_id,
157
- class: "collapse #{collapse_id}" do
156
+ class: "collapse #{collapse_id}",
157
+ "data-parent": ".act-accordion-group" do
158
158
  wrap_with :div, details, class: "card-body"
159
159
  end
160
160
  end
@@ -70,9 +70,24 @@ class Card
70
70
  # each action is associated with on and only one card
71
71
  # @return [Card]
72
72
  def card
73
- res = Card.fetch card_id, look_in_trash: true, skip_modules: true
74
- return res unless res && res.type_id.in?([FileID, ImageID])
75
- res.include_set_modules
73
+ Card.fetch card_id, look_in_trash: true
74
+
75
+ # I'm not sure what the rationale for the following was/is, but it was causing
76
+ # problems in cases where slot attributes are overridden (eg see #wrap_data in
77
+ # sources on wikirate). The problem is the format object had the set modules but
78
+ # the card didn't.
79
+ #
80
+ # My guess is that the need for the following had something to do with errors
81
+ # associated with changed types. If so, the solution probably needs to handling
82
+ # including the set modules associated with the type at the time of the action
83
+ # rather than including no set modules at all.
84
+ #
85
+ # What's more, we _definitely_ don't want to hard code special behavior for
86
+ # specific types in here!
87
+
88
+ # , skip_modules: true
89
+ # return res unless res && res.type_id.in?([FileID, ImageID])
90
+ # res.include_set_modules
76
91
  end
77
92
 
78
93
  # remove action from action cache