dm_cms 4.2.1.5

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 (298) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +22 -0
  3. data/README.md +31 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/dm_cms/admin.js +58 -0
  6. data/app/assets/javascripts/dm_cms/application.js +16 -0
  7. data/app/assets/stylesheets/dm_cms/admin.css +3 -0
  8. data/app/assets/stylesheets/dm_cms/application.css +13 -0
  9. data/app/controllers/dm_cms/admin/admin_controller.rb +14 -0
  10. data/app/controllers/dm_cms/admin/cms_blogs_controller.rb +89 -0
  11. data/app/controllers/dm_cms/admin/cms_contentitems_controller.rb +96 -0
  12. data/app/controllers/dm_cms/admin/cms_pages_controller.rb +100 -0
  13. data/app/controllers/dm_cms/admin/cms_posts_controller.rb +67 -0
  14. data/app/controllers/dm_cms/admin/cms_snippets_controller.rb +73 -0
  15. data/app/controllers/dm_cms/admin/dashboard_controller.rb +12 -0
  16. data/app/controllers/dm_cms/admin/media_files_controller.rb +80 -0
  17. data/app/controllers/dm_cms/application_controller.rb +9 -0
  18. data/app/controllers/dm_cms/blogs_controller.rb +50 -0
  19. data/app/controllers/dm_cms/comments_controller.rb +3 -0
  20. data/app/controllers/dm_cms/contact_form_controller.rb +27 -0
  21. data/app/controllers/dm_cms/pages_controller.rb +67 -0
  22. data/app/controllers/dm_cms/posts_controller.rb +69 -0
  23. data/app/datatables/blog_user_datatable.rb +79 -0
  24. data/app/helpers/dm_cms/analytics_helper.rb +27 -0
  25. data/app/helpers/dm_cms/application_helper.rb +4 -0
  26. data/app/helpers/dm_cms/cms_contentitems_helper.rb +8 -0
  27. data/app/helpers/dm_cms/cms_pages_helper.rb +30 -0
  28. data/app/helpers/dm_cms/pages_helper.rb +204 -0
  29. data/app/helpers/dm_cms/posts_helper.rb +26 -0
  30. data/app/helpers/dm_cms/render_helper.rb +50 -0
  31. data/app/inputs/media_input.rb +17 -0
  32. data/app/liquid/tags/markdown.rb +30 -0
  33. data/app/mailers/post_notify_mailer.rb +36 -0
  34. data/app/models/cms_blog.rb +89 -0
  35. data/app/models/cms_contentitem.rb +76 -0
  36. data/app/models/cms_page.rb +227 -0
  37. data/app/models/cms_post.rb +76 -0
  38. data/app/models/cms_snippet.rb +42 -0
  39. data/app/models/contact_form.rb +28 -0
  40. data/app/models/dm_cms/concerns/ability.rb +54 -0
  41. data/app/models/dm_cms/permitted_params.rb +34 -0
  42. data/app/models/media_file.rb +102 -0
  43. data/app/presenters/cms_blog_presenter.rb +15 -0
  44. data/app/presenters/cms_page_presenter.rb +23 -0
  45. data/app/presenters/cms_post_presenter.rb +11 -0
  46. data/app/presenters/cms_snippet_presenter.rb +10 -0
  47. data/app/uploaders/media_uploader.rb +169 -0
  48. data/app/views/customized/analytics/_google_analytics.html.erb +11 -0
  49. data/app/views/dm_cms/admin/cms_blogs/_form.html.erb +34 -0
  50. data/app/views/dm_cms/admin/cms_blogs/edit.html.erb +2 -0
  51. data/app/views/dm_cms/admin/cms_blogs/index.html.erb +44 -0
  52. data/app/views/dm_cms/admin/cms_blogs/new.html.erb +2 -0
  53. data/app/views/dm_cms/admin/cms_blogs/show.html.erb +167 -0
  54. data/app/views/dm_cms/admin/cms_contentitems/_form.html.erb +43 -0
  55. data/app/views/dm_cms/admin/cms_contentitems/_form_dialog.html.erb +17 -0
  56. data/app/views/dm_cms/admin/cms_contentitems/edit.html.erb +1 -0
  57. data/app/views/dm_cms/admin/cms_contentitems/markdown.html.erb +21 -0
  58. data/app/views/dm_cms/admin/cms_contentitems/new_content.html.erb +1 -0
  59. data/app/views/dm_cms/admin/cms_pages/_content_toolbar.html.erb +11 -0
  60. data/app/views/dm_cms/admin/cms_pages/_form.html.erb +50 -0
  61. data/app/views/dm_cms/admin/cms_pages/_tree.html.erb +20 -0
  62. data/app/views/dm_cms/admin/cms_pages/_tree_sidebar.html.erb +8 -0
  63. data/app/views/dm_cms/admin/cms_pages/edit.html.erb +2 -0
  64. data/app/views/dm_cms/admin/cms_pages/index.html.erb +32 -0
  65. data/app/views/dm_cms/admin/cms_pages/new_page.html.erb +2 -0
  66. data/app/views/dm_cms/admin/cms_pages/show.html.erb +54 -0
  67. data/app/views/dm_cms/admin/cms_posts/_form.html.erb +59 -0
  68. data/app/views/dm_cms/admin/cms_posts/edit.html.erb +2 -0
  69. data/app/views/dm_cms/admin/cms_posts/new.html.erb +1 -0
  70. data/app/views/dm_cms/admin/cms_snippets/_form.html.erb +28 -0
  71. data/app/views/dm_cms/admin/cms_snippets/edit.html.erb +1 -0
  72. data/app/views/dm_cms/admin/cms_snippets/index.html.erb +29 -0
  73. data/app/views/dm_cms/admin/cms_snippets/new.html.erb +1 -0
  74. data/app/views/dm_cms/admin/dashboard/_widget_blog_comments.html.erb +37 -0
  75. data/app/views/dm_cms/admin/dashboard/widget_blog_comments.js.erb +1 -0
  76. data/app/views/dm_cms/admin/media_files/_form.html.erb +102 -0
  77. data/app/views/dm_cms/admin/media_files/edit.html.erb +3 -0
  78. data/app/views/dm_cms/admin/media_files/index.html.erb +98 -0
  79. data/app/views/dm_cms/admin/media_files/new.html.erb +3 -0
  80. data/app/views/dm_cms/admin/shared/_liquid_tags_ref.html.erb +35 -0
  81. data/app/views/dm_cms/blogs/show.html.erb +0 -0
  82. data/app/views/dm_cms/blogs/toggle_follow.js.coffee +5 -0
  83. data/app/views/dm_cms/contact_form/create.html.erb +2 -0
  84. data/app/views/dm_cms/contact_form/create.js.erb +2 -0
  85. data/app/views/dm_cms/pages/_content_fragment.html.erb +13 -0
  86. data/app/views/dm_cms/pages/_snippet_fragment.html.erb +12 -0
  87. data/app/views/dm_cms/pages/coming_soon.html.erb +2 -0
  88. data/app/views/dm_cms/pages/show.html.erb +0 -0
  89. data/app/views/dm_cms/posts/show.html.erb +0 -0
  90. data/app/views/dm_cms/shared/_comment.html.erb +22 -0
  91. data/app/views/dm_cms/shared/_comment_form.html.erb +16 -0
  92. data/app/views/dm_cms/shared/_comment_list.html.erb +11 -0
  93. data/app/views/dm_cms/shared/_social_buttons.html.erb +6 -0
  94. data/app/views/layouts/email_templates/dm_cms_email_layout.html.erb +320 -0
  95. data/app/views/layouts/email_templates/dm_cms_email_layout.text.erb +1 -0
  96. data/app/views/layouts/email_templates/dm_cms_post_notify.html.erb +13 -0
  97. data/app/views/layouts/email_templates/dm_cms_post_notify.text.erb +9 -0
  98. data/app/views/liquid_tags/_contact_form.html.erb +17 -0
  99. data/config/initializers/liquid_init.rb +2 -0
  100. data/config/locales/cms.cs.yml +42 -0
  101. data/config/locales/cms.de.yml +42 -0
  102. data/config/locales/cms.en.yml +42 -0
  103. data/config/locales/cms.fi.yml +42 -0
  104. data/config/locales/cms.ja.yml +42 -0
  105. data/config/routes.rb +70 -0
  106. data/db/migrate/20121103181909_create_cms.rb +91 -0
  107. data/db/migrate/20130206213720_add_account_to_cms.rb +10 -0
  108. data/db/migrate/20130507123255_create_blog.rb +61 -0
  109. data/db/migrate/20130531212537_add_notification_sent.rb +5 -0
  110. data/db/migrate/20130605184116_add_blog_comment.rb +7 -0
  111. data/db/migrate/20131128201053_add_blog_image.rb +5 -0
  112. data/db/migrate/20140217135228_rename_snippet_slug.rb +13 -0
  113. data/db/migrate/20140303121217_add_requires_subscription_blog.rb +7 -0
  114. data/db/migrate/20140328205246_add_pages_ranked_model.rb +22 -0
  115. data/db/migrate/20140423113417_add_blog_owner.rb +6 -0
  116. data/db/migrate/20140428122156_create_media_files.rb +29 -0
  117. data/db/migrate/20140523134543_add_cmspage_summary.rb +6 -0
  118. data/db/migrate/20140601151631_add_blog_image_email_header.rb +5 -0
  119. data/db/migrate/20141004154725_add_header_image.rb +9 -0
  120. data/db/migrate/20160821150108_index_foreign_keys_in_cms_blogs.rb +6 -0
  121. data/db/migrate/20160821150109_index_foreign_keys_in_cms_media_files.rb +6 -0
  122. data/db/migrate/20160821150110_index_foreign_keys_in_cms_posts.rb +6 -0
  123. data/lib/dm_cms.rb +4 -0
  124. data/lib/dm_cms/engine.rb +16 -0
  125. data/lib/dm_cms/liquid/filters/liquid_filters.rb +11 -0
  126. data/lib/dm_cms/liquid/tags/contact_form.rb +35 -0
  127. data/lib/dm_cms/liquid/tags/div.rb +42 -0
  128. data/lib/dm_cms/liquid/tags/image.rb +76 -0
  129. data/lib/dm_cms/liquid/tags/quote.rb +38 -0
  130. data/lib/dm_cms/liquid/tags/snippet.rb +37 -0
  131. data/lib/dm_cms/liquid/tags/url_asset.rb +41 -0
  132. data/lib/dm_cms/liquid/tags/url_media.rb +42 -0
  133. data/lib/dm_cms/liquid/tags/url_protected.rb +31 -0
  134. data/lib/tasks/dm_cms_tasks.rake +4 -0
  135. data/spec/controllers/admin/cms_blogs_controller_spec.rb +173 -0
  136. data/spec/controllers/admin/cms_pages_controller_spec.rb +182 -0
  137. data/spec/controllers/admin/cms_posts_controller_spec.rb +166 -0
  138. data/spec/dummy/README.rdoc +28 -0
  139. data/spec/dummy/Rakefile +6 -0
  140. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  141. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  142. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  143. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  144. data/spec/dummy/app/models/ability.rb +12 -0
  145. data/spec/dummy/app/models/user.rb +6 -0
  146. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  147. data/spec/dummy/bin/bundle +3 -0
  148. data/spec/dummy/bin/rails +4 -0
  149. data/spec/dummy/bin/rake +4 -0
  150. data/spec/dummy/config.ru +4 -0
  151. data/spec/dummy/config/application.rb +26 -0
  152. data/spec/dummy/config/boot.rb +5 -0
  153. data/spec/dummy/config/database.yml +25 -0
  154. data/spec/dummy/config/environment.rb +5 -0
  155. data/spec/dummy/config/environments/development.rb +37 -0
  156. data/spec/dummy/config/environments/production.rb +82 -0
  157. data/spec/dummy/config/environments/test.rb +39 -0
  158. data/spec/dummy/config/initializers/_themes_for_rails.rb +39 -0
  159. data/spec/dummy/config/initializers/account_initialization.rb +28 -0
  160. data/spec/dummy/config/initializers/assets.rb +8 -0
  161. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  162. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  163. data/spec/dummy/config/initializers/dm_core.rb +6 -0
  164. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  165. data/spec/dummy/config/initializers/inflections.rb +16 -0
  166. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  167. data/spec/dummy/config/initializers/session_store.rb +3 -0
  168. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  169. data/spec/dummy/config/locales/en.yml +23 -0
  170. data/spec/dummy/config/routes.rb +19 -0
  171. data/spec/dummy/config/secrets.yml +22 -0
  172. data/spec/dummy/db/development.sqlite3 +0 -0
  173. data/spec/dummy/db/migrate/20141114170927_add_globalize_countries.dm_core.rb +50 -0
  174. data/spec/dummy/db/migrate/20141114170928_devise_create_users.dm_core.rb +46 -0
  175. data/spec/dummy/db/migrate/20141114170929_add_user_fields.dm_core.rb +14 -0
  176. data/spec/dummy/db/migrate/20141114170930_rolify_create_roles.dm_core.rb +20 -0
  177. data/spec/dummy/db/migrate/20141114170931_add_last_access.dm_core.rb +10 -0
  178. data/spec/dummy/db/migrate/20141114170932_create_versions.dm_core.rb +19 -0
  179. data/spec/dummy/db/migrate/20141114170933_add_object_changes_column_to_versions.dm_core.rb +12 -0
  180. data/spec/dummy/db/migrate/20141114170934_create_dm_core_accounts.dm_core.rb +13 -0
  181. data/spec/dummy/db/migrate/20141114170935_add_account_to_users.dm_core.rb +9 -0
  182. data/spec/dummy/db/migrate/20141114170936_create_preferences.dm_core.rb +13 -0
  183. data/spec/dummy/db/migrate/20141114170937_create_comments.dm_core.rb +22 -0
  184. data/spec/dummy/db/migrate/20141114170938_add_activity.dm_core.rb +21 -0
  185. data/spec/dummy/db/migrate/20141114170939_add_type_to_comments.dm_core.rb +9 -0
  186. data/spec/dummy/db/migrate/20141114170940_add_category.dm_core.rb +28 -0
  187. data/spec/dummy/db/migrate/20141114170941_create_email_table.dm_core.rb +26 -0
  188. data/spec/dummy/db/migrate/20141114170942_add_user_profile.dm_core.rb +46 -0
  189. data/spec/dummy/db/migrate/20141114170943_add_profile_email.dm_core.rb +14 -0
  190. data/spec/dummy/db/migrate/20141114170944_create_payment_history.dm_core.rb +37 -0
  191. data/spec/dummy/db/migrate/20141114170945_change_anchor_field.dm_core.rb +10 -0
  192. data/spec/dummy/db/migrate/20141114170946_create_user_site_profile.dm_core.rb +27 -0
  193. data/spec/dummy/db/migrate/20141114170947_add_avatar.dm_core.rb +12 -0
  194. data/spec/dummy/db/migrate/20141114170948_add_notify_to_payment_history.dm_core.rb +8 -0
  195. data/spec/dummy/db/migrate/20141114170949_acts_as_votable_migration.dm_core.rb +28 -0
  196. data/spec/dummy/db/migrate/20141114170950_add_user_site_profile_uuid.dm_core.rb +19 -0
  197. data/spec/dummy/db/migrate/20141114170951_add_invoice_id.dm_core.rb +7 -0
  198. data/spec/dummy/db/migrate/20141114170952_acts_as_follower_migration.dm_core.rb +18 -0
  199. data/spec/dummy/db/migrate/20141114170953_rename_invoice_id.dm_core.rb +12 -0
  200. data/spec/dummy/db/migrate/20141114170954_add_core_addresses.dm_core.rb +18 -0
  201. data/spec/dummy/db/migrate/20141114170955_papertrail_increase_column.dm_core.rb +9 -0
  202. data/spec/dummy/db/migrate/20141114170956_acts_as_taggable_on_migration.dm_core.rb +32 -0
  203. data/spec/dummy/db/migrate/20141114170957_add_missing_unique_indices.dm_core.rb +23 -0
  204. data/spec/dummy/db/migrate/20141114170958_add_taggings_counter_cache_to_tags.dm_core.rb +16 -0
  205. data/spec/dummy/db/migrate/20141114170959_create_custom_fields.dm_core.rb +40 -0
  206. data/spec/dummy/db/migrate/20141114170960_add_missing_taggable_index.dm_core.rb +11 -0
  207. data/spec/dummy/db/migrate/20141114170961_create_documents.dm_knowledge.rb +19 -0
  208. data/spec/dummy/db/migrate/20141114170962_add_document_notes.dm_knowledge.rb +7 -0
  209. data/spec/dummy/db/migrate/20160128134522_add_favored_locale.dm_core.rb +17 -0
  210. data/spec/dummy/db/migrate/20160128134523_update_papertrail_v4.dm_core.rb +41 -0
  211. data/spec/dummy/db/schema.rb +590 -0
  212. data/spec/dummy/db/seeds.rb +18 -0
  213. data/spec/dummy/public/404.html +67 -0
  214. data/spec/dummy/public/422.html +67 -0
  215. data/spec/dummy/public/500.html +66 -0
  216. data/spec/dummy/public/favicon.ico +0 -0
  217. data/spec/dummy/themes/_mbus/_readme.md +6 -0
  218. data/spec/dummy/themes/_mbus/_theme.yml +21 -0
  219. data/spec/dummy/themes/_mbus/theme_assets/_mbus/javascripts/application.js +9 -0
  220. data/spec/dummy/themes/_mbus/theme_assets/_mbus/javascripts/bootstrap.js +2114 -0
  221. data/spec/dummy/themes/_mbus/theme_assets/_mbus/javascripts/bootstrap.min.js +6 -0
  222. data/spec/dummy/themes/_mbus/theme_assets/_mbus/javascripts/contact_me.js +75 -0
  223. data/spec/dummy/themes/_mbus/theme_assets/_mbus/javascripts/jqBootstrapValidation.js +912 -0
  224. data/spec/dummy/themes/_mbus/theme_assets/_mbus/javascripts/jquery-1.11.0.js +4 -0
  225. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/application.css +14 -0
  226. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/bootstrap.css +6203 -0
  227. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/bootstrap.min.css +5 -0
  228. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/css/font-awesome.css +1566 -0
  229. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/css/font-awesome.min.css +4 -0
  230. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/fonts/FontAwesome.otf +0 -0
  231. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/fonts/fontawesome-webfont.eot +0 -0
  232. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/fonts/fontawesome-webfont.svg +504 -0
  233. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/fonts/fontawesome-webfont.ttf +0 -0
  234. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/fonts/fontawesome-webfont.woff +0 -0
  235. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/bordered-pulled.less +16 -0
  236. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/core.less +12 -0
  237. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/fixed-width.less +6 -0
  238. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/font-awesome.less +17 -0
  239. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/icons.less +506 -0
  240. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/larger.less +13 -0
  241. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/list.less +19 -0
  242. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/mixins.less +20 -0
  243. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/path.less +14 -0
  244. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/rotated-flipped.less +9 -0
  245. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/spinning.less +32 -0
  246. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/stacked.less +20 -0
  247. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/less/variables.less +515 -0
  248. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_bordered-pulled.scss +16 -0
  249. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_core.scss +12 -0
  250. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_fixed-width.scss +6 -0
  251. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_icons.scss +506 -0
  252. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_larger.scss +13 -0
  253. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_list.scss +19 -0
  254. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_mixins.scss +20 -0
  255. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_path.scss +14 -0
  256. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_rotated-flipped.scss +9 -0
  257. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_spinning.scss +32 -0
  258. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_stacked.scss +20 -0
  259. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/_variables.scss +515 -0
  260. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/font-awesome-4.1.0/scss/font-awesome.scss +17 -0
  261. data/spec/dummy/themes/_mbus/theme_assets/_mbus/stylesheets/modern-business.css +93 -0
  262. data/spec/dummy/themes/_mbus/theme_support/config/load_theme.rb +0 -0
  263. data/spec/dummy/themes/_mbus/theme_support/locales/site.cs.yml +57 -0
  264. data/spec/dummy/themes/_mbus/theme_support/locales/site.de.yml +57 -0
  265. data/spec/dummy/themes/_mbus/theme_support/locales/site.en.yml +57 -0
  266. data/spec/dummy/themes/_mbus/theme_support/locales/site.fi.yml +58 -0
  267. data/spec/dummy/themes/_mbus/theme_support/locales/site.ja.yml +57 -0
  268. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_blog_right_sidebar.html.erb +91 -0
  269. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_comment.html.erb +21 -0
  270. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_comment_form.html.erb +16 -0
  271. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_comment_list.html.erb +7 -0
  272. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_comment_section.html.erb +17 -0
  273. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_page_footer.html.erb +11 -0
  274. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_page_header.html.erb +39 -0
  275. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_page_top.html.erb +24 -0
  276. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_post_summary_item.html.erb +11 -0
  277. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/_social_buttons_initialization.html.erb +10 -0
  278. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/blog.html.erb +47 -0
  279. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/blog_post.html.erb +55 -0
  280. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/content_full_width.html.erb +28 -0
  281. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/content_with_left_nav.html.erb +44 -0
  282. data/spec/dummy/themes/_mbus/theme_support/views/layouts/cms_templates/index.html.erb +19 -0
  283. data/spec/dummy/themes/local/_theme.yml +8 -0
  284. data/spec/factories/accounts.rb +17 -0
  285. data/spec/factories/blogs.rb +19 -0
  286. data/spec/factories/posts.rb +23 -0
  287. data/spec/factories/user_profiles.rb +10 -0
  288. data/spec/factories/users.rb +19 -0
  289. data/spec/features/admin/blog_admin_spec.rb +16 -0
  290. data/spec/models/cms_blog_spec.rb +37 -0
  291. data/spec/models/cms_page_spec.rb +9 -0
  292. data/spec/models/cms_post_spec.rb +44 -0
  293. data/spec/rails_helper.rb +70 -0
  294. data/spec/spec_helper.rb +85 -0
  295. data/spec/support/accounts.rb +17 -0
  296. data/spec/support/devise.rb +44 -0
  297. data/spec/support/fix_locale.rb +57 -0
  298. metadata +545 -0
@@ -0,0 +1,61 @@
1
+ class CreateBlog < ActiveRecord::Migration
2
+ def up
3
+ create_table :cms_blog_translations, :force => true do |t|
4
+ t.integer :cms_blog_id
5
+ t.string :locale
6
+ t.string :title
7
+ t.datetime :created_at
8
+ t.datetime :updated_at
9
+ end
10
+
11
+ add_index :cms_blog_translations, ["cms_blog_id"], :name => "index_cms_blog_translations_on_cms_blog_id"
12
+
13
+ create_table :cms_blogs, :force => true do |t|
14
+ t.string :slug
15
+ t.boolean :published, :default => false
16
+ t.boolean :is_public, :default => false
17
+ t.boolean :requires_login, :default => false
18
+ t.integer :row_order
19
+ t.datetime :updated_on
20
+ t.datetime :created_on
21
+ t.integer :account_id
22
+ t.integer :lock_version, :default => 0, :null => false
23
+ end
24
+
25
+ add_index :cms_blogs, ["slug"], :name => "blogname_key"
26
+ add_index :cms_blogs, ["published"], :name => "cms_blogs_published_index"
27
+
28
+ create_table :cms_post_translations, :force => true do |t|
29
+ t.integer :cms_post_id
30
+ t.string :locale
31
+ t.string :title
32
+ t.text :content
33
+ t.text :summary
34
+ t.datetime :created_at
35
+ t.datetime :updated_at
36
+ end
37
+
38
+ add_index :cms_post_translations, ["cms_post_id"], :name => "index_cms_post_translations_on_cms_post_id"
39
+
40
+ create_table :cms_posts, :force => true do |t|
41
+ t.string :slug
42
+ t.integer :cms_blog_id
43
+ t.string :image
44
+ t.datetime :published_on
45
+ t.datetime :updated_on
46
+ t.datetime :created_on
47
+ t.integer :account_id
48
+ t.integer :lock_version, :default => 0, :null => false
49
+ end
50
+
51
+ add_index :cms_posts, ["slug"], :name => "postname_key"
52
+ add_index :cms_posts, ["published_on"], :name => "cms_posts_published_index"
53
+ end
54
+
55
+ def down
56
+ drop_table :cms_blogs
57
+ drop_table :cms_blog_translations
58
+ drop_table :cms_posts
59
+ drop_table :cms_post_translations
60
+ end
61
+ end
@@ -0,0 +1,5 @@
1
+ class AddNotificationSent < ActiveRecord::Migration
2
+ def change
3
+ add_column :cms_posts, :notification_sent_on, :datetime
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ class AddBlogComment < ActiveRecord::Migration
2
+ def change
3
+ add_column :cms_posts, :comments_count, :integer, :default => 0
4
+ add_column :cms_posts, :comments_allowed, :boolean
5
+ add_column :cms_blogs, :comments_allowed, :boolean
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class AddBlogImage < ActiveRecord::Migration
2
+ def change
3
+ add_column :cms_blogs, :image, :string
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ class RenameSnippetSlug < ActiveRecord::Migration
2
+ def up
3
+ change_column :cms_snippets, :itemtype, :string, :default => 'markdown'
4
+ rename_column :cms_snippets, :container, :slug
5
+ rename_index :cms_snippets, 'index_cms_snippets_on_container', 'index_cms_snippets_on_slug'
6
+ end
7
+
8
+ def down
9
+ change_column :cms_snippets, :itemtype, :string, :default => 'textile'
10
+ rename_column :cms_snippets, :slug, :container
11
+ rename_index :cms_snippets, 'index_cms_snippets_on_slug', 'index_cms_snippets_on_container'
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ class AddRequiresSubscriptionBlog < ActiveRecord::Migration
2
+ def change
3
+ add_column :cms_blogs, :requires_subscription, :boolean, :default => false
4
+ add_column :cms_pages, :requires_subscription, :boolean, :default => false
5
+ add_column :cms_pages, :is_public, :boolean, :default => true
6
+ end
7
+ end
@@ -0,0 +1,22 @@
1
+ class AddPagesRankedModel < ActiveRecord::Migration
2
+ def up
3
+ add_column :cms_pages, :row_order, :integer
4
+ rename_column :cms_contentitems, :position, :row_order
5
+
6
+ #--- because of some duplications in the position column, need to
7
+ # create a more unique position value. So add up the positions
8
+ total = 0
9
+ CmsPage.unscoped.order(:ancestry, :position).each do |page|
10
+ total = total + page.position
11
+ Account.current = Account.find(page.account_id)
12
+ page.update_attributes :row_order => total
13
+ end
14
+ remove_column :cms_pages, :position
15
+ end
16
+
17
+ def down
18
+ remove_column :cms_pages, :row_order
19
+ add_columnn :cms_pages, :position, :integer
20
+ rename_column :cms_contentitems, :row_order, :position
21
+ end
22
+ end
@@ -0,0 +1,6 @@
1
+ class AddBlogOwner < ActiveRecord::Migration
2
+ def change
3
+ add_column :cms_blogs, :owner_id, :integer
4
+ add_column :cms_blogs, :owner_type, :string
5
+ end
6
+ end
@@ -0,0 +1,29 @@
1
+ class CreateMediaFiles < ActiveRecord::Migration
2
+ def change
3
+ create_table :cms_media_files do |t|
4
+ t.string :media
5
+ t.integer :media_file_size
6
+ t.string :media_content_type
7
+ t.string :folder
8
+ t.boolean :generate_retina
9
+ t.integer :user_id
10
+ t.datetime :created_at
11
+ t.datetime :updated_at
12
+ t.integer :account_id
13
+ end
14
+
15
+ add_index :cms_media_files, [:media, :folder, :account_id], unique: true, name: "index_media_folder_account_id"
16
+
17
+ create_table :cms_media_file_translations, :force => true do |t|
18
+ t.integer :cms_media_file_id
19
+ t.string :locale
20
+ t.string :title
21
+ t.string :description
22
+ t.datetime :created_at
23
+ t.datetime :updated_at
24
+ end
25
+
26
+ add_index :cms_media_file_translations, [:cms_media_file_id], name: "index_cms_media_file_translations_on_cms_media_file_id"
27
+
28
+ end
29
+ end
@@ -0,0 +1,6 @@
1
+ class AddCmspageSummary < ActiveRecord::Migration
2
+ def change
3
+ add_column :cms_pages, :image, :string
4
+ add_column :cms_page_translations, :summary, :text
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddBlogImageEmailHeader < ActiveRecord::Migration
2
+ def change
3
+ add_column :cms_blogs, :image_email_header, :string
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class AddHeaderImage < ActiveRecord::Migration
2
+ def change
3
+ rename_column :cms_pages, :image, :featured_image
4
+ add_column :cms_pages, :header_image, :string
5
+
6
+ rename_column :cms_blogs, :image, :header_image
7
+ rename_column :cms_posts, :image, :featured_image
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ class IndexForeignKeysInCmsBlogs < ActiveRecord::Migration
2
+ def change
3
+ add_index :cms_blogs, :account_id
4
+ add_index :cms_blogs, :owner_id
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ class IndexForeignKeysInCmsMediaFiles < ActiveRecord::Migration
2
+ def change
3
+ add_index :cms_media_files, :account_id
4
+ add_index :cms_media_files, :user_id
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ class IndexForeignKeysInCmsPosts < ActiveRecord::Migration
2
+ def change
3
+ add_index :cms_posts, :account_id
4
+ add_index :cms_posts, :cms_blog_id
5
+ end
6
+ end
data/lib/dm_cms.rb ADDED
@@ -0,0 +1,4 @@
1
+ require "dm_cms/engine"
2
+
3
+ module DmCms
4
+ end
@@ -0,0 +1,16 @@
1
+ require 'meta-tags-helpers'
2
+ require 'mail_form'
3
+ require 'dm_core'
4
+
5
+ module DmCms
6
+ class Engine < ::Rails::Engine
7
+ isolate_namespace DmCms
8
+
9
+ initializer "dm_cms.init_liquid_tags" do |app|
10
+ #--- require each tag -- registration is done in the tag file itself
11
+ Dir.glob(File.expand_path("../../../app/liquid/tags/*.rb", __FILE__)).each do |path|
12
+ require path
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ #------------------------------------------------------------------------------
2
+ module LiquidFilters
3
+ include ActionView::Helpers::NumberHelper
4
+
5
+ #------------------------------------------------------------------------------
6
+ def currency(price)
7
+ number_to_currency(price)
8
+ end
9
+ end
10
+
11
+ Liquid::Template.register_filter(LiquidFilters)
@@ -0,0 +1,35 @@
1
+ #------------------------------------------------------------------------------
2
+ module Liquid
3
+ class ContactForm < DmCore::LiquidTag
4
+
5
+ #------------------------------------------------------------------------------
6
+ def render(context)
7
+ partial_name = @attributes['name'].present? ? "#{@attributes['name']}_contact_form" : 'contact_form'
8
+ context.registers[:view].render(:partial => "liquid_tags/#{partial_name}")
9
+ end
10
+
11
+ #------------------------------------------------------------------------------
12
+ def self.details
13
+ { name: self.tag_name,
14
+ summary: 'Contact form tag',
15
+ category: 'form',
16
+ description: <<-END_OF_DESCRIPTION
17
+ Includes a system standard contact form.
18
+
19
+ ~~~
20
+ {% contact_form %}
21
+ ~~~
22
+
23
+ If you have a custom form, provide it's name
24
+
25
+ ~~~
26
+ {% contact_form name: tech_support %}
27
+ ~~~
28
+
29
+ END_OF_DESCRIPTION
30
+ }
31
+ end
32
+ end
33
+ Template.register_tag('contact_form', ContactForm)
34
+ end
35
+
@@ -0,0 +1,42 @@
1
+ module Liquid
2
+ class Div < DmCore::LiquidBlock
3
+
4
+ #------------------------------------------------------------------------------
5
+ def render(context)
6
+ @attributes.reverse_merge! 'class' => '', 'id' => '', 'style' => '', 'markdown' => ''
7
+
8
+ output = super
9
+ style = "style='#{@attributes["style"]}'" unless @attributes['style'].blank?
10
+ dclass = "class='#{@attributes["class"]}'" unless @attributes['class'].blank?
11
+ id = "id='#{@attributes["id"]}'" unless @attributes['id'].blank?
12
+ markdown = "markdown='#{@attributes["markdown"]}'" unless @attributes['markdown'].blank?
13
+
14
+ out = "<div #{[id, dclass, style, markdown].join(' ')}>"
15
+ out += output
16
+ out += "</div>"
17
+ end
18
+
19
+ def self.details
20
+ { name: self.tag_name,
21
+ summary: 'HTML div block',
22
+ category: 'structure',
23
+ description: <<-END_OF_DESCRIPTION
24
+ Outputs an HTML 'div' block. You can specify id, class, and style.
25
+ You can also specify the markdown modifier, such as 'markdown: 0', if you don't wish the contents to be
26
+ processed by Markdown.
27
+
28
+ ~~~
29
+ {% div id: some_id, class: "class1 class2", style: "color: red; background-color: #aaa;" %}
30
+ ...content
31
+ {% enddiv %}
32
+ ~~~
33
+
34
+ _Note:_ `class` and `style` are specified the same as a normal HTML div
35
+ END_OF_DESCRIPTION
36
+ }
37
+ end
38
+ end
39
+
40
+ Template.register_tag('div', Div)
41
+
42
+ end
@@ -0,0 +1,76 @@
1
+ # Simple image tag - uses rails helper
2
+ #
3
+ # {% image src : source_img, class : ccc, title : ttt, size : 16x16, width : www, height : hhh,
4
+ # alt : aaa, style : sss, id : iii, mouseover : mmm}
5
+ #------------------------------------------------------------------------------
6
+ module Liquid
7
+ class Image < DmCore::LiquidTag
8
+ include ActionView::Helpers::TagHelper
9
+ include ActionView::Helpers::AssetTagHelper
10
+ include DmCore::UrlHelper
11
+ include DmCore::ParamsHelper
12
+ include DmCore::AccountHelper
13
+
14
+ #------------------------------------------------------------------------------
15
+ def render(context)
16
+ if @attributes['version']
17
+ #--- pull from MediaFile object
18
+ src = MediaFile.url_by_name(@attributes['src'], version: @attributes['version'])
19
+ @attributes.delete('version')
20
+ else
21
+ #--- handle like regular url
22
+ src = file_url(@attributes['src'], account_site_assets: context_account_site_assets(context), default_folder: 'media', protected: @attributes['protected'].as_boolean)
23
+ end
24
+ @attributes.delete('src')
25
+
26
+ image_tag(src, @attributes)
27
+ end
28
+
29
+ #------------------------------------------------------------------------------
30
+ def self.details
31
+ { name: self.tag_name,
32
+ summary: 'Displays an image',
33
+ category: 'media',
34
+ description: <<-END_OF_DESCRIPTION
35
+ Displays an image. Will pull image (with optional version) from the site's media directory unless a full path is given.
36
+ Any normal HTML img attributes can be passed, such `alt`, `title`, `width`, etc
37
+
38
+ Parameters:
39
+
40
+ src
41
+ : name of the image. Can either reference a file in the 'media' directory (`2014/car.jpg`), a full path (`http://example.com/image/car.jpg`)
42
+ or reference an S3 file (`s3://bucket/car.jpg`)
43
+
44
+ version
45
+ : (optional) Use a specific image version (`thumb`, `lg`, etc)
46
+
47
+ protected
48
+ : (optional) File is in protected directory. `version` will have no effect with this option
49
+
50
+ html img attributes
51
+ : you can specify any valid HTML img attributes, such as `width` or `title`
52
+
53
+ **Examples**
54
+
55
+ ~~~
56
+ {% image src: '2014/placeholder_190x105.jpg', class: 'right', title: "Some title" %}
57
+ ~~~
58
+ Image in the media directory, with a specified class and title
59
+
60
+ ~~~
61
+ {% image src: '2014/placeholder_190x105.jpg', class: right, protected: true %}
62
+ ~~~
63
+ Image is in the protected asset folder
64
+
65
+ ~~~
66
+ {% image src: '2014/placeholder_190x105.jpg', version: 'thumb', alt: "Some title" %}
67
+ ~~~
68
+ Use the `thumb` version of the image
69
+
70
+ END_OF_DESCRIPTION
71
+ }
72
+ end
73
+ end
74
+
75
+ Template.register_tag('image', Image)
76
+ end
@@ -0,0 +1,38 @@
1
+ module Liquid
2
+ class Quote < DmCore::LiquidBlock
3
+
4
+ #------------------------------------------------------------------------------
5
+ def render(context)
6
+ @attributes.reverse_merge! 'class' => '', 'id' => '', 'style' => '', 'author' => ''
7
+
8
+ output = super
9
+ style = "style='#{@attributes["style"]}'" unless @attributes['style'].blank?
10
+ dclass = "class='#{@attributes["class"]}'" unless @attributes['class'].blank?
11
+ id = "id='#{@attributes["id"]}'" unless @attributes['id'].blank?
12
+
13
+ out = "<blockquote #{[id, dclass, style].join(' ')}>"
14
+ out += output
15
+ out += "\r\n<footer markdown='0'><cite>#{@attributes['author']}</cite></footer>" unless @attributes['author'].blank?
16
+ out += "</blockquote>"
17
+ end
18
+
19
+ def self.details
20
+ { name: self.tag_name,
21
+ summary: 'HTML blockquote',
22
+ category: 'structure',
23
+ description: <<-END_OF_DESCRIPTION
24
+ Outpus an HTML 'blockquote' with optional author. You can specify id, class, and style.
25
+
26
+ ~~~
27
+ {% quote author: 'Favorite Person', id: some_id, class: some_class, style: some_style %}
28
+ ...content
29
+ {% endquote %}
30
+ ~~~
31
+ END_OF_DESCRIPTION
32
+ }
33
+ end
34
+ end
35
+
36
+ Template.register_tag('quote', Quote)
37
+
38
+ end