alchemy_cms 4.0.5 → 4.1.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +1 -0
  3. data/.gitignore +1 -0
  4. data/.localeapp/config.rb +8 -0
  5. data/.rubocop.yml +26 -13
  6. data/.travis.yml +8 -11
  7. data/CHANGELOG.md +5 -20
  8. data/Gemfile +10 -7
  9. data/README.md +16 -14
  10. data/Rakefile +1 -1
  11. data/alchemy_cms.gemspec +6 -7
  12. data/app/assets/images/alchemy/alchemy-logo.png +0 -0
  13. data/app/assets/images/alchemy/alchemy-logo.svg +1 -70
  14. data/app/assets/images/alchemy/favicon.ico +0 -0
  15. data/app/assets/images/alchemy/icon.svg +1 -14
  16. data/app/assets/javascripts/alchemy/admin.js +0 -7
  17. data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +2 -2
  18. data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +1 -1
  19. data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +1 -1
  20. data/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee +1 -0
  21. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +19 -6
  22. data/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee +2 -7
  23. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +36 -26
  24. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +6 -15
  25. data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +1 -1
  26. data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +8 -11
  27. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +4 -1
  28. data/app/assets/javascripts/alchemy/alchemy.image_overlay.coffee +1 -1
  29. data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +5 -14
  30. data/app/assets/javascripts/alchemy/alchemy.preview.js.coffee +54 -75
  31. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +4 -13
  32. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +1 -0
  33. data/app/assets/javascripts/alchemy/alchemy.tinymce.js.coffee +12 -6
  34. data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +0 -158
  35. data/app/assets/stylesheets/alchemy/_defaults.scss +0 -2
  36. data/app/assets/stylesheets/alchemy/_extends.scss +13 -18
  37. data/app/assets/stylesheets/alchemy/_mixins.scss +72 -46
  38. data/app/assets/stylesheets/alchemy/_variables.scss +128 -59
  39. data/app/assets/stylesheets/alchemy/admin.scss +7 -1
  40. data/app/assets/stylesheets/alchemy/archive.scss +23 -27
  41. data/app/assets/stylesheets/alchemy/base.scss +5 -355
  42. data/app/assets/stylesheets/alchemy/buttons.scss +23 -60
  43. data/app/assets/stylesheets/alchemy/clipboard.scss +26 -0
  44. data/app/assets/stylesheets/alchemy/dashboard.scss +7 -40
  45. data/app/assets/stylesheets/alchemy/dialogs.scss +23 -36
  46. data/app/assets/stylesheets/alchemy/elements.scss +80 -156
  47. data/app/assets/stylesheets/alchemy/errors.scss +2 -2
  48. data/app/assets/stylesheets/alchemy/flash.scss +19 -10
  49. data/app/assets/stylesheets/alchemy/fonts.scss +13 -0
  50. data/app/assets/stylesheets/alchemy/forms.scss +6 -1
  51. data/app/assets/stylesheets/alchemy/frame.scss +24 -65
  52. data/app/assets/stylesheets/alchemy/hints.scss +2 -2
  53. data/app/assets/stylesheets/alchemy/icons.scss +3 -337
  54. data/app/assets/stylesheets/alchemy/image_library.scss +9 -10
  55. data/app/assets/stylesheets/alchemy/jquery-ui.scss +21 -839
  56. data/app/assets/stylesheets/alchemy/jquery.datetimepicker.scss +32 -57
  57. data/app/assets/stylesheets/alchemy/lists.scss +4 -8
  58. data/app/assets/stylesheets/alchemy/menubar.scss +26 -29
  59. data/app/assets/stylesheets/alchemy/navigation.scss +23 -25
  60. data/app/assets/stylesheets/alchemy/notices.scss +25 -25
  61. data/app/assets/stylesheets/alchemy/pagination.scss +12 -7
  62. data/app/assets/stylesheets/alchemy/preview_window.scss +20 -0
  63. data/app/assets/stylesheets/alchemy/resource_info.scss +1 -1
  64. data/app/assets/stylesheets/alchemy/search.scss +19 -15
  65. data/app/assets/stylesheets/alchemy/selects.scss +63 -32
  66. data/app/assets/stylesheets/alchemy/sitemap.scss +70 -148
  67. data/app/assets/stylesheets/alchemy/tables.scss +16 -59
  68. data/app/assets/stylesheets/alchemy/toolbar.scss +9 -36
  69. data/app/assets/stylesheets/alchemy/trash.scss +8 -0
  70. data/app/assets/stylesheets/alchemy/upload.scss +5 -6
  71. data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +1 -0
  72. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +78 -43
  73. data/app/controllers/alchemy/admin/attachments_controller.rb +6 -6
  74. data/app/controllers/alchemy/admin/base_controller.rb +9 -9
  75. data/app/controllers/alchemy/admin/contents_controller.rb +0 -17
  76. data/app/controllers/alchemy/admin/elements_controller.rb +1 -4
  77. data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -3
  78. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +1 -3
  79. data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
  80. data/app/controllers/alchemy/admin/pictures_controller.rb +5 -5
  81. data/app/controllers/alchemy/admin/resources_controller.rb +10 -10
  82. data/app/controllers/alchemy/admin/tags_controller.rb +7 -7
  83. data/app/controllers/alchemy/api/contents_controller.rb +6 -1
  84. data/app/controllers/alchemy/api/elements_controller.rb +5 -1
  85. data/app/controllers/alchemy/api/pages_controller.rb +6 -1
  86. data/app/controllers/alchemy/base_controller.rb +5 -3
  87. data/app/controllers/alchemy/pages_controller.rb +1 -1
  88. data/app/helpers/alchemy/admin/base_helper.rb +14 -15
  89. data/app/helpers/alchemy/admin/contents_helper.rb +1 -2
  90. data/app/helpers/alchemy/admin/elements_helper.rb +7 -6
  91. data/app/helpers/alchemy/admin/tags_helper.rb +3 -4
  92. data/app/helpers/alchemy/base_helper.rb +35 -5
  93. data/app/helpers/alchemy/elements_helper.rb +2 -2
  94. data/app/helpers/alchemy/pages_helper.rb +4 -2
  95. data/app/models/alchemy/attachment.rb +14 -23
  96. data/app/models/alchemy/base_record.rb +13 -0
  97. data/app/models/alchemy/cell.rb +1 -1
  98. data/app/models/alchemy/content.rb +1 -2
  99. data/app/models/alchemy/content/factory.rb +1 -1
  100. data/app/models/alchemy/element.rb +10 -12
  101. data/app/models/alchemy/essence_boolean.rb +1 -1
  102. data/app/models/alchemy/essence_date.rb +2 -2
  103. data/app/models/alchemy/essence_file.rb +1 -1
  104. data/app/models/alchemy/essence_html.rb +1 -1
  105. data/app/models/alchemy/essence_link.rb +1 -1
  106. data/app/models/alchemy/essence_picture.rb +1 -1
  107. data/app/models/alchemy/essence_richtext.rb +1 -1
  108. data/app/models/alchemy/essence_select.rb +1 -1
  109. data/app/models/alchemy/essence_text.rb +1 -1
  110. data/app/models/alchemy/folded_page.rb +1 -1
  111. data/app/models/alchemy/language.rb +21 -5
  112. data/app/models/alchemy/page.rb +17 -5
  113. data/app/models/alchemy/page/page_elements.rb +14 -2
  114. data/app/models/alchemy/page/page_naming.rb +17 -4
  115. data/app/models/alchemy/picture.rb +4 -7
  116. data/app/models/alchemy/site.rb +3 -3
  117. data/app/models/alchemy/tag.rb +3 -3
  118. data/app/models/concerns/alchemy/content_touching.rb +23 -0
  119. data/app/serializers/alchemy/element_serializer.rb +2 -0
  120. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +1 -1
  121. data/app/views/alchemy/admin/attachments/_attachment.html.erb +11 -21
  122. data/app/views/alchemy/admin/attachments/_files_list.html.erb +26 -29
  123. data/app/views/alchemy/admin/attachments/_filter_bar.html.erb +2 -3
  124. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +3 -4
  125. data/app/views/alchemy/admin/attachments/_replace_button.html.erb +2 -3
  126. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +3 -3
  127. data/app/views/alchemy/admin/attachments/destroy.js.erb +1 -1
  128. data/app/views/alchemy/admin/attachments/edit.html.erb +2 -2
  129. data/app/views/alchemy/admin/attachments/index.html.erb +3 -2
  130. data/app/views/alchemy/admin/attachments/show.html.erb +7 -8
  131. data/app/views/alchemy/admin/clipboard/clear.js.erb +1 -1
  132. data/app/views/alchemy/admin/clipboard/index.html.erb +23 -7
  133. data/app/views/alchemy/admin/clipboard/insert.js.erb +1 -1
  134. data/app/views/alchemy/admin/clipboard/remove.js.erb +2 -2
  135. data/app/views/alchemy/admin/contents/create.js.erb +1 -1
  136. data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +9 -6
  137. data/app/views/alchemy/admin/dashboard/_recent_pages.html.erb +6 -4
  138. data/app/views/alchemy/admin/dashboard/_sites.html.erb +4 -2
  139. data/app/views/alchemy/admin/dashboard/_users.html.erb +6 -4
  140. data/app/views/alchemy/admin/dashboard/index.html.erb +3 -3
  141. data/app/views/alchemy/admin/dashboard/info.html.erb +6 -7
  142. data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
  143. data/app/views/alchemy/admin/elements/_element.html.erb +1 -1
  144. data/app/views/alchemy/admin/elements/_element_header.html.erb +14 -14
  145. data/app/views/alchemy/admin/elements/_element_toolbar.html.erb +3 -3
  146. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +2 -3
  147. data/app/views/alchemy/admin/elements/index.html.erb +2 -4
  148. data/app/views/alchemy/admin/elements/new.html.erb +1 -2
  149. data/app/views/alchemy/admin/elements/publish.js.erb +5 -5
  150. data/app/views/alchemy/admin/languages/_language.html.erb +4 -9
  151. data/app/views/alchemy/admin/languages/_table.html.erb +1 -1
  152. data/app/views/alchemy/admin/languages/index.html.erb +1 -1
  153. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +5 -5
  154. data/app/views/alchemy/admin/layoutpages/index.html.erb +5 -4
  155. data/app/views/alchemy/admin/leave.html.erb +1 -1
  156. data/app/views/alchemy/admin/legacy_page_urls/_legacy_page_url.html.erb +1 -1
  157. data/app/views/alchemy/admin/legacy_page_urls/_new.html.erb +1 -1
  158. data/app/views/alchemy/admin/pages/_form.html.erb +1 -1
  159. data/app/views/alchemy/admin/pages/_locked_page.html.erb +1 -1
  160. data/app/views/alchemy/admin/pages/_page.html.erb +31 -23
  161. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +5 -5
  162. data/app/views/alchemy/admin/pages/_page_infos.html.erb +3 -3
  163. data/app/views/alchemy/admin/pages/_publication_fields.html.erb +1 -1
  164. data/app/views/alchemy/admin/pages/edit.html.erb +22 -21
  165. data/app/views/alchemy/admin/pages/index.html.erb +5 -21
  166. data/app/views/alchemy/admin/pages/info.html.erb +5 -5
  167. data/app/views/alchemy/admin/pages/sort.html.erb +1 -1
  168. data/app/views/alchemy/admin/pages/unlock.js.erb +2 -4
  169. data/app/views/alchemy/admin/partials/_flash.html.erb +1 -1
  170. data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +6 -2
  171. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
  172. data/app/views/alchemy/admin/partials/_search_form.html.erb +3 -3
  173. data/app/views/alchemy/admin/pictures/_archive.html.erb +19 -17
  174. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -1
  175. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +13 -13
  176. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +2 -3
  177. data/app/views/alchemy/admin/pictures/_form.html.erb +3 -3
  178. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +2 -3
  179. data/app/views/alchemy/admin/pictures/_picture.html.erb +7 -7
  180. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +3 -3
  181. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +6 -7
  182. data/app/views/alchemy/admin/pictures/index.html.erb +12 -12
  183. data/app/views/alchemy/admin/pictures/index.js.erb +0 -1
  184. data/app/views/alchemy/admin/pictures/show.html.erb +9 -9
  185. data/app/views/alchemy/admin/resources/_filter_bar.html.erb +2 -3
  186. data/app/views/alchemy/admin/resources/_form.html.erb +10 -2
  187. data/app/views/alchemy/admin/resources/_resource.html.erb +9 -14
  188. data/app/views/alchemy/admin/resources/_table.html.erb +1 -1
  189. data/app/views/alchemy/admin/resources/_tag_list.html.erb +4 -4
  190. data/app/views/alchemy/admin/resources/index.html.erb +2 -3
  191. data/app/views/alchemy/admin/sites/index.html.erb +1 -1
  192. data/app/views/alchemy/admin/tags/_tag.html.erb +7 -11
  193. data/app/views/alchemy/admin/tags/index.html.erb +4 -4
  194. data/app/views/alchemy/admin/trash/index.html.erb +2 -3
  195. data/app/views/alchemy/admin/uploader/_button.html.erb +1 -2
  196. data/app/views/alchemy/base/500.html.erb +1 -1
  197. data/app/views/alchemy/base/permission_denied.js.erb +1 -1
  198. data/app/views/alchemy/base/redirect.js.erb +1 -2
  199. data/app/views/alchemy/elements/_editor_not_found.html.erb +2 -3
  200. data/app/views/alchemy/essences/_essence_date_editor.html.erb +1 -1
  201. data/app/views/alchemy/essences/_essence_file_editor.html.erb +7 -11
  202. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +9 -7
  203. data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +1 -1
  204. data/app/views/alchemy/pages/_meta_data.html.erb +1 -1
  205. data/app/views/kaminari/alchemy/_first_page.html.erb +7 -3
  206. data/app/views/kaminari/alchemy/_gap.html.erb +1 -1
  207. data/app/views/kaminari/alchemy/_last_page.html.erb +7 -3
  208. data/app/views/kaminari/alchemy/_next_page.html.erb +4 -2
  209. data/app/views/kaminari/alchemy/_page.html.erb +1 -1
  210. data/app/views/kaminari/alchemy/_prev_page.html.erb +4 -2
  211. data/app/views/layouts/alchemy/admin.html.erb +8 -6
  212. data/bin/rails +2 -2
  213. data/bin/rspec +1 -1
  214. data/config/alchemy/config.yml +0 -2
  215. data/config/alchemy/modules.yml +5 -5
  216. data/config/initializers/simple_form.rb +45 -8
  217. data/config/locales/alchemy.en.yml +66 -179
  218. data/config/routes.rb +1 -1
  219. data/db/migrate/20180226123013_alchemy_four_point_zero.rb +392 -0
  220. data/db/migrate/20180227224537_migrate_tags_to_gutentag.rb +41 -0
  221. data/lib/alchemy/config.rb +0 -2
  222. data/lib/alchemy/engine.rb +5 -9
  223. data/lib/alchemy/essence.rb +6 -6
  224. data/lib/alchemy/filetypes.rb +13 -1
  225. data/lib/alchemy/forms/builder.rb +5 -3
  226. data/lib/alchemy/i18n.rb +8 -6
  227. data/lib/alchemy/modules.rb +1 -1
  228. data/lib/alchemy/name_conversions.rb +0 -2
  229. data/lib/alchemy/page_layout.rb +3 -2
  230. data/lib/alchemy/paths.rb +5 -5
  231. data/lib/alchemy/resource.rb +9 -9
  232. data/lib/alchemy/resources_helper.rb +11 -15
  233. data/lib/alchemy/routing_constraints.rb +2 -2
  234. data/lib/alchemy/shell.rb +0 -1
  235. data/lib/alchemy/taggable.rb +40 -0
  236. data/lib/alchemy/tasks/tidy.rb +1 -9
  237. data/lib/alchemy/test_support/factories/content_factory.rb +10 -0
  238. data/lib/alchemy/test_support/factories/element_factory.rb +5 -0
  239. data/lib/alchemy/test_support/shared_contexts.rb +1 -1
  240. data/lib/alchemy/tinymce.rb +2 -2
  241. data/lib/alchemy/upgrader/four_point_one.rb +42 -0
  242. data/lib/alchemy/upgrader/tasks/harden_acts_as_taggable_on_migrations.rb +27 -0
  243. data/lib/alchemy/version.rb +1 -1
  244. data/lib/alchemy_cms.rb +2 -3
  245. data/lib/rails/generators/alchemy/elements/elements_generator.rb +2 -2
  246. data/lib/rails/generators/alchemy/essence/essence_generator.rb +1 -1
  247. data/lib/rails/generators/alchemy/install/install_generator.rb +4 -8
  248. data/lib/rails/generators/alchemy/module/module_generator.rb +1 -1
  249. data/lib/rails/generators/alchemy/page_layouts/page_layouts_generator.rb +2 -2
  250. data/lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb +2 -2
  251. data/lib/rails/generators/alchemy/views/views_generator.rb +1 -1
  252. data/lib/tasks/alchemy/db.rake +2 -1
  253. data/lib/tasks/alchemy/tidy.rake +0 -6
  254. data/lib/tasks/alchemy/upgrade.rake +11 -144
  255. data/vendor/assets/fonts/fa-regular-400.eot +0 -0
  256. data/vendor/assets/fonts/fa-regular-400.svg +363 -0
  257. data/vendor/assets/fonts/fa-regular-400.ttf +0 -0
  258. data/vendor/assets/fonts/fa-regular-400.woff +0 -0
  259. data/vendor/assets/fonts/fa-regular-400.woff2 +0 -0
  260. data/vendor/assets/fonts/fa-solid-900.eot +0 -0
  261. data/vendor/assets/fonts/fa-solid-900.svg +1413 -0
  262. data/vendor/assets/fonts/fa-solid-900.ttf +0 -0
  263. data/vendor/assets/fonts/fa-solid-900.woff +0 -0
  264. data/vendor/assets/fonts/fa-solid-900.woff2 +0 -0
  265. data/vendor/assets/javascripts/tinymce/license.txt +6 -6
  266. data/vendor/assets/javascripts/tinymce/tinymce.min.js +2 -15
  267. data/vendor/assets/stylesheets/fontawesome/_animated.scss +20 -0
  268. data/vendor/assets/stylesheets/fontawesome/_bordered-pulled.scss +20 -0
  269. data/vendor/assets/stylesheets/fontawesome/_core.scss +16 -0
  270. data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +6 -0
  271. data/vendor/assets/stylesheets/fontawesome/_icons.scss +792 -0
  272. data/vendor/assets/stylesheets/fontawesome/_larger.scss +23 -0
  273. data/vendor/assets/stylesheets/fontawesome/_list.scss +18 -0
  274. data/vendor/assets/stylesheets/fontawesome/_mixins.scss +57 -0
  275. data/vendor/assets/stylesheets/fontawesome/_rotated-flipped.scss +23 -0
  276. data/vendor/assets/stylesheets/fontawesome/_screen-reader.scss +5 -0
  277. data/vendor/assets/stylesheets/fontawesome/_stacked.scss +31 -0
  278. data/vendor/assets/stylesheets/fontawesome/_variables.scss +805 -0
  279. data/vendor/assets/stylesheets/fontawesome/fa-regular.scss +22 -0
  280. data/vendor/assets/stylesheets/fontawesome/fa-solid.scss +23 -0
  281. data/vendor/assets/stylesheets/fontawesome/fontawesome.scss +16 -0
  282. metadata +77 -112
  283. data/app/assets/fonts/alchemy/icons.eot +0 -0
  284. data/app/assets/fonts/alchemy/icons.svg +0 -33
  285. data/app/assets/fonts/alchemy/icons.ttf +0 -0
  286. data/app/assets/fonts/alchemy/icons.woff +0 -0
  287. data/app/assets/images/alchemy/icons.png +0 -0
  288. data/app/assets/images/alchemy/ui-icons_666666_256x240.png +0 -0
  289. data/app/assets/images/sassy-ie-overlay.png +0 -0
  290. data/app/assets/javascripts/alchemy/alchemy.jquery_loader.js +0 -42
  291. data/app/assets/stylesheets/alchemy/icon-font.scss +0 -75
  292. data/app/assets/stylesheets/alchemy/modules.scss +0 -27
  293. data/app/models/alchemy.rb +0 -7
  294. data/app/views/alchemy/admin/contents/destroy.js.erb +0 -4
  295. data/app/views/alchemy/admin/pictures/flush.js.erb +0 -2
  296. data/config/locales/alchemy.de.yml +0 -932
  297. data/config/locales/alchemy.es.yml +0 -960
  298. data/config/locales/alchemy.fr.yml +0 -938
  299. data/config/locales/alchemy.it.yml +0 -938
  300. data/config/locales/alchemy.nl.yml +0 -918
  301. data/config/locales/alchemy.ru.yml +0 -830
  302. data/config/locales/simple_form.de.yml +0 -26
  303. data/config/locales/simple_form.en.yml +0 -25
  304. data/config/locales/simple_form.es.yml +0 -6
  305. data/config/locales/simple_form.fr.yml +0 -26
  306. data/config/locales/simple_form.it.yml +0 -25
  307. data/config/locales/simple_form.nl.yml +0 -25
  308. data/config/locales/simple_form.ru.yml +0 -25
  309. data/db/migrate/20130827094554_alchemy_two_point_six.rb +0 -378
  310. data/db/migrate/20130828121054_remove_do_not_index_from_alchemy_essence_texts.rb +0 -5
  311. data/db/migrate/20130828121120_remove_do_not_index_from_alchemy_essence_richtexts.rb +0 -5
  312. data/db/migrate/20130918201742_add_published_at_to_alchemy_pages.rb +0 -5
  313. data/db/migrate/20150608204610_add_parent_element_id_to_alchemy_elements.rb +0 -6
  314. data/db/migrate/20150729151825_add_link_text_to_alchemy_essence_files.rb +0 -5
  315. data/db/migrate/20150906195818_add_locale_to_alchemy_languages.rb +0 -7
  316. data/db/migrate/20160108174834_add_timebased_publishing_columns_to_pages.rb +0 -32
  317. data/db/migrate/20160422195310_add_image_file_format_to_alchemy_pictures.rb +0 -9
  318. data/db/migrate/20160617224938_change_alchemy_pages_locked_to_locked_at.rb +0 -22
  319. data/db/migrate/20160912223112_add_index_to_alchemy_pages_rgt.rb +0 -9
  320. data/db/migrate/20160927205604_add_foreign_key_indices_and_null_constraints.rb +0 -20
  321. data/db/migrate/20160928080104_add_foreign_keys.rb +0 -27
  322. data/lib/alchemy/touching.rb +0 -42
  323. data/lib/alchemy/upgrader/tasks/available_contents_upgrader.rb +0 -161
  324. data/lib/alchemy/upgrader/tasks/install_asset_manifests.rb +0 -15
  325. data/lib/alchemy/upgrader/tasks/install_dragonfly_config.rb +0 -14
  326. data/lib/alchemy/upgrader/tasks/nestable_elements_migration.rb +0 -71
  327. data/lib/alchemy/upgrader/tasks/three_point_two_task.rb +0 -31
  328. data/lib/alchemy/upgrader/three_point_five.rb +0 -32
  329. data/lib/alchemy/upgrader/three_point_four.rb +0 -52
  330. data/lib/alchemy/upgrader/three_point_one.rb +0 -54
  331. data/lib/alchemy/upgrader/three_point_three.rb +0 -50
  332. data/lib/alchemy/upgrader/three_point_two.rb +0 -40
  333. data/lib/alchemy/upgrader/three_point_zero.rb +0 -92
  334. data/vendor/assets/javascripts/jquery_plugins/jquery.floatThead.min.js +0 -3
  335. data/vendor/assets/javascripts/tinymce/langs/de.js +0 -219
  336. data/vendor/assets/javascripts/tinymce/langs/es.js +0 -219
  337. data/vendor/assets/javascripts/tinymce/langs/fr.js +0 -219
  338. data/vendor/assets/javascripts/tinymce/langs/it.js +0 -219
  339. data/vendor/assets/javascripts/tinymce/langs/nl.js +0 -219
  340. data/vendor/assets/javascripts/tinymce/langs/ru.js +0 -219
@@ -23,8 +23,7 @@ module Alchemy
23
23
  warning("Content #{content.name} is missing its definition")
24
24
 
25
25
  icon = hint_with_tooltip(
26
- Alchemy.t(:content_definition_missing),
27
- class: 'inline warning icon'
26
+ Alchemy.t(:content_definition_missing)
28
27
  )
29
28
 
30
29
  content_name = "#{icon} #{content_name}".html_safe
@@ -82,16 +82,17 @@ module Alchemy
82
82
  options.delete_if { |_c, e| e.blank? }
83
83
  end
84
84
 
85
- def element_array_for_options(e, object_method, cell = nil)
86
- if e.class.name == 'Alchemy::Element'
85
+ def element_array_for_options(element, object_method, cell = nil)
86
+ case element
87
+ when Alchemy::Element
87
88
  [
88
- e.display_name_with_preview_text,
89
- e.send(object_method).to_s + (cell ? "##{cell['name']}" : "")
89
+ element.display_name_with_preview_text,
90
+ element.send(object_method).to_s + (cell ? "##{cell['name']}" : "")
90
91
  ]
91
92
  else
92
93
  [
93
- Element.display_name_for(e['name']),
94
- e[object_method] + (cell ? "##{cell['name']}" : "")
94
+ Element.display_name_for(element['name']),
95
+ element[object_method] + (cell ? "##{cell['name']}" : "")
95
96
  ]
96
97
  end
97
98
  end
@@ -16,14 +16,13 @@ module Alchemy
16
16
  sorted_tags_from(class_name: class_name).map do |tag|
17
17
  content_tag('li', name: tag.name, class: filtered_by_tag?(tag) ? 'active' : nil) do
18
18
  link_to(
19
- "#{tag.name} (#{tag.count})",
19
+ "#{tag.name} (#{tag.taggings_count})",
20
20
  url_for(
21
21
  search_filter_params.except(:page, :tagged_with).merge(
22
22
  tagged_with: tags_for_filter(current: tag).presence
23
23
  )
24
24
  ),
25
- remote: request.xhr?,
26
- class: 'please_wait'
25
+ remote: request.xhr?
27
26
  )
28
27
  end
29
28
  end.join.html_safe
@@ -37,7 +36,7 @@ module Alchemy
37
36
 
38
37
  # Returns the tags from params suitable for the tags filter.
39
38
  #
40
- # @param current [ActsAsTaggableOn::Tag] - The current tag that will be added or removed if already present
39
+ # @param current [Gutentag::Tag] - The current tag that will be added or removed if already present
41
40
  # @returns [String]
42
41
  def tags_for_filter(current:)
43
42
  if filtered_by_tag?(current)
@@ -20,9 +20,24 @@ module Alchemy
20
20
  end
21
21
  end
22
22
 
23
- # Returns an icon
24
- def render_icon(icon_class)
25
- content_tag('span', '', class: "icon #{icon_class}")
23
+ # Render a Fontawesome icon
24
+ #
25
+ # @param icon_class [String] Fontawesome icon name
26
+ # @param size: nil [String] Fontawesome icon size
27
+ # @param transform: nil [String] Fontawesome transform style
28
+ #
29
+ # @return [String]
30
+ def render_icon(icon_class, options = {})
31
+ options = {style: 'solid'}.merge(options)
32
+ classes = [
33
+ "icon fa-fw",
34
+ "fa-#{icon_class}",
35
+ "fa#{options[:style].first}",
36
+ options[:size] ? "fa-#{options[:size]}" : nil,
37
+ options[:transform] ? "fa-#{options[:transform]}" : nil,
38
+ options[:class]
39
+ ].compact
40
+ content_tag('i', nil, class: classes)
26
41
  end
27
42
 
28
43
  # Returns a div with an icon and the passed content
@@ -36,10 +51,11 @@ module Alchemy
36
51
  # <% end %>
37
52
  #
38
53
  def render_message(type = :info, msg = nil, &blk)
54
+ icon_class = message_icon_class(type)
39
55
  if block_given?
40
- content_tag :div, render_icon(type) + capture(&blk), class: "#{type} message"
56
+ content_tag :div, render_icon(icon_class) + capture(&blk), class: "#{type} message"
41
57
  else
42
- content_tag :div, render_icon(type) + msg, class: "#{type} message"
58
+ content_tag :div, render_icon(icon_class) + msg, class: "#{type} message"
43
59
  end
44
60
  end
45
61
 
@@ -66,5 +82,19 @@ module Alchemy
66
82
  page
67
83
  end
68
84
  end
85
+
86
+ # Returns the FontAwesome icon name for given message type
87
+ #
88
+ # @param message_type [String] The message type. One of +warning+, +info+, +notice+, +error+
89
+ # @return [String] The FontAwesome icon name
90
+ def message_icon_class(message_type)
91
+ case message_type.to_s
92
+ when 'warning', 'warn', 'alert' then 'exclamation'
93
+ when 'notice' then 'check'
94
+ when 'error' then 'bug'
95
+ else
96
+ message_type
97
+ end
98
+ end
69
99
  end
70
100
  end
@@ -198,7 +198,7 @@ module Alchemy
198
198
  # Returns a hash containing the HTML tag attributes required for preview mode.
199
199
  def element_preview_code_attributes(element)
200
200
  return {} unless element.present? && @preview_mode && element.page == @page
201
- { :'data-alchemy-element' => element.id }
201
+ { 'data-alchemy-element' => element.id }
202
202
  end
203
203
 
204
204
  # Returns the element's tags information as a string. Parameters and options
@@ -235,7 +235,7 @@ module Alchemy
235
235
  }.merge(options)
236
236
 
237
237
  return {} if !element.taggable? || element.tag_list.blank?
238
- { :'data-element-tags' => options[:formatter].call(element.tag_list) }
238
+ { 'data-element-tags' => options[:formatter].call(element.tag_list) }
239
239
  end
240
240
 
241
241
  # Sort given elements by content.
@@ -69,7 +69,7 @@ module Alchemy
69
69
  render current_alchemy_site
70
70
  rescue ActionView::MissingTemplate
71
71
  warning("Site layout for #{current_alchemy_site.try(:name)} not found. Please run `rails g alchemy:site_layouts`")
72
- return ""
72
+ ""
73
73
  end
74
74
 
75
75
  # Renders the navigation.
@@ -269,6 +269,7 @@ module Alchemy
269
269
  return "" if @page.title.blank?
270
270
  options = {
271
271
  prefix: "",
272
+ suffix: "",
272
273
  separator: ""
273
274
  }.update(options)
274
275
  title_parts = [options[:prefix]]
@@ -277,7 +278,8 @@ module Alchemy
277
278
  else
278
279
  title_parts << response.status
279
280
  end
280
- title_parts.join(options[:separator]).html_safe
281
+ title_parts << options[:suffix]
282
+ title_parts.reject(&:blank?).join(options[:separator]).html_safe
281
283
  end
282
284
 
283
285
  def meta_description
@@ -18,12 +18,11 @@
18
18
  #
19
19
 
20
20
  module Alchemy
21
- class Attachment < ActiveRecord::Base
21
+ class Attachment < BaseRecord
22
22
  include Alchemy::Filetypes
23
23
  include Alchemy::NameConversions
24
- include Alchemy::Touching
25
-
26
- acts_as_taggable
24
+ include Alchemy::Taggable
25
+ include Alchemy::ContentTouching
27
26
 
28
27
  dragonfly_accessor :file, app: :alchemy_attachments do
29
28
  after_assign { |f| write_attribute(:file_mime_type, f.mime_type) }
@@ -64,8 +63,6 @@ module Alchemy
64
63
 
65
64
  before_save :set_name, if: :file_name_changed?
66
65
 
67
- after_update :touch_contents
68
-
69
66
  scope :with_file_type, ->(file_type) { where(file_mime_type: file_type) }
70
67
 
71
68
  # Instance methods
@@ -98,30 +95,24 @@ module Alchemy
98
95
  #
99
96
  def icon_css_class
100
97
  case file_mime_type
101
- when "application/x-shockwave-flash"
102
- then "flash"
103
- when "image/x-psd"
104
- then "psd"
105
- when "text/plain"
106
- then "text"
107
- when "application/rtf"
108
- then "rtf"
109
98
  when "application/pdf"
110
- then "pdf"
99
+ then "file-pdf"
111
100
  when "application/msword"
112
- then "word"
113
- when "application/vnd.ms-excel"
114
- then "excel"
101
+ then "file-word"
102
+ when *TEXT_FILE_TYPES
103
+ then "file-alt"
104
+ when *EXCEL_FILE_TYPES
105
+ then "file-excel"
115
106
  when *VCARD_FILE_TYPES
116
- then "vcard"
107
+ then "address-card"
117
108
  when *ARCHIVE_FILE_TYPES
118
- then "archive"
109
+ then "file-archive"
119
110
  when *AUDIO_FILE_TYPES
120
- then "audio"
111
+ then "file-audio"
121
112
  when *IMAGE_FILE_TYPES
122
- then "image"
113
+ then "file-image"
123
114
  when *VIDEO_FILE_TYPES
124
- then "video"
115
+ then "file-video"
125
116
  else
126
117
  "file"
127
118
  end
@@ -0,0 +1,13 @@
1
+ module Alchemy
2
+ def self.table_name_prefix
3
+ 'alchemy_'
4
+ end
5
+
6
+ class BaseRecord < ActiveRecord::Base
7
+ self.abstract_class = true
8
+
9
+ def active_record_5_1?
10
+ ActiveRecord.gem_version >= Gem::Version.new('5.1.0')
11
+ end
12
+ end
13
+ end
@@ -24,7 +24,7 @@
24
24
  # Views for cells are inside the +app/views/cells+ folder in your project.
25
25
  #
26
26
  module Alchemy
27
- class Cell < ActiveRecord::Base
27
+ class Cell < BaseRecord
28
28
  include Alchemy::Logger
29
29
 
30
30
  belongs_to :page, required: true
@@ -17,9 +17,8 @@
17
17
  #
18
18
 
19
19
  module Alchemy
20
- class Content < ActiveRecord::Base
20
+ class Content < BaseRecord
21
21
  include Alchemy::Logger
22
- include Alchemy::Touching
23
22
  include Alchemy::Hints
24
23
 
25
24
  # Concerns
@@ -129,7 +129,7 @@ module Alchemy
129
129
  rescue NameError
130
130
  false
131
131
  end
132
- end # end class methods
132
+ end
133
133
 
134
134
  # Instance Methods
135
135
 
@@ -21,9 +21,9 @@
21
21
  #
22
22
 
23
23
  module Alchemy
24
- class Element < ActiveRecord::Base
24
+ class Element < BaseRecord
25
25
  include Alchemy::Logger
26
- include Alchemy::Touching
26
+ include Alchemy::Taggable
27
27
  include Alchemy::Hints
28
28
 
29
29
  FORBIDDEN_DEFINITION_ATTRIBUTES = [
@@ -46,8 +46,6 @@ module Alchemy
46
46
  "updater_id"
47
47
  ].freeze
48
48
 
49
- acts_as_taggable
50
-
51
49
  # All Elements that share the same page id, cell id and parent element id are considered a list.
52
50
  #
53
51
  # If cell id and parent element id are nil (typical case for a simple page),
@@ -71,8 +69,8 @@ module Alchemy
71
69
  foreign_key: :parent_element_id,
72
70
  dependent: :destroy
73
71
 
74
- belongs_to :cell, required: false
75
- belongs_to :page, required: true
72
+ belongs_to :cell, required: false, touch: true
73
+ belongs_to :page, required: true, touch: true
76
74
 
77
75
  # A nested element belongs to a parent element.
78
76
  belongs_to :parent_element,
@@ -90,8 +88,7 @@ module Alchemy
90
88
  attr_accessor :create_contents_after_create
91
89
 
92
90
  after_create :create_contents, unless: proc { |e| e.create_contents_after_create == false }
93
- after_update :touch_pages
94
- after_update :touch_cell, unless: -> { cell.nil? }
91
+ after_update :touch_touchable_pages
95
92
 
96
93
  scope :trashed, -> { where(position: nil).order('updated_at DESC') }
97
94
  scope :not_trashed, -> { where(Element.arel_table[:position].not_eq(nil)) }
@@ -105,6 +102,7 @@ module Alchemy
105
102
  scope :from_current_site, -> { where(Language.table_name => {site_id: Site.current || Site.default}).joins(page: 'language') }
106
103
  scope :folded, -> { where(folded: true) }
107
104
  scope :expanded, -> { where(folded: false) }
105
+ scope :not_nested, -> { where(parent_element_id: nil) }
108
106
 
109
107
  delegate :restricted?, to: :page, allow_nil: true
110
108
 
@@ -327,13 +325,13 @@ module Alchemy
327
325
  available_page_cells(page).collect(&:name).uniq
328
326
  end
329
327
 
330
- # If element has a +cell+ associated,
331
- # it updates it's timestamp.
328
+ # Updates all +touchable_pages+
332
329
  #
333
330
  # Called after_update
334
331
  #
335
- def touch_cell
336
- cell.touch
332
+ def touch_touchable_pages
333
+ return unless respond_to?(:touchable_pages)
334
+ touchable_pages.each(&:touch)
337
335
  end
338
336
  end
339
337
  end
@@ -15,7 +15,7 @@
15
15
  # Stores boolean values.
16
16
  # Provides a checkbox in the editor views.
17
17
  module Alchemy
18
- class EssenceBoolean < ActiveRecord::Base
18
+ class EssenceBoolean < BaseRecord
19
19
  acts_as_essence ingredient_column: 'value'
20
20
  end
21
21
  end
@@ -13,13 +13,13 @@
13
13
  #
14
14
 
15
15
  module Alchemy
16
- class EssenceDate < ActiveRecord::Base
16
+ class EssenceDate < BaseRecord
17
17
  acts_as_essence ingredient_column: 'date'
18
18
 
19
19
  # Returns self.date for the Element#preview_text method.
20
20
  def preview_text(_maxlength = nil)
21
21
  return "" if date.blank?
22
- ::I18n.l(date, format: :date)
22
+ ::I18n.l(date, format: :'alchemy.essence_date')
23
23
  end
24
24
  end
25
25
  end
@@ -16,7 +16,7 @@
16
16
  #
17
17
 
18
18
  module Alchemy
19
- class EssenceFile < ActiveRecord::Base
19
+ class EssenceFile < BaseRecord
20
20
  belongs_to :attachment, required: false
21
21
  acts_as_essence ingredient_column: 'attachment'
22
22
 
@@ -13,7 +13,7 @@
13
13
  #
14
14
 
15
15
  module Alchemy
16
- class EssenceHtml < ActiveRecord::Base
16
+ class EssenceHtml < BaseRecord
17
17
  acts_as_essence ingredient_column: 'source'
18
18
 
19
19
  # Returns the first x (default = 30) (HTML escaped) characters from self.source for the Element#preview_text method.
@@ -16,7 +16,7 @@
16
16
  #
17
17
 
18
18
  module Alchemy
19
- class EssenceLink < ActiveRecord::Base
19
+ class EssenceLink < BaseRecord
20
20
  acts_as_essence ingredient_column: 'link'
21
21
  end
22
22
  end
@@ -24,7 +24,7 @@
24
24
  #
25
25
 
26
26
  module Alchemy
27
- class EssencePicture < ActiveRecord::Base
27
+ class EssencePicture < BaseRecord
28
28
  acts_as_essence ingredient_column: 'picture'
29
29
 
30
30
  belongs_to :picture, required: false
@@ -15,7 +15,7 @@
15
15
  #
16
16
 
17
17
  module Alchemy
18
- class EssenceRichtext < ActiveRecord::Base
18
+ class EssenceRichtext < BaseRecord
19
19
  acts_as_essence preview_text_column: 'stripped_body'
20
20
 
21
21
  before_save :strip_content
@@ -14,7 +14,7 @@
14
14
 
15
15
  # Provides a select box that stores string values.
16
16
  module Alchemy
17
- class EssenceSelect < ActiveRecord::Base
17
+ class EssenceSelect < BaseRecord
18
18
  acts_as_essence ingredient_column: 'value'
19
19
  end
20
20
  end
@@ -18,7 +18,7 @@
18
18
  #
19
19
 
20
20
  module Alchemy
21
- class EssenceText < ActiveRecord::Base
21
+ class EssenceText < BaseRecord
22
22
  acts_as_essence
23
23
  end
24
24
  end
@@ -11,7 +11,7 @@
11
11
  #
12
12
 
13
13
  module Alchemy
14
- class FoldedPage < ActiveRecord::Base
14
+ class FoldedPage < BaseRecord
15
15
  belongs_to :page, required: true
16
16
  belongs_to :user, required: true,
17
17
  class_name: Alchemy.user_class_name