gluttonberg-core 2.6.4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (613) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +29 -3
  3. data/Rakefile +32 -15
  4. data/app/assets/images/chosen-sprite-2x.png +0 -0
  5. data/app/assets/images/chosen-sprite.png +0 -0
  6. data/app/assets/images/{library/gb_sort_by_asc.png → gb_sort_by_asc.png} +0 -0
  7. data/app/assets/images/{library/gb_sort_by_desc.png → gb_sort_by_desc.png} +0 -0
  8. data/app/assets/javascripts/chosen-jquery-min.js +2 -0
  9. data/app/assets/javascripts/gb_360player.js +676 -0
  10. data/app/assets/javascripts/gb_application.js +708 -463
  11. data/app/assets/javascripts/gb_html5.js +9 -0
  12. data/app/assets/javascripts/gb_jeditable.js +356 -356
  13. data/app/assets/javascripts/gb_jquery-nestable.js +490 -0
  14. data/app/assets/javascripts/gb_utils.js +1808 -0
  15. data/app/assets/javascripts/gluttonberg.js +26 -0
  16. data/app/assets/javascripts/jcrop/css/gb_jquery-Jcrop.css +163 -31
  17. data/app/assets/javascripts/jcrop/js/jquery-Jcrop-min.js +19 -243
  18. data/app/assets/javascripts/jquery-1-10-1.js +6 -0
  19. data/app/assets/javascripts/jquery-ui-1-10-3.custom-min.js +6 -0
  20. data/app/assets/javascripts/jquery-validate.js +652 -718
  21. data/app/assets/javascripts/rails.js +372 -106
  22. data/app/assets/javascripts/redactormin.js +7348 -0
  23. data/app/assets/stylesheets/chosen.css +430 -0
  24. data/app/assets/stylesheets/gb_360player.css +2 -10
  25. data/app/assets/stylesheets/gb_admin-override.sass +466 -22
  26. data/app/assets/stylesheets/gb_bootstrap.css +7 -1
  27. data/app/assets/stylesheets/gluttonberg.css +17 -0
  28. data/app/assets/stylesheets/redactor.css +864 -0
  29. data/app/assets/stylesheets/user-styles.sass +0 -3
  30. data/app/controllers/gluttonberg/admin/asset_library/assets_ajax_controller.rb +65 -0
  31. data/app/controllers/gluttonberg/admin/asset_library/assets_bulk_controller.rb +47 -0
  32. data/app/controllers/gluttonberg/admin/asset_library/assets_controller.rb +43 -266
  33. data/app/controllers/gluttonberg/admin/asset_library/base_controller.rb +29 -0
  34. data/app/controllers/gluttonberg/admin/asset_library/collections_controller.rb +11 -37
  35. data/app/controllers/gluttonberg/admin/base_controller.rb +117 -178
  36. data/app/controllers/gluttonberg/admin/content/auto_save_controller.rb +63 -0
  37. data/app/controllers/gluttonberg/admin/content/flag_controller.rb +6 -6
  38. data/app/controllers/gluttonberg/admin/content/galleries_controller.rb +29 -37
  39. data/app/controllers/gluttonberg/admin/content/page_localizations_controller.rb +82 -49
  40. data/app/controllers/gluttonberg/admin/content/pages_controller.rb +59 -32
  41. data/app/controllers/gluttonberg/admin/main_controller.rb +77 -7
  42. data/app/controllers/gluttonberg/admin/membership/base_controller.rb +2 -1
  43. data/app/controllers/gluttonberg/admin/membership/groups_controller.rb +27 -33
  44. data/app/controllers/gluttonberg/admin/membership/main_controller.rb +3 -2
  45. data/app/controllers/gluttonberg/admin/membership/members_controller.rb +37 -42
  46. data/app/controllers/gluttonberg/admin/password_resets_controller.rb +16 -28
  47. data/app/controllers/gluttonberg/admin/settings/configurations_controller.rb +101 -0
  48. data/app/controllers/gluttonberg/admin/settings/embeds_controller.rb +79 -0
  49. data/app/controllers/gluttonberg/admin/settings/locales_controller.rb +22 -28
  50. data/app/controllers/gluttonberg/admin/settings/stylesheets_controller.rb +31 -36
  51. data/app/controllers/gluttonberg/admin/settings/users_controller.rb +45 -40
  52. data/app/controllers/gluttonberg/base_controller.rb +95 -0
  53. data/app/controllers/gluttonberg/public/base_controller.rb +104 -157
  54. data/app/controllers/gluttonberg/public/flag_controller.rb +2 -7
  55. data/app/controllers/gluttonberg/public/gallery_controller.rb +1 -0
  56. data/app/controllers/gluttonberg/public/member_password_resets_controller.rb +5 -17
  57. data/app/controllers/gluttonberg/public/members_controller.rb +5 -15
  58. data/app/controllers/gluttonberg/public/pages_controller.rb +25 -14
  59. data/app/controllers/gluttonberg/public/public_assets_controller.rb +4 -2
  60. data/app/helpers/gluttonberg/admin.rb +86 -368
  61. data/app/helpers/gluttonberg/admin/assets.rb +84 -0
  62. data/app/helpers/gluttonberg/admin/form.rb +159 -0
  63. data/app/helpers/gluttonberg/admin/messages.rb +32 -0
  64. data/app/helpers/gluttonberg/admin/versioning.rb +196 -0
  65. data/app/helpers/gluttonberg/application_helper.rb +34 -7
  66. data/app/helpers/gluttonberg/asset_library.rb +29 -254
  67. data/app/helpers/gluttonberg/content_helpers.rb +17 -69
  68. data/app/helpers/gluttonberg/deprecated.rb +24 -0
  69. data/app/helpers/gluttonberg/public.rb +51 -244
  70. data/app/helpers/gluttonberg/public/assets.rb +31 -0
  71. data/app/helpers/gluttonberg/public/cms_stylesheets.rb +35 -0
  72. data/app/helpers/gluttonberg/public/html_truncate.rb +74 -0
  73. data/app/helpers/gluttonberg/public/meta_tags.rb +27 -0
  74. data/app/helpers/gluttonberg/public/nav_tree.rb +99 -0
  75. data/app/helpers/gluttonberg/public/page_info.rb +168 -0
  76. data/app/mailer/gluttonberg/base_notifier.rb +25 -0
  77. data/app/mailer/member_notifier.rb +8 -20
  78. data/app/mailer/notifier.rb +14 -39
  79. data/app/models/ability.rb +48 -34
  80. data/app/models/flag.rb +7 -7
  81. data/app/models/gluttonberg/asset.rb +115 -166
  82. data/app/models/gluttonberg/asset_bulk_import.rb +70 -0
  83. data/app/models/gluttonberg/asset_category.rb +75 -29
  84. data/app/models/gluttonberg/asset_collection.rb +65 -12
  85. data/app/models/gluttonberg/asset_mime_type.rb +5 -0
  86. data/app/models/gluttonberg/asset_thumbnail.rb +6 -1
  87. data/app/models/gluttonberg/asset_type.rb +49 -38
  88. data/app/models/gluttonberg/audio_asset_attribute.rb +7 -3
  89. data/app/models/gluttonberg/authorization.rb +10 -0
  90. data/app/models/gluttonberg/auto_save.rb +32 -0
  91. data/app/models/gluttonberg/collapsed_page.rb +13 -0
  92. data/app/models/gluttonberg/embed.rb +13 -0
  93. data/app/models/gluttonberg/feed.rb +14 -5
  94. data/app/models/gluttonberg/gallery.rb +35 -9
  95. data/app/models/gluttonberg/gallery_image.rb +9 -2
  96. data/app/models/gluttonberg/group.rb +18 -2
  97. data/app/models/gluttonberg/html_content.rb +5 -1
  98. data/app/models/gluttonberg/image_content.rb +5 -1
  99. data/app/models/gluttonberg/locale.rb +28 -9
  100. data/app/models/gluttonberg/member.rb +48 -197
  101. data/app/models/gluttonberg/page.rb +78 -288
  102. data/app/models/gluttonberg/page_localization.rb +63 -66
  103. data/app/models/gluttonberg/plain_text_content.rb +6 -0
  104. data/app/models/gluttonberg/repeater.rb +30 -0
  105. data/app/models/gluttonberg/search.rb +96 -72
  106. data/app/models/gluttonberg/select_content.rb +12 -0
  107. data/app/models/gluttonberg/setting.rb +79 -29
  108. data/app/models/gluttonberg/sitemap.rb +1 -0
  109. data/app/models/gluttonberg/stylesheet.rb +12 -6
  110. data/app/models/gluttonberg/textarea_content.rb +14 -0
  111. data/app/models/gluttonberg/version.rb +9 -0
  112. data/app/models/user.rb +137 -13
  113. data/app/observers/gluttonberg/locale_observer.rb +33 -22
  114. data/app/observers/gluttonberg/page_localization_observer.rb +22 -12
  115. data/app/observers/gluttonberg/page_observer.rb +50 -35
  116. data/app/views/{gluttonberg/public/exceptions → exceptions}/access_denied.html.haml +0 -0
  117. data/app/views/{gluttonberg/public/exceptions → exceptions}/not_found.html.haml +0 -0
  118. data/app/views/gluttonberg/admin/asset_library/assets/_browser_root.html.haml +17 -12
  119. data/app/views/gluttonberg/admin/asset_library/assets/_form.html.haml +5 -7
  120. data/app/views/gluttonberg/admin/asset_library/assets/browser.html.haml +5 -5
  121. data/app/views/gluttonberg/admin/asset_library/assets/show.html.haml +13 -7
  122. data/app/views/gluttonberg/admin/asset_library/assets/show.json.rabl +3 -0
  123. data/app/views/gluttonberg/admin/asset_library/{assets → assets_ajax}/browser_collection.json.haml +0 -0
  124. data/app/views/gluttonberg/admin/asset_library/{assets → assets_bulk}/add_assets_in_bulk.html.haml +6 -20
  125. data/app/views/gluttonberg/admin/asset_library/{assets → assets_bulk}/create_assets_in_bulk.html.haml +0 -0
  126. data/app/views/gluttonberg/admin/asset_library/collections/_form.html.haml +8 -5
  127. data/app/views/gluttonberg/admin/asset_library/shared/_asset_browser.html.haml +34 -0
  128. data/app/views/gluttonberg/admin/asset_library/shared/_asset_panels.html.haml +15 -11
  129. data/app/views/gluttonberg/admin/content/editors/_html_content.html.haml +2 -2
  130. data/app/views/gluttonberg/admin/content/editors/_select_content.html.haml +7 -0
  131. data/app/views/gluttonberg/admin/content/editors/_textarea_content.html.haml +6 -0
  132. data/app/views/gluttonberg/admin/content/flag/index.html.haml +48 -39
  133. data/app/views/gluttonberg/admin/content/galleries/_form.html.haml +46 -9
  134. data/app/views/gluttonberg/admin/content/galleries/_image_repeater.html.haml +30 -0
  135. data/app/views/gluttonberg/admin/content/galleries/edit.html.haml +1 -12
  136. data/app/views/gluttonberg/admin/content/galleries/index.html.haml +18 -9
  137. data/app/views/gluttonberg/admin/content/galleries/new.html.haml +1 -1
  138. data/app/views/gluttonberg/admin/content/main/_sidebar.html.haml +28 -16
  139. data/app/views/gluttonberg/admin/content/page_localizations/_form.html.haml +11 -20
  140. data/app/views/gluttonberg/admin/content/page_localizations/edit.html.haml +7 -0
  141. data/app/views/gluttonberg/admin/content/pages/_form.html.haml +11 -4
  142. data/app/views/gluttonberg/admin/content/pages/_page_settings.html.haml +4 -7
  143. data/app/views/gluttonberg/admin/content/pages/_row.html.haml +38 -30
  144. data/app/views/gluttonberg/admin/content/pages/index.html.haml +23 -15
  145. data/app/views/gluttonberg/admin/content/pages/pages_list_for_tinymce.html.haml +14 -3
  146. data/app/views/gluttonberg/admin/content/pages/show.html.haml +1 -1
  147. data/app/views/gluttonberg/admin/main/index.html.haml +13 -12
  148. data/app/views/gluttonberg/admin/main/waiting_for_approval.html.haml +33 -0
  149. data/app/views/gluttonberg/admin/membership/groups/index.html.haml +5 -5
  150. data/app/views/gluttonberg/admin/membership/members/_form.html.haml +3 -1
  151. data/app/views/gluttonberg/admin/membership/members/edit.html.haml +1 -0
  152. data/app/views/gluttonberg/admin/membership/members/index.html.haml +1 -1
  153. data/app/views/gluttonberg/admin/password_resets/edit.html.haml +36 -16
  154. data/app/views/gluttonberg/admin/password_resets/new.html.haml +19 -11
  155. data/app/views/gluttonberg/admin/settings/configurations/_form.html.haml +28 -0
  156. data/app/views/gluttonberg/admin/settings/configurations/_settings_table.html.haml +42 -0
  157. data/app/views/gluttonberg/admin/settings/{generic_settings → configurations}/_value_tag.html.haml +0 -0
  158. data/app/views/gluttonberg/admin/settings/configurations/edit.html.haml +4 -0
  159. data/app/views/gluttonberg/admin/settings/configurations/index.html.haml +31 -0
  160. data/app/views/gluttonberg/admin/settings/{generic_settings → configurations}/new.html.haml +2 -2
  161. data/app/views/gluttonberg/admin/settings/embeds/_form.html.haml +19 -0
  162. data/app/views/gluttonberg/admin/settings/embeds/edit.html.haml +12 -0
  163. data/app/views/gluttonberg/admin/settings/embeds/index.html.haml +36 -0
  164. data/app/views/gluttonberg/admin/settings/embeds/list_for_redactor.html.haml +29 -0
  165. data/app/views/gluttonberg/admin/settings/embeds/new.html.haml +12 -0
  166. data/app/views/gluttonberg/admin/settings/locales/edit.html.haml +9 -1
  167. data/app/views/gluttonberg/admin/settings/locales/index.html.haml +2 -1
  168. data/app/views/gluttonberg/admin/settings/locales/new.html.haml +10 -1
  169. data/app/views/gluttonberg/admin/settings/main/_sidebar.html.haml +9 -7
  170. data/app/views/gluttonberg/admin/settings/stylesheets/_form.html.haml +11 -9
  171. data/app/views/gluttonberg/admin/settings/stylesheets/edit.html.haml +11 -2
  172. data/app/views/gluttonberg/admin/settings/stylesheets/index.html.haml +45 -36
  173. data/app/views/gluttonberg/admin/settings/stylesheets/new.html.haml +11 -2
  174. data/app/views/gluttonberg/admin/settings/users/_form.html.haml +29 -18
  175. data/app/views/gluttonberg/admin/settings/users/index.html.haml +1 -1
  176. data/app/views/gluttonberg/admin/shared/_asset_panel.html.haml +19 -4
  177. data/app/views/gluttonberg/admin/shared/_auto_save_version.html.haml +12 -0
  178. data/app/views/gluttonberg/admin/shared/_datetime_field.html.haml +19 -0
  179. data/app/views/gluttonberg/admin/shared/_previous_version_warning.html.haml +5 -0
  180. data/app/views/gluttonberg/admin/shared/_version_alerts.html.haml +34 -0
  181. data/app/views/gluttonberg/admin/shared/_version_dashboard_notifications.html.haml +11 -0
  182. data/app/views/gluttonberg/admin/shared/_version_listing.html.haml +23 -0
  183. data/app/views/gluttonberg/admin/shared/delete.html.haml +21 -48
  184. data/app/views/gluttonberg/admin/shared/generic.html.haml +20 -19
  185. data/app/views/gluttonberg/admin/user_sessions/new.html.haml +14 -9
  186. data/app/views/gluttonberg/public/member_password_resets/edit.html.haml +2 -0
  187. data/app/views/gluttonberg/public/member_password_resets/new.html.haml +3 -0
  188. data/app/views/gluttonberg/public/members/_form.html.haml +3 -0
  189. data/app/views/gluttonberg/public/members/edit.html.haml +7 -9
  190. data/app/views/gluttonberg/public/members/show.html.haml +1 -3
  191. data/app/views/gluttonberg/public/pages/restrict_site_access.html.haml +3 -4
  192. data/app/views/gluttonberg/public/shared/_gallery_images_lis.html.haml +9 -0
  193. data/app/views/layouts/_flash_messages.html.haml +5 -3
  194. data/app/views/layouts/bare.html.haml +8 -17
  195. data/app/views/layouts/gluttonberg.html.haml +37 -44
  196. data/app/views/notifier/version_declined.html.haml +21 -0
  197. data/config/locales/en_au.yml +1 -1
  198. data/config/locales/en_gb.yml +2 -1
  199. data/config/routes.rb +70 -85
  200. data/db/migrate/20130801050257_create_repeater.rb +14 -0
  201. data/lib/audio_job.rb +11 -9
  202. data/lib/engine.rb +115 -72
  203. data/lib/generators/gluttonberg/resource/resource_generator.rb +51 -41
  204. data/lib/generators/gluttonberg/resource/templates/admin_controller.rb +16 -11
  205. data/lib/generators/gluttonberg/resource/templates/backend_view_edit.html.haml +7 -2
  206. data/lib/generators/gluttonberg/resource/templates/backend_view_form.html.haml +3 -14
  207. data/lib/generators/gluttonberg/resource/templates/backend_view_import.html.haml +10 -7
  208. data/lib/generators/gluttonberg/resource/templates/backend_view_index.html.haml +6 -5
  209. data/lib/generators/gluttonberg/resource/templates/backend_view_show.html.haml +2 -2
  210. data/lib/generators/gluttonberg/resource/templates/migration.rb +12 -1
  211. data/lib/generators/gluttonberg/resource/templates/model.rb +18 -1
  212. data/lib/generators/gluttonberg/resource/templates/public_view_index.html.haml +27 -10
  213. data/lib/generators/gluttonberg/resource/templates/public_view_show.html.haml +10 -4
  214. data/lib/gluttonberg.rb +68 -37
  215. data/lib/gluttonberg/can_flag.rb +64 -76
  216. data/lib/gluttonberg/components.rb +47 -24
  217. data/lib/gluttonberg/content.rb +15 -0
  218. data/lib/gluttonberg/content/block.rb +99 -85
  219. data/lib/gluttonberg/content/block_localization.rb +11 -8
  220. data/lib/gluttonberg/content/clean_html.rb +12 -15
  221. data/lib/gluttonberg/content/default_template_file.rb +44 -0
  222. data/lib/gluttonberg/content/despamilator/filter/naughty_words.rb +4 -2
  223. data/lib/gluttonberg/content/home_page_info.rb +39 -0
  224. data/lib/gluttonberg/content/import_export_csv.rb +243 -130
  225. data/lib/gluttonberg/content/localization.rb +137 -148
  226. data/lib/gluttonberg/content/page_children.rb +36 -0
  227. data/lib/gluttonberg/content/page_components.rb +23 -0
  228. data/lib/gluttonberg/content/page_description_info.rb +55 -0
  229. data/lib/gluttonberg/content/page_duplicate.rb +68 -0
  230. data/lib/gluttonberg/content/page_finder.rb +63 -0
  231. data/lib/gluttonberg/content/page_localization_slug.rb +89 -0
  232. data/lib/gluttonberg/content/page_repairer.rb +117 -0
  233. data/lib/gluttonberg/content/publishable.rb +77 -71
  234. data/lib/gluttonberg/content/slug_management.rb +74 -26
  235. data/lib/gluttonberg/content/validations.rb +58 -0
  236. data/lib/gluttonberg/content/versioning.rb +40 -22
  237. data/lib/gluttonberg/drag_tree.rb +0 -1
  238. data/lib/gluttonberg/drag_tree/action_controller.rb +49 -37
  239. data/lib/gluttonberg/drag_tree/action_view.rb +0 -6
  240. data/lib/gluttonberg/drag_tree/active_record.rb +49 -49
  241. data/lib/gluttonberg/extensions.rb +1 -0
  242. data/lib/gluttonberg/extensions/string.rb +20 -0
  243. data/lib/gluttonberg/gb_file.rb +30 -0
  244. data/lib/gluttonberg/helpers/form_builder.rb +91 -38
  245. data/lib/gluttonberg/library.rb +9 -90
  246. data/lib/gluttonberg/library/attachment_mixin.rb +88 -98
  247. data/lib/gluttonberg/library/config/image_sizes.rb +22 -19
  248. data/lib/gluttonberg/library/default_asset_types.rb +104 -0
  249. data/lib/gluttonberg/library/processor/audio.rb +32 -16
  250. data/lib/gluttonberg/library/processor/image.rb +78 -69
  251. data/lib/gluttonberg/library/quick_magick/image.rb +72 -319
  252. data/lib/gluttonberg/library/quick_magick/image/draw.rb +133 -0
  253. data/lib/gluttonberg/library/quick_magick/image/operators_and_settings.rb +78 -0
  254. data/lib/gluttonberg/library/quick_magick/image/serialization.rb +79 -0
  255. data/lib/gluttonberg/library/quick_magick/image_list.rb +0 -1
  256. data/lib/gluttonberg/library/storage/filesystem.rb +45 -46
  257. data/lib/gluttonberg/library/storage/s3.rb +123 -119
  258. data/lib/gluttonberg/membership.rb +9 -0
  259. data/lib/gluttonberg/membership/export.rb +82 -0
  260. data/lib/gluttonberg/membership/import.rb +179 -0
  261. data/lib/gluttonberg/middleware/honeypot.rb +1 -2
  262. data/lib/gluttonberg/middleware/locales.rb +69 -18
  263. data/lib/gluttonberg/middleware/rewriter.rb +57 -16
  264. data/lib/gluttonberg/mixin_manager.rb +19 -0
  265. data/lib/gluttonberg/page_description.rb +82 -112
  266. data/lib/gluttonberg/random_string_generator.rb +31 -0
  267. data/lib/gluttonberg/record_history.rb +5 -7
  268. data/lib/gluttonberg/tasks/asset.rake +19 -8
  269. data/lib/gluttonberg/tasks/gluttonberg.rake +167 -13
  270. data/lib/gluttonberg/templates.rb +1 -3
  271. data/lib/gluttonberg/version.rb +1 -1
  272. data/lib/photo_job.rb +16 -0
  273. data/spec/controllers/auto_save_controller_spec.rb +57 -0
  274. data/spec/controllers/record_history_spec.rb +75 -0
  275. data/spec/dummy/README.rdoc +261 -0
  276. data/spec/dummy/Rakefile +7 -0
  277. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  278. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  279. data/spec/dummy/app/controllers/admin/staff_profiles_controller.rb +56 -0
  280. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  281. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  282. data/spec/dummy/app/models/staff_profile.rb +20 -0
  283. data/spec/dummy/app/models/vendor_mixin.rb +14 -0
  284. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  285. data/spec/dummy/config.ru +4 -0
  286. data/spec/dummy/config/application.rb +18 -0
  287. data/spec/dummy/config/boot.rb +10 -0
  288. data/spec/dummy/config/database.yml +8 -0
  289. data/spec/dummy/config/environment.rb +5 -0
  290. data/spec/dummy/config/environments/development.rb +37 -0
  291. data/spec/dummy/config/environments/production.rb +67 -0
  292. data/spec/dummy/config/environments/test.rb +37 -0
  293. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  294. data/spec/dummy/config/initializers/gluttonberg_advance_settings.rb +73 -0
  295. data/spec/dummy/config/initializers/gluttonberg_basic_settings.rb +65 -0
  296. data/spec/dummy/config/initializers/gluttonberg_menu_settings.rb +1 -0
  297. data/spec/dummy/config/initializers/inflections.rb +15 -0
  298. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  299. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  300. data/spec/dummy/config/initializers/session_store.rb +8 -0
  301. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  302. data/spec/dummy/config/locales/en.yml +5 -0
  303. data/{lib/generators/gluttonberg/installer/templates → spec/dummy/config}/page_descriptions.rb +103 -65
  304. data/spec/dummy/config/routes.rb +10 -0
  305. data/spec/dummy/db/20130625060411_create_staff_profile.rb +35 -0
  306. data/spec/dummy/db/schema.rb +474 -0
  307. data/spec/dummy/public/404.html +26 -0
  308. data/spec/dummy/public/422.html +26 -0
  309. data/spec/dummy/public/500.html +25 -0
  310. data/spec/dummy/public/favicon.ico +0 -0
  311. data/spec/dummy/script/rails +6 -0
  312. data/spec/dummy/tmp/cache/041/891/setting_library_number_of_recent_assets +0 -0
  313. data/spec/dummy/tmp/cache/08E/741/setting_comment_number_of_emails_allowed +0 -0
  314. data/spec/dummy/tmp/cache/580/D10/setting_title +0 -0
  315. data/spec/dummy/tmp/cache/62E/160/setting_fb_icon +0 -0
  316. data/spec/dummy/tmp/cache/6D6/FB0/setting_keywords +0 -0
  317. data/spec/dummy/tmp/cache/6D8/B60/setting_s3_key_id +0 -0
  318. data/spec/dummy/tmp/cache/6E1/A40/setting_s3_bucket +0 -0
  319. data/spec/dummy/tmp/cache/779/DF0/setting_from_email +0 -0
  320. data/spec/dummy/tmp/cache/7C5/450/setting_title_site1 +0 -0
  321. data/spec/dummy/tmp/cache/7C6/460/setting_title_site2 +0 -0
  322. data/spec/dummy/tmp/cache/802/000/setting_description +0 -0
  323. data/spec/dummy/tmp/cache/836/DD0/setting_backend_logo +0 -0
  324. data/spec/dummy/tmp/cache/862/FA0/setting_audio_assets +1 -0
  325. data/spec/dummy/tmp/cache/867/4E0/setting_video_assets +0 -0
  326. data/spec/dummy/tmp/cache/867/710/setting_enable_WYSIWYG +0 -0
  327. data/spec/dummy/tmp/cache/873/9E0/setting_fb_icon_site1 +0 -0
  328. data/spec/dummy/tmp/cache/874/9F0/setting_fb_icon_site2 +0 -0
  329. data/spec/dummy/tmp/cache/87D/A10/setting_s3_access_key +0 -0
  330. data/spec/dummy/tmp/cache/8AC/280/setting_s3_server_url +0 -0
  331. data/spec/dummy/tmp/cache/91B/730/setting_keywords_site1 +0 -0
  332. data/spec/dummy/tmp/cache/91C/740/setting_keywords_site2 +0 -0
  333. data/spec/dummy/tmp/cache/933/980/setting_auto_save_time +0 -0
  334. data/spec/dummy/tmp/cache/9BE/290/setting_from_email_site1 +0 -0
  335. data/spec/dummy/tmp/cache/9BF/2A0/setting_from_email_site2 +0 -0
  336. data/spec/dummy/tmp/cache/A02/5E0/setting_google_analytics +0 -0
  337. data/spec/dummy/tmp/cache/A47/800/setting_description_site1 +0 -0
  338. data/spec/dummy/tmp/cache/A48/810/setting_description_site2 +0 -0
  339. data/spec/dummy/tmp/cache/A69/B60/setting_comment_blacklist +0 -0
  340. data/spec/dummy/tmp/cache/B5C/D40/setting_number_of_revisions +0 -0
  341. data/spec/dummy/tmp/cache/BB3/350/setting_restrict_site_access +0 -0
  342. data/spec/dummy/tmp/cache/BB7/620/setting_comment_notification +0 -0
  343. data/spec/dummy/tmp/cache/BFB/140/setting_comment_email_as_spam +0 -0
  344. data/spec/dummy/tmp/cache/C47/DE0/setting_google_analytics_site1 +0 -0
  345. data/spec/dummy/tmp/cache/C48/DF0/setting_google_analytics_site2 +0 -0
  346. data/spec/dummy/tmp/cache/D3E/E20/setting_number_of_per_page_items +0 -0
  347. data/spec/dummy/tmp/cache/DF8/DB0/setting_restrict_site_access_site1 +0 -0
  348. data/spec/dummy/tmp/cache/DF9/DC0/setting_restrict_site_access_site2 +0 -0
  349. data/spec/dummy/tmp/cache/DFC/200/setting_comment_notification_site1 +0 -0
  350. data/spec/dummy/tmp/cache/DFD/210/setting_comment_notification_site2 +0 -0
  351. data/spec/dummy/tmp/cache/FD9/200/setting_comment_number_of_urls_allowed +0 -0
  352. data/spec/fixtures/assets/assets_import.zip +0 -0
  353. data/spec/fixtures/assets/audio.mp3 +0 -0
  354. data/spec/fixtures/assets/c3-add-interactive.mov +0 -0
  355. data/spec/fixtures/assets/gb_banner.jpg +0 -0
  356. data/spec/fixtures/assets/gb_logo.png +0 -0
  357. data/spec/fixtures/assets/high_res_photo.jpg +0 -0
  358. data/spec/fixtures/assets/untitled +0 -0
  359. data/spec/fixtures/members.csv +5 -0
  360. data/spec/fixtures/staff_profiles.csv +4 -0
  361. data/spec/helpers/public/assets_spec.rb +73 -0
  362. data/spec/helpers/public/content_helpers_spec.rb +71 -0
  363. data/spec/helpers/public/html_truncate_spec.rb +37 -0
  364. data/spec/helpers/public/meta_tags_spec.rb +29 -0
  365. data/spec/helpers/public/page_info_spec.rb +233 -0
  366. data/spec/helpers/public_spec.rb +114 -0
  367. data/spec/lib/content/import_export_csv_spec.rb +177 -0
  368. data/spec/lib/content/localization_spec.rb +107 -0
  369. data/spec/lib/content/page_finder_spec.rb +71 -0
  370. data/spec/lib/content/page_repairer_spec.rb +151 -0
  371. data/spec/lib/content/publishable_spec.rb +54 -0
  372. data/spec/lib/content/validations_spec.rb +88 -0
  373. data/spec/lib/drag_tree/action_controller_spec.rb +137 -0
  374. data/spec/lib/drag_tree/active_record_spec.rb +86 -0
  375. data/spec/lib/library/s3_rspec.rb +78 -0
  376. data/spec/lib/membership/export_spec.rb +89 -0
  377. data/spec/lib/membership/import_spec.rb +68 -0
  378. data/spec/lib/middleware/locales_spec.rb +192 -0
  379. data/spec/lib/middleware/rewriter_spec.rb +186 -0
  380. data/spec/lib/page_description_spec.rb +68 -0
  381. data/spec/mailers/member_notifier_spec.rb +140 -0
  382. data/spec/mailers/notifier_spec.rb +86 -0
  383. data/spec/models/asset_bulk_import_spec.rb +43 -0
  384. data/spec/models/asset_category_spec.rb +77 -0
  385. data/spec/models/asset_collection_spec.rb +72 -0
  386. data/spec/models/asset_spec.rb +278 -0
  387. data/spec/models/asset_type_spec.rb +109 -0
  388. data/spec/models/member_spec.rb +128 -0
  389. data/spec/models/page_localization_spec.rb +81 -0
  390. data/spec/models/page_spec.rb +221 -0
  391. data/spec/models/setting_spec.rb +49 -0
  392. data/spec/models/user_spec.rb +385 -0
  393. data/spec/observers/locale_observer_spec.rb +79 -0
  394. data/spec/observers/page_localization_observer_spec.rb +87 -0
  395. data/spec/observers/page_observer_spec.rb +130 -0
  396. data/spec/spec_helper.rb +90 -0
  397. metadata +508 -331
  398. data/app/assets/images/gb_360-button-pause-light.gif +0 -0
  399. data/app/assets/images/gb_360-button-pause-light.png +0 -0
  400. data/app/assets/images/gb_360-button-pause.gif +0 -0
  401. data/app/assets/images/gb_360-button-pause.png +0 -0
  402. data/app/assets/images/gb_360-button-play-light.gif +0 -0
  403. data/app/assets/images/gb_360-button-play-light.png +0 -0
  404. data/app/assets/images/gb_360-button-play.gif +0 -0
  405. data/app/assets/images/gb_360-button-play.png +0 -0
  406. data/app/assets/images/gb_360-button-vis-pause-light.gif +0 -0
  407. data/app/assets/images/gb_360-button-vis-pause-light.png +0 -0
  408. data/app/assets/images/gb_360-button-vis-pause.gif +0 -0
  409. data/app/assets/images/gb_360-button-vis-pause.png +0 -0
  410. data/app/assets/images/gb_360-button-vis-play-light.gif +0 -0
  411. data/app/assets/images/gb_360-button-vis-play-light.png +0 -0
  412. data/app/assets/images/gb_360-button-vis-play.gif +0 -0
  413. data/app/assets/images/gb_360-button-vis-play.png +0 -0
  414. data/app/assets/images/gb_button_bkg_grey.gif +0 -0
  415. data/app/assets/images/gb_icon_content_2.png +0 -0
  416. data/app/assets/images/gb_icon_dash.png +0 -0
  417. data/app/assets/images/gb_icon_library_2.png +0 -0
  418. data/app/assets/images/gb_page_content_fillin.gif +0 -0
  419. data/app/assets/images/gb_spinner_for_dialouge.gif +0 -0
  420. data/app/assets/images/gb_sub_nav_back_bkg.gif +0 -0
  421. data/app/assets/images/gb_subnav_bkg.gif +0 -0
  422. data/app/assets/images/gb_table_head_bkg.gif +0 -0
  423. data/app/assets/images/gb_wrapper_bkg.png +0 -0
  424. data/app/assets/images/gb_wysiwyg.png +0 -0
  425. data/app/assets/images/help/gb_help.jpg +0 -0
  426. data/app/assets/images/icons/gb_collapsed.png +0 -0
  427. data/app/assets/images/icons/gb_expanded.png +0 -0
  428. data/app/assets/images/library/gb_back.gif +0 -0
  429. data/app/assets/images/library/gb_dialog_overlay.png +0 -0
  430. data/app/assets/images/library/gb_inactive_tab.jpg +0 -0
  431. data/app/assets/images/library/gb_search_icon.gif +0 -0
  432. data/app/assets/images/library/gb_wysiwyg_pic.png +0 -0
  433. data/app/assets/javascripts/gb_ajaxfileupload.js +0 -205
  434. data/app/assets/javascripts/gb_berniecode-animator.js +0 -674
  435. data/app/assets/javascripts/gb_bootstrap-datepicker.js +0 -501
  436. data/app/assets/javascripts/gb_expander.js +0 -81
  437. data/app/assets/javascripts/gb_jquery-dragTree.js +0 -525
  438. data/app/assets/javascripts/gb_jquery-tagarea.js +0 -404
  439. data/app/assets/javascripts/gb_login.js +0 -33
  440. data/app/assets/javascripts/gb_tags.js +0 -177
  441. data/app/assets/javascripts/jquery-1-7-1.js +0 -9267
  442. data/app/assets/javascripts/jquery-dimensions-min.js +0 -12
  443. data/app/assets/javascripts/jquery-ui-1-8-23-custom-min.js +0 -85
  444. data/app/assets/javascripts/tiny_mce/jquery.tinymce.js +0 -1
  445. data/app/assets/javascripts/tiny_mce/langs/en.js +0 -223
  446. data/app/assets/javascripts/tiny_mce/plugins/advhr/css/advhr.css +0 -5
  447. data/app/assets/javascripts/tiny_mce/plugins/advhr/editor_plugin.js +0 -1
  448. data/app/assets/javascripts/tiny_mce/plugins/advhr/js/rule.js +0 -43
  449. data/app/assets/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js +0 -7
  450. data/app/assets/javascripts/tiny_mce/plugins/advhr/rule.htm +0 -58
  451. data/app/assets/javascripts/tiny_mce/plugins/advlink/css/advlink.css +0 -8
  452. data/app/assets/javascripts/tiny_mce/plugins/advlink/editor_plugin.js +0 -61
  453. data/app/assets/javascripts/tiny_mce/plugins/advlink/js/advlink.js +0 -564
  454. data/app/assets/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js +0 -54
  455. data/app/assets/javascripts/tiny_mce/plugins/advlink/link.htm +0 -355
  456. data/app/assets/javascripts/tiny_mce/plugins/advlist/editor_plugin.js +0 -1
  457. data/app/assets/javascripts/tiny_mce/plugins/autolink/editor_plugin.js +0 -1
  458. data/app/assets/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +0 -1
  459. data/app/assets/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +0 -109
  460. data/app/assets/javascripts/tiny_mce/plugins/gb_assets/editor_plugin.js +0 -47
  461. data/app/assets/javascripts/tiny_mce/plugins/gb_assets/editor_plugin_src.js +0 -43
  462. data/app/assets/javascripts/tiny_mce/plugins/gb_assets/emotions.htm +0 -41
  463. data/app/assets/javascripts/tiny_mce/plugins/gb_assets/js/emotions.js +0 -22
  464. data/app/assets/javascripts/tiny_mce/plugins/gb_assets/langs/en_dlg.js +0 -20
  465. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -1
  466. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  467. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  468. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  469. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  470. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  471. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  472. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  473. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -90
  474. data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/template.htm +0 -387
  475. data/app/assets/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +0 -1
  476. data/app/assets/javascripts/tiny_mce/plugins/lists/editor_plugin.js +0 -1
  477. data/app/assets/javascripts/tiny_mce/plugins/paste/editor_plugin.js +0 -1
  478. data/app/assets/javascripts/tiny_mce/plugins/paste/js/pastetext.js +0 -36
  479. data/app/assets/javascripts/tiny_mce/plugins/paste/js/pasteword.js +0 -51
  480. data/app/assets/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +0 -5
  481. data/app/assets/javascripts/tiny_mce/plugins/paste/pastetext.htm +0 -27
  482. data/app/assets/javascripts/tiny_mce/plugins/paste/pasteword.htm +0 -21
  483. data/app/assets/javascripts/tiny_mce/plugins/preview/editor_plugin.js +0 -1
  484. data/app/assets/javascripts/tiny_mce/plugins/preview/jscripts/embed.js +0 -73
  485. data/app/assets/javascripts/tiny_mce/plugins/preview/preview.html +0 -18
  486. data/app/assets/javascripts/tiny_mce/plugins/style/css/props.css +0 -13
  487. data/app/assets/javascripts/tiny_mce/plugins/style/editor_plugin.js +0 -1
  488. data/app/assets/javascripts/tiny_mce/plugins/style/js/props.js +0 -635
  489. data/app/assets/javascripts/tiny_mce/plugins/style/langs/en_dlg.js +0 -70
  490. data/app/assets/javascripts/tiny_mce/plugins/style/props.htm +0 -838
  491. data/app/assets/javascripts/tiny_mce/plugins/table/cell.htm +0 -180
  492. data/app/assets/javascripts/tiny_mce/plugins/table/css/cell.css +0 -17
  493. data/app/assets/javascripts/tiny_mce/plugins/table/css/row.css +0 -25
  494. data/app/assets/javascripts/tiny_mce/plugins/table/css/table.css +0 -13
  495. data/app/assets/javascripts/tiny_mce/plugins/table/editor_plugin.js +0 -1
  496. data/app/assets/javascripts/tiny_mce/plugins/table/js/cell.js +0 -319
  497. data/app/assets/javascripts/tiny_mce/plugins/table/js/merge_cells.js +0 -27
  498. data/app/assets/javascripts/tiny_mce/plugins/table/js/row.js +0 -237
  499. data/app/assets/javascripts/tiny_mce/plugins/table/js/table.js +0 -450
  500. data/app/assets/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +0 -75
  501. data/app/assets/javascripts/tiny_mce/plugins/table/merge_cells.htm +0 -32
  502. data/app/assets/javascripts/tiny_mce/plugins/table/row.htm +0 -158
  503. data/app/assets/javascripts/tiny_mce/plugins/table/table.htm +0 -188
  504. data/app/assets/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +0 -1
  505. data/app/assets/javascripts/tiny_mce/themes/advanced/anchor.htm +0 -26
  506. data/app/assets/javascripts/tiny_mce/themes/advanced/editor_template.js +0 -1
  507. data/app/assets/javascripts/tiny_mce/themes/advanced/editor_template_src.js +0 -1358
  508. data/app/assets/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
  509. data/app/assets/javascripts/tiny_mce/themes/advanced/img/trans.gif +0 -0
  510. data/app/assets/javascripts/tiny_mce/themes/advanced/js/anchor.js +0 -42
  511. data/app/assets/javascripts/tiny_mce/themes/advanced/js/link.js +0 -153
  512. data/app/assets/javascripts/tiny_mce/themes/advanced/js/source_editor.js +0 -56
  513. data/app/assets/javascripts/tiny_mce/themes/advanced/langs/en.js +0 -68
  514. data/app/assets/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +0 -54
  515. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/content.css +0 -47
  516. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +0 -117
  517. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  518. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  519. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  520. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  521. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  522. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  523. data/app/assets/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +0 -227
  524. data/app/assets/javascripts/tiny_mce/themes/advanced/source_editor.htm +0 -25
  525. data/app/assets/javascripts/tiny_mce/tiny_mce.js +0 -1
  526. data/app/assets/javascripts/tiny_mce/tiny_mce_popup.js +0 -5
  527. data/app/assets/javascripts/tiny_mce/utils/editable_selects.js +0 -70
  528. data/app/assets/javascripts/tiny_mce/utils/form_utils.js +0 -210
  529. data/app/assets/javascripts/tiny_mce/utils/mctabs.js +0 -162
  530. data/app/assets/javascripts/tiny_mce/utils/validate.js +0 -252
  531. data/app/controllers/gluttonberg/admin/content/articles_controller.rb +0 -139
  532. data/app/controllers/gluttonberg/admin/content/blogs_controller.rb +0 -101
  533. data/app/controllers/gluttonberg/admin/content/comments_controller.rb +0 -130
  534. data/app/controllers/gluttonberg/admin/content/main_controller.rb +0 -13
  535. data/app/controllers/gluttonberg/admin/help_controller.rb +0 -15
  536. data/app/controllers/gluttonberg/admin/settings/generic_settings_controller.rb +0 -90
  537. data/app/controllers/gluttonberg/admin/settings/main_controller.rb +0 -11
  538. data/app/controllers/gluttonberg/public/articles_controller.rb +0 -79
  539. data/app/controllers/gluttonberg/public/blogs_controller.rb +0 -44
  540. data/app/controllers/gluttonberg/public/comments_controller.rb +0 -46
  541. data/app/models/gluttonberg/article.rb +0 -73
  542. data/app/models/gluttonberg/article_localization.rb +0 -21
  543. data/app/models/gluttonberg/blog.rb +0 -19
  544. data/app/models/gluttonberg/comment.rb +0 -142
  545. data/app/models/gluttonberg/comment_subscription.rb +0 -28
  546. data/app/models/gluttonberg/help.rb +0 -48
  547. data/app/views/gluttonberg/admin/content/articles/_form.html.haml +0 -115
  548. data/app/views/gluttonberg/admin/content/articles/edit.html.haml +0 -11
  549. data/app/views/gluttonberg/admin/content/articles/index.html.haml +0 -71
  550. data/app/views/gluttonberg/admin/content/articles/new.html.haml +0 -11
  551. data/app/views/gluttonberg/admin/content/blogs/_form.html.haml +0 -56
  552. data/app/views/gluttonberg/admin/content/blogs/edit.html.haml +0 -3
  553. data/app/views/gluttonberg/admin/content/blogs/index.html.haml +0 -35
  554. data/app/views/gluttonberg/admin/content/blogs/new.html.haml +0 -10
  555. data/app/views/gluttonberg/admin/content/comments/index.html.haml +0 -66
  556. data/app/views/gluttonberg/admin/content/galleries/_images_list.html.haml +0 -21
  557. data/app/views/gluttonberg/admin/content/galleries/add_image.html.haml +0 -1
  558. data/app/views/gluttonberg/admin/content/main/index.html.haml +0 -20
  559. data/app/views/gluttonberg/admin/content/pages/edit_home.html.haml +0 -11
  560. data/app/views/gluttonberg/admin/exceptions/internal_server_error.html.haml +0 -11
  561. data/app/views/gluttonberg/admin/exceptions/not_acceptable.html.haml +0 -9
  562. data/app/views/gluttonberg/admin/membership/main/index.html.haml +0 -11
  563. data/app/views/gluttonberg/admin/settings/generic_settings/_form.html.haml +0 -26
  564. data/app/views/gluttonberg/admin/settings/generic_settings/edit.html.haml +0 -4
  565. data/app/views/gluttonberg/admin/settings/generic_settings/index.html.haml +0 -58
  566. data/app/views/gluttonberg/admin/settings/main/index.html.haml +0 -18
  567. data/app/views/gluttonberg/public/articles/index.rss.builder +0 -21
  568. data/app/views/gluttonberg/public/blogs/show.rss.builder +0 -21
  569. data/app/views/gluttonberg/public/exceptions/internal_server_error.html.haml +0 -11
  570. data/app/views/gluttonberg/public/exceptions/not_acceptable.html.haml +0 -9
  571. data/app/views/help/gluttonberg/admin/AssetLibrary/assets/add_assets_in_bulk.html.haml +0 -41
  572. data/app/views/help/gluttonberg/admin/AssetLibrary/assets/edit.html.haml +0 -61
  573. data/app/views/help/gluttonberg/admin/AssetLibrary/assets/index.html.haml +0 -16
  574. data/app/views/help/gluttonberg/admin/AssetLibrary/assets/new.html.haml +0 -57
  575. data/app/views/help/gluttonberg/admin/AssetLibrary/collections/edit.html.haml +0 -15
  576. data/app/views/help/gluttonberg/admin/AssetLibrary/collections/index.html.haml +0 -41
  577. data/app/views/help/gluttonberg/admin/AssetLibrary/collections/new.html.haml +0 -15
  578. data/app/views/help/gluttonberg/admin/AssetLibrary/main/index.html.haml +0 -34
  579. data/app/views/help/gluttonberg/admin/content/page_localizations/edit.html.haml +0 -89
  580. data/app/views/help/gluttonberg/admin/content/pages/_page_description_help.html.haml +0 -14
  581. data/app/views/help/gluttonberg/admin/content/pages/edit.html.haml +0 -62
  582. data/app/views/help/gluttonberg/admin/content/pages/index.html.haml +0 -111
  583. data/app/views/help/gluttonberg/admin/content/pages/new.html.haml +0 -61
  584. data/app/views/help/gluttonberg/admin/settings/dialects/edit.html.haml +0 -47
  585. data/app/views/help/gluttonberg/admin/settings/dialects/index.html.haml +0 -50
  586. data/app/views/help/gluttonberg/admin/settings/dialects/new.html.haml +0 -47
  587. data/app/views/help/gluttonberg/admin/settings/generic_settings/index.html.haml +0 -74
  588. data/app/views/help/gluttonberg/admin/settings/locales/edit.html.haml +0 -71
  589. data/app/views/help/gluttonberg/admin/settings/locales/index.html.haml +0 -57
  590. data/app/views/help/gluttonberg/admin/settings/locales/new.html.haml +0 -71
  591. data/app/views/help/gluttonberg/admin/settings/users/edit.html.haml +0 -63
  592. data/app/views/help/gluttonberg/admin/settings/users/index.html.haml +0 -60
  593. data/app/views/help/gluttonberg/admin/settings/users/new.html.haml +0 -69
  594. data/app/views/notifier/comment_notification.html.haml +0 -17
  595. data/app/views/notifier/comment_notification_for_admin.html.haml +0 -19
  596. data/db/migrate/20121106025800_add_artist_and_link_to_assets.rb +0 -6
  597. data/lib/acts_as_versioned.rb +0 -496
  598. data/lib/generators/gluttonberg/blog/blog_generator.rb +0 -46
  599. data/lib/generators/gluttonberg/blog/templates/articles_index.html.haml +0 -18
  600. data/lib/generators/gluttonberg/blog/templates/articles_show.html.haml +0 -63
  601. data/lib/generators/gluttonberg/blog/templates/articles_tag.html.haml +0 -24
  602. data/lib/generators/gluttonberg/blog/templates/blog_migration.rb +0 -90
  603. data/lib/generators/gluttonberg/blog/templates/blogs_index.html.haml +0 -15
  604. data/lib/generators/gluttonberg/blog/templates/blogs_show.html.haml +0 -25
  605. data/lib/generators/gluttonberg/installer/USAGE +0 -1
  606. data/lib/generators/gluttonberg/installer/installer_generator.rb +0 -106
  607. data/lib/generators/gluttonberg/installer/templates/delayed_job_script +0 -5
  608. data/lib/generators/gluttonberg/installer/templates/gluttonberg_migration.rb +0 -368
  609. data/lib/generators/gluttonberg/installer/templates/public.html.haml +0 -24
  610. data/lib/generators/gluttonberg/installer/templates/sitemap.rb +0 -70
  611. data/lib/gluttonberg/authorizable.rb +0 -51
  612. data/lib/gluttonberg/helpers.rb +0 -20
  613. data/lib/rails/railties/tasks.rake +0 -3
data/lib/engine.rb CHANGED
@@ -5,100 +5,143 @@ module Gluttonberg
5
5
  class Engine < Rails::Engine
6
6
 
7
7
  # Config defaults
8
- config.widget_factory_name = "default factory name"
9
- config.mount_at = '/'
10
- config.admin_path = '/admin'
11
- config.app_name = 'Gluttonberg 2.5'
12
- config.localize = false
13
- config.flagged_content = false
14
- config.active_record.observers = ['gluttonberg/page_observer' , 'gluttonberg/page_localization_observer' , 'gluttonberg/locale_observer' ]
15
-
16
- config.thumbnails = { }
17
- config.max_image_size = "1600x1200>"
18
- config.encoding = "utf-8"
19
- #config.gluttonberg = {}
20
- config.identify_locale = :prefix
21
- config.host_name = "localhost:3000"
22
- config.user_roles = [] # User model always concat following two roles ["superadmin" , "admin"]
23
- config.honeypot_field_name = "our_newly_weekly_series"
24
- config.custom_css_for_cms = false
25
- config.custom_js_for_cms = false
26
- config.asset_storage = :filesystem
27
- #engines which depends on gluttonberg-core can
28
- #use this to provide additional processor for assets
29
- #in first stage I am going to use it with Tv
30
- config.asset_processors = []
31
- config.asset_mixins = []
32
- config.member_mixins = []
33
- config.search_models = {
8
+ def init_settings
9
+ init_basic_settings
10
+ init_advance_settings
11
+ init_internal_settings
12
+ end
13
+
14
+ def init_basic_settings
15
+ config.mount_at = '/'
16
+ config.app_name = 'Gluttonberg'
17
+ config.max_image_size = "1600x1200>"
18
+ config.thumbnails = {}
19
+ config.enable_gallery = false
20
+ config.enable_members = false
21
+ config.encoding = "utf-8"
22
+ config.host_name = "localhost:5000"
23
+ end
24
+
25
+ def init_advance_settings
26
+ config.asset_storage = :filesystem
27
+ #engines which depends on gluttonberg-core can
28
+ #use this to provide additional processor for assets
29
+ #in first stage I am going to use it with TV
30
+ config.asset_processors = []
31
+ config.asset_mixins = []
32
+ config.custom_css_for_cms = false
33
+ config.custom_js_for_cms = false
34
+ config.custom_css_files_for_backend = []
35
+ config.custom_js_files_for_backend = []
36
+ # User model always concat following three roles
37
+ # ["super_admin" , "admin" , "contributor"]
38
+ config.user_roles = []
39
+ config.limited_roles = ["contributor"]
40
+ config.cms_based_public_css = false
41
+ config.flagged_content = false
42
+ config.search_models = {
34
43
  "Gluttonberg::Page" => [:name],
35
- "Gluttonberg::Blog" => [:name , :description],
36
- "Gluttonberg::ArticleLocalization" => [:title , :body],
44
+ "Gluttonberg::Blog::Weblog" => [:name , :description],
45
+ "Gluttonberg::Blog::ArticleLocalization" => [:title , :body],
37
46
  "Gluttonberg::PlainTextContentLocalization" => [:text] ,
38
47
  "Gluttonberg::HtmlContentLocalization" => [:text]
39
- }
40
- config.multisite = false
41
-
42
- config.enable_members = false
43
- config.member_csv_metadata = { :first_name => "FIRST NAME" , :last_name => "LAST NAME" , :email => "EMAIL" , :groups => "GROUPS" , :bio => "BIO" }
48
+ }
49
+ config.honeypot_field_name = "our_newly_weekly_series"
50
+ config.localize = false
51
+ config.member_csv_metadata = {
52
+ :first_name => "FIRST NAME",
53
+ :last_name => "LAST NAME",
54
+ :email => "EMAIL",
55
+ :groups => "GROUPS",
56
+ :bio => "BIO"
57
+ }
58
+ config.model_mixins = {}
59
+ config.password_pattern = /^(?=.*\d)(?=.*[a-zA-Z])(?!.*[^\w\S\s]).{6,}$/
60
+ config.password_validation_message = "must be a minimum of 6 characters in length, contain at least 1 letter and at least 1 number"
61
+ config.multisite = false
62
+ end
44
63
 
45
- config.enable_gallery = false
46
- config.cms_based_public_css = false
64
+ def init_internal_settings
65
+ config.identify_locale = :prefix
66
+ config.active_record.observers = ['gluttonberg/page_observer',
67
+ 'gluttonberg/page_localization_observer' ,
68
+ 'gluttonberg/locale_observer'
69
+ ]
70
+ end
47
71
 
72
+ init_settings
48
73
  # Load rake tasks
49
74
  rake_tasks do
50
- load File.join(File.dirname(__FILE__), 'rails/railties/tasks.rake')
51
75
  load File.join(File.dirname(__FILE__), 'gluttonberg/tasks/asset.rake')
52
76
  load File.join(File.dirname(__FILE__), 'gluttonberg/tasks/gluttonberg.rake')
53
77
  end
54
78
 
55
- # Check the gem config
56
- initializer "check config" do |app|
57
-
58
- # make sure mount_at ends with trailing slash
59
- config.mount_at += '/' unless config.mount_at.last == '/'
79
+ initializer "initialize gluttonberg" do |app|
80
+ init_gluttonberg(app)
60
81
  end
61
82
 
62
- initializer "static assets" do |app|
63
- app.middleware.use ::ActionDispatch::Static, "#{root}/public"
64
- end
83
+ private
65
84
 
66
- initializer "middleware" do |app|
67
- app.middleware.use Gluttonberg::Middleware::Locales
68
- app.middleware.use Gluttonberg::Middleware::Rewriter
69
- app.middleware.use Gluttonberg::Middleware::Honeypot , config.honeypot_field_name
70
- end
85
+ def init_gluttonberg(app)
86
+ init_middlewares(app)
87
+ init_gb_components(app)
88
+ init_acts_as_taggable_on(app)
89
+ require 'active_link_to'
90
+ init_static_assets(app)
91
+ init_mount_at(app)
92
+ init_asset_precompile(app)
93
+ end
71
94
 
95
+ def init_middlewares(app)
96
+ app.middleware.use Gluttonberg::Middleware::Locales
97
+ app.middleware.use Gluttonberg::Middleware::Rewriter
98
+ app.middleware.use Gluttonberg::Middleware::Honeypot , config.honeypot_field_name
99
+ end
72
100
 
73
- initializer "setup gluttonberg components" do |app|
74
- Gluttonberg::Content::Versioning.setup
75
- Gluttonberg::Content::ImportExportCSV.setup
76
- Gluttonberg::Content::CleanHtml.setup
77
- Gluttonberg::PageDescription.setup
101
+ def init_gb_components(app)
102
+ Gluttonberg::Content::Versioning.setup
103
+ Gluttonberg::Content::ImportExportCSV.setup
104
+ Gluttonberg::Content::CleanHtml.setup
105
+ Gluttonberg::PageDescription.setup
106
+ Gluttonberg::Content::Validations.setup
78
107
 
79
- # register content class here. It is required for lazyloading environments.
80
- Gluttonberg::Content::Block.register(Gluttonberg::PlainTextContent)
81
- Gluttonberg::Content::Block.register(Gluttonberg::HtmlContent)
82
- Gluttonberg::Content::Block.register(Gluttonberg::ImageContent)
108
+ # register content class here.
109
+ # It is required for lazyloading environments.
110
+ Gluttonberg::Content::Block.register(Gluttonberg::PlainTextContent)
111
+ Gluttonberg::Content::Block.register(Gluttonberg::HtmlContent)
112
+ Gluttonberg::Content::Block.register(Gluttonberg::ImageContent)
113
+ Gluttonberg::Content::Block.register(Gluttonberg::TextareaContent)
114
+ Gluttonberg::Content::Block.register(Gluttonberg::SelectContent)
83
115
 
84
- Gluttonberg::Content.setup
85
116
 
86
- Gluttonberg::CanFlag.setup
87
- Time::DATE_FORMATS[:default] = "%d/%m/%Y %I:%M %p"
88
- end
117
+ Gluttonberg::Content.setup
89
118
 
90
- initializer "setup gluttonberg asset library" do |app|
91
- #Gluttonberg::Library.setup
92
- require "acts-as-taggable-on"
93
- if ::ActsAsTaggableOn::Tag.attribute_names.include?("slug") == true
94
- ::ActsAsTaggableOn::Tag.send(:include , Gluttonberg::Content::SlugManagement)
119
+ Gluttonberg::CanFlag.setup
120
+ Time::DATE_FORMATS[:default] = "%d/%m/%Y %I:%M %p"
121
+ Components.init_main_nav
95
122
  end
96
- require 'active_link_to'
97
- end
98
123
 
99
- initializer "setup delayed job" do |app|
100
- Delayed::Job.attr_accessible :priority, :payload_object, :handler, :run_at, :failed_at
101
- end
124
+ def init_acts_as_taggable_on(app)
125
+ require "acts-as-taggable-on"
126
+ if ::ActsAsTaggableOn::Tag.attribute_names.include?("slug") == true
127
+ ::ActsAsTaggableOn::Tag.send(:include , Gluttonberg::Content::SlugManagement)
128
+ end
129
+ end
102
130
 
131
+ def init_static_assets(app)
132
+ app.middleware.use ::ActionDispatch::Static, "#{root}/public"
133
+ end
134
+
135
+ def init_mount_at(app)
136
+ # make sure mount_at ends with trailing slash
137
+ config.mount_at += '/' unless config.mount_at.last == '/'
138
+ end
139
+
140
+ def init_asset_precompile(app)
141
+ if Rails.version > "3.1"
142
+ #Gluttonberg precompile hook
143
+ app.config.assets.precompile += ["*.js", "chosen.css", "gb_360player.css", "gb_bootstrap-responsive.css", "gb_bootstrap.css", "gluttonberg.css", "redactor.css", "gb_admin-override.css"]
144
+ end
145
+ end
103
146
  end
104
147
  end
@@ -10,9 +10,10 @@ class Gluttonberg::ResourceGenerator < Rails::Generators::Base
10
10
  argument :resource_name, :type => :string, :required => true
11
11
  argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
12
12
 
13
- hook_for :draggable, :aliases => "-d" , :type => :boolean
14
- hook_for :importable, :aliases => "-i" , :type => :boolean
15
- hook_for :localized, :aliases => "-l" , :type => :boolean
13
+ class_option :draggable, :aliases => "-d" , :type => :boolean
14
+ class_option :importable, :aliases => "-i" , :type => :boolean
15
+ class_option :localized, :aliases => "-l" , :type => :boolean
16
+ class_option :without_versioning, :aliases => "-w" , :type => :boolean
16
17
 
17
18
  def initialize(args, *options)
18
19
  super(args, *options)
@@ -41,43 +42,23 @@ class Gluttonberg::ResourceGenerator < Rails::Generators::Base
41
42
  end
42
43
 
43
44
  def add_route
44
- if draggable?
45
- route(
46
- %Q(
47
- namespace :admin do
48
- match \"/#{plural_name}/move(.:format)\" => \"#{plural_name}#move_node\" , :as=> :#{singular_name}_move
49
- match \"/#{plural_name}/import(.:format)\" => \"#{plural_name}#import\" , :as=> :#{plural_name}_import
50
- match \"/#{plural_name}/export(.:format)\" => \"#{plural_name}#export\" , :as=> :#{plural_name}_export
51
- resources :#{plural_name} do
52
- member do
53
- get 'delete'
54
- get 'duplicate'
55
- end
56
- end
57
- end
58
- )
59
- )
60
- else
61
- route(
62
- %Q(
63
- namespace :admin do
64
- match \"/#{plural_name}/import(.:format)\" => \"#{plural_name}#import\" , :as=> :#{plural_name}_import
65
- match \"/#{plural_name}/export(.:format)\" => \"#{plural_name}#export\" , :as=> :#{plural_name}_export
66
- resources :#{plural_name} do
67
- member do
68
- get 'delete'
69
- get 'duplicate'
70
- end
71
- end
72
- end
73
- )
74
- )
75
- end
45
+ route_str = "namespace :admin do"
46
+ route_str << draggable_move_route if draggable?
47
+ route_str << import_export_routes if importable?
48
+ route_str << resource_admin_routes
49
+ route_str << "end"
50
+ route(route_str)
76
51
  route("resources :#{plural_name}")
77
52
  end
78
53
 
79
54
  def add_config
80
- application "Gluttonberg::Components.register(:#{plural_name}, :label => '#{plural_class_name}', :admin_url => :admin_#{plural_name})"
55
+ menu_config_filename = "config/initializers/gluttonberg_menu_settings.rb"
56
+ code = "Gluttonberg::Components.register(:#{plural_name}, :label => '#{plural_class_name}', :admin_url => :admin_#{plural_name}, :can_model_name => '#{class_name}')\n"
57
+ if File.exist?(menu_config_filename)
58
+ append_file(menu_config_filename, code)
59
+ else
60
+ File.open(menu_config_filename, "a+") { |file| file.write(code) }
61
+ end
81
62
  end
82
63
 
83
64
  protected
@@ -103,11 +84,7 @@ class Gluttonberg::ResourceGenerator < Rails::Generators::Base
103
84
  end
104
85
 
105
86
  def self.next_migration_number(dirname)
106
- if ActiveRecord::Base.timestamped_migrations
107
- Time.now.utc.strftime("%Y%m%d%H%M%S")
108
- else
109
- "%.3d" % (current_migration_number(dirname) + 1)
110
- end
87
+ Gluttonberg.next_migration_number(dirname)
111
88
  end
112
89
 
113
90
  def file_name
@@ -118,6 +95,10 @@ class Gluttonberg::ResourceGenerator < Rails::Generators::Base
118
95
  ([file_name]).map!{ |m| m.camelize }.join('::')
119
96
  end
120
97
 
98
+ def versioned_class_name
99
+ localized? ? class_name + "Localization" : class_name
100
+ end
101
+
121
102
  def plural_class_name
122
103
  ([plural_name]).map!{ |m| m.camelize }.join('::')
123
104
  end
@@ -159,6 +140,11 @@ class Gluttonberg::ResourceGenerator < Rails::Generators::Base
159
140
  !(options[:localized].blank?)
160
141
  end
161
142
 
143
+ # by default models are versioned
144
+ def versioned?
145
+ options[:without_versioning].blank?
146
+ end
147
+
162
148
  def attr_db_type_wrapper(attr)
163
149
  if ['asset', 'image','video','document', 'audio'].include?(attr.type.to_s)
164
150
  'integer'
@@ -197,4 +183,28 @@ class Gluttonberg::ResourceGenerator < Rails::Generators::Base
197
183
  end
198
184
  end
199
185
 
186
+ def resource_admin_routes
187
+ %{
188
+ resources :#{plural_name} do
189
+ member do
190
+ get 'delete'
191
+ get 'duplicate'
192
+ end
193
+ end
194
+ }
195
+ end
196
+
197
+ def draggable_move_route
198
+ %{
199
+ post \"/#{plural_name}/move(.:format)\" => \"#{plural_name}#move_node\" , :as => :#{singular_name}_move
200
+ }
201
+ end
202
+
203
+ def import_export_routes
204
+ %{
205
+ match \"/#{plural_name}/import(.:format)\" => \"#{plural_name}#import\" , :as => :#{plural_name}_import
206
+ get \"/#{plural_name}/export(.:format)\" => \"#{plural_name}#export\" , :as => :#{plural_name}_export
207
+ }
208
+ end
209
+
200
210
  end
@@ -1,5 +1,6 @@
1
1
  module Admin
2
2
  class <%= plural_class_name %>Controller < Gluttonberg::Admin::BaseController
3
+ before_filter :find_<%= singular_name %>, :only => [:show, :edit, :update, :delete, :destroy, :duplicate]
3
4
  before_filter :authorize_user , :except => [:destroy , :delete]
4
5
  before_filter :authorize_user_for_destroy , :only => [:destroy , :delete]
5
6
  <%if draggable? %>
@@ -18,7 +19,6 @@ module Admin
18
19
  end
19
20
 
20
21
  def show
21
- @<%= singular_name %> = <%= class_name %>.find(params[:id])
22
22
  end
23
23
 
24
24
  def new
@@ -26,12 +26,16 @@ module Admin
26
26
  end
27
27
 
28
28
  def edit
29
- @<%= singular_name %> = <%= class_name %>.find(params[:id])
30
29
  <% if localized? %>@<%= singular_name %>.load_localization(params[:locale_id]) unless params[:locale_id].blank? <%end%>
30
+ <% if versioned? %>unless params[:version].blank?
31
+ @version = params[:version]
32
+ @<%= singular_name %><% if localized? %>.current_localization<% end %>.revert_to(@version)
33
+ end<%end%>
31
34
  end
32
35
 
33
36
  def create
34
37
  @<%= singular_name %> = <% if localized? %><%= class_name %>.new_with_localization(params[:<%= singular_name %>])<% else %><%= class_name %>.new(params[:<%= singular_name %>]) <%end%>
38
+ <% if versioned? %>@<%= singular_name %><% if localized? %>.current_localization<% end %>.current_user_id = current_user.id<%end%>
35
39
  if @<%= singular_name %>.save
36
40
  flash[:notice] = "The <%= singular_name.titleize.downcase %> was successfully created."
37
41
  redirect_to admin_<%= plural_name %>_path
@@ -41,12 +45,9 @@ module Admin
41
45
  end
42
46
 
43
47
  def update
44
- @<%= singular_name %> = <%= class_name %>.find(params[:id])
45
48
  <% if localized? %>@<%= singular_name %>.load_localization(params[:locale_id]) unless params[:locale_id].blank? <%end%>
46
- @<%= singular_name %>.current_slug = @<%= singular_name %>.slug
47
- @<%= singular_name %>.assign_attributes(params[:<%= singular_name %>])
48
- @<%= singular_name %>.previous_slug = @<%= singular_name %>.current_slug if @<%= singular_name %>.slug_changed?
49
- if @<%= singular_name %>.save
49
+ <% if versioned? %>@<%= singular_name %><% if localized? %>.current_localization<% end %>.current_user_id = current_user.id<%end%>
50
+ if @<%= singular_name %>.update_attributes(params[:<%= singular_name %>])
50
51
  flash[:notice] = "The <%= singular_name.titleize.downcase %> was successfully updated."
51
52
  redirect_to admin_<%= plural_name %>_path
52
53
  else
@@ -56,7 +57,6 @@ module Admin
56
57
  end
57
58
 
58
59
  def delete
59
- @<%= singular_name %> = <%= class_name %>.find(params[:id])
60
60
  display_delete_confirmation(
61
61
  :title => "Delete <%= class_name %> '#{@<%= singular_name %>.id}'?",
62
62
  :url => admin_<%= singular_name %>_path(@<%= singular_name %>),
@@ -66,7 +66,7 @@ module Admin
66
66
  end
67
67
 
68
68
  def destroy
69
- @<%= singular_name %> = <%= class_name %>.find(params[:id])
69
+ <% if localized? %>@<%= singular_name %>.current_localization <% end %>
70
70
  if @<%= singular_name %>.destroy
71
71
  flash[:notice] = "The <%= singular_name.titleize.downcase %> was successfully deleted."
72
72
  redirect_to admin_<%= plural_name %>_path
@@ -95,7 +95,6 @@ module Admin
95
95
  <% end %>
96
96
 
97
97
  def duplicate
98
- @<%= singular_name %> = <%= class_name %>.find(params[:id])
99
98
  @cloned_<%= singular_name %> = @<%= singular_name %>.duplicate!
100
99
  if @cloned_<%= singular_name %>
101
100
  flash[:notice] = "The <%= singular_name.titleize.downcase %> was successfully duplicated."
@@ -108,12 +107,18 @@ module Admin
108
107
 
109
108
  private
110
109
 
110
+ def find_<%= singular_name %>
111
+ @<%= singular_name %> = <%= class_name %>.find(params[:id])
112
+ raise ActiveRecord::RecordNotFound.new if @<%= singular_name %>.blank?
113
+ end
114
+
111
115
  def authorize_user
112
116
  authorize! :manage, <%= class_name %>
117
+ authorize! :manage_model, "<%= class_name %>"
113
118
  end
114
119
 
115
120
  def authorize_user_for_destroy
116
- authorize! :destroy, <%= class_name %>
121
+ authorize! :destroy, @<%= singular_name %>
117
122
  end
118
123
 
119
124
  <%unless draggable? %>
@@ -20,9 +20,14 @@
20
20
  %li{:class => "#{ (@<%= singular_name %>.current_localization.locale_id == locale.id ) ? 'active' : '' }"}
21
21
  %a{:href => edit_admin_<%= singular_name %>_path( :id => @<%= singular_name %>.id, :locale_id => locale.id) }
22
22
  = "Edit #{locale.name} Content"
23
+ = auto_save(@<%= singular_name %>.current_localization)
24
+ <% else %>= auto_save(@<%= singular_name %>)<%end%>
25
+ <% if versioned? %>
26
+ - unless @<%= singular_name %>.blank?
27
+ = version_alerts(@<%= singular_name %>.versions , @<%= singular_name %>.version, can?(:publish , @<%= class_name %>) )
28
+ = version_listing(@<%= singular_name %>.versions , @<%= singular_name %>.version )
23
29
  <%end%>
24
-
25
- = form_for(@<%= singular_name %>, :url => admin_<%= singular_name %>_path(@<%= singular_name %>)) do |f|
30
+ = form_for(@<%= singular_name %>, :url => admin_<%= singular_name %>_path(@<%= singular_name %>), :html => {:class => "auto_save"}) do |f|
26
31
  <% if localized? %>= hidden_field_tag :locale_id , @<%= singular_name %>.current_localization.locale_id<%end%>
27
32
  = gb_error_messages_for(@<%= singular_name %>)
28
33
  = render :partial => "form", :locals => {:f => f}