forest_cms 0.98.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +204 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/config/forest_manifest.js +2 -0
  6. data/app/assets/fonts/FontAwesome.otf +0 -0
  7. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  8. data/app/assets/fonts/fontawesome-webfont.svg +2671 -0
  9. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  10. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  11. data/app/assets/fonts/fontawesome-webfont.woff2 +0 -0
  12. data/app/assets/images/forest/favicons/android-chrome-192x192.png +0 -0
  13. data/app/assets/images/forest/favicons/android-chrome-512x512.png +0 -0
  14. data/app/assets/images/forest/favicons/apple-touch-icon.png +0 -0
  15. data/app/assets/images/forest/favicons/browserconfig.xml +9 -0
  16. data/app/assets/images/forest/favicons/favicon-16x16.png +0 -0
  17. data/app/assets/images/forest/favicons/favicon-32x32.png +0 -0
  18. data/app/assets/images/forest/favicons/favicon.ico +0 -0
  19. data/app/assets/images/forest/favicons/manifest.json.erb +18 -0
  20. data/app/assets/images/forest/favicons/mstile-150x150.png +0 -0
  21. data/app/assets/images/forest/favicons/safari-pinned-tab.svg +21 -0
  22. data/app/assets/images/forest/forest-low.jpg +0 -0
  23. data/app/assets/images/forest/forest.jpg +0 -0
  24. data/app/assets/javascripts/forest/admin/lib/jquery_plugins.js +32 -0
  25. data/app/assets/javascripts/forest/admin/main.js +59 -0
  26. data/app/assets/javascripts/forest/admin/partials/add_block.js +22 -0
  27. data/app/assets/javascripts/forest/admin/partials/block_collapser.js +49 -0
  28. data/app/assets/javascripts/forest/admin/partials/block_errors.js +11 -0
  29. data/app/assets/javascripts/forest/admin/partials/block_selector_inputs.js +61 -0
  30. data/app/assets/javascripts/forest/admin/partials/cocoon_events.js +3 -0
  31. data/app/assets/javascripts/forest/admin/partials/cocoon_sortable_field_sets.js +55 -0
  32. data/app/assets/javascripts/forest/admin/partials/collage_inputs.js +286 -0
  33. data/app/assets/javascripts/forest/admin/partials/color_inputs.js +24 -0
  34. data/app/assets/javascripts/forest/admin/partials/datepicker_init.js +70 -0
  35. data/app/assets/javascripts/forest/admin/partials/documentation_sidebar_affix.js +22 -0
  36. data/app/assets/javascripts/forest/admin/partials/dropdown_block_selector.js +106 -0
  37. data/app/assets/javascripts/forest/admin/partials/edit_header.js +22 -0
  38. data/app/assets/javascripts/forest/admin/partials/file_upload_init.js +111 -0
  39. data/app/assets/javascripts/forest/admin/partials/forest_tables.js +42 -0
  40. data/app/assets/javascripts/forest/admin/partials/infinite_loader.js +89 -0
  41. data/app/assets/javascripts/forest/admin/partials/markdown_text_editor_init.js +89 -0
  42. data/app/assets/javascripts/forest/admin/partials/media_item_chooser_modal.js.erb +259 -0
  43. data/app/assets/javascripts/forest/admin/partials/menus.js +79 -0
  44. data/app/assets/javascripts/forest/admin/partials/multi_checkbox_selector.js +27 -0
  45. data/app/assets/javascripts/forest/admin/partials/persisted_value_warnings.js +38 -0
  46. data/app/assets/javascripts/forest/admin/partials/repeater_inputs.js +24 -0
  47. data/app/assets/javascripts/forest/admin/partials/select2_init.js +165 -0
  48. data/app/assets/javascripts/forest/admin/partials/select_tag_form_submitter.js +40 -0
  49. data/app/assets/javascripts/forest/admin/partials/sortable_gallery.js +45 -0
  50. data/app/assets/javascripts/forest/admin/partials/sortable_page_block_position_setter.js +37 -0
  51. data/app/assets/javascripts/forest/admin/partials/status_scheduler.js +16 -0
  52. data/app/assets/javascripts/forest/admin/partials/tab_templates.js +93 -0
  53. data/app/assets/javascripts/forest/admin/partials/tables.js +7 -0
  54. data/app/assets/javascripts/forest/admin/partials/tooltips.js +7 -0
  55. data/app/assets/javascripts/forest/admin/partials/turboform_form_submitter.js +15 -0
  56. data/app/assets/javascripts/forest/admin/vendor/imagesloaded.pkgd.min.js +7 -0
  57. data/app/assets/javascripts/forest/admin/vendor/jquery-ui-timepicker-addon.js +2291 -0
  58. data/app/assets/javascripts/forest/admin/vendor/jquery.ba-throttle-debounce.min.js +9 -0
  59. data/app/assets/javascripts/forest/admin/vendor/jquery.nestable.js +756 -0
  60. data/app/assets/javascripts/forest/admin/vendor/select2.full.min.js +3 -0
  61. data/app/assets/javascripts/forest/admin/vendor/simplemde.min.js +15 -0
  62. data/app/assets/javascripts/forest/application_admin.js +29 -0
  63. data/app/assets/javascripts/forest/application_admin_from_host_app.js +1 -0
  64. data/app/assets/javascripts/forest/application_public.js +19 -0
  65. data/app/assets/javascripts/forest/cable.js +13 -0
  66. data/app/assets/javascripts/forest/lib/jquery-3.3.1.min.js +2 -0
  67. data/app/assets/javascripts/forest/main.js +59 -0
  68. data/app/assets/javascripts/forest/public/partials/analytics.js +16 -0
  69. data/app/assets/stylesheets/forest/admin/_bootstrap-variables.scss +877 -0
  70. data/app/assets/stylesheets/forest/admin/_variables.scss +13 -0
  71. data/app/assets/stylesheets/forest/admin/base/_foundation.scss +17 -0
  72. data/app/assets/stylesheets/forest/admin/mixins/_breakpoints.scss +26 -0
  73. data/app/assets/stylesheets/forest/admin/mixins/_glyphicons.scss +278 -0
  74. data/app/assets/stylesheets/forest/admin/mixins/_layout.scss +13 -0
  75. data/app/assets/stylesheets/forest/admin/mixins/_links.scss +10 -0
  76. data/app/assets/stylesheets/forest/admin/mixins/_lists.scss +10 -0
  77. data/app/assets/stylesheets/forest/admin/mixins/_mixins.scss +6 -0
  78. data/app/assets/stylesheets/forest/admin/mixins/_triangles.scss +21 -0
  79. data/app/assets/stylesheets/forest/admin/partials/_admin.scss +57 -0
  80. data/app/assets/stylesheets/forest/admin/partials/_affix.scss +5 -0
  81. data/app/assets/stylesheets/forest/admin/partials/_block_errors.scss +15 -0
  82. data/app/assets/stylesheets/forest/admin/partials/_block_layout.scss +48 -0
  83. data/app/assets/stylesheets/forest/admin/partials/_block_type_edit_ui.scss +15 -0
  84. data/app/assets/stylesheets/forest/admin/partials/_bootstrap_customizations.scss +12 -0
  85. data/app/assets/stylesheets/forest/admin/partials/_collage_inputs.scss +122 -0
  86. data/app/assets/stylesheets/forest/admin/partials/_documentation.scss +7 -0
  87. data/app/assets/stylesheets/forest/admin/partials/_dropdown_block_selector.scss +19 -0
  88. data/app/assets/stylesheets/forest/admin/partials/_edit_header.scss +16 -0
  89. data/app/assets/stylesheets/forest/admin/partials/_file_upload.scss +3 -0
  90. data/app/assets/stylesheets/forest/admin/partials/_forest_tables.scss +20 -0
  91. data/app/assets/stylesheets/forest/admin/partials/_forms_and_inputs.scss +72 -0
  92. data/app/assets/stylesheets/forest/admin/partials/_helper_classes.scss +24 -0
  93. data/app/assets/stylesheets/forest/admin/partials/_infinite_loader.scss +8 -0
  94. data/app/assets/stylesheets/forest/admin/partials/_markdown_editor.scss +12 -0
  95. data/app/assets/stylesheets/forest/admin/partials/_media_item_chooser.scss +168 -0
  96. data/app/assets/stylesheets/forest/admin/partials/_media_library.scss +109 -0
  97. data/app/assets/stylesheets/forest/admin/partials/_pages.scss +6 -0
  98. data/app/assets/stylesheets/forest/admin/partials/_pagination.scss +5 -0
  99. data/app/assets/stylesheets/forest/admin/partials/_repeater_inputs.scss +57 -0
  100. data/app/assets/stylesheets/forest/admin/partials/_resizable_ui.scss +1 -0
  101. data/app/assets/stylesheets/forest/admin/partials/_select2_custom.scss +20 -0
  102. data/app/assets/stylesheets/forest/admin/partials/_sessions.scss +13 -0
  103. data/app/assets/stylesheets/forest/admin/partials/_slug_attributes.scss +9 -0
  104. data/app/assets/stylesheets/forest/admin/partials/_sortable_field_sets.scss +22 -0
  105. data/app/assets/stylesheets/forest/admin/partials/_sortable_select2.scss +18 -0
  106. data/app/assets/stylesheets/forest/admin/partials/_sortable_ui.scss +15 -0
  107. data/app/assets/stylesheets/forest/admin/partials/_status_indicators.scss +33 -0
  108. data/app/assets/stylesheets/forest/admin/partials/_status_scheduler.scss +9 -0
  109. data/app/assets/stylesheets/forest/admin/partials/_tooltips.scss +5 -0
  110. data/app/assets/stylesheets/forest/admin/partials/_turbolinks.scss +5 -0
  111. data/app/assets/stylesheets/forest/admin/partials/_typography.scss +19 -0
  112. data/app/assets/stylesheets/forest/admin/partials/_ui.scss +32 -0
  113. data/app/assets/stylesheets/forest/admin/sprockets/font-awesome.scss +2337 -0
  114. data/app/assets/stylesheets/forest/admin/sprockets/main_bootstrap.scss +3 -0
  115. data/app/assets/stylesheets/forest/admin/vendor/_jquery-ui-timepicker-addon.scss +30 -0
  116. data/app/assets/stylesheets/forest/admin/vendor/_nestable.scss +347 -0
  117. data/app/assets/stylesheets/forest/admin/vendor/_select2_1_core.scss +484 -0
  118. data/app/assets/stylesheets/forest/admin/vendor/_select2_2_bootstrap.scss +612 -0
  119. data/app/assets/stylesheets/forest/admin/vendor/_simplemde.min.scss +7 -0
  120. data/app/assets/stylesheets/forest/admin_overrides.scss +1 -0
  121. data/app/assets/stylesheets/forest/application_admin.css +23 -0
  122. data/app/assets/stylesheets/forest/application_public.css +16 -0
  123. data/app/assets/stylesheets/forest/main_admin.scss +16 -0
  124. data/app/assets/stylesheets/forest/main_public.scss +4 -0
  125. data/app/assets/stylesheets/forest/public/base/_admin_error_messages.scss +15 -0
  126. data/app/assets/stylesheets/forest/public/base/_foundation.scss +24 -0
  127. data/app/assets/stylesheets/forest/public/base/_images.scss +14 -0
  128. data/app/assets/stylesheets/forest/scaffolds.scss +87 -0
  129. data/app/assets/stylesheets/jquery.fileupload.scss +37 -0
  130. data/app/classes/forest/block_set.rb +26 -0
  131. data/app/classes/forest/error.rb +15 -0
  132. data/app/classes/forest/markdown_renderer.rb +31 -0
  133. data/app/classes/search_index_manager.rb +83 -0
  134. data/app/controllers/admin/block_kinds_controller.rb +31 -0
  135. data/app/controllers/admin/block_layouts_controller.rb +47 -0
  136. data/app/controllers/admin/cache_purge_controller.rb +11 -0
  137. data/app/controllers/admin/dashboard_controller.rb +6 -0
  138. data/app/controllers/admin/documentation_controller.rb +5 -0
  139. data/app/controllers/admin/errors_controller.rb +9 -0
  140. data/app/controllers/admin/forest_controller.rb +96 -0
  141. data/app/controllers/admin/imports_controller.rb +34 -0
  142. data/app/controllers/admin/media_items_controller.rb +107 -0
  143. data/app/controllers/admin/menus_controller.rb +69 -0
  144. data/app/controllers/admin/pages_controller.rb +105 -0
  145. data/app/controllers/admin/settings_controller.rb +66 -0
  146. data/app/controllers/admin/translations_controller.rb +58 -0
  147. data/app/controllers/admin/user_groups_controller.rb +69 -0
  148. data/app/controllers/admin/users_controller.rb +88 -0
  149. data/app/controllers/application_controller.rb +2 -0
  150. data/app/controllers/errors_controller.rb +26 -0
  151. data/app/controllers/forest_controller.rb +39 -0
  152. data/app/controllers/media_items_controller.rb +12 -0
  153. data/app/controllers/pages_controller.rb +39 -0
  154. data/app/controllers/public_controller.rb +5 -0
  155. data/app/helpers/admin_helper.rb +95 -0
  156. data/app/helpers/admin_info_helper.rb +12 -0
  157. data/app/helpers/admin_settings_helper.rb +16 -0
  158. data/app/helpers/application_helper.rb +2 -0
  159. data/app/helpers/block_helper.rb +25 -0
  160. data/app/helpers/cache_helper.rb +23 -0
  161. data/app/helpers/forest_errors_helper.rb +34 -0
  162. data/app/helpers/form_helper.rb +93 -0
  163. data/app/helpers/image_helper.rb +65 -0
  164. data/app/helpers/markdown_helper.rb +25 -0
  165. data/app/helpers/meta_helper.rb +238 -0
  166. data/app/helpers/navigation_helper.rb +18 -0
  167. data/app/helpers/status_indicator_helper.rb +7 -0
  168. data/app/inputs/block_selector_input.rb +16 -0
  169. data/app/inputs/collage_input.rb +63 -0
  170. data/app/inputs/color_input.rb +30 -0
  171. data/app/inputs/currency_input.rb +22 -0
  172. data/app/inputs/datepicker_input.rb +19 -0
  173. data/app/inputs/gallery_input.rb +67 -0
  174. data/app/inputs/grouped_collection_select_input.rb +19 -0
  175. data/app/inputs/image_input.rb +82 -0
  176. data/app/inputs/repeater_input.rb +58 -0
  177. data/app/jobs/forest/application_job.rb +4 -0
  178. data/app/mailers/forest/application_mailer.rb +6 -0
  179. data/app/models/application_record.rb +13 -0
  180. data/app/models/block_kind.rb +54 -0
  181. data/app/models/block_layout.rb +19 -0
  182. data/app/models/block_slot.rb +49 -0
  183. data/app/models/blocks/base_block.rb +134 -0
  184. data/app/models/cache_record.rb +2 -0
  185. data/app/models/concerns/attachable.rb +126 -0
  186. data/app/models/concerns/blockable.rb +65 -0
  187. data/app/models/concerns/filter_controller_scopes.rb +13 -0
  188. data/app/models/concerns/forest/cache_buster.rb +112 -0
  189. data/app/models/concerns/searchable.rb +200 -0
  190. data/app/models/concerns/sluggable.rb +70 -0
  191. data/app/models/concerns/statusable.rb +71 -0
  192. data/app/models/concerns/versionable.rb +13 -0
  193. data/app/models/forest/application_record.rb +111 -0
  194. data/app/models/import.rb +43 -0
  195. data/app/models/media_item.rb +136 -0
  196. data/app/models/menu.rb +65 -0
  197. data/app/models/page.rb +154 -0
  198. data/app/models/setting.rb +142 -0
  199. data/app/models/translation.rb +97 -0
  200. data/app/models/user.rb +45 -0
  201. data/app/models/user_group.rb +17 -0
  202. data/app/policies/application_policy.rb +71 -0
  203. data/app/policies/block_kind_policy.rb +2 -0
  204. data/app/policies/block_layout_policy.rb +2 -0
  205. data/app/policies/block_record_policy.rb +13 -0
  206. data/app/policies/dashboard_policy.rb +19 -0
  207. data/app/policies/media_item_policy.rb +5 -0
  208. data/app/policies/menu_policy.rb +2 -0
  209. data/app/policies/page_policy.rb +9 -0
  210. data/app/policies/setting_policy.rb +2 -0
  211. data/app/policies/translation_policy.rb +2 -0
  212. data/app/policies/user_group_policy.rb +2 -0
  213. data/app/policies/user_policy.rb +17 -0
  214. data/app/views/admin/_file_upload.html.erb +75 -0
  215. data/app/views/admin/_flash_notifications.html.erb +20 -0
  216. data/app/views/admin/_navigation.html.erb +61 -0
  217. data/app/views/admin/api/index/_header.json.jbuilder +2 -0
  218. data/app/views/admin/api/index/_records.json.jbuilder +6 -0
  219. data/app/views/admin/block_kinds/_form.html.erb +34 -0
  220. data/app/views/admin/block_kinds/edit.html.erb +3 -0
  221. data/app/views/admin/block_kinds/index.html.erb +31 -0
  222. data/app/views/admin/block_layouts/_form.html.erb +33 -0
  223. data/app/views/admin/block_layouts/edit.html.erb +3 -0
  224. data/app/views/admin/block_layouts/index.html.erb +29 -0
  225. data/app/views/admin/block_layouts/new.html.erb +3 -0
  226. data/app/views/admin/block_layouts/show.html.erb +24 -0
  227. data/app/views/admin/block_record/_block_layout.html.erb +67 -0
  228. data/app/views/admin/block_record/_block_slot_field_buttons.html.erb +15 -0
  229. data/app/views/admin/block_record/_block_slot_fields.html.erb +37 -0
  230. data/app/views/admin/block_record/_block_slot_fields_template.html.erb +50 -0
  231. data/app/views/admin/dashboard/_panel.html.erb +30 -0
  232. data/app/views/admin/dashboard/index.html.erb +18 -0
  233. data/app/views/admin/documentation/_body.html.erb +9 -0
  234. data/app/views/admin/documentation/_sidebar.html.erb +17 -0
  235. data/app/views/admin/documentation/index.html.erb +87 -0
  236. data/app/views/admin/form_inputs/_slug.html.erb +11 -0
  237. data/app/views/admin/form_inputs/_status.html.erb +20 -0
  238. data/app/views/admin/form_inputs/collage/_media_item_fields.html.erb +41 -0
  239. data/app/views/admin/headers/_edit.html.erb +68 -0
  240. data/app/views/admin/headers/_index.html.erb +61 -0
  241. data/app/views/admin/headers/_new.html.erb +14 -0
  242. data/app/views/admin/headers/_show.html.erb +37 -0
  243. data/app/views/admin/imports/edit.html.erb +60 -0
  244. data/app/views/admin/media_items/_form.html.erb +54 -0
  245. data/app/views/admin/media_items/_media_item_grid_layout.html.erb +23 -0
  246. data/app/views/admin/media_items/_media_item_list_layout.html.erb +32 -0
  247. data/app/views/admin/media_items/_modal.html.erb +62 -0
  248. data/app/views/admin/media_items/edit.html.erb +3 -0
  249. data/app/views/admin/media_items/index.html.erb +58 -0
  250. data/app/views/admin/media_items/index.json.jbuilder +2 -0
  251. data/app/views/admin/media_items/new.html.erb +3 -0
  252. data/app/views/admin/menus/_form.html.erb +92 -0
  253. data/app/views/admin/menus/_list_item.html.erb +39 -0
  254. data/app/views/admin/menus/edit.html.erb +3 -0
  255. data/app/views/admin/menus/index.html.erb +29 -0
  256. data/app/views/admin/menus/new.html.erb +3 -0
  257. data/app/views/admin/menus/show.html.erb +3 -0
  258. data/app/views/admin/navigation/_resources_dropdown.html.erb +12 -0
  259. data/app/views/admin/pages/_additional_inputs.html.erb +1 -0
  260. data/app/views/admin/pages/_form.html.erb +52 -0
  261. data/app/views/admin/pages/_table_row.html.erb +14 -0
  262. data/app/views/admin/pages/edit.html.erb +3 -0
  263. data/app/views/admin/pages/index.html.erb +33 -0
  264. data/app/views/admin/pages/index.json.jbuilder +2 -0
  265. data/app/views/admin/pages/new.html.erb +3 -0
  266. data/app/views/admin/pages/show.html.erb +3 -0
  267. data/app/views/admin/settings/_form.html.erb +25 -0
  268. data/app/views/admin/settings/edit.html.erb +3 -0
  269. data/app/views/admin/settings/index.html.erb +38 -0
  270. data/app/views/admin/settings/new.html.erb +3 -0
  271. data/app/views/admin/settings/show.html.erb +19 -0
  272. data/app/views/admin/settings/types/_boolean.html.erb +1 -0
  273. data/app/views/admin/settings/types/_image.html.erb +10 -0
  274. data/app/views/admin/settings/types/_integer.html.erb +5 -0
  275. data/app/views/admin/settings/types/_string.html.erb +5 -0
  276. data/app/views/admin/settings/types/_text.html.erb +5 -0
  277. data/app/views/admin/shared/_admin_head_additions.html.erb +1 -0
  278. data/app/views/admin/shared/navigation/_navbar.html.erb +8 -0
  279. data/app/views/admin/translations/_form.html.erb +31 -0
  280. data/app/views/admin/translations/edit.html.erb +3 -0
  281. data/app/views/admin/translations/index.html.erb +41 -0
  282. data/app/views/admin/translations/new.html.erb +3 -0
  283. data/app/views/admin/translations/show.html.erb +19 -0
  284. data/app/views/admin/user_groups/_form.html.erb +11 -0
  285. data/app/views/admin/user_groups/edit.html.erb +3 -0
  286. data/app/views/admin/user_groups/index.html.erb +29 -0
  287. data/app/views/admin/user_groups/new.html.erb +3 -0
  288. data/app/views/admin/user_groups/show.html.erb +9 -0
  289. data/app/views/admin/users/_form.html.erb +41 -0
  290. data/app/views/admin/users/edit.html.erb +3 -0
  291. data/app/views/admin/users/index.html.erb +35 -0
  292. data/app/views/admin/users/new.html.erb +3 -0
  293. data/app/views/admin/users/show.html.erb +4 -0
  294. data/app/views/blocks/_show.html.erb +21 -0
  295. data/app/views/devise/confirmations/new.html.erb +28 -0
  296. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  297. data/app/views/devise/mailer/password_change.html.erb +3 -0
  298. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  299. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  300. data/app/views/devise/passwords/edit.html.erb +31 -0
  301. data/app/views/devise/passwords/new.html.erb +27 -0
  302. data/app/views/devise/registrations/edit.html.erb +39 -0
  303. data/app/views/devise/registrations/new.html.erb +1 -0
  304. data/app/views/devise/sessions/_default_login.html.erb +25 -0
  305. data/app/views/devise/sessions/_first_time_login.html.erb +22 -0
  306. data/app/views/devise/sessions/new.html.erb +12 -0
  307. data/app/views/devise/shared/_flash_notifications.html.erb +3 -0
  308. data/app/views/devise/shared/_links.html.erb +25 -0
  309. data/app/views/devise/unlocks/new.html.erb +28 -0
  310. data/app/views/errors/internal_server_error.html.erb +2 -0
  311. data/app/views/errors/internal_server_error.json.jbuilder +4 -0
  312. data/app/views/errors/not_found.html.erb +2 -0
  313. data/app/views/errors/not_found.json.jbuilder +4 -0
  314. data/app/views/errors/unprocessable.html.erb +2 -0
  315. data/app/views/errors/unprocessable.json.jbuilder +4 -0
  316. data/app/views/forest/_analytics.html.erb +10 -0
  317. data/app/views/forest/_favicons.html.erb +7 -0
  318. data/app/views/kaminari/_first_page.html.erb +11 -0
  319. data/app/views/kaminari/_gap.html.erb +8 -0
  320. data/app/views/kaminari/_last_page.html.erb +11 -0
  321. data/app/views/kaminari/_next_page.html.erb +11 -0
  322. data/app/views/kaminari/_page.html.erb +12 -0
  323. data/app/views/kaminari/_paginator.html.erb +25 -0
  324. data/app/views/kaminari/_prev_page.html.erb +11 -0
  325. data/app/views/layouts/_shared_head.html.erb +48 -0
  326. data/app/views/layouts/admin.html.erb +19 -0
  327. data/app/views/layouts/application.html.erb +15 -0
  328. data/app/views/layouts/devise.html.erb +12 -0
  329. data/app/views/layouts/mailer.html.erb +13 -0
  330. data/app/views/layouts/mailer.text.erb +1 -0
  331. data/app/views/media_items/show.html.erb +29 -0
  332. data/app/views/pages/show.html.erb +1 -0
  333. data/app/views/public/index.html.erb +2 -0
  334. data/app/views/shared/_footer.html.erb +9 -0
  335. data/app/views/shared/_header.html.erb +9 -0
  336. data/app/views/shared/_header_colophon.html.erb +7 -0
  337. data/app/views/shared/_menu.html.erb +5 -0
  338. data/app/views/shared/_menu_item.html.erb +30 -0
  339. data/app/views/shared/_subnav.html.erb +7 -0
  340. data/config/initializers/aws.rb +17 -0
  341. data/config/initializers/devise.rb +275 -0
  342. data/config/initializers/forest.rb +5 -0
  343. data/config/initializers/paperclip.rb +1 -0
  344. data/config/initializers/rails_extensions.rb +6 -0
  345. data/config/initializers/simple_form.rb +164 -0
  346. data/config/initializers/simple_form/markdown.rb +21 -0
  347. data/config/initializers/simple_form/remote.rb +38 -0
  348. data/config/initializers/simple_form/sortable.rb +28 -0
  349. data/config/initializers/simple_form_bootstrap.rb +155 -0
  350. data/config/locales/devise.en.yml +62 -0
  351. data/config/locales/en.yml +24 -0
  352. data/config/locales/simple_form.en.yml +31 -0
  353. data/config/routes.rb +61 -0
  354. data/db/migrate/20161217191000_devise_create_users.rb +48 -0
  355. data/db/migrate/20161217200300_create_pages.rb +21 -0
  356. data/db/migrate/20161217205353_create_menus.rb +12 -0
  357. data/db/migrate/20161219033747_create_settings.rb +14 -0
  358. data/db/migrate/20161219231741_create_media_items.rb +18 -0
  359. data/db/migrate/20161225212203_create_user_groups.rb +10 -0
  360. data/db/migrate/20161225212258_create_join_table_user_groups_users.rb +8 -0
  361. data/db/migrate/20170109175932_create_block_kinds.rb +14 -0
  362. data/db/migrate/20170109180818_create_block_slots.rb +17 -0
  363. data/db/migrate/20170109185414_create_base_blocks.rb +8 -0
  364. data/db/migrate/20170818025124_create_block_layouts.rb +13 -0
  365. data/db/migrate/20170818025229_add_block_layout_to_block_slots.rb +5 -0
  366. data/db/migrate/20170818025500_remove_layout_from_block_slots.rb +5 -0
  367. data/db/migrate/20170821161755_add_unique_index_to_block_layouts.rb +6 -0
  368. data/db/migrate/20170826173346_create_translations.rb +12 -0
  369. data/db/migrate/20170910204934_index_attachment_content_type_on_media_items.rb +5 -0
  370. data/db/migrate/20180206035546_create_cache_records.rb +14 -0
  371. data/db/migrate/20180415034427_add_redirect_to_pages.rb +5 -0
  372. data/db/migrate/20180618190248_add_index_created_at_to_media_items.rb +5 -0
  373. data/db/migrate/20180625172226_add_blockable_metadata_to_pages.rb +6 -0
  374. data/db/migrate/20180626182949_remove_attachable_from_media_items.rb +7 -0
  375. data/db/migrate/20180712162414_add_media_item_status_to_media_items.rb +6 -0
  376. data/db/migrate/20190223155013_add_type_to_block_kinds.rb +6 -0
  377. data/db/migrate/20190423173909_add_seo_title_to_pages.rb +5 -0
  378. data/lib/forest.rb +9 -0
  379. data/lib/forest/engine.rb +51 -0
  380. data/lib/forest/migrations.rb +86 -0
  381. data/lib/forest/rails/active_record/has_many_ordered.rb +30 -0
  382. data/lib/forest/rails/active_record/has_repeatable.rb +19 -0
  383. data/lib/forest/rails/core_ext/enumerable.rb +17 -0
  384. data/lib/forest/version.rb +3 -0
  385. data/lib/generators/forest/block/USAGE +8 -0
  386. data/lib/generators/forest/block/block_generator.rb +103 -0
  387. data/lib/generators/forest/block/templates/_block.html.erb +2 -0
  388. data/lib/generators/forest/block/templates/_block.scss.erb +5 -0
  389. data/lib/generators/forest/block/templates/_block_edit_fields.html.erb +21 -0
  390. data/lib/generators/forest/block/templates/create_table_migration.rb +31 -0
  391. data/lib/generators/forest/block/templates/model.rb +41 -0
  392. data/lib/generators/forest/install/USAGE +2 -0
  393. data/lib/generators/forest/install/install_generator.rb +72 -0
  394. data/lib/generators/forest/scaffold/USAGE +8 -0
  395. data/lib/generators/forest/scaffold/scaffold_generator.rb +133 -0
  396. data/lib/generators/forest/scaffold/templates/admin_controller.rb +67 -0
  397. data/lib/generators/forest/scaffold/templates/controller.rb +20 -0
  398. data/lib/generators/forest/scaffold/templates/create_table_migration.rb +35 -0
  399. data/lib/generators/forest/scaffold/templates/model.rb +21 -0
  400. data/lib/generators/forest/scaffold/templates/policy.rb +2 -0
  401. data/lib/generators/forest/scaffold/templates/views/admin/_form.html.erb +56 -0
  402. data/lib/generators/forest/scaffold/templates/views/admin/edit.html.erb +3 -0
  403. data/lib/generators/forest/scaffold/templates/views/admin/index.html.erb +58 -0
  404. data/lib/generators/forest/scaffold/templates/views/admin/index.json.jbuilder +2 -0
  405. data/lib/generators/forest/scaffold/templates/views/admin/new.html.erb +3 -0
  406. data/lib/generators/forest/scaffold/templates/views/admin/show.html.erb +12 -0
  407. data/lib/generators/forest/scaffold/templates/views/public/index.html.erb +1 -0
  408. data/lib/generators/forest/scaffold/templates/views/public/show.html.erb +17 -0
  409. data/lib/tasks/forest_db_tasks.rake +176 -0
  410. data/lib/tasks/forest_elasticsearch_tasks.rake +22 -0
  411. metadata +719 -0
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,29 @@
1
+ <%= link_to @media_item.attachment.url do %>
2
+ <%# TODO: handle non-image file types %>
3
+ <%= responsive_image @media_item %>
4
+ <% end %>
5
+
6
+ <p>
7
+ <strong>Title:</strong>
8
+ <%= @media_item.title %>
9
+ </p>
10
+
11
+ <p>
12
+ <strong>Slug:</strong>
13
+ <%= @media_item.slug %>
14
+ </p>
15
+
16
+ <p>
17
+ <strong>Caption:</strong>
18
+ <%= @media_item.caption %>
19
+ </p>
20
+
21
+ <p>
22
+ <strong>Alternative text:</strong>
23
+ <%= @media_item.alternative_text %>
24
+ </p>
25
+
26
+ <p>
27
+ <strong>Description:</strong>
28
+ <%= @media_item.description %>
29
+ </p>
@@ -0,0 +1 @@
1
+ <%= render_blocks @page %>
@@ -0,0 +1,2 @@
1
+ <h1>Public#index</h1>
2
+ <p>Find me in app/views/public/index.html.erb</p>
@@ -0,0 +1,9 @@
1
+ <hr>
2
+
3
+ <h4>Footer</h4>
4
+ <p>Find me in /app/views/shared/_footer.html.erb</p>
5
+
6
+ <% if Menu.for('footer-menu').present? %>
7
+ <strong><%= Menu.for('footer-menu').title %></strong>
8
+ <%= render 'shared/menu', menu: Menu.for('footer-menu') %>
9
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <h4>Header</h4>
2
+ <p>Find me in /app/views/shared/_header.html.erb</p>
3
+
4
+ <% if Menu.for('main-menu').present? %>
5
+ <strong><%= Menu.for('main-menu').title %></strong>
6
+ <%= render 'shared/menu', menu: Menu.for('main-menu') %>
7
+ <% end %>
8
+
9
+ <hr>
@@ -0,0 +1,7 @@
1
+ <!--
2
+ 🌲 This application is made with Forest, a Ruby on Rails CMS
3
+ https://github.com/dylanfisher/forest
4
+
5
+ Want to work on a project together? Get in touch at
6
+ http://dylanfisher.com/
7
+ -->
@@ -0,0 +1,5 @@
1
+ <% if menu.present? %>
2
+ <%= content_tag :ul, class: "menu menu--#{menu.slug}" do -%>
3
+ <%= render partial: 'shared/menu_item', collection: menu.structure_as_json, as: 'item' -%>
4
+ <% end -%>
5
+ <% end %>
@@ -0,0 +1,30 @@
1
+ <%# TODO: refactor this logic to exist in a MenuItem class -%>
2
+ <% item_name = item['name'] %>
3
+ <% if item['url'].present? %>
4
+ <% item_url = item['url'] %>
5
+ <% else %>
6
+ <% item_url = '' %>
7
+ <% end %>
8
+ <% classes = ['menu__item'] %>
9
+ <% classes.push 'menu__item--with-children' if item['children'].present? %>
10
+ <% classes.push "menu__item--#{item_name.parameterize}" if item_name %>
11
+ <% classes.push 'menu__item--active' if item_url.sub(/^\//, '') == request.path.sub(/^\//, '') %>
12
+ <% classes.push 'menu__item--active' if item_url == '/' && request.path == '' %>
13
+ <% classes.push 'menu__item--active-child' if item_url.sub(/^\//, '') == request.path.split('/').reject(&:blank?).first %>
14
+ <%= content_tag :li, class: classes.join(' ') do -%>
15
+ <% if item_url.present? %>
16
+ <% link = item_url %>
17
+ <% else %>
18
+ <% link = nil %>
19
+ <% end %>
20
+ <% if link.present? %>
21
+ <%= link_to md(item_name), link, class: 'menu__item__link' -%>
22
+ <% else %>
23
+ <%= content_tag :span, md(item_name), class: 'menu__item__link menu__item__link--no-link' -%>
24
+ <% end %>
25
+ <% if item['children'].present? %>
26
+ <%= content_tag :ul, class: "menu__sub-menu" do -%>
27
+ <%= render partial: 'shared/menu_item', collection: item['children'], as: 'item' -%>
28
+ <% end %>
29
+ <% end %>
30
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <ul class="subnav">
2
+ <% items.each do |item| %>
3
+ <%= content_tag :li, class: "subnav__item subnav__item--#{item.slug}" do %>
4
+ <%= link_to md(item.title), page_path(item.to_friendly_param), class: "subnav__item__link subnav__item__link--#{item.slug}" %>
5
+ <% end %>
6
+ <% end %>
7
+ </ul>
@@ -0,0 +1,17 @@
1
+ aws_access_key_id = ENV['AWS_ACCESS_KEY_ID'].presence || Rails.application.credentials&.dig(:aws, :aws_access_key_id)
2
+ aws_secret_key_id = ENV['AWS_SECRET_KEY_ID'].presence || Rails.application.credentials&.dig(:aws, :aws_secret_key_id)
3
+ s3_bucket_name = ENV['S3_BUCKET_NAME'].presence || Rails.application.credentials&.dig(:aws, :s3_bucket_name)
4
+ aws_region = ENV['AWS_REGION'].presence || Rails.application.credentials&.dig(:aws, :aws_region)
5
+
6
+ if aws_access_key_id.present? &&
7
+ aws_secret_key_id.present? &&
8
+ s3_bucket_name.present? &&
9
+ aws_region.present?
10
+
11
+ Aws.config.update({
12
+ region: aws_region,
13
+ credentials: Aws::Credentials.new(aws_access_key_id, aws_secret_key_id),
14
+ })
15
+
16
+ S3_BUCKET = Aws::S3::Resource.new.bucket(s3_bucket_name)
17
+ end
@@ -0,0 +1,275 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # Devise will use the `secret_key_base` as its `secret_key`
8
+ # by default. You can change it below and use your own secret key.
9
+ # config.secret_key = 'c243e7d563444a28e727cdab0f01f103a9e9cad1ba699f6788a3544655075cc9d5def261d7f1d4d6dac1d75e7427f081820bec99d433629225f1d5f049258a4b'
10
+
11
+ # ==> Mailer Configuration
12
+ # Configure the e-mail address which will be shown in Devise::Mailer,
13
+ # note that it will be overwritten if you use your own mailer class
14
+ # with default "from" parameter.
15
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
16
+
17
+ # Configure the class responsible to send e-mails.
18
+ # config.mailer = 'Devise::Mailer'
19
+
20
+ # Configure the parent class responsible to send e-mails.
21
+ # config.parent_mailer = 'ActionMailer::Base'
22
+
23
+ # ==> ORM configuration
24
+ # Load and configure the ORM. Supports :active_record (default) and
25
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
26
+ # available as additional gems.
27
+ require 'devise/orm/active_record'
28
+
29
+ # ==> Configuration for any authentication mechanism
30
+ # Configure which keys are used when authenticating a user. The default is
31
+ # just :email. You can configure it to use [:username, :subdomain], so for
32
+ # authenticating a user, both parameters are required. Remember that those
33
+ # parameters are used only when authenticating and not when retrieving from
34
+ # session. If you need permissions, you should implement that in a before filter.
35
+ # You can also supply a hash where the value is a boolean determining whether
36
+ # or not authentication should be aborted when the value is not present.
37
+ # config.authentication_keys = [:email]
38
+
39
+ # Configure parameters from the request object used for authentication. Each entry
40
+ # given should be a request method and it will automatically be passed to the
41
+ # find_for_authentication method and considered in your model lookup. For instance,
42
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
43
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
44
+ # config.request_keys = []
45
+
46
+ # Configure which authentication keys should be case-insensitive.
47
+ # These keys will be downcased upon creating or modifying a user and when used
48
+ # to authenticate or find a user. Default is :email.
49
+ config.case_insensitive_keys = [:email]
50
+
51
+ # Configure which authentication keys should have whitespace stripped.
52
+ # These keys will have whitespace before and after removed upon creating or
53
+ # modifying a user and when used to authenticate or find a user. Default is :email.
54
+ config.strip_whitespace_keys = [:email]
55
+
56
+ # Tell if authentication through request.params is enabled. True by default.
57
+ # It can be set to an array that will enable params authentication only for the
58
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
59
+ # enable it only for database (email + password) authentication.
60
+ # config.params_authenticatable = true
61
+
62
+ # Tell if authentication through HTTP Auth is enabled. False by default.
63
+ # It can be set to an array that will enable http authentication only for the
64
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
65
+ # enable it only for database authentication. The supported strategies are:
66
+ # :database = Support basic authentication with authentication key + password
67
+ # config.http_authenticatable = false
68
+
69
+ # If 401 status code should be returned for AJAX requests. True by default.
70
+ # config.http_authenticatable_on_xhr = true
71
+
72
+ # The realm used in Http Basic Authentication. 'Application' by default.
73
+ # config.http_authentication_realm = 'Application'
74
+
75
+ # It will change confirmation, password recovery and other workflows
76
+ # to behave the same regardless if the e-mail provided was right or wrong.
77
+ # Does not affect registerable.
78
+ # config.paranoid = true
79
+
80
+ # By default Devise will store the user in session. You can skip storage for
81
+ # particular strategies by setting this option.
82
+ # Notice that if you are skipping storage for all authentication paths, you
83
+ # may want to disable generating routes to Devise's sessions controller by
84
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
85
+ config.skip_session_storage = [:http_auth]
86
+
87
+ # By default, Devise cleans up the CSRF token on authentication to
88
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
89
+ # requests for sign in and sign up, you need to get a new CSRF token
90
+ # from the server. You can disable this option at your own risk.
91
+ # config.clean_up_csrf_token_on_authentication = true
92
+
93
+ # When false, Devise will not attempt to reload routes on eager load.
94
+ # This can reduce the time taken to boot the app but if your application
95
+ # requires the Devise mappings to be loaded during boot time the application
96
+ # won't boot properly.
97
+ # config.reload_routes = true
98
+
99
+ # ==> Configuration for :database_authenticatable
100
+ # For bcrypt, this is the cost for hashing the password and defaults to 11. If
101
+ # using other algorithms, it sets how many times you want the password to be hashed.
102
+ #
103
+ # Limiting the stretches to just one in testing will increase the performance of
104
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
105
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
106
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
107
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
108
+ config.stretches = Rails.env.test? ? 1 : 11
109
+
110
+ # Set up a pepper to generate the hashed password.
111
+ # config.pepper = 'fba61035d011026566ec6cfb43f9502b20b8e2986db9deccdeb14620ce1903e85f19f6aa87423b92d1ddbdfb7764b380df386f7d8a2fc1e3db55f2b23dc65f42'
112
+
113
+ # Send a notification email when the user's password is changed
114
+ # config.send_password_change_notification = false
115
+
116
+ # ==> Configuration for :confirmable
117
+ # A period that the user is allowed to access the website even without
118
+ # confirming their account. For instance, if set to 2.days, the user will be
119
+ # able to access the website for two days without confirming their account,
120
+ # access will be blocked just in the third day. Default is 0.days, meaning
121
+ # the user cannot access the website without confirming their account.
122
+ # config.allow_unconfirmed_access_for = 2.days
123
+
124
+ # A period that the user is allowed to confirm their account before their
125
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
126
+ # their account within 3 days after the mail was sent, but on the fourth day
127
+ # their account can't be confirmed with the token any more.
128
+ # Default is nil, meaning there is no restriction on how long a user can take
129
+ # before confirming their account.
130
+ # config.confirm_within = 3.days
131
+
132
+ # If true, requires any email changes to be confirmed (exactly the same way as
133
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
134
+ # db field (see migrations). Until confirmed, new email is stored in
135
+ # unconfirmed_email column, and copied to email column on successful confirmation.
136
+ config.reconfirmable = true
137
+
138
+ # Defines which key will be used when confirming an account
139
+ # config.confirmation_keys = [:email]
140
+
141
+ # ==> Configuration for :rememberable
142
+ # The time the user will be remembered without asking for credentials again.
143
+ # config.remember_for = 2.weeks
144
+
145
+ # Invalidates all the remember me tokens when the user signs out.
146
+ config.expire_all_remember_me_on_sign_out = true
147
+
148
+ # If true, extends the user's remember period when remembered via cookie.
149
+ # config.extend_remember_period = false
150
+
151
+ # Options to be passed to the created cookie. For instance, you can set
152
+ # secure: true in order to force SSL only cookies.
153
+ # config.rememberable_options = {}
154
+
155
+ # ==> Configuration for :validatable
156
+ # Range for password length.
157
+ config.password_length = 6..128
158
+
159
+ # Email regex used to validate email formats. It simply asserts that
160
+ # one (and only one) @ exists in the given string. This is mainly
161
+ # to give user feedback and not to assert the e-mail validity.
162
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
163
+
164
+ # ==> Configuration for :timeoutable
165
+ # The time you want to timeout the user session without activity. After this
166
+ # time the user will be asked for credentials again. Default is 30 minutes.
167
+ # config.timeout_in = 30.minutes
168
+
169
+ # ==> Configuration for :lockable
170
+ # Defines which strategy will be used to lock an account.
171
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
172
+ # :none = No lock strategy. You should handle locking by yourself.
173
+ # config.lock_strategy = :failed_attempts
174
+
175
+ # Defines which key will be used when locking and unlocking an account
176
+ # config.unlock_keys = [:email]
177
+
178
+ # Defines which strategy will be used to unlock an account.
179
+ # :email = Sends an unlock link to the user email
180
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
181
+ # :both = Enables both strategies
182
+ # :none = No unlock strategy. You should handle unlocking by yourself.
183
+ # config.unlock_strategy = :both
184
+
185
+ # Number of authentication tries before locking an account if lock_strategy
186
+ # is failed attempts.
187
+ # config.maximum_attempts = 20
188
+
189
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
190
+ # config.unlock_in = 1.hour
191
+
192
+ # Warn on the last attempt before the account is locked.
193
+ # config.last_attempt_warning = true
194
+
195
+ # ==> Configuration for :recoverable
196
+ #
197
+ # Defines which key will be used when recovering the password for an account
198
+ # config.reset_password_keys = [:email]
199
+
200
+ # Time interval you can reset your password with a reset password key.
201
+ # Don't put a too small interval or your users won't have the time to
202
+ # change their passwords.
203
+ config.reset_password_within = 6.hours
204
+
205
+ # When set to false, does not sign a user in automatically after their password is
206
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
207
+ # config.sign_in_after_reset_password = true
208
+
209
+ # ==> Configuration for :encryptable
210
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
211
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
212
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
213
+ # for default behavior) and :restful_authentication_sha1 (then you should set
214
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
215
+ #
216
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
217
+ # config.encryptor = :sha512
218
+
219
+ # ==> Scopes configuration
220
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
221
+ # "users/sessions/new". It's turned off by default because it's slower if you
222
+ # are using only default views.
223
+ # config.scoped_views = false
224
+
225
+ # Configure the default scope given to Warden. By default it's the first
226
+ # devise role declared in your routes (usually :user).
227
+ # config.default_scope = :user
228
+
229
+ # Set this configuration to false if you want /users/sign_out to sign out
230
+ # only the current scope. By default, Devise signs out all scopes.
231
+ # config.sign_out_all_scopes = true
232
+
233
+ # ==> Navigation configuration
234
+ # Lists the formats that should be treated as navigational. Formats like
235
+ # :html, should redirect to the sign in page when the user does not have
236
+ # access, but formats like :xml or :json, should return 401.
237
+ #
238
+ # If you have any extra navigational formats, like :iphone or :mobile, you
239
+ # should add them to the navigational formats lists.
240
+ #
241
+ # The "*/*" below is required to match Internet Explorer requests.
242
+ # config.navigational_formats = ['*/*', :html]
243
+
244
+ # The default HTTP method used to sign out a resource. Default is :delete.
245
+ config.sign_out_via = :delete
246
+
247
+ # ==> OmniAuth
248
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
249
+ # up on your models and hooks.
250
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
251
+
252
+ # ==> Warden configuration
253
+ # If you want to use other strategies, that are not supported by Devise, or
254
+ # change the failure app, you can configure them inside the config.warden block.
255
+ #
256
+ # config.warden do |manager|
257
+ # manager.intercept_401 = false
258
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
259
+ # end
260
+
261
+ # ==> Mountable engine configurations
262
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
263
+ # is mountable, there are some extra configurations to be taken into account.
264
+ # The following options are available, assuming the engine is mounted as:
265
+ #
266
+ # mount MyEngine, at: '/my_engine'
267
+ #
268
+ # The router that invoked `devise_for`, in the example above, would be:
269
+ # config.router_name = :forest
270
+ config.parent_controller = 'ForestController'
271
+
272
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
273
+ # so you need to do it manually. For the users scope, it would be:
274
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
275
+ end
@@ -0,0 +1,5 @@
1
+ MediaItem.expire_cache!
2
+ Menu.expire_cache!
3
+ Setting.expire_cache!
4
+ Setting.expire_application_cache_key!
5
+ Translation.expire_cache!
@@ -0,0 +1 @@
1
+ Paperclip::Attachment.default_options[:use_timestamp] = false
@@ -0,0 +1,6 @@
1
+ # ActiveRecord
2
+ require 'forest/rails/active_record/has_many_ordered'
3
+ require 'forest/rails/active_record/has_repeatable'
4
+
5
+ # Enumerable
6
+ require 'forest/rails/core_ext/enumerable'
@@ -0,0 +1,164 @@
1
+ # Use this setup block to configure all options available in SimpleForm.
2
+ SimpleForm.setup do |config|
3
+ # Wrappers are used by the form builder to generate a
4
+ # complete input. You can remove any component from the
5
+ # wrapper, change the order or even add your own to the
6
+ # stack. The options given below are used to wrap the
7
+ # whole input.
8
+ config.wrappers :default, class: :input, hint_class: :field_with_hint, error_class: :field_with_errors do |b|
9
+ ## Extensions enabled by default
10
+ # Any of these extensions can be disabled for a
11
+ # given input by passing: `f.input EXTENSION_NAME => false`.
12
+ # You can make any of these extensions optional by
13
+ # renaming `b.use` to `b.optional`.
14
+
15
+ # Determines whether to use HTML5 (:email, :url, ...)
16
+ # and required attributes
17
+ b.use :html5
18
+
19
+ # Calculates placeholders automatically from I18n
20
+ # You can also pass a string as f.input placeholder: "Placeholder"
21
+ b.use :placeholder
22
+
23
+ ## Optional extensions
24
+ # They are disabled unless you pass `f.input EXTENSION_NAME => true`
25
+ # to the input. If so, they will retrieve the values from the model
26
+ # if any exists. If you want to enable any of those
27
+ # extensions by default, you can change `b.optional` to `b.use`.
28
+
29
+ # Calculates maxlength from length validations for string inputs
30
+ b.optional :maxlength
31
+
32
+ # Calculates pattern from format validations for string inputs
33
+ b.optional :pattern
34
+
35
+ # Calculates min and max from length validations for numeric inputs
36
+ b.optional :min_max
37
+
38
+ # Calculates readonly automatically from readonly attributes
39
+ b.optional :readonly
40
+
41
+ ## Inputs
42
+ b.use :label_input
43
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
44
+ b.use :error, wrap_with: { tag: :span, class: :error }
45
+
46
+ ## full_messages_for
47
+ # If you want to display the full error message for the attribute, you can
48
+ # use the component :full_error, like:
49
+ #
50
+ # b.use :full_error, wrap_with: { tag: :span, class: :error }
51
+ end
52
+
53
+ # The default wrapper to be used by the FormBuilder.
54
+ config.default_wrapper = :default
55
+
56
+ # Define the way to render check boxes / radio buttons with labels.
57
+ # Defaults to :nested for bootstrap config.
58
+ # inline: input + label
59
+ # nested: label > input
60
+ config.boolean_style = :nested
61
+
62
+ # Default class for buttons
63
+ config.button_class = 'btn'
64
+
65
+ # Method used to tidy up errors. Specify any Rails Array method.
66
+ # :first lists the first message for each field.
67
+ # Use :to_sentence to list all errors for each field.
68
+ # config.error_method = :first
69
+
70
+ # Default tag used for error notification helper.
71
+ config.error_notification_tag = :div
72
+
73
+ # CSS class to add for error notification helper.
74
+ config.error_notification_class = 'error_notification'
75
+
76
+ # ID to add for error notification helper.
77
+ # config.error_notification_id = nil
78
+
79
+ # Series of attempts to detect a default label method for collection.
80
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
81
+
82
+ # Series of attempts to detect a default value method for collection.
83
+ # config.collection_value_methods = [ :id, :to_s ]
84
+
85
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
86
+ # config.collection_wrapper_tag = nil
87
+
88
+ # You can define the class to use on all collection wrappers. Defaulting to none.
89
+ # config.collection_wrapper_class = nil
90
+
91
+ # You can wrap each item in a collection of radio/check boxes with a tag,
92
+ # defaulting to :span.
93
+ # config.item_wrapper_tag = :span
94
+
95
+ # You can define a class to use in all item wrappers. Defaulting to none.
96
+ # config.item_wrapper_class = nil
97
+
98
+ # How the label text should be generated altogether with the required text.
99
+ # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
100
+
101
+ # You can define the class to use on all labels. Default is nil.
102
+ # config.label_class = nil
103
+
104
+ # You can define the default class to be used on forms. Can be overriden
105
+ # with `html: { :class }`. Defaulting to none.
106
+ # config.default_form_class = nil
107
+
108
+ # You can define which elements should obtain additional classes
109
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
110
+
111
+ # Whether attributes are required by default (or not). Default is true.
112
+ # config.required_by_default = true
113
+
114
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
115
+ # These validations are enabled in SimpleForm's internal config but disabled by default
116
+ # in this configuration, which is recommended due to some quirks from different browsers.
117
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
118
+ # change this configuration to true.
119
+ config.browser_validations = false
120
+
121
+ # Collection of methods to detect if a file type was given.
122
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
123
+
124
+ # Custom mappings for input types. This should be a hash containing a regexp
125
+ # to match as key, and the input type that will be used when the field name
126
+ # matches the regexp as value.
127
+ # config.input_mappings = { /count/ => :integer }
128
+
129
+ # Custom wrappers for input types. This should be a hash containing an input
130
+ # type as key and the wrapper that will be used for all inputs with specified type.
131
+ # config.wrapper_mappings = { string: :prepend }
132
+
133
+ # Namespaces where SimpleForm should look for custom input classes that
134
+ # override default inputs.
135
+ # config.custom_inputs_namespaces << "CustomInputs"
136
+
137
+ # Default priority for time_zone inputs.
138
+ # config.time_zone_priority = nil
139
+
140
+ # Default priority for country inputs.
141
+ # config.country_priority = nil
142
+
143
+ # When false, do not use translations for labels.
144
+ # config.translate_labels = true
145
+
146
+ # Automatically discover new inputs in Rails' autoload path.
147
+ # config.inputs_discovery = true
148
+
149
+ # Cache SimpleForm inputs discovery
150
+ # config.cache_discovery = !Rails.env.development?
151
+
152
+ # Default class for inputs
153
+ # config.input_class = nil
154
+
155
+ # Define the default class of the input wrapper of the boolean input.
156
+ config.boolean_label_class = 'checkbox'
157
+
158
+ # Defines if the default input wrapper class should be included in radio
159
+ # collection wrappers.
160
+ # config.include_default_input_wrapper_class = true
161
+
162
+ # Defines which i18n scope will be used in Simple Form.
163
+ # config.i18n_scope = 'simple_form'
164
+ end