card 1.19.0 → 1.19.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (424) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/card.gemspec +3 -3
  4. data/config/initializers/{02_extensions → 02_patches}/kaminari.rb +16 -5
  5. data/config/initializers/patches.rb +7 -0
  6. data/config/locales/en.yml +15 -6
  7. data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +11 -11
  8. data/db/migrate_core_cards/data/themes/bootstrap_default/_variables.scss +2 -1
  9. data/db/seed/new/card_actions.yml +915 -443
  10. data/db/seed/new/card_acts.yml +348 -186
  11. data/db/seed/new/card_changes.yml +4409 -3329
  12. data/db/seed/new/card_references.yml +220 -3
  13. data/db/seed/new/cards.yml +6687 -3445
  14. data/db/seed/test/fixtures/card_actions.yml +1953 -1513
  15. data/db/seed/test/fixtures/card_acts.yml +615 -453
  16. data/db/seed/test/fixtures/card_changes.yml +7596 -6516
  17. data/db/seed/test/fixtures/card_references.yml +892 -675
  18. data/db/seed/test/fixtures/cards.yml +8803 -5561
  19. data/db/seeds.rb +8 -0
  20. data/lib/card.rb +10 -0
  21. data/lib/card/auth/setup.rb +6 -6
  22. data/lib/card/mod/dirs.rb +13 -3
  23. data/lib/card/set/advanced_api.rb +5 -4
  24. data/lib/cardio.rb +7 -3
  25. data/mod/Modfile +2 -2
  26. data/mod/admin/set/self/admin.rb +47 -30
  27. data/mod/admin/set/self/admin_info.rb +11 -11
  28. data/mod/basic_formats/set/self/head.rb +1 -1
  29. data/mod/{basic_types → basic_formats}/spec/set/all/all_css_spec.rb +0 -0
  30. data/mod/{basic_types → basic_formats}/spec/set/all/all_csv_spec.rb +0 -0
  31. data/mod/{basic_types → basic_formats}/spec/set/all/base_spec.rb +0 -0
  32. data/mod/{basic_types → basic_formats}/spec/set/all/file_spec.rb +0 -0
  33. data/mod/{basic_types → basic_formats}/spec/set/all/json_spec.rb +0 -0
  34. data/mod/{basic_types → basic_formats}/spec/set/all/rss_spec.rb +0 -0
  35. data/mod/{basic_types → basic_formats}/spec/set/all/text_spec.rb +0 -0
  36. data/mod/bootstrap/lib/stylesheets/bootstrap/_variables.scss +1 -1
  37. data/mod/bootstrap/set/all/bootstrap/table.rb +1 -1
  38. data/mod/bootstrap/set/self/bootswatch_shared.rb +1 -1
  39. data/mod/carrierwave/Gemfile +4 -0
  40. data/mod/carrierwave/lib/carrier_wave/cardmount.rb +24 -13
  41. data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +189 -57
  42. data/mod/carrierwave/lib/carrier_wave/image_card_uploader.rb +5 -0
  43. data/mod/carrierwave/set/abstract/attachment.rb +26 -190
  44. data/mod/carrierwave/set/abstract/attachment/paths.rb +50 -0
  45. data/mod/carrierwave/set/abstract/attachment/storage_type.rb +319 -0
  46. data/mod/carrierwave/set/abstract/attachment/upload_cache.rb +77 -0
  47. data/mod/carrierwave/set/all/file_utils.rb +28 -0
  48. data/mod/carrierwave/set/self/admin.rb +23 -0
  49. data/mod/carrierwave/set/type/file.rb +26 -23
  50. data/mod/carrierwave/set/type/image.rb +1 -0
  51. data/mod/carrierwave/spec/lib/carrier_wave/file_card_uploader_spec.rb +67 -0
  52. data/mod/carrierwave/spec/set/type/file_spec.rb +557 -0
  53. data/mod/{standard → carrierwave}/spec/set/type/image_spec.rb +22 -4
  54. data/mod/core/set/abstract/code_file.rb +3 -3
  55. data/mod/core/set/all/debug.rb +23 -0
  56. data/mod/core/set/all/name.rb +1 -1
  57. data/mod/core/set/all/permissions.rb +22 -12
  58. data/mod/core/set/all/tracked_attributes.rb +0 -76
  59. data/mod/core/set/all/trash.rb +50 -0
  60. data/mod/core/set/all/update_read_rules.rb +84 -0
  61. data/mod/core/set/all/utils.rb +1 -75
  62. data/mod/email/set/type_plus_right/user/follow.rb +4 -8
  63. data/mod/history/lib/card/act.rb +3 -1
  64. data/mod/history/lib/card/action.rb +3 -1
  65. data/mod/history/lib/card/action/differ.rb +12 -1
  66. data/mod/history/set/all/history.rb +2 -1
  67. data/mod/machines/file/all_script_machine_output/file.js +211 -0
  68. data/mod/machines/file/all_style_machine_output/file.css +19 -0
  69. data/mod/machines/set/abstract/machine.rb +270 -0
  70. data/mod/machines/set/abstract/machine_input.rb +76 -0
  71. data/mod/machines/set/right/machine_output.rb +9 -1
  72. data/mod/machines/set/type/coffee_script.rb +2 -6
  73. data/mod/machines/set/type/css.rb +2 -2
  74. data/mod/machines/set/type/java_script.rb +2 -2
  75. data/mod/machines/set/type/skin.rb +2 -2
  76. data/mod/machines/spec/set/abstract/machine_spec.rb +10 -0
  77. data/mod/{basic_types → pointer}/spec/set/type/pointer_spec.rb +10 -26
  78. data/mod/settings/set/right/script.rb +1 -1
  79. data/mod/settings/set/right/style.rb +1 -1
  80. data/mod/solid_cache/set/all/solid_cache.rb +1 -1
  81. data/mod/standard/file/credit_image/image-icon.png +0 -0
  82. data/mod/standard/file/credit_image/image-large.png +0 -0
  83. data/mod/standard/file/credit_image/image-medium.png +0 -0
  84. data/mod/standard/file/credit_image/image-small.png +0 -0
  85. data/mod/standard/file/favicon/image-icon.png +0 -0
  86. data/mod/standard/file/favicon/image-large.png +0 -0
  87. data/mod/standard/file/favicon/image-medium.png +0 -0
  88. data/mod/standard/file/favicon/image-small.png +0 -0
  89. data/mod/standard/file/logo/image-icon.png +0 -0
  90. data/mod/standard/file/logo/image-large.png +0 -0
  91. data/mod/standard/file/logo/image-medium.png +0 -0
  92. data/mod/standard/file/logo/image-small.png +0 -0
  93. data/mod/standard/set/all/links.rb +2 -2
  94. data/spec/spec_helper.rb +15 -3
  95. data/tmpsets/set/{mod014-admin → mod001-admin}/self/admin.rb +47 -30
  96. data/tmpsets/set/{mod014-admin → mod001-admin}/self/admin_info.rb +11 -11
  97. data/tmpsets/set/{mod014-admin → mod001-admin}/self/version.rb +0 -0
  98. data/tmpsets/set/{mod001-core → mod002-core}/abstract/code_file.rb +0 -0
  99. data/tmpsets/set/{mod001-core → mod002-core}/all/actify.rb +6 -5
  100. data/tmpsets/set/{mod001-core → mod002-core}/all/active_card.rb +0 -0
  101. data/tmpsets/set/{mod001-core → mod002-core}/all/collection.rb +0 -0
  102. data/tmpsets/set/{mod001-core → mod002-core}/all/content.rb +0 -0
  103. data/tmpsets/set/mod002-core/all/debug.rb +30 -0
  104. data/tmpsets/set/{mod001-core → mod002-core}/all/erb.rb +0 -0
  105. data/tmpsets/set/{mod001-core → mod002-core}/all/event.rb +0 -0
  106. data/tmpsets/set/{mod001-core → mod002-core}/all/export.rb +0 -0
  107. data/tmpsets/set/{mod001-core → mod002-core}/all/fetch.rb +0 -0
  108. data/tmpsets/set/{mod001-core → mod002-core}/all/haml.rb +0 -0
  109. data/tmpsets/set/{mod001-core → mod002-core}/all/initialize.rb +0 -0
  110. data/tmpsets/set/{mod001-core → mod002-core}/all/location_history.rb +0 -0
  111. data/tmpsets/set/{mod001-core → mod002-core}/all/name.rb +1 -1
  112. data/tmpsets/set/{mod001-core → mod002-core}/all/name_validations.rb +0 -0
  113. data/tmpsets/set/{mod001-core → mod002-core}/all/pattern.rb +0 -0
  114. data/tmpsets/set/{mod001-core → mod002-core}/all/permissions.rb +22 -12
  115. data/tmpsets/set/{mod001-core → mod002-core}/all/phases.rb +0 -0
  116. data/tmpsets/set/{mod001-core → mod002-core}/all/references.rb +0 -0
  117. data/tmpsets/set/{mod001-core → mod002-core}/all/rules.rb +0 -0
  118. data/tmpsets/set/{mod001-core → mod002-core}/all/stages.rb +0 -0
  119. data/tmpsets/set/{mod001-core → mod002-core}/all/states.rb +0 -0
  120. data/tmpsets/set/{mod001-core → mod002-core}/all/subcards.rb +0 -0
  121. data/tmpsets/set/{mod001-core → mod002-core}/all/templating.rb +0 -0
  122. data/tmpsets/set/mod002-core/all/tracked_attributes.rb +78 -0
  123. data/tmpsets/set/{mod001-core → mod002-core}/all/trash.rb +50 -0
  124. data/tmpsets/set/{mod001-core → mod002-core}/all/type.rb +0 -0
  125. data/tmpsets/set/mod002-core/all/update_read_rules.rb +91 -0
  126. data/tmpsets/set/mod002-core/all/utils.rb +62 -0
  127. data/tmpsets/set/{mod001-core → mod002-core}/all/view_cache.rb +0 -0
  128. data/tmpsets/set/{mod002-history → mod003-history}/all/actions.rb +0 -0
  129. data/tmpsets/set/{mod002-history → mod003-history}/all/content_history.rb +0 -0
  130. data/tmpsets/set/{mod002-history → mod003-history}/all/history.rb +2 -1
  131. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/all_css.rb +0 -0
  132. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/all_csv.rb +0 -0
  133. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/all_js.rb +0 -0
  134. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/base.rb +0 -0
  135. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/file.rb +0 -0
  136. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/json.rb +0 -0
  137. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/rss.rb +0 -0
  138. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/text.rb +0 -0
  139. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/self/01_head/javascript.rb +0 -0
  140. data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/self/head.rb +1 -1
  141. data/tmpsets/set/{mod004-pointer → mod005-pointer}/abstract/01_pointer.rb +0 -0
  142. data/tmpsets/set/{mod004-pointer → mod005-pointer}/abstract/01_pointer/edit.rb +0 -0
  143. data/tmpsets/set/{mod004-pointer → mod005-pointer}/abstract/code_pointer.rb +0 -0
  144. data/tmpsets/set/{mod004-pointer → mod005-pointer}/self/script_editors.rb +0 -0
  145. data/tmpsets/set/{mod004-pointer → mod005-pointer}/self/script_mods.rb +0 -0
  146. data/tmpsets/set/{mod004-pointer → mod005-pointer}/self/script_pointer_config.rb +0 -0
  147. data/tmpsets/set/{mod004-pointer → mod005-pointer}/type/pointer.rb +0 -0
  148. data/tmpsets/set/{mod005-ace_editor → mod006-ace_editor}/abstract/ace_editor.rb +0 -0
  149. data/tmpsets/set/{mod005-ace_editor → mod006-ace_editor}/self/script_ace.rb +0 -0
  150. data/tmpsets/set/{mod005-ace_editor → mod006-ace_editor}/self/script_ace_config.rb +0 -0
  151. data/tmpsets/set/{mod006-prosemirror_editor → mod007-prosemirror_editor}/abstract/prosemirror_editor.rb +0 -0
  152. data/tmpsets/set/{mod006-prosemirror_editor → mod007-prosemirror_editor}/self/script_prosemirror.rb +0 -0
  153. data/tmpsets/set/{mod006-prosemirror_editor → mod007-prosemirror_editor}/self/script_prosemirror_config.rb +0 -0
  154. data/tmpsets/set/{mod008-solid_cache → mod009-solid_cache}/abstract/solid_cache.rb +0 -0
  155. data/tmpsets/set/{mod008-solid_cache → mod009-solid_cache}/all/solid_cache.rb +0 -0
  156. data/tmpsets/set/{mod008-solid_cache → mod009-solid_cache}/right/solid_cache.rb +0 -0
  157. data/tmpsets/set/{mod009-basic_types → mod010-basic_types}/type/html.rb +0 -0
  158. data/tmpsets/set/{mod009-basic_types → mod010-basic_types}/type/plain_text.rb +0 -0
  159. data/tmpsets/set/mod011-machines/abstract/machine.rb +277 -0
  160. data/tmpsets/set/mod011-machines/abstract/machine_input.rb +83 -0
  161. data/tmpsets/set/{mod010-machines → mod011-machines}/abstract/script.rb +0 -0
  162. data/tmpsets/set/{mod010-machines → mod011-machines}/all/reset_machines.rb +0 -0
  163. data/tmpsets/set/{mod010-machines → mod011-machines}/right/machine_cache.rb +0 -0
  164. data/tmpsets/set/{mod010-machines → mod011-machines}/right/machine_input.rb +0 -0
  165. data/tmpsets/set/{mod010-machines → mod011-machines}/right/machine_output.rb +9 -1
  166. data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_card_menu.rb +0 -0
  167. data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_html5shiv_printshiv.rb +0 -0
  168. data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_jquery.rb +0 -0
  169. data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_jquery_helper.rb +0 -0
  170. data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_slot.rb +0 -0
  171. data/tmpsets/set/{mod010-machines → mod011-machines}/self/style_bootstrap_compatible.rb +0 -0
  172. data/tmpsets/set/{mod010-machines → mod011-machines}/self/style_cards.rb +0 -0
  173. data/tmpsets/set/{mod010-machines → mod011-machines}/self/style_jquery_ui_smoothness.rb +0 -0
  174. data/tmpsets/set/{mod010-machines → mod011-machines}/type/coffee_script.rb +2 -6
  175. data/tmpsets/set/{mod010-machines → mod011-machines}/type/css.rb +2 -2
  176. data/tmpsets/set/{mod010-machines → mod011-machines}/type/java_script.rb +2 -2
  177. data/tmpsets/set/{mod010-machines → mod011-machines}/type/scss.rb +0 -0
  178. data/tmpsets/set/{mod010-machines → mod011-machines}/type/skin.rb +2 -2
  179. data/tmpsets/set/{mod011-settings → mod012-settings}/abstract/permission.rb +0 -0
  180. data/tmpsets/set/{mod011-settings → mod012-settings}/right/add_help.rb +0 -0
  181. data/tmpsets/set/{mod011-settings → mod012-settings}/right/comment.rb +0 -0
  182. data/tmpsets/set/{mod011-settings → mod012-settings}/right/create.rb +0 -0
  183. data/tmpsets/set/{mod011-settings → mod012-settings}/right/default.rb +0 -0
  184. data/tmpsets/set/{mod011-settings → mod012-settings}/right/delete.rb +0 -0
  185. data/tmpsets/set/{mod011-settings → mod012-settings}/right/help.rb +0 -0
  186. data/tmpsets/set/{mod011-settings → mod012-settings}/right/read.rb +0 -0
  187. data/tmpsets/set/{mod011-settings → mod012-settings}/right/script.rb +1 -1
  188. data/tmpsets/set/{mod011-settings → mod012-settings}/right/structure.rb +0 -0
  189. data/tmpsets/set/{mod011-settings → mod012-settings}/right/style.rb +1 -1
  190. data/tmpsets/set/{mod011-settings → mod012-settings}/right/update.rb +0 -0
  191. data/tmpsets/set/{mod011-settings → mod012-settings}/self/accountable.rb +0 -0
  192. data/tmpsets/set/{mod011-settings → mod012-settings}/self/add_help.rb +0 -0
  193. data/tmpsets/set/{mod011-settings → mod012-settings}/self/autoname.rb +0 -0
  194. data/tmpsets/set/{mod011-settings → mod012-settings}/self/captcha.rb +0 -0
  195. data/tmpsets/set/{mod011-settings → mod012-settings}/self/create.rb +0 -0
  196. data/tmpsets/set/{mod011-settings → mod012-settings}/self/default.rb +0 -0
  197. data/tmpsets/set/{mod011-settings → mod012-settings}/self/default_html_view.rb +0 -0
  198. data/tmpsets/set/{mod011-settings → mod012-settings}/self/delete.rb +0 -0
  199. data/tmpsets/set/{mod011-settings → mod012-settings}/self/follow_fields.rb +0 -0
  200. data/tmpsets/set/{mod011-settings → mod012-settings}/self/help.rb +0 -0
  201. data/tmpsets/set/{mod011-settings → mod012-settings}/self/input.rb +0 -0
  202. data/tmpsets/set/{mod011-settings → mod012-settings}/self/layout.rb +0 -0
  203. data/tmpsets/set/{mod011-settings → mod012-settings}/self/on_create.rb +0 -0
  204. data/tmpsets/set/{mod011-settings → mod012-settings}/self/on_delete.rb +0 -0
  205. data/tmpsets/set/{mod011-settings → mod012-settings}/self/on_update.rb +0 -0
  206. data/tmpsets/set/{mod011-settings → mod012-settings}/self/options.rb +0 -0
  207. data/tmpsets/set/{mod011-settings → mod012-settings}/self/options_label.rb +0 -0
  208. data/tmpsets/set/{mod011-settings → mod012-settings}/self/read.rb +0 -0
  209. data/tmpsets/set/{mod011-settings → mod012-settings}/self/recent_settings.rb +0 -0
  210. data/tmpsets/set/{mod011-settings → mod012-settings}/self/script.rb +0 -0
  211. data/tmpsets/set/{mod011-settings → mod012-settings}/self/structure.rb +0 -0
  212. data/tmpsets/set/{mod011-settings → mod012-settings}/self/style.rb +0 -0
  213. data/tmpsets/set/{mod011-settings → mod012-settings}/self/table_of_contents.rb +0 -0
  214. data/tmpsets/set/{mod011-settings → mod012-settings}/self/thanks.rb +0 -0
  215. data/tmpsets/set/{mod011-settings → mod012-settings}/self/update.rb +0 -0
  216. data/tmpsets/set/{mod011-settings → mod012-settings}/type/setting.rb +0 -0
  217. data/tmpsets/set/{mod012-email → mod013-email}/all/email_html.rb +0 -0
  218. data/tmpsets/set/{mod012-email → mod013-email}/all/email_text.rb +0 -0
  219. data/tmpsets/set/{mod012-email → mod013-email}/all/follow.rb +0 -0
  220. data/tmpsets/set/{mod012-email → mod013-email}/all/notify.rb +0 -0
  221. data/tmpsets/set/{mod012-email → mod013-email}/all/observer.rb +0 -0
  222. data/tmpsets/set/{mod012-email → mod013-email}/right/bcc.rb +0 -0
  223. data/tmpsets/set/{mod012-email → mod013-email}/right/cc.rb +0 -0
  224. data/tmpsets/set/{mod012-email → mod013-email}/right/follow.rb +0 -0
  225. data/tmpsets/set/{mod012-email → mod013-email}/right/follow_fields.rb +0 -0
  226. data/tmpsets/set/{mod012-email → mod013-email}/right/followers.rb +0 -0
  227. data/tmpsets/set/{mod012-email → mod013-email}/right/following.rb +0 -0
  228. data/tmpsets/set/{mod012-email → mod013-email}/right/from.rb +0 -0
  229. data/tmpsets/set/{mod012-email → mod013-email}/right/html_message.rb +0 -0
  230. data/tmpsets/set/{mod012-email → mod013-email}/right/to.rb +0 -0
  231. data/tmpsets/set/{mod012-email → mod013-email}/self/always.rb +0 -0
  232. data/tmpsets/set/{mod012-email → mod013-email}/self/created.rb +0 -0
  233. data/tmpsets/set/{mod012-email → mod013-email}/self/edited.rb +0 -0
  234. data/tmpsets/set/{mod012-email → mod013-email}/self/follow.rb +0 -0
  235. data/tmpsets/set/{mod012-email → mod013-email}/self/follow_defaults.rb +0 -0
  236. data/tmpsets/set/{mod012-email → mod013-email}/self/never.rb +0 -0
  237. data/tmpsets/set/{mod012-email → mod013-email}/type/email_template.rb +0 -0
  238. data/tmpsets/set/{mod012-email → mod013-email}/type_plus_right/user/follow.rb +4 -8
  239. data/tmpsets/set/{mod015-developer → mod014-developer}/all/event_viz.rb +0 -0
  240. data/tmpsets/set/{mod015-developer → mod014-developer}/all/view_viz.rb +0 -0
  241. data/tmpsets/set/{mod015-developer → mod014-developer}/right/debug.rb +0 -0
  242. data/tmpsets/set/mod015-carrierwave/abstract/attachment.rb +118 -0
  243. data/tmpsets/set/mod015-carrierwave/abstract/attachment/paths.rb +57 -0
  244. data/tmpsets/set/mod015-carrierwave/abstract/attachment/storage_type.rb +326 -0
  245. data/tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb +84 -0
  246. data/tmpsets/set/mod015-carrierwave/all/file_utils.rb +35 -0
  247. data/tmpsets/set/mod015-carrierwave/self/admin.rb +30 -0
  248. data/tmpsets/set/{mod013-carrierwave → mod015-carrierwave}/type/file.rb +27 -24
  249. data/tmpsets/set/{mod013-carrierwave → mod015-carrierwave}/type/image.rb +1 -0
  250. data/tmpsets/set/mod016-standard/all/links.rb +2 -2
  251. data/tmpsets/set/mod018-bootstrap/all/bootstrap/table.rb +1 -1
  252. data/tmpsets/set/mod018-bootstrap/self/bootswatch_shared.rb +1 -1
  253. data/vendor/carrierwave/.gitignore +19 -0
  254. data/vendor/carrierwave/.rubocop.yml +262 -0
  255. data/vendor/carrierwave/.travis.yml +58 -0
  256. data/vendor/carrierwave/CHANGELOG.md +81 -0
  257. data/vendor/carrierwave/CONTRIBUTING.md +37 -0
  258. data/vendor/carrierwave/Gemfile +5 -0
  259. data/vendor/carrierwave/README.md +995 -0
  260. data/vendor/carrierwave/Rakefile +26 -0
  261. data/vendor/carrierwave/carrierwave.gemspec +45 -0
  262. data/vendor/carrierwave/cucumber.yml +2 -0
  263. data/vendor/carrierwave/features/caching.feature +28 -0
  264. data/vendor/carrierwave/features/download.feature +20 -0
  265. data/vendor/carrierwave/features/file_storage.feature +37 -0
  266. data/vendor/carrierwave/features/file_storage_overridden_filename.feature +38 -0
  267. data/vendor/carrierwave/features/file_storage_overridden_store_dir.feature +38 -0
  268. data/vendor/carrierwave/features/file_storage_reversing_processor.feature +43 -0
  269. data/vendor/carrierwave/features/fixtures/bork.txt +1 -0
  270. data/vendor/carrierwave/features/fixtures/monkey.txt +1 -0
  271. data/vendor/carrierwave/features/fixtures/upcased_bork.txt +1 -0
  272. data/vendor/carrierwave/features/mount_activerecord.feature +46 -0
  273. data/vendor/carrierwave/features/step_definitions/activerecord_steps.rb +20 -0
  274. data/vendor/carrierwave/features/step_definitions/caching_steps.rb +12 -0
  275. data/vendor/carrierwave/features/step_definitions/datamapper_steps.rb +27 -0
  276. data/vendor/carrierwave/features/step_definitions/download_steps.rb +8 -0
  277. data/vendor/carrierwave/features/step_definitions/file_steps.rb +51 -0
  278. data/vendor/carrierwave/features/step_definitions/general_steps.rb +102 -0
  279. data/vendor/carrierwave/features/step_definitions/mount_steps.rb +17 -0
  280. data/vendor/carrierwave/features/step_definitions/store_steps.rb +16 -0
  281. data/vendor/carrierwave/features/support/activerecord.rb +18 -0
  282. data/vendor/carrierwave/features/support/env.rb +19 -0
  283. data/vendor/carrierwave/features/versions_basics.feature +50 -0
  284. data/vendor/carrierwave/features/versions_caching_from_versions.feature +32 -0
  285. data/vendor/carrierwave/features/versions_nested_versions.feature +70 -0
  286. data/vendor/carrierwave/features/versions_overridden_filename.feature +51 -0
  287. data/vendor/carrierwave/features/versions_overriden_store_dir.feature +41 -0
  288. data/vendor/carrierwave/gemfiles/rails-4-0-stable.gemfile +5 -0
  289. data/vendor/carrierwave/gemfiles/rails-4-1-stable.gemfile +5 -0
  290. data/vendor/carrierwave/gemfiles/rails-4-2-stable.gemfile +5 -0
  291. data/vendor/carrierwave/gemfiles/rails-master.gemfile +11 -0
  292. data/vendor/carrierwave/lib/carrierwave.rb +93 -0
  293. data/vendor/carrierwave/lib/carrierwave/compatibility/paperclip.rb +103 -0
  294. data/vendor/carrierwave/lib/carrierwave/error.rb +8 -0
  295. data/vendor/carrierwave/lib/carrierwave/locale/cs.yml +14 -0
  296. data/vendor/carrierwave/lib/carrierwave/locale/de.yml +14 -0
  297. data/vendor/carrierwave/lib/carrierwave/locale/el.yml +14 -0
  298. data/vendor/carrierwave/lib/carrierwave/locale/en.yml +14 -0
  299. data/vendor/carrierwave/lib/carrierwave/locale/es.yml +14 -0
  300. data/vendor/carrierwave/lib/carrierwave/locale/fr-CA.yml +14 -0
  301. data/vendor/carrierwave/lib/carrierwave/locale/fr.yml +14 -0
  302. data/vendor/carrierwave/lib/carrierwave/locale/id.yml +14 -0
  303. data/vendor/carrierwave/lib/carrierwave/locale/ja.yml +14 -0
  304. data/vendor/carrierwave/lib/carrierwave/locale/nb.yml +14 -0
  305. data/vendor/carrierwave/lib/carrierwave/locale/nl.yml +14 -0
  306. data/vendor/carrierwave/lib/carrierwave/locale/pl.yml +14 -0
  307. data/vendor/carrierwave/lib/carrierwave/locale/pt-BR.yml +14 -0
  308. data/vendor/carrierwave/lib/carrierwave/locale/pt-PT.yml +14 -0
  309. data/vendor/carrierwave/lib/carrierwave/locale/ru.yml +14 -0
  310. data/vendor/carrierwave/lib/carrierwave/locale/sk.yml +14 -0
  311. data/vendor/carrierwave/lib/carrierwave/locale/tr.yml +14 -0
  312. data/vendor/carrierwave/lib/carrierwave/locale/zh-CN.yml +14 -0
  313. data/vendor/carrierwave/lib/carrierwave/locale/zh-TW.yml +14 -0
  314. data/vendor/carrierwave/lib/carrierwave/mount.rb +444 -0
  315. data/vendor/carrierwave/lib/carrierwave/mounter.rb +163 -0
  316. data/vendor/carrierwave/lib/carrierwave/orm/activerecord.rb +103 -0
  317. data/vendor/carrierwave/lib/carrierwave/processing.rb +2 -0
  318. data/vendor/carrierwave/lib/carrierwave/processing/mini_magick.rb +328 -0
  319. data/vendor/carrierwave/lib/carrierwave/processing/rmagick.rb +379 -0
  320. data/vendor/carrierwave/lib/carrierwave/sanitized_file.rb +348 -0
  321. data/vendor/carrierwave/lib/carrierwave/storage.rb +2 -0
  322. data/vendor/carrierwave/lib/carrierwave/storage/abstract.rb +43 -0
  323. data/vendor/carrierwave/lib/carrierwave/storage/file.rb +118 -0
  324. data/vendor/carrierwave/lib/carrierwave/storage/fog.rb +462 -0
  325. data/vendor/carrierwave/lib/carrierwave/test/matchers.rb +394 -0
  326. data/vendor/carrierwave/lib/carrierwave/uploader.rb +67 -0
  327. data/vendor/carrierwave/lib/carrierwave/uploader/cache.rb +207 -0
  328. data/vendor/carrierwave/lib/carrierwave/uploader/callbacks.rb +33 -0
  329. data/vendor/carrierwave/lib/carrierwave/uploader/configuration.rb +203 -0
  330. data/vendor/carrierwave/lib/carrierwave/uploader/content_type_blacklist.rb +48 -0
  331. data/vendor/carrierwave/lib/carrierwave/uploader/content_type_whitelist.rb +48 -0
  332. data/vendor/carrierwave/lib/carrierwave/uploader/default_url.rb +17 -0
  333. data/vendor/carrierwave/lib/carrierwave/uploader/download.rb +92 -0
  334. data/vendor/carrierwave/lib/carrierwave/uploader/extension_blacklist.rb +51 -0
  335. data/vendor/carrierwave/lib/carrierwave/uploader/extension_whitelist.rb +51 -0
  336. data/vendor/carrierwave/lib/carrierwave/uploader/file_size.rb +41 -0
  337. data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_blacklist.rb +94 -0
  338. data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_whitelist.rb +94 -0
  339. data/vendor/carrierwave/lib/carrierwave/uploader/mountable.rb +38 -0
  340. data/vendor/carrierwave/lib/carrierwave/uploader/processing.rb +88 -0
  341. data/vendor/carrierwave/lib/carrierwave/uploader/proxy.rb +86 -0
  342. data/vendor/carrierwave/lib/carrierwave/uploader/remove.rb +21 -0
  343. data/vendor/carrierwave/lib/carrierwave/uploader/serialization.rb +28 -0
  344. data/vendor/carrierwave/lib/carrierwave/uploader/store.rb +93 -0
  345. data/vendor/carrierwave/lib/carrierwave/uploader/url.rb +41 -0
  346. data/vendor/carrierwave/lib/carrierwave/uploader/versions.rb +295 -0
  347. data/vendor/carrierwave/lib/carrierwave/utilities.rb +6 -0
  348. data/vendor/carrierwave/lib/carrierwave/utilities/uri.rb +21 -0
  349. data/vendor/carrierwave/lib/carrierwave/validations/active_model.rb +78 -0
  350. data/vendor/carrierwave/lib/carrierwave/version.rb +3 -0
  351. data/vendor/carrierwave/lib/generators/templates/uploader.rb +49 -0
  352. data/vendor/carrierwave/lib/generators/uploader_generator.rb +7 -0
  353. data/vendor/carrierwave/script/console +10 -0
  354. data/vendor/carrierwave/script/destroy +14 -0
  355. data/vendor/carrierwave/script/generate +14 -0
  356. data/vendor/carrierwave/spec/compatibility/paperclip_spec.rb +138 -0
  357. data/vendor/carrierwave/spec/fixtures/Uppercase.jpg +1 -0
  358. data/vendor/carrierwave/spec/fixtures/bork.ttxt +1 -0
  359. data/vendor/carrierwave/spec/fixtures/bork.txt +1 -0
  360. data/vendor/carrierwave/spec/fixtures/bork.txtt +1 -0
  361. data/vendor/carrierwave/spec/fixtures/case.JPG +1 -0
  362. data/vendor/carrierwave/spec/fixtures/landscape.jpg +0 -0
  363. data/vendor/carrierwave/spec/fixtures/multi_page.pdf +0 -0
  364. data/vendor/carrierwave/spec/fixtures/new.jpeg +1 -0
  365. data/vendor/carrierwave/spec/fixtures/new.txt +1 -0
  366. data/vendor/carrierwave/spec/fixtures/old.jpeg +1 -0
  367. data/vendor/carrierwave/spec/fixtures/old.txt +1 -0
  368. data/vendor/carrierwave/spec/fixtures/portrait.jpg +0 -0
  369. data/vendor/carrierwave/spec/fixtures/ruby.gif +0 -0
  370. data/vendor/carrierwave/spec/fixtures/sponsored.doc +1 -0
  371. data/vendor/carrierwave/spec/fixtures/test+.jpg +1 -0
  372. data/vendor/carrierwave/spec/fixtures/test.jpeg +1 -0
  373. data/vendor/carrierwave/spec/fixtures/test.jpg +1 -0
  374. data/vendor/carrierwave/spec/generators/uploader_generator_spec.rb +19 -0
  375. data/vendor/carrierwave/spec/mount_multiple_spec.rb +913 -0
  376. data/vendor/carrierwave/spec/mount_single_spec.rb +793 -0
  377. data/vendor/carrierwave/spec/orm/activerecord_spec.rb +1556 -0
  378. data/vendor/carrierwave/spec/processing/mini_magick_spec.rb +210 -0
  379. data/vendor/carrierwave/spec/processing/rmagick_spec.rb +250 -0
  380. data/vendor/carrierwave/spec/sanitized_file_spec.rb +805 -0
  381. data/vendor/carrierwave/spec/spec_helper.rb +105 -0
  382. data/vendor/carrierwave/spec/storage/file_spec.rb +82 -0
  383. data/vendor/carrierwave/spec/storage/fog_credentials.rb +46 -0
  384. data/vendor/carrierwave/spec/storage/fog_helper.rb +428 -0
  385. data/vendor/carrierwave/spec/storage/fog_spec.rb +48 -0
  386. data/vendor/carrierwave/spec/support/activerecord.rb +31 -0
  387. data/vendor/carrierwave/spec/support/file_utils_helper.rb +15 -0
  388. data/vendor/carrierwave/spec/uploader/cache_spec.rb +324 -0
  389. data/vendor/carrierwave/spec/uploader/callback_spec.rb +30 -0
  390. data/vendor/carrierwave/spec/uploader/configuration_spec.rb +133 -0
  391. data/vendor/carrierwave/spec/uploader/content_type_blacklist_spec.rb +61 -0
  392. data/vendor/carrierwave/spec/uploader/content_type_whitelist_spec.rb +63 -0
  393. data/vendor/carrierwave/spec/uploader/default_url_spec.rb +77 -0
  394. data/vendor/carrierwave/spec/uploader/download_spec.rb +204 -0
  395. data/vendor/carrierwave/spec/uploader/extension_blacklist_spec.rb +112 -0
  396. data/vendor/carrierwave/spec/uploader/extension_whitelist_spec.rb +102 -0
  397. data/vendor/carrierwave/spec/uploader/file_size_spec.rb +52 -0
  398. data/vendor/carrierwave/spec/uploader/mountable_spec.rb +26 -0
  399. data/vendor/carrierwave/spec/uploader/overrides_spec.rb +71 -0
  400. data/vendor/carrierwave/spec/uploader/paths_spec.rb +18 -0
  401. data/vendor/carrierwave/spec/uploader/processing_spec.rb +159 -0
  402. data/vendor/carrierwave/spec/uploader/proxy_spec.rb +79 -0
  403. data/vendor/carrierwave/spec/uploader/remove_spec.rb +71 -0
  404. data/vendor/carrierwave/spec/uploader/store_spec.rb +400 -0
  405. data/vendor/carrierwave/spec/uploader/url_spec.rb +273 -0
  406. data/vendor/carrierwave/spec/uploader/versions_spec.rb +633 -0
  407. metadata +339 -187
  408. data/config/initializers/extensions.rb +0 -3
  409. data/mod/05_standard/file/favicon/image-icon.png +0 -0
  410. data/mod/05_standard/file/favicon/image-large.png +0 -0
  411. data/mod/05_standard/file/favicon/image-medium.png +0 -0
  412. data/mod/05_standard/file/favicon/image-original.png +0 -0
  413. data/mod/05_standard/file/favicon/image-small.png +0 -0
  414. data/mod/machines/lib/card/machine.rb +0 -261
  415. data/mod/machines/lib/card/machine_input.rb +0 -80
  416. data/mod/standard/file/credit/icon-image.png +0 -0
  417. data/mod/standard/file/credit/large-image.png +0 -0
  418. data/mod/standard/file/credit/medium-image.png +0 -0
  419. data/mod/standard/file/credit/original-image.png +0 -0
  420. data/mod/standard/file/credit/small-image.png +0 -0
  421. data/mod/standard/spec/set/type/file_spec.rb +0 -99
  422. data/tmpsets/set/mod001-core/all/tracked_attributes.rb +0 -154
  423. data/tmpsets/set/mod001-core/all/utils.rb +0 -132
  424. data/tmpsets/set/mod013-carrierwave/abstract/attachment.rb +0 -282
@@ -0,0 +1,8 @@
1
+ WAGN_SEED_TABLES = %w( cards card_actions card_acts card_changes
2
+ card_references ).freeze
3
+ WAGN_SEED_PATH = File.join(
4
+ ENV["DECKO_SEED_REPO_PATH"] || [Cardio.gem_root, "db", "seed"], "new"
5
+ )
6
+
7
+ require "active_record/fixtures"
8
+ ActiveRecord::FixtureSet.create_fixtures WAGN_SEED_PATH, WAGN_SEED_TABLES
@@ -1,5 +1,15 @@
1
1
  # -*- encoding : utf-8 -*-
2
+ cw_path = File.expand_path "../../vendor/carrierwave/lib", __FILE__
3
+ $LOAD_PATH.unshift(cw_path) unless $LOAD_PATH.include?(cw_path)
2
4
  require "carrierwave"
5
+
6
+ # if Cardio.file_buckets.present?
7
+ # require "carrierwave/storage/fog"
8
+ # Cardio.file_buckets.each do |bucket, config|
9
+ # require config["provider"]
10
+ # end
11
+ # end
12
+
3
13
  Object.send :remove_const, :Card if Object.send(:const_defined?, :Card)
4
14
 
5
15
  # Cards are wiki-inspired building blocks.
@@ -21,12 +21,12 @@ class Card
21
21
  @simulating_setup_need = mode
22
22
  end
23
23
 
24
- # def instant_account_activation
25
- # simulate_setup_need!
26
- # yield
27
- # ensure
28
- # simulate_setup_need! false
29
- # end
24
+ def instant_account_activation
25
+ simulate_setup_need!
26
+ yield
27
+ ensure
28
+ simulate_setup_need! false
29
+ end
30
30
 
31
31
  private
32
32
 
@@ -17,12 +17,22 @@ class Card
17
17
  end
18
18
  end
19
19
 
20
- def mod mod_name
20
+ # add a new mod to mod load paths
21
+ def add_path mod_name
22
+ if @mods.include? mod_name
23
+ raise Error,
24
+ "name conflict: mod with name \"#{mod_name}\" already loaded"
25
+ end
21
26
  @mods << mod_name
22
- # TODO: do something if two mods have the same name?
23
27
  @paths[mod_name] = File.join @current_path, mod_name
24
28
  end
25
29
 
30
+ alias_method :mod, :add_path
31
+
32
+ def path mod_name
33
+ @paths[mod_name]
34
+ end
35
+
26
36
  def each type=nil
27
37
  super() do |path|
28
38
  dirname = type ? File.join(path, type.to_s) : path
@@ -58,7 +68,7 @@ class Card
58
68
  def load_from_dir
59
69
  Dir.entries(@current_path).sort.each do |filename|
60
70
  next if filename =~ /^\./
61
- mod filename
71
+ add_path filename
62
72
  end.compact
63
73
  end
64
74
 
@@ -20,10 +20,11 @@ class Card
20
20
  end
21
21
 
22
22
  def attachment name, args
23
- include Abstract::Attachment
24
- add_attributes name, "remote_#{name}_url".to_sym, :load_from_mod,
25
- :action_id_of_cached_upload, :empty_ok
26
- uploader_class = args[:uploader] || CarrierWave::FileUploader
23
+ include_set Abstract::Attachment
24
+ add_attributes name, "remote_#{name}_url".to_sym,
25
+ :action_id_of_cached_upload, :empty_ok,
26
+ :storage_type, :bucket, :mod
27
+ uploader_class = args[:uploader] || ::CarrierWave::FileCardUploader
27
28
  mount_uploader name, uploader_class
28
29
  end
29
30
 
@@ -53,7 +53,11 @@ module Cardio
53
53
  encoding: "utf-8",
54
54
  request_logger: false,
55
55
  performance_logger: false,
56
- sql_comments: true
56
+ sql_comments: true,
57
+
58
+ file_storage: :local,
59
+ file_buckets: {},
60
+ file_default_bucket: nil
57
61
  }
58
62
  end
59
63
 
@@ -61,8 +65,8 @@ module Cardio
61
65
  @@config = config
62
66
  @@root = config.root
63
67
 
64
- config.autoload_paths += Dir["#{gem_root}/mod/*/lib/**/"]
65
68
  config.autoload_paths += Dir["#{gem_root}/lib/**/"]
69
+ config.autoload_paths += Dir["#{gem_root}/mod/*/lib/**/"]
66
70
  config.autoload_paths += Dir["#{root}/mod/*/lib/**/"]
67
71
 
68
72
  default_configs.each_pair do |setting, value|
@@ -92,7 +96,7 @@ module Cardio
92
96
  add_path "db/migrate"
93
97
  add_path "db/migrate_core_cards"
94
98
  add_path "db/migrate_deck_cards", root: root, with: "db/migrate_cards"
95
- add_path "db/seeds", with: "db/seeds.rb"
99
+ add_path "db/seeds.rb", with: "db/seeds.rb"
96
100
 
97
101
  add_path "config/initializers", glob: "**/*.rb"
98
102
  add_initializers root
@@ -1,3 +1,4 @@
1
+ mod 'admin'
1
2
  mod 'core'
2
3
  mod 'history'
3
4
  mod 'basic_formats'
@@ -10,9 +11,8 @@ mod 'basic_types'
10
11
  mod 'machines'
11
12
  mod 'settings'
12
13
  mod 'email'
13
- mod 'carrierwave'
14
- mod 'admin'
15
14
  mod 'developer'
15
+ mod 'carrierwave'
16
16
  mod 'standard'
17
17
  mod 'account'
18
18
  mod 'bootstrap'
@@ -1,16 +1,22 @@
1
+ # collect arrays of the form
2
+ # [task symbol, { execute_policy: block, stats_policy: block }]
3
+ basket :tasks
4
+
1
5
  event :admin_tasks, :initialize, on: :update do
2
6
  return unless (task = Env.params[:task])
3
- raise Card::Error::PermissionDenied.new(self) unless Auth.always_ok?
7
+ raise Card::Error::PermissionDenied, self unless Auth.always_ok?
4
8
 
5
9
  case task.to_sym
6
10
  when :clear_cache then Card::Cache.reset_all
7
11
  when :repair_references then Card::Reference.repair_all
8
- when :empty_trash then Card.empty_trash
9
12
  when :clear_view_cache then Card::Cache::ViewCache.reset
10
13
  when :delete_old_revisions then Card::Action.delete_old
11
14
  when :repair_permissions then Card.repair_all_permissions
12
15
  when :clear_solid_cache then Card.clear_solid_cache
13
16
  when :clear_machine_cache then Card.reset_all_machines
17
+ else
18
+ task_data = tasks.find { |h| h[:name].to_sym == task }
19
+ task_data[:execute_policy].call if task_data
14
20
  end
15
21
  abort :success
16
22
  end
@@ -20,63 +26,74 @@ format :html do
20
26
  stats = card_stats
21
27
  stats += cache_stats
22
28
  stats += memory_stats
23
- table_content = stats.map { |args| stat_row(*args) }
29
+ card.tasks.each do |task|
30
+ stats += Array.wrap task[:stats]
31
+ end
32
+ table_content = stats.map { |args| stat_row(args) }
24
33
  table table_content, header: %w(Stat Value Action)
25
34
  end
26
35
 
27
36
  def card_stats
28
37
  [
29
- ["cards", { count: Card.where(trash: false) }],
30
- ["trashed cards", { count: Card.where(trash: true),
31
- link_text: "delete all", task: "empty_trash" }],
32
- ["actions", { count: Card::Action,
33
- link_text: "delete old",
34
- task: "delete_old_revisions" }],
35
- ["references", { count: Card::Reference,
36
- link_text: "repair all", task: "repair_references" }]
38
+ { title: "cards",
39
+ count: Card.where(trash: false) },
40
+ { title: "actions",
41
+ count: Card::Action,
42
+ link_text: "delete old",
43
+ task: "delete_old_revisions" },
44
+ { title: "references",
45
+ count: Card::Reference,
46
+ link_text: "repair all",
47
+ task: "repair_references" }
37
48
  ]
38
49
  end
39
50
 
40
51
  def cache_stats
41
52
  stats = [
42
- ["solid cache", { count: solid_cache_count, unit: " cards",
43
- link_text: "clear cache",
44
- task: "clear_solid_cache" }],
45
- ["machine cache", { count: machine_cache_count, unit: " cards",
46
- link_text: "clear cache",
47
- task: "clear_machine_cache" }]
53
+ { title: "solid cache",
54
+ count: solid_cache_count, unit: " cards",
55
+ link_text: "clear cache",
56
+ task: "clear_solid_cache" },
57
+ { title: "machine cache",
58
+ count: machine_cache_count, unit: " cards",
59
+ link_text: "clear cache",
60
+ task: "clear_machine_cache" }
48
61
  ]
49
62
  return stats unless Card.config.view_cache
50
- stats <<
51
- ["view cache", { count: Card::Cache::ViewCache,
52
- link_text: "clear view cache",
53
- task: "clear_view_cache" }]
54
- stats
63
+ stats << { title: "view cache",
64
+ count: Card::Cache::ViewCache,
65
+ link_text: "clear view cache",
66
+ task: "clear_view_cache" }
55
67
  end
56
68
 
57
69
  def memory_stats
58
70
  oldmem = session[:memory]
59
71
  session[:memory] = newmem = card.profile_memory
60
72
  stats = [
61
- ["memory now", { count: newmem, unit: "M",
62
- link_text: "clear cache", task: "clear_cache" }]
73
+ { title: "memory now",
74
+ count: newmem, unit: "M",
75
+ link_text: "clear cache", task: "clear_cache" }
63
76
  ]
64
77
  return stats unless oldmem
65
- stats << ["memory prev", { count: oldmem, unit: "M" }]
66
- stats << ["memory diff", { count: newmem - oldmem, unit: "M" }]
78
+ stats << { title: "memory prev", count: oldmem, unit: "M" }
79
+ stats << { title: "memory diff", count: newmem - oldmem, unit: "M" }
67
80
  stats
68
81
  end
69
82
 
70
- def stat_row name, args={}
71
- res = [name]
72
- args[:count] = args[:count].count if args[:count].respond_to?(:count)
73
- res << "#{args[:count]}#{args[:unit]}"
83
+ def stat_row args={}
84
+ res = [(args[:title] || "")]
85
+ res << "#{count(args[:count])}#{args[:unit]}"
74
86
  return res unless args[:task]
75
87
  path = card_path("update/:admin?task=#{args[:task]}")
76
88
  res << link_to(args[:link_text] || args[:task], path)
77
89
  res
78
90
  end
79
91
 
92
+ def count counter
93
+ counter = counter.call if counter.is_a?(Proc)
94
+ counter.respond_to?(:count) ? counter.count : counter
95
+ end
96
+
80
97
  def solid_cache_count
81
98
  Card.search right: { codename: "solid_cache" }, return: "count"
82
99
  end
@@ -22,7 +22,7 @@ format :html do
22
22
  def render_warning_list warnings
23
23
  # 'ADMINISTRATOR WARNING'
24
24
  admin_warn = I18n.t(:admin_warn,
25
- scope: "mod.standard.set.self.admin_info")
25
+ scope: "mod.admin.set.self.admin_info")
26
26
  "<h6>#{admin_warn}</h6>".html_safe + list_group(
27
27
  warnings,
28
28
  items: { class: "list-group-item-warning" }
@@ -33,7 +33,7 @@ format :html do
33
33
  # "Email delivery is turned off."
34
34
  # "Change settings in config/application.rb to send sign up notifications."
35
35
  I18n.t(:email_off,
36
- scope: "mod.standard.set.self.admin_info",
36
+ scope: "mod.admin.set.self.admin_info",
37
37
  path: "config/application.rb")
38
38
  end
39
39
 
@@ -43,16 +43,16 @@ format :html do
43
43
  # %(Your captcha is currently working with temporary settings.
44
44
  # This is fine for a local installation, but you will need new
45
45
  # recaptcha keys if you want to make this site public.)
46
- I18n.t(:captcha_temp, scope: "mod.standard.set.self.admin_info")
46
+ I18n.t(:captcha_temp, scope: "mod.admin.set.self.admin_info")
47
47
  else
48
48
  # %(You are configured to use [[*captcha]], but for that to work
49
49
  # you need new recaptcha keys.)
50
50
  process_content(I18n.t(:captcha_keys,
51
- scope: "mod.standard.set.self.admin_info"))
51
+ scope: "mod.admin.set.self.admin_info"))
52
52
  end
53
53
  # 'Instructions'
54
54
  instructions = I18n.t(:instructions,
55
- scope: "mod.standard.set.self.admin_info")
55
+ scope: "mod.admin.set.self.admin_info")
56
56
  <<-HTML
57
57
  <p>
58
58
  #{warning}
@@ -71,15 +71,15 @@ format :html do
71
71
  def howto_add_new_recaptcha_keys
72
72
  instructions(
73
73
  # 'How to add new recaptcha keys:'
74
- I18n.t(:howto_add_keys, scope: "mod.standard.set.self.admin_info"),
74
+ I18n.t(:howto_add_keys, scope: "mod.admin.set.self.admin_info"),
75
75
  [
76
76
  # "1. Register your domain at #{web_link 'http://google.com/recaptcha'}"
77
77
  I18n.t(:howto_register,
78
- scope: "mod.standard.set.self.admin_info",
78
+ scope: "mod.admin.set.self.admin_info",
79
79
  recaptcha_link: web_link("http://google.com/recaptcha")),
80
80
  # "2. Add your keys to #{card_link :recaptcha_settings}"
81
81
  I18n.t(:howto_add,
82
- scope: "mod.standard.set.self.admin_info",
82
+ scope: "mod.admin.set.self.admin_info",
83
83
  recaptcha_settings: card_link(:recaptcha_settings))
84
84
  ]
85
85
  )
@@ -88,15 +88,15 @@ format :html do
88
88
  def howto_turn_captcha_off
89
89
  instructions(
90
90
  # 'How to turn captcha off:'
91
- I18n.t(:howto_turn_off, scope: "mod.standard.set.self.admin_info"),
91
+ I18n.t(:howto_turn_off, scope: "mod.admin.set.self.admin_info"),
92
92
  [
93
93
  # "1. Go to #{card_link :captcha}"
94
94
  I18n.t(:howto_go,
95
- scope: "mod.standard.set.self.admin_info",
95
+ scope: "mod.admin.set.self.admin_info",
96
96
  captcha_card: card_link(:captcha)),
97
97
  # '2. Update all *captcha rules to "no".'
98
98
  I18n.t(:howto_update,
99
- scope: "mod.standard.set.self.admin_info")
99
+ scope: "mod.admin.set.self.admin_info")
100
100
  ]
101
101
  )
102
102
  end
@@ -51,7 +51,7 @@ format :html do
51
51
  if params[:debug] == "style"
52
52
  page_path(style_card.cardname, item: :import, format: :css)
53
53
  elsif style_card
54
- card_path style_card.machine_output_url
54
+ style_card.machine_output_url
55
55
  end
56
56
  return unless @css_path
57
57
  %(<link href="#{@css_path}" media="all" rel="stylesheet" type="text/css" />)
@@ -80,7 +80,7 @@ $headings-color: inherit !default;
80
80
 
81
81
  // [converter] If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path.
82
82
  // [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
83
- $icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/") !default;
83
+ $icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "[[/assets/fonts/bootstrap/]]") !default;
84
84
 
85
85
  //** File name for all font files.
86
86
  $icon-font-name: "glyphicons-halflings-regular" !default;
@@ -40,7 +40,7 @@ format :html do
40
40
  if cell.is_a? Hash
41
41
  content_tag :td, cell.delete(:content).to_s.html_safe, cell
42
42
  else
43
- content_tag :td, cell.html_safe
43
+ content_tag :td, String(cell).html_safe
44
44
  end
45
45
  end
46
46
 
@@ -9,7 +9,7 @@ view :raw do |_args|
9
9
  content = File.read("#{bootstrap_path}/_variables.scss")
10
10
  content += %(
11
11
  $bootstrap-sass-asset-helper: false;
12
- $icon-font-path: "#{card_path 'assets/fonts/'}";
12
+ $icon-font-path: "#{card_url 'assets/fonts/'}";
13
13
  )
14
14
  # mixins
15
15
  content += Dir.glob("#{bootstrap_path}/mixins/*.scss").map do |name|
@@ -0,0 +1,4 @@
1
+ # the current release 0.11.2 uses an old version of the fog gem which isn't
2
+ # compatible with rails 4.2
3
+ gem "carrierwave", git: "https://github.com/carrierwaveuploader/carrierwave",
4
+ branch: "master"
@@ -1,3 +1,5 @@
1
+ cw_path = File.expand_path "../../../../../vendor/carrierwave/lib", __FILE__
2
+ $LOAD_PATH.unshift(cw_path) unless $LOAD_PATH.include?(cw_path)
1
3
  require "carrierwave"
2
4
 
3
5
  module CarrierWave
@@ -30,15 +32,12 @@ module CarrierWave
30
32
  on: :update do
31
33
  mark_remove_#{column}_false
32
34
  end
33
- event :store_previous_model_for_#{column}_event, :store,
35
+ event :store_previous_changes_for_#{column}_event, :store,
34
36
  on: :update, when: proc { |c| !c.history? } do
35
- store_previous_model_for_#{column}
37
+ store_previous_changes_for_#{column}
36
38
  end
37
- event :remove_previously_stored_#{column}_event, :store,
39
+ event :remove_previously_stored_#{column}_event, :finalize,
38
40
  on: :update, when: proc { |c| !c.history?} do
39
- if @previous_model_for_#{column}
40
- @previous_model_for_#{column}.include_set_modules
41
- end
42
41
  remove_previously_stored_#{column}
43
42
  end
44
43
 
@@ -64,23 +63,35 @@ module CarrierWave
64
63
 
65
64
  def #{column}=(new_file)
66
65
  return if new_file.blank?
67
- send(:"#{column}_will_change!")
68
- db_column = _mounter(:#{column}).serialization_column
69
- send(:"\#{db_column}_will_change!")
70
- super
66
+ assign_file(new_file) { super }
71
67
  end
72
68
 
73
69
  def remote_#{column}_url=(url)
74
- send(:"#{column}_will_change!")
70
+ assign_file(url) { super }
71
+ end
72
+
73
+ def assign_file file
75
74
  db_column = _mounter(:#{column}).serialization_column
76
75
  send(:"\#{db_column}_will_change!")
76
+ if web?
77
+ self.content = file
78
+ else
79
+ send(:"#{column}_will_change!")
80
+ yield
81
+ end
82
+ end
83
+
84
+ def remove_#{column}=(value)
85
+ column = _mounter(:#{column}).serialization_column
86
+ send(:"\#{column}_will_change!")
77
87
  super
78
88
  end
79
89
 
80
90
  def remove_#{column}!
91
+ self.remove_#{column} = true
92
+ write_#{column}_identifier
93
+ self.remove_#{column} = false
81
94
  super
82
- _mounter(:#{column}).remove = true
83
- _mounter(:#{column}).write_identifier
84
95
  end
85
96
 
86
97
  def #{column}_will_change!