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,37 @@
1
+ #------------------------------------------------------------------------------
2
+ module Liquid
3
+ class Snippet < DmCore::LiquidTag
4
+ include DmCore::AccountHelper
5
+ include DmCore::LiquidHelper
6
+
7
+ #------------------------------------------------------------------------------
8
+ def render(context)
9
+ output = ''
10
+ if @attributes['slug'].present?
11
+ cms_snippet = CmsSnippet.find_by_slug(@attributes['slug'])
12
+ if cms_snippet
13
+ output = context.registers[:view].render_content_item(cms_snippet)
14
+ end
15
+ end
16
+ return output
17
+ end
18
+
19
+ #------------------------------------------------------------------------------
20
+ def self.details
21
+ { name: self.tag_name,
22
+ summary: 'Display a snippet',
23
+ category: 'structure',
24
+ description: <<-END_OF_DESCRIPTION
25
+ Output the content of a snippet specified by the slug
26
+
27
+ ~~~
28
+ {% snippet slug: 'some-snippet-slug'}
29
+ ~~~
30
+
31
+ END_OF_DESCRIPTION
32
+ }
33
+ end
34
+ end
35
+ Template.register_tag('snippet', Snippet)
36
+ end
37
+
@@ -0,0 +1,41 @@
1
+ # DEPRECATED - use url_media instead
2
+ #------------------------------------------------------------------------------
3
+ module Liquid
4
+ class UrlAsset < DmCore::LiquidTag
5
+ include ActionView::Helpers::TagHelper
6
+ include ActionView::Helpers::AssetTagHelper
7
+ include DmCore::UrlHelper
8
+ include DmCore::ParamsHelper
9
+ include DmCore::AccountHelper
10
+
11
+ #------------------------------------------------------------------------------
12
+ def render(context)
13
+ if @attributes['version']
14
+ #--- pull from MediaFile object
15
+ src = MediaFile.url_by_name(@attributes['src'], version: @attributes['version'])
16
+ else
17
+ #--- handle like regular url
18
+ src = file_url(@attributes['src'], account_site_assets: context_account_site_assets(context), default_folder: 'media', protected: @attributes['protected'].as_boolean)
19
+ end
20
+ return src.nil? ? '' : src
21
+ end
22
+
23
+ # def self.details
24
+ # { name: self.tag_name,
25
+ # summary: 'Returns url of an asset',
26
+ # category: 'url',
27
+ # description: <<-END_OF_DESCRIPTION
28
+ # Give the location/url of an asset file. It is relative to the site's media directory unless a full path/url is given.
29
+ #
30
+ # ~~~
31
+ # {% url_asset src: 'library/something.pdf' %}
32
+ # ~~~
33
+ # END_OF_DESCRIPTION
34
+ # }
35
+ # end
36
+ end
37
+
38
+ Template.register_tag('url_asset', UrlAsset)
39
+ Template.register_tag('image_path', UrlAsset)
40
+ Template.register_tag('url_image', UrlAsset)
41
+ end
@@ -0,0 +1,42 @@
1
+ module Liquid
2
+ class UrlMedia < DmCore::LiquidTag
3
+ include ActionView::Helpers::TagHelper
4
+ include ActionView::Helpers::AssetTagHelper
5
+ include DmCore::UrlHelper
6
+ include DmCore::ParamsHelper
7
+ include DmCore::AccountHelper
8
+
9
+ #------------------------------------------------------------------------------
10
+ def render(context)
11
+ if @attributes['version']
12
+ #--- pull from MediaFile object
13
+ src = MediaFile.url_by_name(@attributes['src'], version: @attributes['version'])
14
+ else
15
+ #--- handle like regular url
16
+ src = file_url(@attributes['src'], account_site_assets: context_account_site_assets(context), default_folder: 'media', protected: @attributes['protected'].as_boolean)
17
+ end
18
+ return src.nil? ? '' : src
19
+ end
20
+
21
+ def self.details
22
+ { name: self.tag_name,
23
+ summary: 'Returns url of a media file',
24
+ category: 'url',
25
+ description: <<-END_OF_DESCRIPTION
26
+ Give the location/url of a media file. It is relative to the site's media directory unless a full path/url is given.
27
+
28
+ ~~~
29
+ {% url_media src: '2014/something.pdf' %}
30
+
31
+ {% url_media src: 'course/lesson1.mp3' %}
32
+
33
+ {% url_media src: 'nature/desert.jpg', version: 'retina_lg' %}
34
+
35
+ ~~~
36
+ END_OF_DESCRIPTION
37
+ }
38
+ end
39
+ end
40
+
41
+ Template.register_tag('url_media', UrlMedia)
42
+ end
@@ -0,0 +1,31 @@
1
+ module Liquid
2
+ class UrlProtected < DmCore::LiquidTag
3
+ include ActionView::Helpers::TagHelper
4
+ include ActionView::Helpers::AssetTagHelper
5
+ include DmCore::UrlHelper
6
+ include DmCore::ParamsHelper
7
+ include DmCore::AccountHelper
8
+
9
+ #------------------------------------------------------------------------------
10
+ def render(context)
11
+ src = file_url(@attributes["src"], account_site_assets: context_account_site_assets(context), default_folder: '', protected: true)
12
+ return src.nil? ? '' : src
13
+ end
14
+
15
+ def self.details
16
+ { name: self.tag_name,
17
+ summary: 'Returns url of a protected asset',
18
+ category: 'url',
19
+ description: <<-END_OF_DESCRIPTION
20
+ Give the location/url of a protected asset file.
21
+
22
+ ~~~
23
+ {% url_protected src: 'teachers/something.pdf' %}
24
+ ~~~
25
+ END_OF_DESCRIPTION
26
+ }
27
+ end
28
+ end
29
+
30
+ Template.register_tag('url_protected', UrlProtected)
31
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :dm_cms do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,173 @@
1
+ require 'rails_helper'
2
+
3
+ describe DmCms::Admin::CmsBlogsController do
4
+
5
+ routes { DmCms::Engine.routes }
6
+ login_admin
7
+
8
+ let(:blog) { create(:blog) }
9
+
10
+ #------------------------------------------------------------------------------
11
+ it "verify using admin role" do
12
+ expect(@current_user.is_admin?).to eq true
13
+ end
14
+
15
+ describe 'GET #index' do
16
+ #------------------------------------------------------------------------------
17
+ it "populates an array of all documents" do
18
+ blog2 = create(:news_blog)
19
+ get :index
20
+ expect(assigns(:blogs)).to match_array([blog, blog2])
21
+ end
22
+
23
+ #------------------------------------------------------------------------------
24
+ it "renders the :index template" do
25
+ get :index
26
+ expect(response).to render_template :index
27
+ end
28
+ end
29
+
30
+ describe 'GET #show' do
31
+ #------------------------------------------------------------------------------
32
+ it "assigns the requested blog to @blog" do
33
+ get :show, id: blog
34
+ expect(assigns(:blog)).to eq blog
35
+ end
36
+
37
+ #------------------------------------------------------------------------------
38
+ it "renders the :show template" do
39
+ get :show, id: blog
40
+ expect(response).to render_template :show
41
+ end
42
+ end
43
+
44
+ describe 'GET #new' do
45
+ #------------------------------------------------------------------------------
46
+ it "assigns a new blog to @blog" do
47
+ get :new
48
+ expect(assigns(:blog)).to be_a_new(CmsBlog)
49
+ end
50
+ #------------------------------------------------------------------------------
51
+ it "renders the :new template" do
52
+ get :new
53
+ expect(response).to render_template :new
54
+ end
55
+ end
56
+
57
+ describe 'GET #edit' do
58
+ #------------------------------------------------------------------------------
59
+ it "assigns the requested blog to @blog" do
60
+ get :edit, id: blog
61
+ expect(assigns(:blog)).to eq blog
62
+ end
63
+
64
+ #------------------------------------------------------------------------------
65
+ it "renders the :edit template" do
66
+ get :edit, id: blog
67
+ expect(response).to render_template :edit
68
+ end
69
+ end
70
+
71
+ describe "POST #create" do
72
+ context "with valid attributes" do
73
+ #------------------------------------------------------------------------------
74
+ it "saves the new blog in the database" do
75
+ expect {
76
+ post :create, cms_blog: attributes_for(:blog)
77
+ }.to change(CmsBlog, :count).by(1)
78
+ end
79
+
80
+ #------------------------------------------------------------------------------
81
+ it "redirects to cms_blog#show" do
82
+ post :create, cms_blog: attributes_for(:blog)
83
+ expect(response).to redirect_to admin_cms_blog_path(assigns[:blog])
84
+ end
85
+ end
86
+
87
+ context "with invalid attributes" do
88
+ #------------------------------------------------------------------------------
89
+ it "does not save the new document in the database" do
90
+ expect {
91
+ post :create, cms_blog: attributes_for(:invalid_blog)
92
+ }.to_not change(CmsBlog, :count)
93
+ end
94
+
95
+ #------------------------------------------------------------------------------
96
+ it "re-renders the :new template" do
97
+ post :create, cms_blog: attributes_for(:invalid_blog)
98
+ expect(response).to render_template :new
99
+ end
100
+ end
101
+ end
102
+
103
+ describe 'PATCH #update' do
104
+
105
+ context "with valid attributes" do
106
+ #------------------------------------------------------------------------------
107
+ it "locates the requested @blog" do
108
+ patch :update, id: blog, cms_blog: attributes_for(:blog)
109
+ expect(assigns(:blog)).to eq blog
110
+ end
111
+
112
+ #------------------------------------------------------------------------------
113
+ it "updates the blog in the database" do
114
+ patch :update, id: blog, cms_blog: attributes_for(:blog, title: 'Updated title')
115
+ blog.reload
116
+ expect(blog.title).to eq 'Updated title'
117
+ end
118
+
119
+ #------------------------------------------------------------------------------
120
+ it "redirects to the updated blog" do
121
+ patch :update, id: blog, cms_blog: attributes_for(:blog, title: 'Updated title')
122
+ expect(response).to redirect_to admin_cms_blog_path(blog)
123
+ end
124
+ end
125
+
126
+ context "with invalid attributes" do
127
+ #------------------------------------------------------------------------------
128
+ it "does not update the blog" do
129
+ patch :update, id: blog, cms_blog: attributes_for(:blog, title: nil)
130
+ blog.reload
131
+ expect(blog.title).to eq(attributes_for(:blog)[:title])
132
+ end
133
+
134
+ #------------------------------------------------------------------------------
135
+ it "re-renders the #edit template" do
136
+ patch :update, id: blog, cms_blog: attributes_for(:blog, title: nil)
137
+ expect(response).to render_template :edit
138
+ end
139
+ end
140
+ end
141
+
142
+ describe 'DELETE #destroy' do
143
+
144
+ #------------------------------------------------------------------------------
145
+ it "deletes the blog from the database" do
146
+ blog
147
+ expect { delete :destroy, id: blog }.to change(CmsBlog, :count).by(-1)
148
+ end
149
+
150
+ #------------------------------------------------------------------------------
151
+ it "redirects to cms_blog#index" do
152
+ delete :destroy, id: blog
153
+ expect(response).to redirect_to admin_cms_blogs_url
154
+ end
155
+ end
156
+
157
+ describe 'sort' do
158
+ it 'write test'
159
+ end
160
+
161
+ describe 'blog_users' do
162
+ it 'write test'
163
+ end
164
+
165
+ describe 'blog_add_member' do
166
+ it 'write test'
167
+ end
168
+
169
+ describe 'blog_delete_member' do
170
+ it 'write test'
171
+ end
172
+
173
+ end
@@ -0,0 +1,182 @@
1
+ require 'rails_helper'
2
+
3
+ describe DmCms::Admin::CmsPagesController do
4
+ routes { DmCms::Engine.routes }
5
+ login_admin
6
+
7
+ #------------------------------------------------------------------------------
8
+ it "verify using admin role" do
9
+ expect(@current_user.is_admin?).to eq true
10
+ end
11
+
12
+ it "write tests"
13
+
14
+ describe 'GET #index' do
15
+ #------------------------------------------------------------------------------
16
+ # it "populates an array of all documents" do
17
+ # document1 = create(:document)
18
+ # document2 = create(:document, title: 'Another document')
19
+ # get :index, locale: :en
20
+ # expect(assigns(:documents)).to match_array([document1, document2])
21
+ # end
22
+
23
+ #------------------------------------------------------------------------------
24
+ # it "renders the :index template" do
25
+ # blog = create(:blog)
26
+ #
27
+ # get :index, cms_blog_id: blog.id
28
+ # expect(response).to render_template :index
29
+ # end
30
+ end
31
+
32
+ # describe 'GET #show' do
33
+ # #------------------------------------------------------------------------------
34
+ # it "assigns the requested contact to @document" do
35
+ # document = create(:document)
36
+ # get :show, id: document.id
37
+ # expect(assigns(:document)).to eq document
38
+ # end
39
+ #
40
+ # #------------------------------------------------------------------------------
41
+ # it "renders the :show template" do
42
+ # document = create(:document)
43
+ # get :show, id: document.id
44
+ # expect(response).to render_template :show
45
+ # end
46
+ # end
47
+ #
48
+ # describe 'GET #new' do
49
+ # #------------------------------------------------------------------------------
50
+ # it "assigns a new Document to @document" do
51
+ # get :new
52
+ # expect(assigns(:document)).to be_a_new(DmKnowledge::Document)
53
+ # end
54
+ # #------------------------------------------------------------------------------
55
+ # it "renders the :new template" do
56
+ # get :new
57
+ # expect(response).to render_template :new
58
+ # end
59
+ # end
60
+ #
61
+ # describe 'GET #edit' do
62
+ # #------------------------------------------------------------------------------
63
+ # it "assigns the requested document to @document" do
64
+ # document = create(:document)
65
+ # get :edit, id: document.id
66
+ # expect(assigns(:document)).to eq document
67
+ # end
68
+ #
69
+ # #------------------------------------------------------------------------------
70
+ # it "renders the :edit template" do
71
+ # document = create(:document)
72
+ # get :edit, id: document.id
73
+ # expect(response).to render_template :edit
74
+ # end
75
+ # end
76
+ #
77
+ # describe "POST #create" do
78
+ # context "with valid attributes" do
79
+ # #------------------------------------------------------------------------------
80
+ # it "saves the new document in the database" do
81
+ # expect {
82
+ # post :create, document: attributes_for(:document)
83
+ # }.to change(DmKnowledge::Document, :count).by(1)
84
+ # end
85
+ #
86
+ # #------------------------------------------------------------------------------
87
+ # it "redirects to documents#show" do
88
+ # post :create, document: attributes_for(:document)
89
+ # expect(response).to redirect_to admin_document_path(assigns[:document].id)
90
+ # end
91
+ # end
92
+ #
93
+ # context "with invalid attributes" do
94
+ # #------------------------------------------------------------------------------
95
+ # it "does not save the new document in the database" do
96
+ # expect {
97
+ # post :create, document: attributes_for(:invalid_document)
98
+ # }.to_not change(DmKnowledge::Document, :count)
99
+ # end
100
+ #
101
+ # #------------------------------------------------------------------------------
102
+ # it "re-renders the :new template" do
103
+ # post :create, document: attributes_for(:invalid_document)
104
+ # expect(response).to render_template :new
105
+ # end
106
+ # end
107
+ # end
108
+ #
109
+ # describe 'PATCH #update' do
110
+ # before :each do
111
+ # @document = create(:document)
112
+ # end
113
+ #
114
+ # context "with valid attributes" do
115
+ # #------------------------------------------------------------------------------
116
+ # it "locates the requested @document" do
117
+ # patch :update, id: @document.id, document: attributes_for(:document)
118
+ # expect(assigns(:document)).to eq(@document)
119
+ # end
120
+ #
121
+ # #------------------------------------------------------------------------------
122
+ # it "updates the document in the database" do
123
+ # date = Time.now
124
+ # patch :update, id: @document.id, document: attributes_for(:document, title: 'Update title', original_date: date)
125
+ # @document.reload
126
+ # expect(@document.title).to eq('Update title')
127
+ # expect(@document.original_date).to eq(date.to_s)
128
+ # end
129
+ #
130
+ # #------------------------------------------------------------------------------
131
+ # it "redirects to the updated document" do
132
+ # patch :update, id: @document.id, document: attributes_for(:document)
133
+ # expect(response).to redirect_to admin_document_path(@document.id)
134
+ # end
135
+ # end
136
+ #
137
+ # context "with invalid attributes" do
138
+ # #------------------------------------------------------------------------------
139
+ # it "does not update the document" do
140
+ # patch :update, id: @document.id, document: attributes_for(:document, title: 'Update title', original_date: nil)
141
+ # @document.reload
142
+ # expect(@document.title).to eq(attributes_for(:document)[:title])
143
+ # expect(@document.original_date).to eq(attributes_for(:document)[:original_date])
144
+ # end
145
+ #
146
+ # #------------------------------------------------------------------------------
147
+ # it "re-renders the #edit template" do
148
+ # patch :update, id: @document.id, document: attributes_for(:invalid_document)
149
+ # expect(response).to render_template :edit
150
+ # end
151
+ # end
152
+ # end
153
+ #
154
+ # describe 'DELETE #destroy' do
155
+ # before :each do
156
+ # @document = create(:document)
157
+ # end
158
+ #
159
+ # #------------------------------------------------------------------------------
160
+ # it "deletes the document from the database" do
161
+ # expect { delete :destroy, id: @document.id }.to change(DmKnowledge::Document, :count).by(-1)
162
+ # end
163
+ #
164
+ # #------------------------------------------------------------------------------
165
+ # it "redirects to documents#index" do
166
+ # delete :destroy, id: @document.id
167
+ # expect(response).to redirect_to admin_documents_url
168
+ # end
169
+ # end
170
+ #
171
+ # describe 'PATCH #add_tags' do
172
+ # #------------------------------------------------------------------------------
173
+ # it "replaces the tags on a srcid with the given tag list" do
174
+ # document = create(:document)
175
+ # document.set_tag_list_on(DmKnowledge::Document.tagcontext_from_srcid('1.12'), "tag1,tag2")
176
+ # document.save
177
+ # patch :add_tags, id: document.id, document: {srcid: '1.12', tag_list: 'tag3, tag4'}
178
+ # document.reload
179
+ # expect(DmKnowledge::Document.all_tags_list).to eq ['tag3', 'tag4']
180
+ # end
181
+ # end
182
+ end