browsercms 3.5.7 → 4.0.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (523) hide show
  1. checksums.yaml +7 -0
  2. data/COPYRIGHT.txt +2 -1
  3. data/README.markdown +3 -3
  4. data/app/assets/fonts/icomoon.dev.svg +61 -0
  5. data/app/assets/fonts/icomoon.eot +0 -0
  6. data/app/assets/fonts/icomoon.svg +61 -0
  7. data/app/assets/fonts/icomoon.ttf +0 -0
  8. data/app/assets/fonts/icomoon.woff +0 -0
  9. data/app/assets/images/ckeditor/plugins/delete_content/icons/deletecontent.png +0 -0
  10. data/app/assets/images/ckeditor/plugins/edit_content/icons/editcontent.png +0 -0
  11. data/app/assets/images/ckeditor/plugins/move_content/icons/movecontentdown.png +0 -0
  12. data/app/assets/images/ckeditor/plugins/move_content/icons/movecontentup.png +0 -0
  13. data/app/assets/images/cms/arrow-down.png +0 -0
  14. data/app/assets/images/cms/arrow-up.png +0 -0
  15. data/app/assets/images/cms/cogs.png +0 -0
  16. data/app/assets/images/cms/dashboard/home.png +0 -0
  17. data/app/assets/images/cms/home.png +0 -0
  18. data/app/assets/images/cms/logo.png +0 -0
  19. data/app/assets/images/cms/pencil.png +0 -0
  20. data/app/assets/images/cms/plus.png +0 -0
  21. data/app/assets/images/cms/user.png +0 -0
  22. data/app/assets/javascripts/bcms/ckeditor_inline.js +23 -0
  23. data/app/assets/javascripts/bcms/ckeditor_standard_config.js +1 -1
  24. data/app/assets/javascripts/ckeditor/plugins/delete_content/plugin.js +36 -0
  25. data/app/assets/javascripts/ckeditor/plugins/edit_content/plugin.js +24 -0
  26. data/app/assets/javascripts/ckeditor/plugins/move_content/plugin.js +25 -0
  27. data/app/assets/javascripts/cms/ajax.js +60 -0
  28. data/app/assets/javascripts/cms/application.js +6 -1
  29. data/app/assets/javascripts/cms/attachment_manager.js.erb +3 -10
  30. data/app/assets/javascripts/cms/content_library.js +31 -12
  31. data/app/assets/javascripts/cms/core_library.js.erb +68 -36
  32. data/app/assets/javascripts/cms/form_builder.js +250 -0
  33. data/app/assets/javascripts/cms/namespace.js +2 -0
  34. data/app/assets/javascripts/cms/new_content_button.js +27 -0
  35. data/app/assets/javascripts/cms/page_editor.js +188 -0
  36. data/app/assets/javascripts/cms/page_toolbar.js +13 -0
  37. data/app/assets/javascripts/cms/site.js +2 -0
  38. data/app/assets/javascripts/cms/sitemap.js +219 -0
  39. data/app/assets/javascripts/cms/toolbar.js +17 -1
  40. data/app/assets/javascripts/cms/user.js +40 -0
  41. data/app/assets/javascripts/jquery.exists.js +5 -0
  42. data/app/assets/javascripts/jquery.taglist.js +37 -23
  43. data/app/assets/stylesheets/cms/_assets.css.scss +55 -0
  44. data/app/assets/stylesheets/cms/_base.css.scss +42 -0
  45. data/app/assets/stylesheets/cms/_cms-buttons.css.scss +73 -0
  46. data/app/assets/stylesheets/cms/_cms-forms.css.scss +70 -0
  47. data/app/assets/stylesheets/cms/_colors.css.scss +20 -0
  48. data/app/assets/stylesheets/cms/_dashboard.css.scss +25 -0
  49. data/app/assets/stylesheets/cms/_glyph.css.scss +60 -0
  50. data/app/assets/stylesheets/cms/_main-area.css.scss +62 -0
  51. data/app/assets/stylesheets/cms/_nav.css.scss +197 -0
  52. data/app/assets/stylesheets/cms/_sidebar.css.scss +64 -0
  53. data/app/assets/stylesheets/cms/_sitemap.css.scss +196 -0
  54. data/app/assets/stylesheets/cms/_submenu.css.scss +48 -0
  55. data/app/assets/stylesheets/cms/application.css.scss +49 -0
  56. data/app/assets/stylesheets/cms/core.css.scss +96 -0
  57. data/app/assets/stylesheets/cms/default-forms.css.scss +3 -0
  58. data/app/assets/stylesheets/cms/includes/_animation.css.scss +2 -0
  59. data/app/assets/stylesheets/cms/includes/_rem.css.scss +120 -0
  60. data/app/assets/stylesheets/cms/includes/animation/_animate.css.scss +31 -0
  61. data/app/assets/stylesheets/cms/includes/animation/_core.css.scss +127 -0
  62. data/app/assets/stylesheets/cms/includes/animation/_shared.css.scss +22 -0
  63. data/app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.css.scss +152 -0
  64. data/app/assets/stylesheets/cms/includes/animation/animate/_bouncing.css.scss +3 -0
  65. data/app/assets/stylesheets/cms/includes/animation/animate/_classes.css.scss +21 -0
  66. data/app/assets/stylesheets/cms/includes/animation/animate/_fading.css.scss +3 -0
  67. data/app/assets/stylesheets/cms/includes/animation/animate/_flippers.css.scss +87 -0
  68. data/app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.css.scss +24 -0
  69. data/app/assets/stylesheets/cms/includes/animation/animate/_rotating.css.scss +3 -0
  70. data/app/assets/stylesheets/cms/includes/animation/animate/_specials.css.scss +42 -0
  71. data/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.css.scss +68 -0
  72. data/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.css.scss +60 -0
  73. data/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.css.scss +86 -0
  74. data/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.css.scss +86 -0
  75. data/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.css.scss +58 -0
  76. data/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.css.scss +58 -0
  77. data/app/assets/stylesheets/cms/page_content_editing.css.scss +4 -0
  78. data/app/assets/stylesheets/cms/page_editor.css.scss +4 -0
  79. data/app/assets/stylesheets/cms/style.css.scss +138 -0
  80. data/app/assets/stylesheets/cms/styles/_alerts.css.scss +150 -0
  81. data/app/assets/stylesheets/cms/styles/_base-grid.css.scss +299 -0
  82. data/app/assets/stylesheets/cms/styles/_buttons.css.scss +247 -0
  83. data/app/assets/stylesheets/cms/styles/_dropdown.css.scss +155 -0
  84. data/app/assets/stylesheets/cms/styles/_forms.css.scss +728 -0
  85. data/app/assets/stylesheets/cms/styles/_glyph.css.scss +86 -0
  86. data/app/assets/stylesheets/cms/styles/_images.css.scss +75 -0
  87. data/app/assets/stylesheets/cms/styles/_lists.css.scss +115 -0
  88. data/app/assets/stylesheets/cms/styles/_modal.css.scss +174 -0
  89. data/app/assets/stylesheets/cms/styles/_progress.css.scss +43 -0
  90. data/app/assets/stylesheets/cms/styles/_tables.css.scss +141 -0
  91. data/app/assets/stylesheets/cms/styles/_text.css.scss +134 -0
  92. data/app/controllers/cms/application_controller.rb +3 -68
  93. data/app/controllers/cms/attachments_controller.rb +5 -5
  94. data/app/controllers/cms/base_controller.rb +20 -13
  95. data/app/controllers/cms/cache_controller.rb +16 -17
  96. data/app/controllers/cms/category_types_controller.rb +6 -1
  97. data/app/controllers/cms/connectors_controller.rb +12 -7
  98. data/app/controllers/cms/content_block_controller.rb +128 -71
  99. data/app/controllers/cms/content_controller.rb +54 -56
  100. data/app/controllers/cms/dashboard_controller.rb +5 -6
  101. data/app/controllers/cms/dynamic_views_controller.rb +12 -9
  102. data/app/controllers/cms/email_messages_controller.rb +18 -13
  103. data/app/controllers/cms/form_entries_controller.rb +119 -0
  104. data/app/controllers/cms/form_fields_controller.rb +74 -0
  105. data/app/controllers/cms/forms_controller.rb +35 -0
  106. data/app/controllers/cms/groups_controller.rb +13 -16
  107. data/app/controllers/cms/html_blocks_controller.rb +2 -2
  108. data/app/controllers/cms/inline_content_controller.rb +48 -0
  109. data/app/controllers/cms/links_controller.rb +58 -46
  110. data/app/controllers/cms/page_components_controller.rb +20 -0
  111. data/app/controllers/cms/page_routes_controller.rb +44 -40
  112. data/app/controllers/cms/pages_controller.rb +111 -97
  113. data/app/controllers/cms/passwords_controller.rb +17 -0
  114. data/app/controllers/cms/portlet_controller.rb +0 -1
  115. data/app/controllers/cms/portlets_controller.rb +20 -27
  116. data/app/controllers/cms/redirects_controller.rb +13 -9
  117. data/app/controllers/cms/resource_controller.rb +15 -4
  118. data/app/controllers/cms/routes_controller.rb +2 -4
  119. data/app/controllers/cms/section_nodes_controller.rb +6 -37
  120. data/app/controllers/cms/sections_controller.rb +13 -8
  121. data/app/controllers/cms/sessions_controller.rb +8 -66
  122. data/app/controllers/cms/sites/passwords_controller.rb +27 -0
  123. data/app/controllers/cms/sites/sessions_controller.rb +20 -0
  124. data/app/controllers/cms/tags_controller.rb +12 -12
  125. data/app/controllers/cms/tasks_controller.rb +45 -46
  126. data/app/controllers/cms/user_controller.rb +8 -0
  127. data/app/controllers/cms/users_controller.rb +91 -68
  128. data/app/helpers/cms/application_helper.rb +58 -52
  129. data/app/helpers/cms/content_block_helper.rb +8 -7
  130. data/app/helpers/cms/form_tag_helper.rb +21 -25
  131. data/app/helpers/cms/menu_helper.rb +1 -3
  132. data/app/helpers/cms/mobile_helper.rb +12 -2
  133. data/app/helpers/cms/nav_menu_helper.rb +23 -0
  134. data/app/helpers/cms/page_helper.rb +72 -30
  135. data/app/helpers/cms/path_helper.rb +46 -70
  136. data/app/helpers/cms/rendering_helper.rb +68 -12
  137. data/app/helpers/cms/section_nodes_helper.rb +92 -31
  138. data/app/helpers/cms/sites/authentication_helper.rb +25 -0
  139. data/app/helpers/cms/sites/devise_shim_helper.rb +31 -0
  140. data/app/helpers/cms/template_support.rb +1 -7
  141. data/app/helpers/cms/ui_elements_helper.rb +147 -6
  142. data/app/helpers/forgot_password_portlet_helper.rb +9 -0
  143. data/app/helpers/login_portlet_helper.rb +10 -0
  144. data/app/inputs/attachments_input.rb +14 -0
  145. data/app/inputs/cms_text_area_input.rb +10 -0
  146. data/app/inputs/cms_text_field_input.rb +29 -0
  147. data/app/inputs/date_picker_input.rb +8 -0
  148. data/app/inputs/file_picker_input.rb +75 -0
  149. data/app/inputs/path_input.rb +18 -0
  150. data/app/inputs/tag_list_input.rb +3 -0
  151. data/app/inputs/template_editor_input.rb +24 -0
  152. data/app/inputs/text_editor_input.rb +19 -0
  153. data/app/models/cms/abstract_file_block.rb +10 -6
  154. data/app/models/cms/attachment.rb +20 -27
  155. data/app/models/cms/category.rb +17 -7
  156. data/app/models/cms/category_type.rb +8 -4
  157. data/app/models/cms/connector.rb +32 -20
  158. data/app/models/cms/content.rb +31 -0
  159. data/app/models/cms/content_type.rb +114 -62
  160. data/app/models/cms/dynamic_view.rb +19 -45
  161. data/app/models/cms/email_message.rb +32 -2
  162. data/app/models/cms/external_user.rb +60 -0
  163. data/app/models/cms/file_block.rb +1 -0
  164. data/app/models/cms/form.rb +47 -0
  165. data/app/models/cms/form_entry.rb +71 -0
  166. data/app/models/cms/form_field.rb +78 -0
  167. data/app/models/cms/group.rb +19 -9
  168. data/app/models/cms/group_permission.rb +1 -1
  169. data/app/models/cms/group_section.rb +1 -1
  170. data/app/models/cms/group_type.rb +5 -5
  171. data/app/models/cms/group_type_permission.rb +1 -1
  172. data/app/models/cms/html_block.rb +14 -19
  173. data/app/models/cms/image_block.rb +1 -0
  174. data/app/models/cms/link.rb +8 -6
  175. data/app/models/cms/page.rb +156 -59
  176. data/app/models/cms/page_component.rb +43 -0
  177. data/app/models/cms/page_partial.rb +16 -8
  178. data/app/models/cms/page_route.rb +1 -1
  179. data/app/models/cms/page_route_condition.rb +1 -1
  180. data/app/models/cms/page_route_option.rb +1 -1
  181. data/app/models/cms/page_route_requirement.rb +1 -1
  182. data/app/models/cms/page_template.rb +14 -9
  183. data/app/models/cms/permission.rb +4 -2
  184. data/app/models/cms/persistent_user.rb +208 -0
  185. data/app/models/cms/portlet.rb +56 -9
  186. data/app/models/cms/redirect.rb +1 -1
  187. data/app/models/cms/search_filter.rb +18 -0
  188. data/app/models/cms/section.rb +39 -28
  189. data/app/models/cms/section_node.rb +32 -5
  190. data/app/models/cms/site.rb +3 -3
  191. data/app/models/cms/tag.rb +14 -12
  192. data/app/models/cms/tagging.rb +2 -2
  193. data/app/models/cms/task.rb +14 -21
  194. data/app/models/cms/templates.rb +1 -2
  195. data/app/models/cms/user.rb +21 -160
  196. data/app/models/cms/user_group_membership.rb +2 -2
  197. data/app/portlets/deprecated_placeholder.rb +12 -0
  198. data/app/portlets/dynamic_portlet.rb +1 -1
  199. data/app/portlets/email_page_portlet.rb +10 -3
  200. data/app/portlets/forgot_password_portlet.rb +9 -28
  201. data/app/portlets/login_portlet.rb +8 -5
  202. data/app/portlets/tag_cloud_portlet.rb +3 -1
  203. data/app/presenters/cms/user_presenter.rb +24 -0
  204. data/app/views/cms/application/_add_content_modal.html.erb +3 -0
  205. data/app/views/cms/application/_buttons.html.erb +7 -0
  206. data/app/views/cms/{shared → application}/_exception.html.erb +0 -0
  207. data/app/views/cms/application/_form_errors.html.erb +7 -0
  208. data/app/views/cms/application/_form_with_buttons.html.erb +10 -0
  209. data/app/views/cms/application/_main_content.html.erb +3 -0
  210. data/app/views/cms/application/_main_with_sidebar.html.erb +8 -0
  211. data/app/views/cms/application/_mobile_toolbar.html.erb +16 -0
  212. data/app/views/cms/application/_page_title.html.erb +5 -0
  213. data/app/views/cms/application/_pagination.html.erb +26 -0
  214. data/app/views/cms/application/_row.html.erb +1 -0
  215. data/app/views/cms/application/_save_buttons.html.erb +7 -0
  216. data/app/views/cms/application/_sidebar_layout.html.erb +3 -0
  217. data/app/views/cms/application/_version.html.erb +23 -0
  218. data/app/views/cms/{shared → application}/_version_conflict_diff.html.erb +0 -0
  219. data/app/views/cms/{shared → application}/_version_conflict_error.html.erb +0 -0
  220. data/app/views/cms/attachments/_attachment_manager.html.erb +22 -0
  221. data/app/views/cms/attachments/_no_attachments_defined.html.erb +1 -0
  222. data/app/views/cms/cache/show.html.erb +5 -10
  223. data/app/views/cms/categories/_form.html.erb +15 -24
  224. data/app/views/cms/category_types/_form.html.erb +1 -1
  225. data/app/views/cms/connectors/new.html.erb +33 -64
  226. data/app/views/cms/content/editing_frame.html.erb +1 -0
  227. data/app/views/cms/content/no_page.html.erb +9 -27
  228. data/app/views/cms/content/show.html.erb +14 -15
  229. data/app/views/cms/content_block/_block_form.html.erb +15 -0
  230. data/app/views/cms/content_block/_buttonbar.html.erb +29 -0
  231. data/app/views/cms/content_block/_buttons.html.erb +13 -0
  232. data/app/views/cms/content_block/_hidden_fields.html.erb +13 -0
  233. data/app/views/cms/content_block/_sidebar.html.erb +35 -0
  234. data/app/views/cms/content_block/edit.html.erb +3 -0
  235. data/app/views/cms/content_block/index.html.erb +87 -0
  236. data/app/views/cms/content_block/new.html.erb +3 -0
  237. data/app/views/cms/content_block/render_block_in_main_container.html.erb +10 -0
  238. data/app/views/cms/content_block/show.html.erb +1 -0
  239. data/app/views/cms/content_block/show_in_isolation.html.erb +15 -0
  240. data/app/views/cms/content_block/versions.html.erb +24 -0
  241. data/app/views/cms/dashboard/_page_drafts.html.erb +12 -22
  242. data/app/views/cms/dashboard/_tasks.html.erb +32 -45
  243. data/app/views/cms/dashboard/index.html.erb +11 -13
  244. data/app/views/cms/dynamic_views/_form.html.erb +8 -10
  245. data/app/views/cms/dynamic_views/edit.html.erb +2 -3
  246. data/app/views/cms/dynamic_views/index.html.erb +22 -44
  247. data/app/views/cms/dynamic_views/new.html.erb +2 -3
  248. data/app/views/cms/email_messages/index.html.erb +31 -34
  249. data/app/views/cms/email_messages/show.html.erb +45 -52
  250. data/app/views/cms/file_blocks/_form.html.erb +2 -4
  251. data/app/views/cms/form_entries/_buttons.html.erb +2 -0
  252. data/app/views/cms/form_entries/_form.html.erb +7 -0
  253. data/app/views/cms/form_entries/_internal_form.html.erb +9 -0
  254. data/app/views/cms/form_entries/edit.html.erb +5 -0
  255. data/app/views/cms/form_entries/error.html.erb +3 -0
  256. data/app/views/cms/form_entries/index.html.erb +4 -0
  257. data/app/views/cms/form_entries/new.html.erb +5 -0
  258. data/app/views/cms/form_entries/show.html.erb +13 -0
  259. data/app/views/cms/form_entries/submit.html.erb +1 -0
  260. data/app/views/cms/form_fields/_form.html.erb +8 -0
  261. data/app/views/cms/form_fields/_select.html.erb +3 -0
  262. data/app/views/cms/form_fields/_text_area.html.erb +3 -0
  263. data/app/views/cms/form_fields/_text_field.html.erb +3 -0
  264. data/app/views/cms/form_fields/edit.html.erb +0 -0
  265. data/app/views/cms/form_fields/new.html.erb +26 -0
  266. data/app/views/cms/form_fields/preview.html.erb +16 -0
  267. data/app/views/cms/forms/_form.html.erb +66 -0
  268. data/app/views/cms/forms/render.html.erb +15 -0
  269. data/app/views/cms/forms/show.html.erb +6 -0
  270. data/app/views/cms/groups/_form.html.erb +32 -38
  271. data/app/views/cms/groups/_permissions.html.erb +11 -34
  272. data/app/views/cms/groups/_sections.html.erb +11 -17
  273. data/app/views/cms/groups/edit.html.erb +1 -3
  274. data/app/views/cms/groups/index.html.erb +10 -32
  275. data/app/views/cms/groups/new.html.erb +2 -4
  276. data/app/views/cms/html_blocks/_form.html.erb +2 -2
  277. data/app/views/cms/html_blocks/render.html.erb +1 -1
  278. data/app/views/cms/image_blocks/_form.html.erb +3 -3
  279. data/app/views/cms/links/_form.html.erb +6 -11
  280. data/app/views/cms/links/edit.html.erb +3 -12
  281. data/app/views/cms/links/new.html.erb +4 -13
  282. data/app/views/cms/page_components/_content.html.erb +18 -0
  283. data/app/views/cms/page_components/new.html.erb +12 -0
  284. data/app/views/cms/page_routes/_form.html.erb +11 -10
  285. data/app/views/cms/page_routes/edit.html.erb +2 -3
  286. data/app/views/cms/page_routes/index.html.erb +25 -48
  287. data/app/views/cms/page_routes/new.html.erb +2 -3
  288. data/app/views/cms/pages/_edit_content.html.erb +28 -0
  289. data/app/views/cms/pages/_form.html.erb +20 -37
  290. data/app/views/cms/pages/_main_form.html.erb +23 -0
  291. data/app/views/cms/pages/_simple_container.html.erb +8 -0
  292. data/app/views/cms/pages/edit.html.erb +2 -23
  293. data/app/views/cms/pages/new.html.erb +2 -16
  294. data/app/views/cms/pages/versions.html.erb +18 -87
  295. data/app/views/cms/redirects/_form.html.erb +6 -14
  296. data/app/views/cms/redirects/edit.html.erb +2 -3
  297. data/app/views/cms/redirects/index.html.erb +24 -50
  298. data/app/views/cms/redirects/new.html.erb +2 -3
  299. data/app/views/cms/routes/index.html.erb +15 -20
  300. data/app/views/cms/section_nodes/_children.html.erb +3 -0
  301. data/app/views/cms/section_nodes/_row_buttons.html.erb +11 -0
  302. data/app/views/cms/section_nodes/_section_node.html.erb +24 -10
  303. data/app/views/cms/section_nodes/_sitemap_buttons.html.erb +47 -0
  304. data/app/views/cms/section_nodes/_status.html.erb +5 -0
  305. data/app/views/cms/section_nodes/show.html.erb +9 -0
  306. data/app/views/cms/sections/_buttons.html.erb +6 -0
  307. data/app/views/cms/sections/_form.html.erb +22 -49
  308. data/app/views/cms/sections/edit.html.erb +3 -8
  309. data/app/views/cms/sections/new.html.erb +4 -20
  310. data/app/views/cms/sessions/new.html.erb +16 -31
  311. data/app/views/cms/shared/access_denied.html.erb +1 -2
  312. data/app/views/cms/shared/error.html.erb +5 -5
  313. data/app/views/cms/sites/_flash.html.erb +8 -0
  314. data/app/views/cms/sites/passwords/new.html.erb +2 -0
  315. data/app/views/cms/sites/sessions/new.html.erb +2 -0
  316. data/app/views/cms/tags/_form.html.erb +1 -1
  317. data/app/views/cms/tags/render.html.erb +0 -1
  318. data/app/views/cms/tasks/new.html.erb +18 -32
  319. data/app/views/cms/toolbar/_new_pages_menu.html.erb +10 -0
  320. data/app/views/cms/users/_form.html.erb +8 -11
  321. data/app/views/cms/users/_password.html.erb +2 -8
  322. data/app/views/cms/users/_user_fields.html.erb +7 -20
  323. data/app/views/cms/users/change_password.html.erb +12 -21
  324. data/app/views/cms/users/edit.html.erb +1 -15
  325. data/app/views/cms/users/index.html.erb +61 -58
  326. data/app/views/cms/users/new.html.erb +1 -12
  327. data/app/views/devise/confirmations/new.html.erb +16 -0
  328. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  329. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  330. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  331. data/app/views/devise/passwords/edit.html.erb +19 -0
  332. data/app/views/devise/passwords/new.html.erb +15 -0
  333. data/app/views/devise/registrations/edit.html.erb +28 -0
  334. data/app/views/devise/registrations/new.html.erb +18 -0
  335. data/app/views/devise/shared/_links.erb +25 -0
  336. data/app/views/devise/unlocks/new.html.erb +16 -0
  337. data/app/views/layouts/cms/_content_types.html.erb +13 -0
  338. data/app/views/layouts/cms/_footer.erb +2 -2
  339. data/app/views/layouts/cms/_head.html.erb +8 -18
  340. data/app/views/layouts/cms/_main_menu.html.erb +78 -0
  341. data/app/views/layouts/cms/application.html.erb +19 -24
  342. data/app/views/layouts/cms/content_page.html.erb +5 -0
  343. data/app/views/layouts/cms/page_editor.html.erb +90 -0
  344. data/app/views/portlets/deprecated_placeholders/_form.html.erb +1 -0
  345. data/app/views/portlets/deprecated_placeholders/render.html.erb +8 -0
  346. data/app/views/portlets/dynamic/_form.html.erb +3 -3
  347. data/app/views/portlets/email_page/_form.html.erb +5 -6
  348. data/app/views/portlets/forgot_password/_form.html.erb +2 -3
  349. data/app/views/portlets/forgot_password/render.html.erb +2 -14
  350. data/app/views/portlets/login/_form.html.erb +4 -6
  351. data/app/views/portlets/login/render.html.erb +8 -27
  352. data/app/views/portlets/portlets/_form.html.erb +7 -6
  353. data/app/views/portlets/tag_cloud/_form.html.erb +4 -4
  354. data/app/views/tests/pretend/open_with_layout.html.erb +1 -1
  355. data/bin/bcms +13 -16
  356. data/config/routes.rb +58 -29
  357. data/db/browsercms.seeds.rb +0 -6
  358. data/db/migrate/{20080815014337_browsercms_3_0_0.rb → 20080815014337_browsercms300.rb} +94 -73
  359. data/db/migrate/20130327184912_browsercms400.rb +90 -0
  360. data/db/migrate/20131206214021_devise_create_users.rb +47 -0
  361. data/db/migrate/20131211223908_kill_reset_password.rb +5 -0
  362. data/db/migrate/20131218222005_create_cms_external_users.rb +10 -0
  363. data/doc/features/design_integration.md +45 -0
  364. data/doc/features/external_user.md +7 -0
  365. data/doc/features/form_builder.md +40 -0
  366. data/doc/features/simple_form_refactor.md +60 -0
  367. data/doc/release_notes.md +224 -10
  368. data/lib/acts_as_list.rb +72 -71
  369. data/lib/browsercms.rb +41 -1
  370. data/lib/cms/acts/content_block.rb +12 -2
  371. data/lib/cms/acts/content_page.rb +3 -4
  372. data/lib/cms/admin_tab.rb +15 -0
  373. data/lib/cms/attachments/configuration.rb +1 -1
  374. data/lib/cms/authentication/controller.rb +83 -177
  375. data/lib/cms/authentication/test_password_strategy.rb +19 -0
  376. data/lib/cms/behaviors.rb +1 -0
  377. data/lib/cms/behaviors/archiving.rb +2 -2
  378. data/lib/cms/behaviors/attaching.rb +21 -45
  379. data/lib/cms/behaviors/connecting.rb +14 -4
  380. data/lib/cms/behaviors/dynamic_attributes.rb +3 -3
  381. data/lib/cms/behaviors/hiding.rb +2 -2
  382. data/lib/cms/behaviors/namespacing.rb +6 -36
  383. data/lib/cms/behaviors/publishing.rb +92 -45
  384. data/lib/cms/behaviors/rendering.rb +15 -7
  385. data/lib/cms/behaviors/searching.rb +5 -4
  386. data/lib/cms/behaviors/soft_deleting.rb +13 -16
  387. data/lib/cms/behaviors/taggable.rb +17 -10
  388. data/lib/cms/behaviors/versioning.rb +12 -16
  389. data/lib/cms/commands/to_version400.rb +10 -0
  390. data/lib/cms/concerns.rb +7 -0
  391. data/lib/cms/concerns/can_be_addressable.rb +326 -0
  392. data/lib/cms/concerns/has_content_type.rb +46 -0
  393. data/lib/cms/concerns/ignores_publishing.rb +9 -0
  394. data/lib/cms/configuration.rb +14 -4
  395. data/lib/cms/configuration/configurable_template.rb +24 -0
  396. data/lib/cms/configuration/devise.rb +256 -0
  397. data/lib/cms/configure_simple_form.rb +142 -0
  398. data/lib/cms/configure_simple_form_bootstrap.rb +49 -0
  399. data/lib/cms/content_filter.rb +18 -0
  400. data/lib/cms/content_page.rb +77 -0
  401. data/lib/cms/content_rendering_support.rb +25 -16
  402. data/lib/cms/controllers/admin_controller.rb +78 -0
  403. data/lib/cms/data_loader.rb +30 -11
  404. data/lib/cms/default_accessible.rb +6 -6
  405. data/lib/cms/domain_support.rb +0 -4
  406. data/lib/cms/engine.rb +52 -20
  407. data/lib/cms/engine_helper.rb +41 -51
  408. data/{app/controllers → lib}/cms/error_handling.rb +11 -5
  409. data/lib/cms/extensions.rb +2 -1
  410. data/lib/cms/extensions/active_model/name.rb +13 -0
  411. data/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +49 -89
  412. data/lib/cms/extensions/hash.rb +0 -12
  413. data/lib/cms/form_builder/content_block_form_builder.rb +45 -0
  414. data/lib/cms/form_builder/default_input.rb +13 -0
  415. data/lib/cms/form_builder/deprecated_inputs.rb +40 -0
  416. data/lib/cms/form_builder/workflow_buttons.rb +38 -0
  417. data/lib/cms/module.rb +1 -7
  418. data/lib/cms/polymorphic_single_table_inheritance.rb +19 -0
  419. data/lib/cms/publish_workflow.rb +26 -0
  420. data/lib/cms/responders/content_responder.rb +14 -0
  421. data/lib/cms/route_extensions.rb +112 -20
  422. data/lib/cms/version.rb +1 -1
  423. data/lib/generators/browser_cms/demo_site/templates/demo.seeds.rb +0 -2
  424. data/lib/generators/cms/content_block/content_block_generator.rb +19 -46
  425. data/lib/generators/cms/content_block/templates/_form.html.erb +22 -28
  426. data/lib/generators/cms/project/templates/devise.rb.erb +7 -0
  427. metadata +383 -150
  428. data/app/assets/javascripts/cms/sitemap.js.erb +0 -464
  429. data/app/assets/stylesheets/browsercms/application.css +0 -7
  430. data/app/assets/stylesheets/cms/administration.css.erb +0 -91
  431. data/app/assets/stylesheets/cms/application.css.erb +0 -171
  432. data/app/assets/stylesheets/cms/attachment_manager.css.scss +0 -28
  433. data/app/assets/stylesheets/cms/block.css +0 -26
  434. data/app/assets/stylesheets/cms/buttons.css.erb +0 -120
  435. data/app/assets/stylesheets/cms/content_library.css.erb +0 -139
  436. data/app/assets/stylesheets/cms/content_types.css +0 -4
  437. data/app/assets/stylesheets/cms/dashboard.css.erb +0 -118
  438. data/app/assets/stylesheets/cms/data_table.css.erb.erb +0 -156
  439. data/app/assets/stylesheets/cms/date_picker.css.erb +0 -82
  440. data/app/assets/stylesheets/cms/form_layout.css.erb +0 -282
  441. data/app/assets/stylesheets/cms/login.css.erb +0 -78
  442. data/app/assets/stylesheets/cms/menu.css.erb +0 -116
  443. data/app/assets/stylesheets/cms/nav.css.erb +0 -99
  444. data/app/assets/stylesheets/cms/page_toolbar.css.erb +0 -135
  445. data/app/assets/stylesheets/cms/reset.css +0 -46
  446. data/app/assets/stylesheets/cms/selectbox.css.erb +0 -56
  447. data/app/assets/stylesheets/cms/sitemap.css.erb +0 -390
  448. data/app/assets/stylesheets/cms/taglist.css +0 -18
  449. data/app/controllers/application_controller.rb +0 -14
  450. data/app/controllers/cms/content_types_controller.rb +0 -9
  451. data/app/helpers/application_helper.rb +0 -5
  452. data/app/helpers/cms/form_builder.rb +0 -241
  453. data/app/models/cms/content_type_group.rb +0 -15
  454. data/app/models/cms/forgot_password_mailer.rb +0 -14
  455. data/app/portlets/reset_password_portlet.rb +0 -28
  456. data/app/views/cms/blocks/_hidden_fields.html.erb +0 -10
  457. data/app/views/cms/blocks/_toolbar.html.erb +0 -9
  458. data/app/views/cms/blocks/_toolbar_for_collection.html.erb +0 -23
  459. data/app/views/cms/blocks/_toolbar_for_member.html.erb +0 -36
  460. data/app/views/cms/blocks/edit.html.erb +0 -28
  461. data/app/views/cms/blocks/index.html.erb +0 -86
  462. data/app/views/cms/blocks/new.html.erb +0 -19
  463. data/app/views/cms/blocks/show.html.erb +0 -43
  464. data/app/views/cms/blocks/usages.html.erb +0 -44
  465. data/app/views/cms/blocks/versions.html.erb +0 -90
  466. data/app/views/cms/content_types/index.html.erb +0 -14
  467. data/app/views/cms/form_builder/_cms_attachment_manager.html.erb +0 -27
  468. data/app/views/cms/form_builder/_cms_check_box.html.erb +0 -7
  469. data/app/views/cms/form_builder/_cms_date_picker.html.erb +0 -12
  470. data/app/views/cms/form_builder/_cms_datetime_select.html.erb +0 -12
  471. data/app/views/cms/form_builder/_cms_drop_down.html.erb +0 -12
  472. data/app/views/cms/form_builder/_cms_fancy_drop_down.html.erb +0 -9
  473. data/app/views/cms/form_builder/_cms_file_field.html.erb +0 -28
  474. data/app/views/cms/form_builder/_cms_instructions.html.erb +0 -4
  475. data/app/views/cms/form_builder/_cms_tag_list.html.erb +0 -15
  476. data/app/views/cms/form_builder/_cms_template_editor.html.erb +0 -9
  477. data/app/views/cms/form_builder/_cms_text_area.html.erb +0 -10
  478. data/app/views/cms/form_builder/_cms_text_editor.html.erb +0 -19
  479. data/app/views/cms/form_builder/_cms_text_field.html.erb +0 -12
  480. data/app/views/cms/links/destroy.js.rjs +0 -2
  481. data/app/views/cms/page_routes/show.html.erb +0 -10
  482. data/app/views/cms/pages/_edit_connector.html.erb +0 -19
  483. data/app/views/cms/pages/_edit_container.html.erb +0 -11
  484. data/app/views/cms/section_nodes/_link.html.erb +0 -14
  485. data/app/views/cms/section_nodes/_node.html.erb +0 -44
  486. data/app/views/cms/section_nodes/_page.html.erb +0 -20
  487. data/app/views/cms/section_nodes/_section.html.erb +0 -28
  488. data/app/views/cms/section_nodes/index.html.erb +0 -43
  489. data/app/views/cms/sections/_page.html.erb +0 -4
  490. data/app/views/cms/sections/_section.html.erb +0 -8
  491. data/app/views/cms/sections/destroy.js.rjs +0 -2
  492. data/app/views/cms/sections/index.html.erb +0 -23
  493. data/app/views/cms/shared/_admin_sidebar.html.erb +0 -36
  494. data/app/views/cms/shared/_pagination.html.erb +0 -31
  495. data/app/views/cms/toolbar/_mobile_toggle.html.erb +0 -33
  496. data/app/views/cms/toolbar/index.html.erb +0 -1
  497. data/app/views/cms/users/_groups.html.erb +0 -12
  498. data/app/views/cms/users/_toolbar.html.erb +0 -24
  499. data/app/views/cms/users/show.html.erb +0 -50
  500. data/app/views/layouts/_cms_toolbar.html.erb +0 -54
  501. data/app/views/layouts/_page_toolbar.html.erb +0 -119
  502. data/app/views/layouts/cms/administration.html.erb +0 -51
  503. data/app/views/layouts/cms/content_library.html.erb +0 -96
  504. data/app/views/layouts/cms/dashboard.html.erb +0 -16
  505. data/app/views/layouts/cms/login.html.erb +0 -31
  506. data/app/views/layouts/cms/section_nodes.html.erb +0 -20
  507. data/app/views/layouts/cms/toolbar.html.erb +0 -23
  508. data/app/views/portlets/reset_password/_form.html.erb +0 -3
  509. data/app/views/portlets/reset_password/render.html.erb +0 -22
  510. data/bin/bcms-upgrade +0 -332
  511. data/db/migrate/20091109175123_browsercms_3_0_5.rb +0 -9
  512. data/db/migrate/20100117144038_browsercms314.rb +0 -20
  513. data/db/migrate/20100117144039_browsercms315.rb +0 -95
  514. data/db/migrate/20100705083859_browsercms_3_3_0.rb +0 -56
  515. data/db/migrate/20111130221145_browsercms340.rb +0 -56
  516. data/db/migrate/20120329144406_browsercms350.rb +0 -32
  517. data/db/migrate/20120717182827_browsercms353.rb +0 -19
  518. data/db/migrate/20120813180110_browsercms354.rb +0 -9
  519. data/lib/cms/addressable.rb +0 -93
  520. data/lib/cms/authentication/model.rb +0 -116
  521. data/lib/cms/behaviors/pagination.rb +0 -212
  522. data/lib/cms/upgrades/v3_4_0.rb +0 -31
  523. data/lib/cms/upgrades/v3_5_0.rb +0 -227
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 823840598ca36d83107fe20da64f6385708fc561
4
+ data.tar.gz: 14697d04fda45494e9b9f251423b0c2b932f4408
5
+ SHA512:
6
+ metadata.gz: dd83ce37f9b57de888b0dba23da366a13465d3170aceaa0e105e840d04167fddbc88a7d5556cba108af66cc45f8d2de810f095d358bb0240d687a6783ab19d62
7
+ data.tar.gz: 72a6338860e4222696725d10f314b4338b0a77c22e18f3f686bc04e81498c674f7d0e507fc0495c5c675fc78fec529cb980e1fdaac327d8899cc8f8f76bdff6b
@@ -1,4 +1,4 @@
1
- All BrowserCMS code is Copyright (C) 1998-2013 by BrowserMedia, LLC.
1
+ All BrowserCMS code is Copyright (C) 1998-2012 by BrowserMedia, LLC.
2
2
 
3
3
  This program is free software: you can redistribute it and/or modify
4
4
  it under the terms of the GNU Lesser General Public License as published by
@@ -21,6 +21,7 @@ license, including:
21
21
 
22
22
  - jQuery - Copyright (C) 2009 John Resig
23
23
  - CKEditor - Copyright (C) 2003-2009 Frederico Caldeira Knabben
24
+ - Icons - Copyright (C) 2012 Keyamoon
24
25
 
25
26
 
26
27
 
@@ -1,6 +1,6 @@
1
1
  # BrowserCMS: Humane Content Management for Rails
2
2
 
3
- BrowserCMS is a general purpose, open source Web Content Management System (CMS) that supports Ruby on Rails v3.2. It can be used as a standalone CMS, added to existing Rails projects or extended using Rails Engines. It is designed to support three distinct groups of users:
3
+ BrowserCMS is a general purpose, open source Web Content Management System (CMS) that supports Ruby on Rails v4.0. It can be used as a standalone CMS, added to existing Rails projects or extended using Rails Engines. It is designed to support three distinct groups of users:
4
4
 
5
5
  1. Non-technical web editors who want a humane system to manage their site, without needing to understand what HTML or even Rails is.
6
6
  2. Designers who want to create large and elegantly designed websites with no artificial constraints by the CMS.
@@ -11,7 +11,7 @@ BrowserCMS is intended to offer features comparable to commercial CMS products,
11
11
 
12
12
  Here's a quick overview of some of the more notable features:
13
13
 
14
- * Stanealone CMS: BrowserCMS is designed to provide a robust CMS capabilities out of the box for content heavy web sites.
14
+ * Standalone CMS: BrowserCMS is designed to provide a robust CMS capabilities out of the box for content heavy web sites.
15
15
  * Mobile Friendly: Sites can be built to use mobile optimized designs that are optimized for small screens, with low bandwidth, with responsive design.
16
16
  * In Context Editing: Users can browse their site to locate content and make changes from the page itself.
17
17
  * Design friendly Templates: Pages aren't just a template and giant single chunk of HTML. Templates can be built to have multiple editable areas, to allow for rich designs that are still easy to manage by non-technical users.
@@ -28,7 +28,7 @@ Here's a quick overview of some of the more notable features:
28
28
  See the [Getting Started](https://github.com/browsermedia/browsercms/wiki/Getting-Started) guide for instructions on how to install and start a project with BrowserCMS.
29
29
 
30
30
  ## License
31
- BrowserCMS is released under a LGPL license, and is copyright 1998-2013 BrowserMedia. The complete copyright can be found in COPYRIGHT.txt, and copy of the license can be found in LICENSE.txt.
31
+ BrowserCMS is released under a LGPL license, and is copyright 1998-2014 BrowserMedia. The complete copyright can be found in COPYRIGHT.txt, and copy of the license can be found in LICENSE.txt.
32
32
 
33
33
  ## Documentation / Support
34
34
  The user documentation and guides for this version of the application can be found at:
@@ -0,0 +1,61 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>
5
+ This is a custom SVG font generated by IcoMoon.
6
+ <iconset grid="20"></iconset>
7
+ </metadata>
8
+ <defs>
9
+ <font id="icomoon" horiz-adv-x="640" >
10
+ <font-face units-per-em="640" ascent="608" descent="-32" />
11
+ <missing-glyph horiz-adv-x="640" />
12
+ <glyph class="hidden" unicode="&#xf000;" d="M0,608L 640 -32L0 -32 z" horiz-adv-x="0" />
13
+ <glyph unicode="&#xe003;" d="M 620.164,63.378L 468.569,192.311c-15.671,14.104-32.431,20.579-45.97,19.954C 458.384,254.183, 480,308.564, 480,368
14
+ C 480,500.549, 372.549,608, 240,608C 107.453,608,0,500.549,0,368c0-132.549, 107.451-240, 240-240c 59.436,0, 113.817,21.616, 155.735,57.402
15
+ c-0.625-13.539, 5.85-30.299, 19.954-45.97l 128.934-151.595c 22.076-24.529, 58.139-26.596, 80.138-4.598S 644.692,41.301, 620.164,63.378z
16
+ M 240,208c-88.365,0-160,71.635-160,160S 151.635,528, 240,528s 160-71.635, 160-160S 328.366,208, 240,208z" data-tags="search, magnifier, lookup, find" />
17
+ <glyph unicode="&#xe004;" d="M 537.12,288c0,33.536, 20.64,60, 51.68,78.176c-5.632,18.688-12.992,36.64-22.112,53.504c-34.88-9.12-63.072,4.544-86.752,28.224
18
+ c-23.744,23.712-31.008,51.936-21.888,86.752c-16.864,9.12-34.752,16.576-53.504,22.144C 386.368,525.728, 353.504,505.088, 320,505.088
19
+ c-33.504,0-66.336,20.64-84.544,51.712C 216.704,551.232, 198.816,543.776, 181.952,534.688C 191.040,499.84, 183.808,471.616, 160.096,447.904
20
+ C 136.384,424.224, 108.16,410.56, 73.344,419.648C 64.224,402.816, 56.8,384.864, 51.2,366.176C 82.272,348, 102.912,321.536, 102.912,288
21
+ c0-33.504-20.64-66.368-51.712-84.576c 5.6-18.72, 13.024-36.64, 22.144-53.504c 34.848,9.12, 63.040,1.856, 86.752-21.856
22
+ c 23.712-23.712, 30.944-51.904, 21.856-86.752c 16.864-9.12, 34.784-16.576, 53.504-22.144c 18.208,31.104, 51.040,51.712, 84.544,51.712
23
+ c 33.504,0, 66.4-20.64, 84.576-51.712c 18.752,5.6, 36.64,13.024, 53.504,22.144c-9.12,34.848-1.888,63.040, 21.888,86.752
24
+ c 23.68,23.68, 51.872,37.344, 86.752,28.256c 9.12,16.864, 16.512,34.784, 22.112,53.504C 557.76,228.032, 537.12,254.496, 537.12,288z M 320,171.104
25
+ c-64.544,0-116.864,52.352-116.864,116.896S 255.456,404.896, 320,404.896c 64.576,0, 116.896-52.352, 116.896-116.896S 384.576,171.104, 320,171.104z" data-tags="cog, settings, preferences, options" />
26
+ <glyph unicode="&#xe006;" d="M 600.64,278.4l-256.768,256.992c-13.12,13.632-34.592,13.632-47.712,0L 39.36,278.4c-13.152-13.6-8.256-24.768, 10.88-24.768l 53.536,0 l0-197.376
27
+ c0-14.24, 0.608-25.888, 26.368-25.888l 124.64,0 l0,198.016 l 130.4,0 l0-198.016 l 130.848,0 c 19.648,0, 20.192,11.616, 20.192,25.888l0,197.376 l 53.504,0
28
+ C 608.832,253.632, 613.76,264.768, 600.64,278.4z" data-tags="house, home, building" />
29
+ <glyph unicode="&#xe007;" d="M 320,608C 143.269,608,0,464.731,0,288s 143.269-320, 320-320s 320,143.269, 320,320S 496.731,608, 320,608z M 320,48
30
+ c-132.549,0-240,107.451-240,240c0,132.549, 107.451,240, 240,240c 132.549,0, 240-107.451, 240-240C 560,155.451, 452.549,48, 320,48zM 200,288A120,120 12780 1 1 440,288A120,120 12780 1 1 200,288z" data-tags="radio-checked" />
31
+ <glyph unicode="&#xe008;" d="M 320,608C 143.269,608,0,464.731,0,288s 143.269-320, 320-320s 320,143.269, 320,320S 496.731,608, 320,608z M 320,48
32
+ c-132.549,0-240,107.451-240,240c0,132.549, 107.451,240, 240,240c 132.549,0, 240-107.451, 240-240C 560,155.451, 452.549,48, 320,48z" data-tags="radio-unchecked, circle" />
33
+ <glyph unicode="&#xe009;" d="M0,608l0-640 l 640,0 L 640,608 L0,608 z M 600,8L 40,8 L 40,568 l 560,0 L 600,8 z M 480,468L 280,268l-120,120l-80-80l 200-200l 280,280L 480,468z" data-tags="checkbox-checked, tick, checked, selected" />
34
+ <glyph unicode="&#xe00a;" d="M0,608l0-640 l 640,0 L 640,608 L0,608 z M 600,8L 40,8 L 40,568 l 560,0 L 600,8 z" data-tags="checkbox-unchecked, unchecked, square" />
35
+ <glyph unicode="&#xe00b;" d="M 557.574,490.426l-75.146,75.148C 459.091,588.909, 413,608, 380,608L 100,608 C 67,608, 40,581, 40,548l0-520 c0-33, 27-60, 60-60l 440,0
36
+ c 33,0, 60,27, 60,60L 600,388 C 600,421, 580.909,467.091, 557.574,490.426z M 400,523.274c 1.373-0.503, 2.782-1.050, 4.224-1.647
37
+ c 11.287-4.676, 19.124-10.11, 21.635-12.621l 75.148-75.149c 2.511-2.511, 7.945-10.346, 12.621-21.634c 0.597-1.441, 1.145-2.851, 1.647-4.223
38
+ L 400,408 L 400,523.274 z M 520,48L 120,48 L 120,528 l 240,0 l0-160 l 160,0 L 520,48 z" data-tags="file, paper, page, new, empty, blank, document" />
39
+ <glyph unicode="&#xe00c;" d="M 0,408 L 640,408 L 600,8 L 40,8 L 0,408 Z M 580,488 L 600,448 L 40,448 L 80,528 L 300,528 L 320,488 L 580,488 Z" data-tags="folder, directory, category, browse" />
40
+ <glyph unicode="&#xe00e;" d="M 520,8L 640,328L 120,328L0,8 zM 80,368 L 0,8 L 0,528 L 180,528 L 260,448 L 520,448 L 520,368 Z" data-tags="folder-open, directory, category, browse" />
41
+ <glyph unicode="&#xe00f;" d="M 320,595.232c-169.408,0-307.2-137.856-307.2-307.232c0-169.408, 137.792-307.232, 307.2-307.232s 307.2,137.824, 307.2,307.232
42
+ C 627.2,457.376, 489.408,595.232, 320,595.232z M 582.016,288c0-59.936-20.352-115.232-54.272-159.392c-9.6,7.52-19.776,27.776-10.176,48.768
43
+ c 9.664,21.12, 12.192,70.016, 9.984,89.024c-2.112,19.008-12,64.832-38.88,65.28c-26.784,0.416-45.184,9.248-61.12,41.056
44
+ c-33.056,66.144, 62.048,78.88, 28.992,115.52c-9.248,10.272-57.056-42.368-64.064,27.776C 392,521.056, 396.8,528.576, 403.2,536.352
45
+ C 507.008,501.472, 582.016,403.36, 582.016,288z M 284,547.392C 277.76,535.232, 261.216,530.24, 251.136,521.056C 229.28,501.28, 219.872,504, 208.064,484.992
46
+ c-11.84-19.008-50.112-46.368-50.112-60.128c0-13.728, 19.328-29.984, 28.992-26.816c 9.664,3.2, 35.136,3.008, 50.112-2.24
47
+ c 15.008-5.312, 125.28-10.592, 90.112-103.808c-11.136-29.632-59.904-24.64-72.896-73.728c-1.952-7.2-8.672-37.952-9.152-48
48
+ c-0.768-15.552, 11.008-74.176-4-74.176c-15.072,0-55.584,52.448-55.584,61.952s-10.528,42.848-10.528,71.36s-48.544,28.064-48.544,65.984
49
+ c0,34.24, 26.336,51.264, 20.416,67.616c-5.824,16.32-52.064,16.896-71.328,18.88C 109.216,469.312, 188.48,534.208, 284,547.392z M 237.6,39.36
50
+ c 15.744,8.288, 17.344,19.040, 31.616,19.616c 16.32,0.704, 29.6,6.368, 47.968,10.4c 16.352,3.552, 45.536,20.128, 71.296,22.24
51
+ c 21.664,1.792, 64.48-1.12, 76-22.048c-41.472-27.52-91.136-43.584-144.48-43.584C 291.2,25.984, 263.52,30.72, 237.6,39.36z" data-tags="earth, globe, planet" />
52
+ <glyph unicode="&#xe010;" d="M0,608L 160,608L 160,448L0,448zM 240,568L 640,568L 640,488L 240,488zM0,368L 160,368L 160,208L0,208zM 240,328L 640,328L 640,248L 240,248zM0,128L 160,128L 160-32L0-32zM 240,88L 640,88L 640,8L 240,8z" data-tags="list, bullet, ul, todo, menu" />
53
+ <glyph unicode="&#xe000;" d="M 524.576,422.74 C 573.104,388.346 612.933,342.058 640,288 C 580.549,169.276 459.571,88 320,88 C 280.896,88 243.255,94.382 208.014,106.177 L 256.736,154.9 C 277.398,150.337 298.594,148 320,148 C 375.974,148 430.534,163.929 477.779,194.065 C 515.38,218.050 547.244,250.175 571.176,288.001 C 548.019,324.605 517.418,355.845 481.395,379.56 L 524.576,422.74 ZM 320,171.75 C 305.798,171.75 292.030,173.61 278.92,177.084 L 474.661,372.824 C 478.137,359.716 480,345.952 480,331.75 C 480,243.385 408.365,171.75 320,171.75 ZM 600,608l-33.586,0 L 429.156,470.743C 394.734,481.945, 358.060,488, 320,488C 180.426,488, 59.449,406.724,0,288
54
+ c 26.661-53.245, 65.705-98.942, 113.246-133.168L0,41.586L0,8 l 33.586,0 L 600,574.414L 600,608 z M 260,411.75c 30.027,0, 54.904-22.059, 59.307-50.856
55
+ l-68.453-68.453C 222.059,296.846, 200,321.723, 200,351.75C 200,384.887, 226.863,411.75, 260,411.75z M 68.823,288
56
+ c 23.933,37.828, 55.796,69.953, 93.396,93.935c 2.449,1.563, 4.923,3.076, 7.411,4.563C 163.406,369.417, 160,350.984, 160,331.75
57
+ c0-36.578, 12.281-70.28, 32.936-97.226l-36.594-36.594C 121.297,221.456, 91.496,252.162, 68.823,288z" data-tags="eye-blocked, views, vision, visit, banned, blocked, forbidden, private" />
58
+ <glyph unicode="&#xe001;" d="M 580-32L 60-32 c-11.040,0-20,8.94-20,20L 40,308 c0,11.060, 8.96,20, 20,20l 60,0 l0,80 C 120,518.46, 209.54,608, 320,608
59
+ s 200-89.54, 200-200l0-80 l 60,0 c 11.060,0, 20-8.94, 20-20l0-320 C 600-23.060, 591.060-32, 580-32z M 440,418C 440,478.76, 386.26,528, 320,528s-120-49.24-120-110L 200,328 l 240,0 L 440,418 z" data-tags="locked, encryption, login, log in" />
60
+ <glyph unicode="&#x20;" horiz-adv-x="320" />
61
+ </font></defs></svg>
@@ -0,0 +1,61 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>
5
+ This is a custom SVG font generated by IcoMoon.
6
+ <iconset grid="20"></iconset>
7
+ </metadata>
8
+ <defs>
9
+ <font id="icomoon" horiz-adv-x="640" >
10
+ <font-face units-per-em="640" ascent="608" descent="-32" />
11
+ <missing-glyph horiz-adv-x="640" />
12
+ <glyph class="hidden" unicode="&#xf000;" d="M0,608L 640 -32L0 -32 z" horiz-adv-x="0" />
13
+ <glyph unicode="&#xe003;" d="M 620.164,63.378L 468.569,192.311c-15.671,14.104-32.431,20.579-45.97,19.954C 458.384,254.183, 480,308.564, 480,368
14
+ C 480,500.549, 372.549,608, 240,608C 107.453,608,0,500.549,0,368c0-132.549, 107.451-240, 240-240c 59.436,0, 113.817,21.616, 155.735,57.402
15
+ c-0.625-13.539, 5.85-30.299, 19.954-45.97l 128.934-151.595c 22.076-24.529, 58.139-26.596, 80.138-4.598S 644.692,41.301, 620.164,63.378z
16
+ M 240,208c-88.365,0-160,71.635-160,160S 151.635,528, 240,528s 160-71.635, 160-160S 328.366,208, 240,208z" />
17
+ <glyph unicode="&#xe004;" d="M 537.12,288c0,33.536, 20.64,60, 51.68,78.176c-5.632,18.688-12.992,36.64-22.112,53.504c-34.88-9.12-63.072,4.544-86.752,28.224
18
+ c-23.744,23.712-31.008,51.936-21.888,86.752c-16.864,9.12-34.752,16.576-53.504,22.144C 386.368,525.728, 353.504,505.088, 320,505.088
19
+ c-33.504,0-66.336,20.64-84.544,51.712C 216.704,551.232, 198.816,543.776, 181.952,534.688C 191.040,499.84, 183.808,471.616, 160.096,447.904
20
+ C 136.384,424.224, 108.16,410.56, 73.344,419.648C 64.224,402.816, 56.8,384.864, 51.2,366.176C 82.272,348, 102.912,321.536, 102.912,288
21
+ c0-33.504-20.64-66.368-51.712-84.576c 5.6-18.72, 13.024-36.64, 22.144-53.504c 34.848,9.12, 63.040,1.856, 86.752-21.856
22
+ c 23.712-23.712, 30.944-51.904, 21.856-86.752c 16.864-9.12, 34.784-16.576, 53.504-22.144c 18.208,31.104, 51.040,51.712, 84.544,51.712
23
+ c 33.504,0, 66.4-20.64, 84.576-51.712c 18.752,5.6, 36.64,13.024, 53.504,22.144c-9.12,34.848-1.888,63.040, 21.888,86.752
24
+ c 23.68,23.68, 51.872,37.344, 86.752,28.256c 9.12,16.864, 16.512,34.784, 22.112,53.504C 557.76,228.032, 537.12,254.496, 537.12,288z M 320,171.104
25
+ c-64.544,0-116.864,52.352-116.864,116.896S 255.456,404.896, 320,404.896c 64.576,0, 116.896-52.352, 116.896-116.896S 384.576,171.104, 320,171.104z" />
26
+ <glyph unicode="&#xe006;" d="M 600.64,278.4l-256.768,256.992c-13.12,13.632-34.592,13.632-47.712,0L 39.36,278.4c-13.152-13.6-8.256-24.768, 10.88-24.768l 53.536,0 l0-197.376
27
+ c0-14.24, 0.608-25.888, 26.368-25.888l 124.64,0 l0,198.016 l 130.4,0 l0-198.016 l 130.848,0 c 19.648,0, 20.192,11.616, 20.192,25.888l0,197.376 l 53.504,0
28
+ C 608.832,253.632, 613.76,264.768, 600.64,278.4z" />
29
+ <glyph unicode="&#xe007;" d="M 320,608C 143.269,608,0,464.731,0,288s 143.269-320, 320-320s 320,143.269, 320,320S 496.731,608, 320,608z M 320,48
30
+ c-132.549,0-240,107.451-240,240c0,132.549, 107.451,240, 240,240c 132.549,0, 240-107.451, 240-240C 560,155.451, 452.549,48, 320,48zM 200,288A120,120 12780 1 1 440,288A120,120 12780 1 1 200,288z" />
31
+ <glyph unicode="&#xe008;" d="M 320,608C 143.269,608,0,464.731,0,288s 143.269-320, 320-320s 320,143.269, 320,320S 496.731,608, 320,608z M 320,48
32
+ c-132.549,0-240,107.451-240,240c0,132.549, 107.451,240, 240,240c 132.549,0, 240-107.451, 240-240C 560,155.451, 452.549,48, 320,48z" />
33
+ <glyph unicode="&#xe009;" d="M0,608l0-640 l 640,0 L 640,608 L0,608 z M 600,8L 40,8 L 40,568 l 560,0 L 600,8 z M 480,468L 280,268l-120,120l-80-80l 200-200l 280,280L 480,468z" />
34
+ <glyph unicode="&#xe00a;" d="M0,608l0-640 l 640,0 L 640,608 L0,608 z M 600,8L 40,8 L 40,568 l 560,0 L 600,8 z" />
35
+ <glyph unicode="&#xe00b;" d="M 557.574,490.426l-75.146,75.148C 459.091,588.909, 413,608, 380,608L 100,608 C 67,608, 40,581, 40,548l0-520 c0-33, 27-60, 60-60l 440,0
36
+ c 33,0, 60,27, 60,60L 600,388 C 600,421, 580.909,467.091, 557.574,490.426z M 400,523.274c 1.373-0.503, 2.782-1.050, 4.224-1.647
37
+ c 11.287-4.676, 19.124-10.11, 21.635-12.621l 75.148-75.149c 2.511-2.511, 7.945-10.346, 12.621-21.634c 0.597-1.441, 1.145-2.851, 1.647-4.223
38
+ L 400,408 L 400,523.274 z M 520,48L 120,48 L 120,528 l 240,0 l0-160 l 160,0 L 520,48 z" />
39
+ <glyph unicode="&#xe00c;" d="M 0,408 L 640,408 L 600,8 L 40,8 L 0,408 Z M 580,488 L 600,448 L 40,448 L 80,528 L 300,528 L 320,488 L 580,488 Z" />
40
+ <glyph unicode="&#xe00e;" d="M 520,8L 640,328L 120,328L0,8 zM 80,368 L 0,8 L 0,528 L 180,528 L 260,448 L 520,448 L 520,368 Z" />
41
+ <glyph unicode="&#xe00f;" d="M 320,595.232c-169.408,0-307.2-137.856-307.2-307.232c0-169.408, 137.792-307.232, 307.2-307.232s 307.2,137.824, 307.2,307.232
42
+ C 627.2,457.376, 489.408,595.232, 320,595.232z M 582.016,288c0-59.936-20.352-115.232-54.272-159.392c-9.6,7.52-19.776,27.776-10.176,48.768
43
+ c 9.664,21.12, 12.192,70.016, 9.984,89.024c-2.112,19.008-12,64.832-38.88,65.28c-26.784,0.416-45.184,9.248-61.12,41.056
44
+ c-33.056,66.144, 62.048,78.88, 28.992,115.52c-9.248,10.272-57.056-42.368-64.064,27.776C 392,521.056, 396.8,528.576, 403.2,536.352
45
+ C 507.008,501.472, 582.016,403.36, 582.016,288z M 284,547.392C 277.76,535.232, 261.216,530.24, 251.136,521.056C 229.28,501.28, 219.872,504, 208.064,484.992
46
+ c-11.84-19.008-50.112-46.368-50.112-60.128c0-13.728, 19.328-29.984, 28.992-26.816c 9.664,3.2, 35.136,3.008, 50.112-2.24
47
+ c 15.008-5.312, 125.28-10.592, 90.112-103.808c-11.136-29.632-59.904-24.64-72.896-73.728c-1.952-7.2-8.672-37.952-9.152-48
48
+ c-0.768-15.552, 11.008-74.176-4-74.176c-15.072,0-55.584,52.448-55.584,61.952s-10.528,42.848-10.528,71.36s-48.544,28.064-48.544,65.984
49
+ c0,34.24, 26.336,51.264, 20.416,67.616c-5.824,16.32-52.064,16.896-71.328,18.88C 109.216,469.312, 188.48,534.208, 284,547.392z M 237.6,39.36
50
+ c 15.744,8.288, 17.344,19.040, 31.616,19.616c 16.32,0.704, 29.6,6.368, 47.968,10.4c 16.352,3.552, 45.536,20.128, 71.296,22.24
51
+ c 21.664,1.792, 64.48-1.12, 76-22.048c-41.472-27.52-91.136-43.584-144.48-43.584C 291.2,25.984, 263.52,30.72, 237.6,39.36z" />
52
+ <glyph unicode="&#xe010;" d="M0,608L 160,608L 160,448L0,448zM 240,568L 640,568L 640,488L 240,488zM0,368L 160,368L 160,208L0,208zM 240,328L 640,328L 640,248L 240,248zM0,128L 160,128L 160-32L0-32zM 240,88L 640,88L 640,8L 240,8z" />
53
+ <glyph unicode="&#xe000;" d="M 524.576,422.74 C 573.104,388.346 612.933,342.058 640,288 C 580.549,169.276 459.571,88 320,88 C 280.896,88 243.255,94.382 208.014,106.177 L 256.736,154.9 C 277.398,150.337 298.594,148 320,148 C 375.974,148 430.534,163.929 477.779,194.065 C 515.38,218.050 547.244,250.175 571.176,288.001 C 548.019,324.605 517.418,355.845 481.395,379.56 L 524.576,422.74 ZM 320,171.75 C 305.798,171.75 292.030,173.61 278.92,177.084 L 474.661,372.824 C 478.137,359.716 480,345.952 480,331.75 C 480,243.385 408.365,171.75 320,171.75 ZM 600,608l-33.586,0 L 429.156,470.743C 394.734,481.945, 358.060,488, 320,488C 180.426,488, 59.449,406.724,0,288
54
+ c 26.661-53.245, 65.705-98.942, 113.246-133.168L0,41.586L0,8 l 33.586,0 L 600,574.414L 600,608 z M 260,411.75c 30.027,0, 54.904-22.059, 59.307-50.856
55
+ l-68.453-68.453C 222.059,296.846, 200,321.723, 200,351.75C 200,384.887, 226.863,411.75, 260,411.75z M 68.823,288
56
+ c 23.933,37.828, 55.796,69.953, 93.396,93.935c 2.449,1.563, 4.923,3.076, 7.411,4.563C 163.406,369.417, 160,350.984, 160,331.75
57
+ c0-36.578, 12.281-70.28, 32.936-97.226l-36.594-36.594C 121.297,221.456, 91.496,252.162, 68.823,288z" />
58
+ <glyph unicode="&#xe001;" d="M 580-32L 60-32 c-11.040,0-20,8.94-20,20L 40,308 c0,11.060, 8.96,20, 20,20l 60,0 l0,80 C 120,518.46, 209.54,608, 320,608
59
+ s 200-89.54, 200-200l0-80 l 60,0 c 11.060,0, 20-8.94, 20-20l0-320 C 600-23.060, 591.060-32, 580-32z M 440,418C 440,478.76, 386.26,528, 320,528s-120-49.24-120-110L 200,328 l 240,0 L 440,418 z" />
60
+ <glyph unicode="&#x20;" horiz-adv-x="320" />
61
+ </font></defs></svg>
@@ -0,0 +1,23 @@
1
+ // This file is for defining toolbars used in the CKEDITOR inline
2
+
3
+ // For html body areas edited inline.
4
+ CKEDITOR.config.toolbar_inline =
5
+ [
6
+ { name:'clipboard', items:[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
7
+ { name:'editing', items:[ 'Scayt' ] },
8
+ { name:'insert', items:[ 'Image', 'Link', 'Unlink', 'Anchor' ] },
9
+ { name:'content', items:[ 'EditContent','MoveContentUp','MoveContentDown','DeleteContent']},
10
+ '/',
11
+ { name:'styles', items:[ 'Format', 'Styles' ] },
12
+ { name:'basicstyles', items:[ 'Bold', 'Italic', '-', 'RemoveFormat' ] },
13
+ { name:'paragraph', items:[ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent' ] } ,
14
+ { name:'tools', items:[ 'About' ] }
15
+
16
+ ];
17
+ CKEDITOR.config.toolbar_page_title =
18
+ [
19
+ { name:'undo', items:[ 'Undo', 'Redo' ] },
20
+ { name:'clipboard', items:[ 'Cut', 'Copy', 'Paste' ] }
21
+
22
+ ];
23
+ CKEDITOR.config.extraPlugins = 'delete_content,edit_content,move_content';
@@ -17,6 +17,6 @@ CKEDITOR.config.toolbar_CMSForms = [
17
17
  ['TextField','Select','Checkbox','Radio','Textarea','Button','ImageButton','HiddenField']
18
18
  ];
19
19
 
20
- CKEDITOR.config.width = 598;
20
+ CKEDITOR.config.width = '100%';
21
21
  CKEDITOR.config.height = 400;
22
22
  CKEDITOR.config.toolbar = 'CMS';
@@ -0,0 +1,36 @@
1
+ CKEDITOR.plugins.add('delete_content', {
2
+ icons:'deletecontent',
3
+ init:function (editor) {
4
+ editor.ui.addButton('DeleteContent', {
5
+ label:'Remove this content from the page (It will remain in Content Library)',
6
+ command:'deleteContent',
7
+ toolbar:'tools'
8
+ });
9
+
10
+ editor.addCommand('deleteContent', new CKEDITOR.dialogCommand('deleteContent'));
11
+
12
+ CKEDITOR.dialog.add('deleteContent', function (editor) {
13
+ return {
14
+ title:'Remove Content',
15
+ minWidth:300,
16
+ minHeight:100,
17
+ contents:[
18
+ {
19
+ id:'tab1',
20
+ label:'Confirm Delete',
21
+ elements:[
22
+ {
23
+ type:'html',
24
+ html:'<p>Do you want to remove this content from the page?</p><br /><p>(It will remain in the content library)</p>'
25
+ }
26
+ ]
27
+ }
28
+ ],
29
+
30
+ onOk:function () {
31
+ $.cms_editor.deleteContent();
32
+ }
33
+ };
34
+ });
35
+ }
36
+ });
@@ -0,0 +1,24 @@
1
+ CKEDITOR.plugins.add('edit_content', {
2
+ icons:'editcontent',
3
+ init:function (editor) {
4
+ editor.ui.addButton('EditContent', {
5
+ label:'Edit this content in the full editor.',
6
+ command:'editContent',
7
+ toolbar:'tools'
8
+ });
9
+
10
+ // When the user clicks the 'Edit Content' button, save any changes they made already, then take them to
11
+ editor.addCommand('editContent', {
12
+ exec:function (editor) {
13
+ var goto_edit = function(){
14
+ window.parent.location = $.cms_editor.selectedConnector().data('edit-path');
15
+ };
16
+ if (editor.checkDirty()) {
17
+ $.cms_editor.saveChanges(editor, goto_edit);
18
+ } else {
19
+ goto_edit.apply();
20
+ }
21
+ }
22
+ });
23
+ }
24
+ });
@@ -0,0 +1,25 @@
1
+ CKEDITOR.plugins.add('move_content', {
2
+ icons:'movecontentup,movecontentdown',
3
+ init:function (editor) {
4
+ editor.ui.addButton('MoveContentUp', {
5
+ label:'Move this content up',
6
+ command:'moveContentUp',
7
+ toolbar:'tools'
8
+ });
9
+ editor.ui.addButton('MoveContentDown', {
10
+ label:'Move this content down.',
11
+ command:'moveContentDown',
12
+ toolbar:'tools'
13
+ });
14
+ editor.addCommand('moveContentDown', {
15
+ exec:function (editor) {
16
+ $.cms_editor.moveContent(editor, 'move-down');
17
+ }
18
+ });
19
+ editor.addCommand('moveContentUp', {
20
+ exec:function (editor) {
21
+ $.cms_editor.moveContent(editor, 'move-up');
22
+ }
23
+ });
24
+ }
25
+ });
@@ -0,0 +1,60 @@
1
+ //= require 'cms/core_library'
2
+
3
+ // CMS library for invoking ajax functions.
4
+ // A layer on top of jQuery .ajax that adds some Rails and CMS logic
5
+ jQuery(function ($) {
6
+ $.cms_ajax = {
7
+
8
+ // Sets the message Accepts to javascript.
9
+ // Pass to beforeSend: when calling AJAX.
10
+ asJS:function () {
11
+ return function (xhr) {
12
+ xhr.setRequestHeader('X-CSRF-Token', $.cms.csrfToken());
13
+ xhr.setRequestHeader("Accept", "text/javascript, */*, q=0.1");
14
+ }
15
+ },
16
+ asJSON:function () {
17
+ return function (xhr) {
18
+ xhr.setRequestHeader('X-CSRF-Token', $.cms.csrfToken());
19
+ xhr.setRequestHeader("Accept", "application/json, */*, q=0.1");
20
+ }
21
+ },
22
+ // Invoke a Rails aware (w/ CSRF token) PUT request.
23
+ // @param [Hash] message A json message without the type.
24
+ // See http://api.jquery.com/jQuery.ajax/ for acceptable format.
25
+ put:function (message) {
26
+ message['type'] = 'POST';
27
+ message['data'] = message['data'] || {}
28
+ message['data']['_method'] = 'PUT';
29
+
30
+ $.ajax(message);
31
+
32
+ },
33
+ // Invoke a Rails aware (w/ CSRF token) DELETE request.
34
+ // @param [Hash] message A json message without the type.
35
+ // See http://api.jquery.com/jQuery.ajax/ for acceptable format.
36
+ // ex.
37
+ // $.cms_ajax.delete({
38
+ // url:'/event/1',
39
+ // success:function (result) {
40
+ // console.log("Got back " + result);
41
+ // }
42
+ // });
43
+ //
44
+ delete:function (message) {
45
+ message['type'] = 'POST';
46
+ message['data'] = message['data'] || {}
47
+ message['data']['_method'] = 'DELETE';
48
+ $.ajax(message);
49
+
50
+ }
51
+ };
52
+
53
+ // Defaults for AJAX requests
54
+ $.ajaxSetup({
55
+ beforeSend: $.cms_ajax.asJSON()
56
+ });
57
+ $(document).ajaxError(function (x, status, error) {
58
+ alert("A " + x.status + " error occurred: " + error);
59
+ });
60
+ });
@@ -2,11 +2,16 @@
2
2
  // Javascript libraries required for the Admin area of the CMS.
3
3
  //
4
4
  //= require jquery
5
- //= require jquery-ui
5
+ //= require jquery_ujs
6
6
  //= require jquery.cookie
7
7
  //= require jquery.selectbox
8
+ //= require jquery.exists
8
9
  //= require jquery.taglist
10
+ //= require jquery.ui.all
9
11
  //= require cms/core_library
10
12
  //= require cms/attachment_manager
13
+ //= require cms/form_builder
14
+ //= require cms/sitemap
15
+ //= require bootstrap
11
16
  //
12
17
 
@@ -1,13 +1,6 @@
1
1
  // Allows users to upload files via AJAX as attachments for a given block.
2
2
  //
3
3
  $(function () {
4
-
5
- // Return the authenticity token for any JS function that needs to do AJAX.
6
- // Since AJAX posts will fail if you don't attach this as defined here: http://michaelhendrickx.com/201012_jquery-ajax-with-rails-authenticity-token.html
7
- $.cms.auth_token = function () {
8
- return $('meta[name=csrf-token]').attr('content');
9
- };
10
-
11
4
  $.cms.AttachmentManager = {
12
5
  upload:function (file) {
13
6
  var assetName = $('#asset_types').val()
@@ -23,7 +16,7 @@ $(function () {
23
16
  fields += '<input type="hidden" name="attachment[attachable_class]" value="' + attachableClass + '" />';
24
17
  fields += '<input type="hidden" name="attachment[attachable_type]" value="' + attachableClass + '" />';
25
18
  fields += '<input type="hidden" name="attachment[attachable_id]" value="' + attachableID + '" />';
26
- fields += '<input type="hidden" name="authenticity_token" value="' + $.cms.authenticity_token + '" />';
19
+ fields += '<input type="hidden" name="authenticity_token" value="' + $.cms.csrfToken() + '" />';
27
20
 
28
21
  $('body').append(form);
29
22
  form.append(fields);
@@ -46,8 +39,8 @@ $(function () {
46
39
  // @param [Integer] id The id of the attachment to delete.
47
40
  destroy:function (id) {
48
41
  if (confirm("Are you sure want to delete this attachment?")) {
49
- $.post('/cms/attachments/' + id, {_method:'delete', authenticity_token:$.cms.auth_token()}, function (attachment_id) {
50
- console.log(attachment_id);
42
+ $.post('/cms/attachments/' + id, {_method:'delete', authenticity_token:$.cms.csrfToken()}, function (attachment_id) {
43
+ // console.log(attachment_id);
51
44
  $("#attachment_" + attachment_id).hide();
52
45
  if ($("#assets_table > table tr:visible").length <= 2) {
53
46
  $("#assets_table > table").hide();
@@ -1,4 +1,4 @@
1
- jQuery(function($) {
1
+ jQuery(function ($) {
2
2
 
3
3
  //----- Helper Functions -----------------------------------------------------
4
4
  //In all of this code, we are defining functions that we use later
@@ -8,12 +8,12 @@ jQuery(function($) {
8
8
  //For example, if you have section_node_5,
9
9
  //you pass this 'section_node_5', 'section_node'
10
10
  //and this returns 5
11
- var getId = function(elementId, s) {
11
+ var getId = function (elementId, s) {
12
12
  return elementId.replace(s, '')
13
13
  }
14
14
 
15
15
 
16
- var nodeOnDoubleClick = function() {
16
+ var nodeOnDoubleClick = function () {
17
17
  if ($('#edit_button').hasClass('disabled')) {
18
18
  //$('#view_button').click()
19
19
  location.href = $('#view_button')[0].href
@@ -23,7 +23,7 @@ jQuery(function($) {
23
23
  }
24
24
  }
25
25
 
26
- var addNodeOnDoubleClick = function() {
26
+ var addNodeOnDoubleClick = function () {
27
27
  $('#blocks tr').dblclick(nodeOnDoubleClick)
28
28
  }
29
29
 
@@ -39,26 +39,26 @@ jQuery(function($) {
39
39
  // I.e. Select a row, the 'View' button becomes active and the URL goes to the right path.
40
40
  //
41
41
  // Any element with class='cms-content-table' will have this applied to it.
42
- (function($) {
43
- $.fn.cmsContentToolbar = function() {
44
-
42
+ (function ($) {
43
+ $.fn.cmsContentToolbar = function () {
45
44
  var content_type = this.data('content_type')
46
45
  var is_versioned = this.data('versioned')
47
46
  var can_publish = this.data('can_publish')
48
47
  var plural_title = this.data('plural_title')
49
48
 
50
49
  $('table.data tbody tr').hover(
51
- function() {
50
+ function () {
52
51
  $(this).addClass('hover')
53
52
  },
54
- function() {
53
+ function () {
55
54
  $(this).removeClass('hover')
56
- }).click(function() {
55
+ }).click(function () {
57
56
  var view_path = $(this).data('view_path');
58
57
  var edit_path = $(this).data('edit_path');
59
58
  var delete_path = $(this).data('delete_path');
60
59
  var new_path = $(this).data('new_path');
61
60
  var versions_path = $(this).data('versions_path');
61
+ var preview_path = $(this).data('preview_path');
62
62
  var publish_path = $(this).data('publish_path') + '?_redirect_to=' + location.href;
63
63
  var status = $(this).data('status');
64
64
 
@@ -89,14 +89,33 @@ jQuery(function($) {
89
89
  }
90
90
  if (can_publish) {
91
91
  if (status == 'draft' && publishable) {
92
- $('#publish_button').removeClass('disabled').attr('href', publish_path);
92
+ $('#publish_button')
93
+ .attr('href', publish_path)
94
+ .enable_menu_button();
95
+ } else {
96
+ $('#publish_button')
97
+ .disable_menu_button();
93
98
  }
94
99
  }
100
+ if(preview_path){
101
+ $('#preview_button').attr('href', preview_path).enable_menu_button();
102
+ }
95
103
  })
96
104
  };
97
105
  })(jQuery);
98
106
 
99
- $(function() {
107
+ (function ($) {
108
+ $.fn.disable_menu_button = function () {
109
+ $(this).addClass('disabled');
110
+ $(this).attr("href", "#");
111
+ }
112
+ $.fn.enable_menu_button = function () {
113
+ $(this).removeClass('disabled');
114
+ return $(this);
115
+ }
116
+ })(jQuery);
117
+
118
+ $(function () {
100
119
  $('.cms-content-table').cmsContentToolbar();
101
120
  });
102
121