browsercms-artirix 4.0.0.rc1.art4
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.
- checksums.yaml +7 -0
- data/.yardopts +5 -0
- data/COPYRIGHT.txt +27 -0
- data/GPL.txt +674 -0
- data/LICENSE.txt +165 -0
- data/README.markdown +45 -0
- data/app/assets/fonts/icomoon.dev.svg +61 -0
- data/app/assets/fonts/icomoon.eot +0 -0
- data/app/assets/fonts/icomoon.svg +61 -0
- data/app/assets/fonts/icomoon.ttf +0 -0
- data/app/assets/fonts/icomoon.woff +0 -0
- data/app/assets/images/ckeditor/plugins/delete_content/icons/deletecontent.png +0 -0
- data/app/assets/images/ckeditor/plugins/edit_content/icons/editcontent.png +0 -0
- data/app/assets/images/ckeditor/plugins/move_content/icons/movecontentdown.png +0 -0
- data/app/assets/images/ckeditor/plugins/move_content/icons/movecontentup.png +0 -0
- data/app/assets/images/cms/administration/user_browser_bg.gif +0 -0
- data/app/assets/images/cms/arrow-down.png +0 -0
- data/app/assets/images/cms/arrow-up.png +0 -0
- data/app/assets/images/cms/bg.png +0 -0
- data/app/assets/images/cms/bl_curve.png +0 -0
- data/app/assets/images/cms/bottom_cap.png +0 -0
- data/app/assets/images/cms/bottom_cap_content.png +0 -0
- data/app/assets/images/cms/browse.gif +0 -0
- data/app/assets/images/cms/browser_media_logo.png +0 -0
- data/app/assets/images/cms/browsercms_logo.png +0 -0
- data/app/assets/images/cms/buttons/button.png +0 -0
- data/app/assets/images/cms/buttons/button_bg.png +0 -0
- data/app/assets/images/cms/buttons/button_cap.png +0 -0
- data/app/assets/images/cms/buttons/button_cap_h.png +0 -0
- data/app/assets/images/cms/buttons/button_cap_off.gif +0 -0
- data/app/assets/images/cms/buttons/button_cap_off_middle.gif +0 -0
- data/app/assets/images/cms/buttons/button_h.png +0 -0
- data/app/assets/images/cms/buttons/button_left_bg.png +0 -0
- data/app/assets/images/cms/buttons/button_off.png +0 -0
- data/app/assets/images/cms/buttons/button_off_middle.png +0 -0
- data/app/assets/images/cms/buttons/delete_x.png +0 -0
- data/app/assets/images/cms/buttons/delete_x_disabled.png +0 -0
- data/app/assets/images/cms/buttons/delete_x_h.png +0 -0
- data/app/assets/images/cms/buttons/sm_button.gif +0 -0
- data/app/assets/images/cms/buttons/sm_button_2.gif +0 -0
- data/app/assets/images/cms/buttons/sm_button_2_h.gif +0 -0
- data/app/assets/images/cms/buttons/sm_button_h.gif +0 -0
- data/app/assets/images/cms/cogs.png +0 -0
- data/app/assets/images/cms/containers/add.gif +0 -0
- data/app/assets/images/cms/containers/alpha.png +0 -0
- data/app/assets/images/cms/containers/beta.png +0 -0
- data/app/assets/images/cms/containers/delete.gif +0 -0
- data/app/assets/images/cms/containers/down.gif +0 -0
- data/app/assets/images/cms/containers/edit.gif +0 -0
- data/app/assets/images/cms/containers/up.gif +0 -0
- data/app/assets/images/cms/containers/view.gif +0 -0
- data/app/assets/images/cms/content_bg.gif +0 -0
- data/app/assets/images/cms/dashboard/bottom_cap.png +0 -0
- data/app/assets/images/cms/dashboard/bottom_cap_content.png +0 -0
- data/app/assets/images/cms/dashboard/header_bg.gif +0 -0
- data/app/assets/images/cms/dashboard/header_left_bg.gif +0 -0
- data/app/assets/images/cms/dashboard/home.png +0 -0
- data/app/assets/images/cms/dashboard/table_header_bg.gif +0 -0
- data/app/assets/images/cms/dashboard/top_cap.png +0 -0
- data/app/assets/images/cms/dashed.gif +0 -0
- data/app/assets/images/cms/datepicker/clear.gif +0 -0
- data/app/assets/images/cms/datepicker/close.gif +0 -0
- data/app/assets/images/cms/dk_button_l.gif +0 -0
- data/app/assets/images/cms/dk_button_r.gif +0 -0
- data/app/assets/images/cms/dot.png +0 -0
- data/app/assets/images/cms/draft_status.gif +0 -0
- data/app/assets/images/cms/file-uploading.gif +0 -0
- data/app/assets/images/cms/gray_long_bg.gif +0 -0
- data/app/assets/images/cms/home.png +0 -0
- data/app/assets/images/cms/icons/actions/add.png +0 -0
- data/app/assets/images/cms/icons/actions/config.png +0 -0
- data/app/assets/images/cms/icons/actions/connect.png +0 -0
- data/app/assets/images/cms/icons/actions/delete.png +0 -0
- data/app/assets/images/cms/icons/actions/down.png +0 -0
- data/app/assets/images/cms/icons/actions/edit.png +0 -0
- data/app/assets/images/cms/icons/actions/folder.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_add.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_delete.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_edit.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_move.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_open.png +0 -0
- data/app/assets/images/cms/icons/actions/history.png +0 -0
- data/app/assets/images/cms/icons/actions/home.png +0 -0
- data/app/assets/images/cms/icons/actions/left.png +0 -0
- data/app/assets/images/cms/icons/actions/link.png +0 -0
- data/app/assets/images/cms/icons/actions/page.png +0 -0
- data/app/assets/images/cms/icons/actions/page_add.png +0 -0
- data/app/assets/images/cms/icons/actions/page_edit.png +0 -0
- data/app/assets/images/cms/icons/actions/page_move.png +0 -0
- data/app/assets/images/cms/icons/actions/redo.png +0 -0
- data/app/assets/images/cms/icons/actions/refresh.png +0 -0
- data/app/assets/images/cms/icons/actions/right.png +0 -0
- data/app/assets/images/cms/icons/actions/root_folder.png +0 -0
- data/app/assets/images/cms/icons/actions/root_link.png +0 -0
- data/app/assets/images/cms/icons/actions/root_page.png +0 -0
- data/app/assets/images/cms/icons/actions/undo.png +0 -0
- data/app/assets/images/cms/icons/actions/up.png +0 -0
- data/app/assets/images/cms/icons/actions/view.png +0 -0
- data/app/assets/images/cms/icons/file_types/doc.png +0 -0
- data/app/assets/images/cms/icons/file_types/file.png +0 -0
- data/app/assets/images/cms/icons/file_types/gif.png +0 -0
- data/app/assets/images/cms/icons/file_types/htm.png +0 -0
- data/app/assets/images/cms/icons/file_types/pdf.png +0 -0
- data/app/assets/images/cms/icons/file_types/ppt.png +0 -0
- data/app/assets/images/cms/icons/file_types/swf.png +0 -0
- data/app/assets/images/cms/icons/file_types/txt.png +0 -0
- data/app/assets/images/cms/icons/file_types/xls.png +0 -0
- data/app/assets/images/cms/icons/file_types/xml.png +0 -0
- data/app/assets/images/cms/icons/file_types/zip.png +0 -0
- data/app/assets/images/cms/icons/status/archived.gif +0 -0
- data/app/assets/images/cms/icons/status/draft.gif +0 -0
- data/app/assets/images/cms/icons/status/hidden.gif +0 -0
- data/app/assets/images/cms/icons/status/locked.gif +0 -0
- data/app/assets/images/cms/icons/status/published.gif +0 -0
- data/app/assets/images/cms/icons/status/unlocked.gif +0 -0
- data/app/assets/images/cms/icons/user.png +0 -0
- data/app/assets/images/cms/login_bg.jpg +0 -0
- data/app/assets/images/cms/login_bottom.jpg +0 -0
- data/app/assets/images/cms/login_top.gif +0 -0
- data/app/assets/images/cms/logo.png +0 -0
- data/app/assets/images/cms/lt_button_bg.gif +0 -0
- data/app/assets/images/cms/lt_button_l.gif +0 -0
- data/app/assets/images/cms/lt_button_r.gif +0 -0
- data/app/assets/images/cms/menu/block_cap_h.gif +0 -0
- data/app/assets/images/cms/menu/bottom_cap.png +0 -0
- data/app/assets/images/cms/menu/bottom_cap_menu.png +0 -0
- data/app/assets/images/cms/menu/bottom_cap_menu_first.png +0 -0
- data/app/assets/images/cms/menu/menu_header_first_bg.gif +0 -0
- data/app/assets/images/cms/menu/selected_block_cap.gif +0 -0
- data/app/assets/images/cms/menu/top_cap.png +0 -0
- data/app/assets/images/cms/menu/top_cap_menu_header.png +0 -0
- data/app/assets/images/cms/menu.png +0 -0
- data/app/assets/images/cms/menu_h.gif +0 -0
- data/app/assets/images/cms/menu_header.png +0 -0
- data/app/assets/images/cms/menu_open.png +0 -0
- data/app/assets/images/cms/menu_open_bg.gif +0 -0
- data/app/assets/images/cms/nav/on_bg.gif +0 -0
- data/app/assets/images/cms/nav.png +0 -0
- data/app/assets/images/cms/nav_admin.gif +0 -0
- data/app/assets/images/cms/nav_admin_h.gif +0 -0
- data/app/assets/images/cms/nav_admin_on.gif +0 -0
- data/app/assets/images/cms/nav_cap.png +0 -0
- data/app/assets/images/cms/nav_cap_h.gif +0 -0
- data/app/assets/images/cms/nav_content_library.gif +0 -0
- data/app/assets/images/cms/nav_content_library_h.gif +0 -0
- data/app/assets/images/cms/nav_content_library_on.gif +0 -0
- data/app/assets/images/cms/nav_dash.gif +0 -0
- data/app/assets/images/cms/nav_dash_h.gif +0 -0
- data/app/assets/images/cms/nav_dash_on.gif +0 -0
- data/app/assets/images/cms/nav_h.gif +0 -0
- data/app/assets/images/cms/nav_sitemap.gif +0 -0
- data/app/assets/images/cms/nav_sitemap_h.gif +0 -0
- data/app/assets/images/cms/nav_sitemap_on.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_draft_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_draft_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_published_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_published_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/visual_editor_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/visual_editor_end.gif +0 -0
- data/app/assets/images/cms/page_toolbar/visual_editor_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/visual_editor_state_bg.gif +0 -0
- data/app/assets/images/cms/pages/add_connectable.gif +0 -0
- data/app/assets/images/cms/pages/connect_connectable.gif +0 -0
- data/app/assets/images/cms/pages/container_border.gif +0 -0
- data/app/assets/images/cms/pages/container_border_l.gif +0 -0
- data/app/assets/images/cms/pages/container_border_r.gif +0 -0
- data/app/assets/images/cms/pages/delete_connectable.gif +0 -0
- data/app/assets/images/cms/pages/down_connectable.gif +0 -0
- data/app/assets/images/cms/pages/down_connectable_disabled.gif +0 -0
- data/app/assets/images/cms/pages/edit_connectable.gif +0 -0
- data/app/assets/images/cms/pages/edit_connectable_2.gif +0 -0
- data/app/assets/images/cms/pages/show_connectable.gif +0 -0
- data/app/assets/images/cms/pages/up_connectable.gif +0 -0
- data/app/assets/images/cms/pages/up_connectable_disabled.gif +0 -0
- data/app/assets/images/cms/pagination/first.gif +0 -0
- data/app/assets/images/cms/pagination/first_h.gif +0 -0
- data/app/assets/images/cms/pagination/input.gif +0 -0
- data/app/assets/images/cms/pagination/last.gif +0 -0
- data/app/assets/images/cms/pagination/last_h.gif +0 -0
- data/app/assets/images/cms/pagination/next.gif +0 -0
- data/app/assets/images/cms/pagination/next_h.gif +0 -0
- data/app/assets/images/cms/pagination/previous.gif +0 -0
- data/app/assets/images/cms/pagination/previous_h.gif +0 -0
- data/app/assets/images/cms/pencil.png +0 -0
- data/app/assets/images/cms/plus.png +0 -0
- data/app/assets/images/cms/published_status.gif +0 -0
- data/app/assets/images/cms/search.png +0 -0
- data/app/assets/images/cms/search_submit.gif +0 -0
- data/app/assets/images/cms/search_submit_h.gif +0 -0
- data/app/assets/images/cms/searchbox_gradient.gif +0 -0
- data/app/assets/images/cms/select_bg.gif +0 -0
- data/app/assets/images/cms/select_bg_2.gif +0 -0
- data/app/assets/images/cms/sitemap/bottom_cap.png +0 -0
- data/app/assets/images/cms/sitemap/buffer_caps.png +0 -0
- data/app/assets/images/cms/sitemap/contract.png +0 -0
- data/app/assets/images/cms/sitemap/corners.gif +0 -0
- data/app/assets/images/cms/sitemap/corners_hover.gif +0 -0
- data/app/assets/images/cms/sitemap/divider.gif +0 -0
- data/app/assets/images/cms/sitemap/expand.png +0 -0
- data/app/assets/images/cms/sitemap/gradient.gif +0 -0
- data/app/assets/images/cms/sitemap/gray_contract.png +0 -0
- data/app/assets/images/cms/sitemap/gray_expand.png +0 -0
- data/app/assets/images/cms/sitemap/no_contents.png +0 -0
- data/app/assets/images/cms/sitemap/site_root_cap.png +0 -0
- data/app/assets/images/cms/sitemap/tooltip.gif +0 -0
- data/app/assets/images/cms/sitemap/top_cap_content.png +0 -0
- data/app/assets/images/cms/solid.gif +0 -0
- data/app/assets/images/cms/table/bl.gif +0 -0
- data/app/assets/images/cms/table/br.gif +0 -0
- data/app/assets/images/cms/table/divider.gif +0 -0
- data/app/assets/images/cms/table/td_cap_first_h.gif +0 -0
- data/app/assets/images/cms/table/td_cap_first_s.gif +0 -0
- data/app/assets/images/cms/table/td_cap_last_h.gif +0 -0
- data/app/assets/images/cms/table/td_cap_last_s.gif +0 -0
- data/app/assets/images/cms/table/td_last_bg.gif +0 -0
- data/app/assets/images/cms/table/th_bg.gif +0 -0
- data/app/assets/images/cms/table/th_divider.gif +0 -0
- data/app/assets/images/cms/table/th_last_bg.gif +0 -0
- data/app/assets/images/cms/table/tl.gif +0 -0
- data/app/assets/images/cms/table/tr.gif +0 -0
- data/app/assets/images/cms/table/tr_bg.gif +0 -0
- data/app/assets/images/cms/toolbar_bg.png +0 -0
- data/app/assets/images/cms/top_cap.png +0 -0
- data/app/assets/images/cms/top_cap_content.png +0 -0
- data/app/assets/images/cms/top_cap_menu_header.png +0 -0
- data/app/assets/images/cms/user.png +0 -0
- data/app/assets/images/cms/user_search_submit.gif +0 -0
- data/app/assets/images/cms/usercontrols_bg.png +0 -0
- data/app/assets/images/cms/usercontrols_bg_cap.png +0 -0
- data/app/assets/javascripts/bcms/ckeditor.js +8 -0
- data/app/assets/javascripts/bcms/ckeditor_inline.js +23 -0
- data/app/assets/javascripts/bcms/ckeditor_load.js +54 -0
- data/app/assets/javascripts/bcms/ckeditor_standard_config.js +10 -0
- data/app/assets/javascripts/ckeditor/plugins/delete_content/plugin.js +36 -0
- data/app/assets/javascripts/ckeditor/plugins/edit_content/plugin.js +24 -0
- data/app/assets/javascripts/ckeditor/plugins/move_content/plugin.js +25 -0
- data/app/assets/javascripts/cms/ajax.js +60 -0
- data/app/assets/javascripts/cms/application.js +18 -0
- data/app/assets/javascripts/cms/attachment_manager.js +88 -0
- data/app/assets/javascripts/cms/content_library.js +121 -0
- data/app/assets/javascripts/cms/content_types.js +13 -0
- data/app/assets/javascripts/cms/core_library.js.erb +210 -0
- data/app/assets/javascripts/cms/form_builder.js +250 -0
- data/app/assets/javascripts/cms/namespace.js +2 -0
- data/app/assets/javascripts/cms/new_content_button.js +27 -0
- data/app/assets/javascripts/cms/page_editor.js +189 -0
- data/app/assets/javascripts/cms/page_toolbar.js +13 -0
- data/app/assets/javascripts/cms/site.js +2 -0
- data/app/assets/javascripts/cms/sitemap.js +219 -0
- data/app/assets/javascripts/cms/toolbar.js +21 -0
- data/app/assets/javascripts/cms/user.js +40 -0
- data/app/assets/javascripts/jquery.exists.js +5 -0
- data/app/assets/javascripts/jquery.taglist.js +157 -0
- data/app/assets/stylesheets/cms/_assets.scss +60 -0
- data/app/assets/stylesheets/cms/_base.scss +42 -0
- data/app/assets/stylesheets/cms/_cms-buttons.scss +73 -0
- data/app/assets/stylesheets/cms/_cms-forms.scss +70 -0
- data/app/assets/stylesheets/cms/_colors.scss +20 -0
- data/app/assets/stylesheets/cms/_dashboard.scss +25 -0
- data/app/assets/stylesheets/cms/_glyph.scss +60 -0
- data/app/assets/stylesheets/cms/_main-area.scss +62 -0
- data/app/assets/stylesheets/cms/_nav.scss +197 -0
- data/app/assets/stylesheets/cms/_sidebar.scss +64 -0
- data/app/assets/stylesheets/cms/_sitemap.scss +209 -0
- data/app/assets/stylesheets/cms/_submenu.scss +48 -0
- data/app/assets/stylesheets/cms/application.scss +49 -0
- data/app/assets/stylesheets/cms/core.scss +96 -0
- data/app/assets/stylesheets/cms/default-forms.scss +3 -0
- data/app/assets/stylesheets/cms/includes/_animation.scss +2 -0
- data/app/assets/stylesheets/cms/includes/_rem.scss +120 -0
- data/app/assets/stylesheets/cms/includes/animation/_animate.scss +31 -0
- data/app/assets/stylesheets/cms/includes/animation/_core.scss +127 -0
- data/app/assets/stylesheets/cms/includes/animation/_shared.scss +22 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.scss +152 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_bouncing.scss +3 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_classes.scss +21 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_fading.scss +3 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_flippers.scss +87 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.scss +24 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_rotating.scss +3 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_specials.scss +42 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.scss +68 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.scss +60 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.scss +86 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.scss +86 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.scss +58 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.scss +58 -0
- data/app/assets/stylesheets/cms/page_content_editing.scss +4 -0
- data/app/assets/stylesheets/cms/page_editor.scss +4 -0
- data/app/assets/stylesheets/cms/style.scss +138 -0
- data/app/assets/stylesheets/cms/styles/_alerts.scss +150 -0
- data/app/assets/stylesheets/cms/styles/_base-grid.scss +299 -0
- data/app/assets/stylesheets/cms/styles/_buttons.scss +247 -0
- data/app/assets/stylesheets/cms/styles/_dropdown.scss +155 -0
- data/app/assets/stylesheets/cms/styles/_forms.scss +728 -0
- data/app/assets/stylesheets/cms/styles/_glyph.scss +86 -0
- data/app/assets/stylesheets/cms/styles/_images.scss +86 -0
- data/app/assets/stylesheets/cms/styles/_lists.scss +115 -0
- data/app/assets/stylesheets/cms/styles/_modal.scss +174 -0
- data/app/assets/stylesheets/cms/styles/_progress.scss +43 -0
- data/app/assets/stylesheets/cms/styles/_tables.scss +141 -0
- data/app/assets/stylesheets/cms/styles/_text.scss +134 -0
- data/app/controllers/cms/application_controller.rb +11 -0
- data/app/controllers/cms/attachments_controller.rb +48 -0
- data/app/controllers/cms/base_controller.rb +22 -0
- data/app/controllers/cms/cache_controller.rb +23 -0
- data/app/controllers/cms/categories_controller.rb +7 -0
- data/app/controllers/cms/category_types_controller.rb +12 -0
- data/app/controllers/cms/connectors_controller.rb +70 -0
- data/app/controllers/cms/content_block_controller.rb +361 -0
- data/app/controllers/cms/content_controller.rb +173 -0
- data/app/controllers/cms/content_types_controller.rb +14 -0
- data/app/controllers/cms/dashboard_controller.rb +13 -0
- data/app/controllers/cms/dynamic_views_controller.rb +81 -0
- data/app/controllers/cms/email_messages_controller.rb +21 -0
- data/app/controllers/cms/file_blocks_controller.rb +4 -0
- data/app/controllers/cms/form_entries_controller.rb +140 -0
- data/app/controllers/cms/form_fields_controller.rb +74 -0
- data/app/controllers/cms/forms_controller.rb +35 -0
- data/app/controllers/cms/groups_controller.rb +25 -0
- data/app/controllers/cms/home_controller.rb +10 -0
- data/app/controllers/cms/html_blocks_controller.rb +4 -0
- data/app/controllers/cms/image_blocks_controller.rb +4 -0
- data/app/controllers/cms/inline_content_controller.rb +50 -0
- data/app/controllers/cms/links_controller.rb +81 -0
- data/app/controllers/cms/page_components_controller.rb +20 -0
- data/app/controllers/cms/page_route_conditions_controller.rb +4 -0
- data/app/controllers/cms/page_route_options_controller.rb +58 -0
- data/app/controllers/cms/page_route_requirements_controller.rb +4 -0
- data/app/controllers/cms/page_routes_controller.rb +51 -0
- data/app/controllers/cms/pages_controller.rb +151 -0
- data/app/controllers/cms/passwords_controller.rb +22 -0
- data/app/controllers/cms/portlet_controller.rb +21 -0
- data/app/controllers/cms/portlets_controller.rb +35 -0
- data/app/controllers/cms/redirects_controller.rb +25 -0
- data/app/controllers/cms/resource_controller.rb +125 -0
- data/app/controllers/cms/routes_controller.rb +22 -0
- data/app/controllers/cms/section_nodes_controller.rb +24 -0
- data/app/controllers/cms/sections_controller.rb +100 -0
- data/app/controllers/cms/sessions_controller.rb +15 -0
- data/app/controllers/cms/sites/passwords_controller.rb +32 -0
- data/app/controllers/cms/sites/sessions_controller.rb +20 -0
- data/app/controllers/cms/tags_controller.rb +16 -0
- data/app/controllers/cms/tasks_controller.rb +56 -0
- data/app/controllers/cms/toolbar_controller.rb +18 -0
- data/app/controllers/cms/user_controller.rb +8 -0
- data/app/controllers/cms/users_controller.rb +125 -0
- data/app/controllers/tests/pretend_controller.rb +32 -0
- data/app/helpers/cms/application_helper.rb +258 -0
- data/app/helpers/cms/content_block_helper.rb +55 -0
- data/app/helpers/cms/content_types_helper.rb +4 -0
- data/app/helpers/cms/form_tag_helper.rb +36 -0
- data/app/helpers/cms/menu_helper.rb +167 -0
- data/app/helpers/cms/mobile_helper.rb +29 -0
- data/app/helpers/cms/nav_menu_helper.rb +23 -0
- data/app/helpers/cms/page_helper.rb +169 -0
- data/app/helpers/cms/path_helper.rb +113 -0
- data/app/helpers/cms/rendering_helper.rb +112 -0
- data/app/helpers/cms/section_nodes_helper.rb +112 -0
- data/app/helpers/cms/sites/authentication_helper.rb +25 -0
- data/app/helpers/cms/sites/devise_shim_helper.rb +31 -0
- data/app/helpers/cms/template_support.rb +18 -0
- data/app/helpers/cms/ui_elements_helper.rb +168 -0
- data/app/helpers/forgot_password_portlet_helper.rb +9 -0
- data/app/helpers/login_portlet_helper.rb +10 -0
- data/app/inputs/attachments_input.rb +14 -0
- data/app/inputs/cms_text_area_input.rb +10 -0
- data/app/inputs/date_picker_input.rb +8 -0
- data/app/inputs/file_picker_input.rb +75 -0
- data/app/inputs/name_input.rb +42 -0
- data/app/inputs/path_input.rb +18 -0
- data/app/inputs/tag_list_input.rb +3 -0
- data/app/inputs/template_editor_input.rb +24 -0
- data/app/inputs/text_editor_input.rb +19 -0
- data/app/models/cms/abstract_file_block.rb +50 -0
- data/app/models/cms/attachment.rb +267 -0
- data/app/models/cms/category.rb +56 -0
- data/app/models/cms/category_type.rb +43 -0
- data/app/models/cms/connector.rb +99 -0
- data/app/models/cms/content.rb +31 -0
- data/app/models/cms/content_type.rb +191 -0
- data/app/models/cms/dynamic_view.rb +81 -0
- data/app/models/cms/email_message.rb +63 -0
- data/app/models/cms/email_message_mailer.rb +12 -0
- data/app/models/cms/external_user.rb +60 -0
- data/app/models/cms/file_block.rb +19 -0
- data/app/models/cms/form.rb +47 -0
- data/app/models/cms/form_entry.rb +75 -0
- data/app/models/cms/form_field.rb +78 -0
- data/app/models/cms/group.rb +62 -0
- data/app/models/cms/group_permission.rb +12 -0
- data/app/models/cms/group_section.rb +9 -0
- data/app/models/cms/group_type.rb +16 -0
- data/app/models/cms/group_type_permission.rb +8 -0
- data/app/models/cms/guest_user.rb +57 -0
- data/app/models/cms/html_block.rb +38 -0
- data/app/models/cms/image_block.rb +23 -0
- data/app/models/cms/link.rb +20 -0
- data/app/models/cms/page.rb +437 -0
- data/app/models/cms/page_component.rb +43 -0
- data/app/models/cms/page_partial.rb +40 -0
- data/app/models/cms/page_route.rb +140 -0
- data/app/models/cms/page_route_condition.rb +5 -0
- data/app/models/cms/page_route_option.rb +7 -0
- data/app/models/cms/page_route_requirement.rb +5 -0
- data/app/models/cms/page_template.rb +45 -0
- data/app/models/cms/permission.rb +17 -0
- data/app/models/cms/persistent_user.rb +223 -0
- data/app/models/cms/portlet.rb +237 -0
- data/app/models/cms/redirect.rb +12 -0
- data/app/models/cms/search_filter.rb +18 -0
- data/app/models/cms/section.rb +224 -0
- data/app/models/cms/section_node.rb +144 -0
- data/app/models/cms/site.rb +45 -0
- data/app/models/cms/tag.rb +69 -0
- data/app/models/cms/tagging.rb +14 -0
- data/app/models/cms/task.rb +75 -0
- data/app/models/cms/templates.rb +31 -0
- data/app/models/cms/user.rb +43 -0
- data/app/models/cms/user_group_membership.rb +9 -0
- data/app/models/cms/view_context.rb +81 -0
- data/app/portlets/deprecated_placeholder.rb +12 -0
- data/app/portlets/dynamic_portlet.rb +7 -0
- data/app/portlets/email_page_portlet.rb +32 -0
- data/app/portlets/forgot_password_portlet.rb +15 -0
- data/app/portlets/helpers/cms/list_portlet_helper.rb +5 -0
- data/app/portlets/list_portlet.rb +40 -0
- data/app/portlets/login_portlet.rb +13 -0
- data/app/portlets/tag_cloud_portlet.rb +15 -0
- data/app/presenters/cms/user_presenter.rb +47 -0
- data/app/views/cms/application/_add_content_modal.html.erb +3 -0
- data/app/views/cms/application/_buttons.html.erb +7 -0
- data/app/views/cms/application/_exception.html.erb +6 -0
- data/app/views/cms/application/_form_errors.html.erb +7 -0
- data/app/views/cms/application/_form_with_buttons.html.erb +10 -0
- data/app/views/cms/application/_main_content.html.erb +3 -0
- data/app/views/cms/application/_main_with_sidebar.html.erb +8 -0
- data/app/views/cms/application/_mobile_toolbar.html.erb +16 -0
- data/app/views/cms/application/_page_title.html.erb +5 -0
- data/app/views/cms/application/_pagination.html.erb +26 -0
- data/app/views/cms/application/_row.html.erb +1 -0
- data/app/views/cms/application/_save_buttons.html.erb +7 -0
- data/app/views/cms/application/_sidebar_layout.html.erb +3 -0
- data/app/views/cms/application/_version.html.erb +23 -0
- data/app/views/cms/application/_version_conflict_diff.html.erb +11 -0
- data/app/views/cms/application/_version_conflict_error.html.erb +6 -0
- data/app/views/cms/attachments/_attachment.html.erb +16 -0
- data/app/views/cms/attachments/_attachment_manager.html.erb +39 -0
- data/app/views/cms/attachments/_attachment_table.html.erb +22 -0
- data/app/views/cms/attachments/_attachment_wrapper.html.erb +4 -0
- data/app/views/cms/attachments/_no_attachments_defined.html.erb +1 -0
- data/app/views/cms/cache/show.html.erb +7 -0
- data/app/views/cms/categories/_form.html.erb +27 -0
- data/app/views/cms/category_types/_form.html.erb +1 -0
- data/app/views/cms/connectors/new.html.erb +38 -0
- data/app/views/cms/content/editing_frame.html.erb +1 -0
- data/app/views/cms/content/no_page.html.erb +19 -0
- data/app/views/cms/content/show.html.erb +21 -0
- data/app/views/cms/content_block/_block_form.html.erb +15 -0
- data/app/views/cms/content_block/_buttonbar.html.erb +29 -0
- data/app/views/cms/content_block/_buttons.html.erb +13 -0
- data/app/views/cms/content_block/_hidden_fields.html.erb +13 -0
- data/app/views/cms/content_block/_sidebar.html.erb +36 -0
- data/app/views/cms/content_block/edit.html.erb +3 -0
- data/app/views/cms/content_block/index.html.erb +87 -0
- data/app/views/cms/content_block/new.html.erb +3 -0
- data/app/views/cms/content_block/render_block_in_main_container.html.erb +10 -0
- data/app/views/cms/content_block/show.html.erb +1 -0
- data/app/views/cms/content_block/show_in_isolation.html.erb +15 -0
- data/app/views/cms/content_block/versions.html.erb +24 -0
- data/app/views/cms/content_types/_order_field.html.erb +5 -0
- data/app/views/cms/content_types/index.html.erb +3 -0
- data/app/views/cms/dashboard/_page_drafts.html.erb +39 -0
- data/app/views/cms/dashboard/_tasks.html.erb +41 -0
- data/app/views/cms/dashboard/index.html.erb +13 -0
- data/app/views/cms/dynamic_views/_form.html.erb +9 -0
- data/app/views/cms/dynamic_views/edit.html.erb +2 -0
- data/app/views/cms/dynamic_views/index.html.erb +33 -0
- data/app/views/cms/dynamic_views/new.html.erb +2 -0
- data/app/views/cms/email_messages/index.html.erb +36 -0
- data/app/views/cms/email_messages/show.html.erb +50 -0
- data/app/views/cms/file_blocks/_form.html.erb +3 -0
- data/app/views/cms/file_blocks/_section_selector.html.erb +13 -0
- data/app/views/cms/file_blocks/render.html.erb +5 -0
- data/app/views/cms/forgot_password_mailer/reset_password.text.html.erb +3 -0
- data/app/views/cms/forgot_password_mailer/reset_password.text.plain.erb +3 -0
- data/app/views/cms/form_entries/_buttons.html.erb +2 -0
- data/app/views/cms/form_entries/_form.html.erb +7 -0
- data/app/views/cms/form_entries/_internal_form.html.erb +9 -0
- data/app/views/cms/form_entries/edit.html.erb +5 -0
- data/app/views/cms/form_entries/error.html.erb +3 -0
- data/app/views/cms/form_entries/index.html.erb +5 -0
- data/app/views/cms/form_entries/new.html.erb +5 -0
- data/app/views/cms/form_entries/show.html.erb +13 -0
- data/app/views/cms/form_entries/submit.html.erb +1 -0
- data/app/views/cms/form_fields/_form.html.erb +8 -0
- data/app/views/cms/form_fields/_select.html.erb +3 -0
- data/app/views/cms/form_fields/_text_area.html.erb +3 -0
- data/app/views/cms/form_fields/_text_field.html.erb +3 -0
- data/app/views/cms/form_fields/edit.html.erb +0 -0
- data/app/views/cms/form_fields/new.html.erb +26 -0
- data/app/views/cms/form_fields/preview.html.erb +16 -0
- data/app/views/cms/forms/_form.html.erb +67 -0
- data/app/views/cms/forms/render.html.erb +15 -0
- data/app/views/cms/forms/show.html.erb +6 -0
- data/app/views/cms/groups/_form.html.erb +38 -0
- data/app/views/cms/groups/_permissions.html.erb +14 -0
- data/app/views/cms/groups/_sections.html.erb +12 -0
- data/app/views/cms/groups/edit.html.erb +2 -0
- data/app/views/cms/groups/index.html.erb +36 -0
- data/app/views/cms/groups/new.html.erb +2 -0
- data/app/views/cms/html_blocks/_form.html.erb +3 -0
- data/app/views/cms/html_blocks/render.html.erb +1 -0
- data/app/views/cms/image_blocks/_form.html.erb +3 -0
- data/app/views/cms/image_blocks/render.html.erb +4 -0
- data/app/views/cms/links/_form.html.erb +8 -0
- data/app/views/cms/links/edit.html.erb +4 -0
- data/app/views/cms/links/new.html.erb +5 -0
- data/app/views/cms/menus/_menu.html.erb +9 -0
- data/app/views/cms/menus/_menu_item.html.erb +11 -0
- data/app/views/cms/page_components/_content.html.erb +18 -0
- data/app/views/cms/page_components/new.html.erb +12 -0
- data/app/views/cms/page_routes/_form.html.erb +12 -0
- data/app/views/cms/page_routes/edit.html.erb +2 -0
- data/app/views/cms/page_routes/index.html.erb +33 -0
- data/app/views/cms/page_routes/new.html.erb +2 -0
- data/app/views/cms/pages/_edit_content.html.erb +28 -0
- data/app/views/cms/pages/_form.html.erb +21 -0
- data/app/views/cms/pages/_main_form.html.erb +23 -0
- data/app/views/cms/pages/_simple_container.html.erb +8 -0
- data/app/views/cms/pages/edit.html.erb +2 -0
- data/app/views/cms/pages/new.html.erb +19 -0
- data/app/views/cms/pages/versions.html.erb +22 -0
- data/app/views/cms/passwords/new.html.erb +16 -0
- data/app/views/cms/redirects/_form.html.erb +7 -0
- data/app/views/cms/redirects/edit.html.erb +2 -0
- data/app/views/cms/redirects/index.html.erb +25 -0
- data/app/views/cms/redirects/new.html.erb +2 -0
- data/app/views/cms/routes/index.html.erb +35 -0
- data/app/views/cms/section_nodes/_children.html.erb +5 -0
- data/app/views/cms/section_nodes/_row_buttons.html.erb +11 -0
- data/app/views/cms/section_nodes/_section_node.html.erb +24 -0
- data/app/views/cms/section_nodes/_sitemap_buttons.html.erb +47 -0
- data/app/views/cms/section_nodes/_status.html.erb +5 -0
- data/app/views/cms/section_nodes/show.html.erb +9 -0
- data/app/views/cms/sections/_buttons.html.erb +6 -0
- data/app/views/cms/sections/_form.html.erb +30 -0
- data/app/views/cms/sections/edit.html.erb +4 -0
- data/app/views/cms/sections/new.html.erb +5 -0
- data/app/views/cms/sessions/new.html.erb +16 -0
- data/app/views/cms/shared/access_denied.html.erb +2 -0
- data/app/views/cms/shared/error.html.erb +40 -0
- data/app/views/cms/shared/error.xml.erb +8 -0
- data/app/views/cms/sites/_flash.html.erb +8 -0
- data/app/views/cms/sites/passwords/new.html.erb +2 -0
- data/app/views/cms/sites/sessions/new.html.erb +2 -0
- data/app/views/cms/tags/_form.html.erb +1 -0
- data/app/views/cms/tags/render.html.erb +52 -0
- data/app/views/cms/tasks/new.html.erb +22 -0
- data/app/views/cms/toolbar/_new_pages_menu.html.erb +10 -0
- data/app/views/cms/users/_form.html.erb +9 -0
- data/app/views/cms/users/_password.html.erb +2 -0
- data/app/views/cms/users/_user_fields.html.erb +7 -0
- data/app/views/cms/users/change_password.html.erb +12 -0
- data/app/views/cms/users/edit.html.erb +2 -0
- data/app/views/cms/users/index.html.erb +65 -0
- data/app/views/cms/users/new.html.erb +2 -0
- data/app/views/devise/confirmations/new.html.erb +16 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +19 -0
- data/app/views/devise/passwords/new.html.erb +15 -0
- data/app/views/devise/registrations/edit.html.erb +28 -0
- data/app/views/devise/registrations/new.html.erb +18 -0
- data/app/views/devise/shared/_links.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +16 -0
- data/app/views/layouts/cms/_content_types.html.erb +13 -0
- data/app/views/layouts/cms/_footer.erb +4 -0
- data/app/views/layouts/cms/_head.html.erb +8 -0
- data/app/views/layouts/cms/_main_menu.html.erb +78 -0
- data/app/views/layouts/cms/application.html.erb +23 -0
- data/app/views/layouts/cms/content_page.html.erb +5 -0
- data/app/views/layouts/cms/page_editor.html.erb +90 -0
- data/app/views/portlets/deprecated_placeholders/_form.html.erb +1 -0
- data/app/views/portlets/deprecated_placeholders/render.html.erb +8 -0
- data/app/views/portlets/dynamic/_form.html.erb +3 -0
- data/app/views/portlets/email_page/_form.html.erb +5 -0
- data/app/views/portlets/email_page/render.html.erb +17 -0
- data/app/views/portlets/forgot_password/_form.html.erb +5 -0
- data/app/views/portlets/forgot_password/render.html.erb +2 -0
- data/app/views/portlets/list/_form.html.erb +33 -0
- data/app/views/portlets/list/_list.html.erb +6 -0
- data/app/views/portlets/list/_table.html.erb +13 -0
- data/app/views/portlets/list/render.html.erb +1 -0
- data/app/views/portlets/login/_form.html.erb +4 -0
- data/app/views/portlets/login/render.html.erb +10 -0
- data/app/views/portlets/portlets/_form.html.erb +20 -0
- data/app/views/portlets/tag_cloud/_form.html.erb +4 -0
- data/app/views/portlets/tag_cloud/render.html.erb +5 -0
- data/app/views/tests/pretend/open_with_layout.html.erb +5 -0
- data/bin/bcms +321 -0
- data/bin/browsercms +4 -0
- data/bin/rake +16 -0
- data/config/routes.rb +135 -0
- data/db/browsercms.seeds.rb +63 -0
- data/db/migrate/20080815014337_browsercms300.rb +287 -0
- data/db/migrate/20130327184912_browsercms400.rb +120 -0
- data/db/migrate/20150715173336_create_default_users.rb +12 -0
- data/db/seeds.rb +1 -0
- data/doc/README_FOR_APP +6 -0
- data/doc/design/blue_button.psd +0 -0
- data/doc/design/gray_box.psd +0 -0
- data/doc/design/main_nav.psd +0 -0
- data/doc/features/design_integration.md +45 -0
- data/doc/features/external_user.md +7 -0
- data/doc/features/form_builder.md +40 -0
- data/doc/features/simple_form_refactor.md +60 -0
- data/doc/performance_tuning_notes.md +12 -0
- data/doc/release_notes.md +837 -0
- data/doc/test_procedure.txt +141 -0
- data/lib/acts_as_list.rb +257 -0
- data/lib/browsercms-artirix.rb +1 -0
- data/lib/browsercms.rb +73 -0
- data/lib/cms/acts/cms_user.rb +131 -0
- data/lib/cms/acts/content_block.rb +61 -0
- data/lib/cms/acts/content_page.rb +90 -0
- data/lib/cms/acts.rb +7 -0
- data/lib/cms/admin_tab.rb +15 -0
- data/lib/cms/attachments/attachment_serving.rb +59 -0
- data/lib/cms/attachments/configuration.rb +88 -0
- data/lib/cms/authentication/controller.rb +120 -0
- data/lib/cms/authentication/test_password_strategy.rb +28 -0
- data/lib/cms/authentication.rb +4 -0
- data/lib/cms/authoring.rb +9 -0
- data/lib/cms/behaviors/archiving.rb +43 -0
- data/lib/cms/behaviors/attaching.rb +363 -0
- data/lib/cms/behaviors/categorizing.rb +31 -0
- data/lib/cms/behaviors/connecting.rb +141 -0
- data/lib/cms/behaviors/dynamic_attributes.rb +384 -0
- data/lib/cms/behaviors/flush_cache_on_change.rb +31 -0
- data/lib/cms/behaviors/hiding.rb +46 -0
- data/lib/cms/behaviors/namespacing.rb +15 -0
- data/lib/cms/behaviors/naming.rb +16 -0
- data/lib/cms/behaviors/publishing.rb +205 -0
- data/lib/cms/behaviors/rendering.rb +195 -0
- data/lib/cms/behaviors/searching.rb +45 -0
- data/lib/cms/behaviors/soft_deleting.rb +103 -0
- data/lib/cms/behaviors/taggable.rb +66 -0
- data/lib/cms/behaviors/userstamping.rb +42 -0
- data/lib/cms/behaviors/versioning.rb +360 -0
- data/lib/cms/behaviors.rb +34 -0
- data/lib/cms/caching.rb +62 -0
- data/lib/cms/commands/actions.rb +107 -0
- data/lib/cms/commands/to_version400.rb +10 -0
- data/lib/cms/concerns/can_be_addressable.rb +326 -0
- data/lib/cms/concerns/has_content_type.rb +46 -0
- data/lib/cms/concerns/ignores_publishing.rb +9 -0
- data/lib/cms/concerns.rb +7 -0
- data/lib/cms/configuration/configurable_template.rb +24 -0
- data/lib/cms/configuration/devise.rb +256 -0
- data/lib/cms/configuration.rb +79 -0
- data/lib/cms/configure_simple_form.rb +142 -0
- data/lib/cms/configure_simple_form_bootstrap.rb +58 -0
- data/lib/cms/content_filter.rb +18 -0
- data/lib/cms/content_page.rb +77 -0
- data/lib/cms/content_rendering_support.rb +114 -0
- data/lib/cms/controllers/admin_controller.rb +78 -0
- data/lib/cms/data_loader.rb +54 -0
- data/lib/cms/date_picker.rb +23 -0
- data/lib/cms/default_accessible.rb +13 -0
- data/lib/cms/domain_support.rb +38 -0
- data/lib/cms/engine.rb +135 -0
- data/lib/cms/engine_helper.rb +103 -0
- data/lib/cms/error_handling.rb +84 -0
- data/lib/cms/error_pages.rb +8 -0
- data/lib/cms/extensions/action_view/base.rb +13 -0
- data/lib/cms/extensions/active_model/name.rb +13 -0
- data/lib/cms/extensions/active_record/base.rb +37 -0
- data/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +94 -0
- data/lib/cms/extensions/active_record/errors.rb +12 -0
- data/lib/cms/extensions/active_support/cache/file_store.rb +9 -0
- data/lib/cms/extensions/hash.rb +11 -0
- data/lib/cms/extensions/integer.rb +16 -0
- data/lib/cms/extensions/nil.rb +19 -0
- data/lib/cms/extensions/string.rb +24 -0
- data/lib/cms/extensions.rb +5 -0
- data/lib/cms/form_builder/content_block_form_builder.rb +45 -0
- data/lib/cms/form_builder/default_input.rb +13 -0
- data/lib/cms/form_builder/deprecated_inputs.rb +40 -0
- data/lib/cms/form_builder/workflow_buttons.rb +38 -0
- data/lib/cms/installation_actions.rb +8 -0
- data/lib/cms/mobile_aware.rb +67 -0
- data/lib/cms/module.rb +36 -0
- data/lib/cms/module_installation.rb +31 -0
- data/lib/cms/polymorphic_single_table_inheritance.rb +19 -0
- data/lib/cms/publish_workflow.rb +26 -0
- data/lib/cms/responders/content_responder.rb +14 -0
- data/lib/cms/route_extensions.rb +157 -0
- data/lib/cms/users_service.rb +208 -0
- data/lib/cms/version.rb +11 -0
- data/lib/command_line.rb +39 -0
- data/lib/generators/browser_cms/demo_site/USAGE +3 -0
- data/lib/generators/browser_cms/demo_site/templates/demo.seeds.rb +249 -0
- data/lib/generators/browser_cms/demo_site/templates/demo_site.rake +14 -0
- data/lib/generators/browser_cms/demo_site/templates/logo.jpg +0 -0
- data/lib/generators/browser_cms/demo_site/templates/splash.jpg +0 -0
- data/lib/generators/browser_cms/demo_site/templates/style.css +257 -0
- data/lib/generators/browser_cms.rb +12 -0
- data/lib/generators/cms/content_block/USAGE +22 -0
- data/lib/generators/cms/content_block/content_block_generator.rb +103 -0
- data/lib/generators/cms/content_block/templates/_form.html.erb +27 -0
- data/lib/generators/cms/content_block/templates/application_controller.rb.erb +4 -0
- data/lib/generators/cms/content_block/templates/render.html.erb +23 -0
- data/lib/generators/cms/install/USAGE +8 -0
- data/lib/generators/cms/install/install_generator.rb +16 -0
- data/lib/generators/cms/portlet/USAGE +26 -0
- data/lib/generators/cms/portlet/portlet_generator.rb +38 -0
- data/lib/generators/cms/portlet/templates/_form.html.erb +5 -0
- data/lib/generators/cms/portlet/templates/portlet.rb +12 -0
- data/lib/generators/cms/portlet/templates/portlet_helper.rb +5 -0
- data/lib/generators/cms/portlet/templates/render.html.erb +1 -0
- data/lib/generators/cms/portlet/templates/unit_test.erb +9 -0
- data/lib/generators/cms/project/USAGE +1 -0
- data/lib/generators/cms/project/templates/COPYRIGHT.txt +23 -0
- data/lib/generators/cms/project/templates/GPL.txt +674 -0
- data/lib/generators/cms/project/templates/LICENSE.txt +165 -0
- data/lib/generators/cms/project/templates/USAGE +3 -0
- data/lib/generators/cms/project/templates/devise.rb.erb +7 -0
- data/lib/generators/cms/project/templates/gitignore.erb +11 -0
- data/lib/generators/cms/project/templates/install_generator.erb +21 -0
- data/lib/generators/cms/project/templates/module_tasks.rake +10 -0
- data/lib/generators/cms/template/USAGE +10 -0
- data/lib/generators/cms/template/template_generator.rb +29 -0
- data/lib/generators/cms/template/templates/template.erb +2 -0
- data/lib/sequence.rb +6 -0
- data/lib/tasks/cms.rake +23 -0
- data/lib/templates/active_record/model/model.rb +17 -0
- data/vendor/assets/javascripts/jquery.cookie.js +91 -0
- data/vendor/assets/javascripts/jquery.selectbox.js +209 -0
- metadata +1048 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module Cms
|
|
2
|
+
module ContentBlockHelper
|
|
3
|
+
|
|
4
|
+
# From 3.3.x (Performance)
|
|
5
|
+
# Delete once we confirm that content_block_tr_tag below works.
|
|
6
|
+
|
|
7
|
+
# Prints the <tr> for each block. Adds classes based on:
|
|
8
|
+
# * Name/id of the block
|
|
9
|
+
# * If a block is published/draft
|
|
10
|
+
# * If the user can edit/publish it
|
|
11
|
+
def block_row_tag(block)
|
|
12
|
+
cname = class_name_for(block)
|
|
13
|
+
can_modify = current_user.able_to_modify?(block)
|
|
14
|
+
|
|
15
|
+
options = {
|
|
16
|
+
:id => "#{cname}_#{block.id}",
|
|
17
|
+
:class => cname
|
|
18
|
+
}
|
|
19
|
+
options[:class] += block.class.publishable? && !block.published? ? ' draft' : ' published'
|
|
20
|
+
options[:class] += ' non-editable' unless can_modify && current_user.able_to?(:edit_content)
|
|
21
|
+
options[:class] += ' non-publishable' unless can_modify && current_user.able_to?(:publish_content)
|
|
22
|
+
tag "tr", options, true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# From 3.4.x (Namespaced and using Data elements to clean up JS in pages)
|
|
26
|
+
|
|
27
|
+
# For each row in content block table, we need to output all the paths for the actions in a way that JS can read them.
|
|
28
|
+
# We use 'data-' elements here to avoid duplication of path calculations.
|
|
29
|
+
def content_block_tr_tag(block)
|
|
30
|
+
cname = class_name_for(block)
|
|
31
|
+
can_modify = current_user.able_to_modify?(block)
|
|
32
|
+
|
|
33
|
+
options = {}
|
|
34
|
+
data = options[:data] = {}
|
|
35
|
+
data[:status] = block.class.publishable? && !block.published? ? 'draft' : 'published'
|
|
36
|
+
|
|
37
|
+
options[:id] = "#{cname}_#{block.id}"
|
|
38
|
+
options[:class] = [cname]
|
|
39
|
+
options[:class] << 'non-editable' unless can_modify && current_user.able_to?(:edit_content)
|
|
40
|
+
options[:class] << 'non-publishable' unless can_modify && current_user.able_to?(:publish_content)
|
|
41
|
+
options['data-new_path'] = url_for(new_engine_aware_path(block))
|
|
42
|
+
options['data-view_path'] = url_for(engine_aware_path(block, nil))
|
|
43
|
+
options['data-edit_path'] = url_for(edit_engine_aware_path(block))
|
|
44
|
+
options['data-preview_path'] = block.path if block.class.addressable?
|
|
45
|
+
options['data-versions_path'] = engine(block).polymorphic_path(block, action: :versions) if block.class.versioned?
|
|
46
|
+
options['data-delete_path'] = url_for(engine_aware_path(block))
|
|
47
|
+
options['data-publish_path'] = engine(block).polymorphic_path([:publish, block]) if block.class.publishable?
|
|
48
|
+
tag "tr", options, true
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def class_name_for(block)
|
|
52
|
+
block.class.name.underscore
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module Cms
|
|
2
|
+
module FormTagHelper
|
|
3
|
+
|
|
4
|
+
# Generates a form (i.e. Rails form_for) for creating/updating content blocks. Exposes additional methods to
|
|
5
|
+
# to create inputs. Implements a superset of SimpleForm behavior (i.e. simple_form_for).
|
|
6
|
+
#
|
|
7
|
+
# This also includes deprecated methods from pre-4.0 form building (like f.cms_text_field) for backwards compatiable
|
|
8
|
+
# support.
|
|
9
|
+
def content_block_form_for(object, *args, &block)
|
|
10
|
+
options = args.extract_options!
|
|
11
|
+
simple_form_for(engine_aware_path(object), *(args << options.merge(builder: Cms::FormBuilder::ContentBlockFormBuilder, wrapper: 'browsercms')), &block)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Simple wrapper for Rails form_for that will use the CMS CustomFormBuilder.
|
|
15
|
+
# Can be used by portlets or other random public facing views to render content.
|
|
16
|
+
def cms_form_for(*args, &block)
|
|
17
|
+
options = args.extract_options!
|
|
18
|
+
options.merge!(:builder => Cms::FormBuilder::ContentBlockFormBuilder)
|
|
19
|
+
form_for(*(args + [options]), &block)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def forecasting_a_new_section?(form_object)
|
|
23
|
+
Cms::Section.with_path(form_object.object.class.path).first.nil?
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def slug_source_if(boolean)
|
|
28
|
+
if boolean
|
|
29
|
+
{input_html: {class: 'slug-source'}}
|
|
30
|
+
else
|
|
31
|
+
{}
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
module Cms
|
|
2
|
+
module MenuHelper
|
|
3
|
+
# Renders a menu. There are two options, neither are required:
|
|
4
|
+
#
|
|
5
|
+
# ==== Options
|
|
6
|
+
# * <tt>:items</tt> - The items which should appear in the menu. This defaults to calling
|
|
7
|
+
# menu_items which generates items automatically based on the current page. But you can use
|
|
8
|
+
# this option to pass in a custom menu structure.
|
|
9
|
+
# * <tt>:partial</tt> - The partial used to render the menu. By default this is "partials/menu",
|
|
10
|
+
# which can be customised through the CMS. The partial gets a local variable <tt>items</tt>.
|
|
11
|
+
#
|
|
12
|
+
# ==== Structure of items
|
|
13
|
+
#
|
|
14
|
+
# The items should be an array of hashes, in a tree. Each hash can have the following keys (name
|
|
15
|
+
# and url are required, others are optional):
|
|
16
|
+
#
|
|
17
|
+
# * <tt>:name</tt> - The name which appears in the menu
|
|
18
|
+
# * <tt>:url</tt> - The URL to link to
|
|
19
|
+
# * <tt>:id</tt> - The id for the menu item
|
|
20
|
+
# * <tt>:selected</tt> - Boolean value to indicate whether the menu item is the current page
|
|
21
|
+
# * <tt>:target</tt> - The target attribute for the link
|
|
22
|
+
# * <tt>:children</tt> - An array of hashes containing the child menu items. This is where the
|
|
23
|
+
# tree structure comes in.
|
|
24
|
+
#
|
|
25
|
+
# Edge Cases:
|
|
26
|
+
# If both @page and :items are nil/empty, this will return an empty string. This might happen if used on an CMS
|
|
27
|
+
# rendered page, where @page isn't set.
|
|
28
|
+
#
|
|
29
|
+
def render_menu(options = {})
|
|
30
|
+
options[:items] ||= menu_items(options)
|
|
31
|
+
return "" unless options[:items]
|
|
32
|
+
|
|
33
|
+
options[:partial] ||= "cms/menus/menu"
|
|
34
|
+
options[:id] ||= "menu"
|
|
35
|
+
options[:class] ||= "menu"
|
|
36
|
+
render :partial => options[:partial], :locals => { :items => options[:items], :css_id => options[:id], :css_class => options[:class] }
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# This will render generate an array-of-hashes tree structure based on the page, which can be
|
|
40
|
+
# passed to render_menu in order to generate a menu.
|
|
41
|
+
#
|
|
42
|
+
# With no options passed, it will generate a structure that includes all the child sections of
|
|
43
|
+
# the root and then it will include the path of decendent sections all the way to the current
|
|
44
|
+
# page.
|
|
45
|
+
#
|
|
46
|
+
# Hidden pages will not be included, but if the first page in a Section is hidden, it will be
|
|
47
|
+
# used as the URL for that Section. This is commonly done to have a page for a Section and avoid
|
|
48
|
+
# having duplicates in the navigation.
|
|
49
|
+
#
|
|
50
|
+
# You can change the behavior with the following options, all of these are optional:
|
|
51
|
+
#
|
|
52
|
+
# ==== Options
|
|
53
|
+
# * <tt>:page</tt> - What page should be used as the current page. If this value is omitted,
|
|
54
|
+
# the value in @page will be used.
|
|
55
|
+
# * <tt>:path</tt> - This will be used to look up a section and that section will used to
|
|
56
|
+
# generate the menu structure. The current page will still be the value of the page option or
|
|
57
|
+
# @page. Note that this is the path to a section, not a path to a page.
|
|
58
|
+
# * <tt>:from_top</tt> - How many below levels from the root the tree should start at.
|
|
59
|
+
# All sections at this level will be shown. The default is 0, which means show all
|
|
60
|
+
# nodes that are direct children of the root
|
|
61
|
+
# * <tt>:depth</tt> - How many levels deep should the tree go, relative to from_top.
|
|
62
|
+
# If no value is supplied, the tree will go all the way down to the current page.
|
|
63
|
+
# If a value is supplied, the tree will be that many levels underneath from_top deep.
|
|
64
|
+
# * <tt>:limit</tt> - Limits the number of top-level elements that will be included in the list
|
|
65
|
+
# * <tt>:show_all_siblings</tt> - Passing true for this option will make all sibilings appear in
|
|
66
|
+
# the tree. The default is false, in which case only the siblings of nodes within the open
|
|
67
|
+
# path will appear.
|
|
68
|
+
#
|
|
69
|
+
# ==== Examples
|
|
70
|
+
#
|
|
71
|
+
# Assume you have the structure the NFL, which is NFL > Conference > Division > Team,
|
|
72
|
+
# with teams being a Page, everything else a Section. Also, assume we are on the
|
|
73
|
+
# Baltimore Ravens page. If you're not a footbal fan, see http://sports.yahoo.com/nfl/teams
|
|
74
|
+
#
|
|
75
|
+
# menu_items
|
|
76
|
+
# # => [
|
|
77
|
+
# { :id => "section_2", :url => "/buf", :name => "AFC", :children => [
|
|
78
|
+
# { :id => "section_3", :url => "/buf", :name => "East" },
|
|
79
|
+
# { :id => "section_4", :url => "/bal", :name => "North", :children => [
|
|
80
|
+
# { :id => "page_5", :selected => true, :url => "/bal", :name => "Baltimore Ravens" },
|
|
81
|
+
# { :id => "page_6", :url => "/cin", :name => "Cincinnati Bengals" },
|
|
82
|
+
# { :id => "page_7", :url => "/cle", :name => "Cleveland Browns" },
|
|
83
|
+
# { :id => "page_8", :url => "/pit", :name => "Pittsburgh Steelers" }
|
|
84
|
+
# ] },
|
|
85
|
+
# { :id => "section_9", :url => "/hou", :name => "South" },
|
|
86
|
+
# { :id => "section_10}", :url => "/den", :name => "West" }
|
|
87
|
+
# ] },
|
|
88
|
+
# { :id => "section_11", :url => "/dal", :name => "NFC" }
|
|
89
|
+
# ]
|
|
90
|
+
#
|
|
91
|
+
# menu_items(:depth => 2, :show_all_siblings => true)
|
|
92
|
+
# # => [
|
|
93
|
+
# { :id => "section_2", :url => "/buf", :name => "AFC", :children => [
|
|
94
|
+
# { :id => "section_3", :url => "/buf", :name => "East" },
|
|
95
|
+
# { :id => "section_4", :url => "/bal", :name => "North" },
|
|
96
|
+
# { :id => "section_5", :url => "/hou", :name => "South" },
|
|
97
|
+
# { :id => "section_6", :url => "/den", :name => "West" }
|
|
98
|
+
# ] },
|
|
99
|
+
# { :id => "section_7", :url => "/dal", :name => "NFC", :children => [
|
|
100
|
+
# { :id => "section_8", :url => "/dal", :name => "East" },
|
|
101
|
+
# { :id => "section_9", :url => "/chi", :name => "North" },
|
|
102
|
+
# { :id => "section_10", :url => "/atl", :name => "South" },
|
|
103
|
+
# { :id => "section_11", :url => "/ari", :name => "West" }
|
|
104
|
+
# ] }
|
|
105
|
+
# ]
|
|
106
|
+
def menu_items(options = {})
|
|
107
|
+
# Intialize parameters
|
|
108
|
+
selected_page = options[:page] || @page
|
|
109
|
+
return nil unless selected_page
|
|
110
|
+
|
|
111
|
+
# Path to the section
|
|
112
|
+
if options.has_key?(:path)
|
|
113
|
+
section_for_path = Section.find_by_path(options[:path])
|
|
114
|
+
raise "Could not find section for path '#{options[:path]}'" unless section_for_path
|
|
115
|
+
ancestors = section_for_path.ancestors(:include_self => true)
|
|
116
|
+
else
|
|
117
|
+
ancestors = selected_page.ancestors
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if options.has_key?(:from_top)
|
|
121
|
+
ancestors = ancestors[options[:from_top].to_i..-1] || []
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
depth = options.has_key?(:depth) ? options[:depth].to_i : 1.0/0
|
|
125
|
+
show_all_siblings = options[:show_all_siblings] || false
|
|
126
|
+
|
|
127
|
+
# We are defining a recursive lambda that takes the top-level sections
|
|
128
|
+
fn = lambda do |section_nodes, current_depth|
|
|
129
|
+
section_nodes.map do |section_node|
|
|
130
|
+
node = section_node.node
|
|
131
|
+
|
|
132
|
+
item = {}
|
|
133
|
+
item[:id] = "#{section_node.node_type.gsub("::","_").underscore}_#{section_node.node_id}"
|
|
134
|
+
|
|
135
|
+
# If we are showing a section item, we want to use the path for the first page
|
|
136
|
+
page_or_link = section_node.section? ? node.first_page_or_link : node
|
|
137
|
+
if section_node.section? && page_or_link
|
|
138
|
+
item[:selected] = true if page_or_link.respond_to?(:hidden?) && page_or_link.hidden? && selected_page == page_or_link
|
|
139
|
+
else
|
|
140
|
+
item[:selected] = true if selected_page == page_or_link
|
|
141
|
+
end
|
|
142
|
+
item[:url] = page_or_link.try(:path) || '#'
|
|
143
|
+
item[:name] = node.name
|
|
144
|
+
item[:target] = "_blank" if page_or_link.respond_to?(:new_window?) && page_or_link.new_window?
|
|
145
|
+
|
|
146
|
+
# Now if this is a section, we do the child nodes,
|
|
147
|
+
# but only if the show_all_siblings parameter is true,
|
|
148
|
+
# or if this section is one of the current page's ancestors
|
|
149
|
+
# and also if the current depth is less than the target depth
|
|
150
|
+
if section_node.section? &&
|
|
151
|
+
current_depth < depth &&
|
|
152
|
+
(show_all_siblings || ancestors.include?(node)) &&
|
|
153
|
+
!node.visible_child_nodes.empty?
|
|
154
|
+
item[:children] = fn.call(node.visible_child_nodes, current_depth + 1)
|
|
155
|
+
end
|
|
156
|
+
item
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if ancestors.empty?
|
|
161
|
+
[]
|
|
162
|
+
else
|
|
163
|
+
fn.call(ancestors.first.visible_child_nodes(:limit => options[:limit]), 1)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module Cms
|
|
2
|
+
module MobileHelper
|
|
3
|
+
|
|
4
|
+
def full_site_url
|
|
5
|
+
options = {
|
|
6
|
+
:host => Rails.configuration.cms.site_domain,
|
|
7
|
+
path: current_page.path,
|
|
8
|
+
params: {:prefer_full_site => true}
|
|
9
|
+
}
|
|
10
|
+
ActionDispatch::Http::URL.url_for(options)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def mobile_site_url
|
|
14
|
+
options = {
|
|
15
|
+
:host => Rails.configuration.cms.site_domain,
|
|
16
|
+
path: current_page.path,
|
|
17
|
+
params: {:prefer_mobile_site => true}
|
|
18
|
+
}
|
|
19
|
+
ActionDispatch::Http::URL.url_for(options)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Determines if the mobile template exists for a given page.
|
|
23
|
+
# Used by view to show/hide the mobile toggle.
|
|
24
|
+
def mobile_template_exists?(page)
|
|
25
|
+
controller.template_exists?(page.layout_name, "layouts/mobile")
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Cms
|
|
2
|
+
module NavMenuHelper
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
helper_method :new_button_path, :target_section
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
# In most cases, the 'New' button should go to create a new page.
|
|
10
|
+
def new_button_path
|
|
11
|
+
cms.new_section_page_path(target_section)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Used to determine which section a New Page should go in, based on the current context.
|
|
15
|
+
def target_section
|
|
16
|
+
if @page && @page.parent
|
|
17
|
+
@page.parent
|
|
18
|
+
else
|
|
19
|
+
Cms::Section.first
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
module Cms
|
|
2
|
+
|
|
3
|
+
# Deprecated in 4.0. Remove in 4.1
|
|
4
|
+
module DeprecatedBehavior
|
|
5
|
+
|
|
6
|
+
# Add the code to render the CMS toolbar.
|
|
7
|
+
# @deprecated This method is no longer required for BrowserCMS templates.
|
|
8
|
+
def cms_toolbar
|
|
9
|
+
ActiveSupport::Deprecation.warn "The cms_toolbar helper is deprecated and no longer necessary. You can safely remove <%= cms_toolbar %> from templates.", caller
|
|
10
|
+
return ""
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def deprecated_set_page_title_usage(args)
|
|
14
|
+
ActiveSupport::Deprecation.warn "Calling page_title('#{args.first}') is deprecated and will be remove in 4.1. Call use_page_title('#{args.first}') instead.", caller
|
|
15
|
+
use_page_title args.first
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
module PageHelper
|
|
20
|
+
include Cms::DeprecatedBehavior
|
|
21
|
+
|
|
22
|
+
# Keep this taller until we reverse the iframes (so menus will work)
|
|
23
|
+
PAGE_TOOLBAR_HEIGHT = 159
|
|
24
|
+
TOOLBAR_HEIGHT = 100
|
|
25
|
+
|
|
26
|
+
# Return the JS file to load the configured default WYSIWYG editor
|
|
27
|
+
#
|
|
28
|
+
# Ideally, this could be improved if sprockets allows for dynamically determining which js library to use.
|
|
29
|
+
# @return [String] Names of the JS file needed to load the editor.
|
|
30
|
+
def cms_content_editor
|
|
31
|
+
"bcms/#{Cms.content_editor}"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Outputs the title for this page. Used by both internal CMS pages, as well as page templates. Call use_page_title to
|
|
35
|
+
# change this value.
|
|
36
|
+
#
|
|
37
|
+
# @param [String] If provided, this is the name of the page to set. (This usage is deprecated in 4.0 and will be removed in 4.1)
|
|
38
|
+
# @return [String] The title of the page.
|
|
39
|
+
def page_title(*args)
|
|
40
|
+
if args.first
|
|
41
|
+
deprecated_set_page_title_usage(args)
|
|
42
|
+
else
|
|
43
|
+
if @page_title
|
|
44
|
+
@page_title
|
|
45
|
+
elsif current_page
|
|
46
|
+
current_page.page_title
|
|
47
|
+
else
|
|
48
|
+
"Untitled"
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns the Page title in an In Context editable area.
|
|
54
|
+
#
|
|
55
|
+
# Use for h1/h2 elements. Use page_title for title elements.
|
|
56
|
+
def page_header()
|
|
57
|
+
if (is_current_user_able_to_edit_this_content?(current_page))
|
|
58
|
+
options = {id: 'page_title', contenteditable: true, data: {attribute: "title", content_name: "page", id: current_page.id, page_id: current_page.id}}
|
|
59
|
+
content_tag "div", page_title, options
|
|
60
|
+
else
|
|
61
|
+
page_title
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Allows Views to set what will be displayed as the <title> element for Page Templates (and Cms admin pages.)
|
|
66
|
+
#
|
|
67
|
+
def use_page_title(title)
|
|
68
|
+
# Implementation note: This method is named use_page_title rather than page_title= because ruby will create a
|
|
69
|
+
# local variable if you call <%= page_title = "A New Page Name" %>
|
|
70
|
+
@page_title = title
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def current_page
|
|
74
|
+
@page
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Outputs the content of a particular container. If the user is in 'edit' mode the container and block controls will
|
|
78
|
+
# be rendered.
|
|
79
|
+
#
|
|
80
|
+
# @return [String] The HTML content for the container.
|
|
81
|
+
def container(name)
|
|
82
|
+
content = content_for(name)
|
|
83
|
+
if is_current_user_able_to_edit_this_content?(@page)
|
|
84
|
+
render :partial => 'cms/pages/simple_container', :locals => {:name => name, :content => content, :container => name}
|
|
85
|
+
else
|
|
86
|
+
content
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Determine if a given container has any blocks within it. Useful for determine if markup should be conditionally included
|
|
91
|
+
# when a block is present, but not shown if no block was added. For example:
|
|
92
|
+
#
|
|
93
|
+
# <% unless container_has_block? :sidebar %>
|
|
94
|
+
# <div id="sidebar">
|
|
95
|
+
# <%= container :sidebar %>
|
|
96
|
+
# </div>
|
|
97
|
+
# <% end %>
|
|
98
|
+
#
|
|
99
|
+
# @param [Symbol] name The name of the container to check
|
|
100
|
+
# @param [Proc] block
|
|
101
|
+
# @return [Boolean] True if the container has one or more blocks, or if we are in edit mode. False otherwise.
|
|
102
|
+
def container_has_block?(name, &block)
|
|
103
|
+
has_block = (edit_mode?) || current_page.connectable_count_for_container(name) > 0
|
|
104
|
+
logger.info "mode = #{@mode}, has_block = #{has_block}"
|
|
105
|
+
if block_given?
|
|
106
|
+
concat(capture(&block)) if has_block
|
|
107
|
+
else
|
|
108
|
+
has_block
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Renders breadcrumbs based on the current_page. This will generate an unordered list representing the
|
|
113
|
+
# current page and all it's ancestors including the root name of of the site. The UL can be styled via CSS for
|
|
114
|
+
# layout purposes. Each breadcrumb except the last will be linked to the page in question.
|
|
115
|
+
#
|
|
116
|
+
# If the current_page is nil, it will return an empty string.
|
|
117
|
+
#
|
|
118
|
+
# ==== Params:
|
|
119
|
+
# options = A hash of options which determine how the breadcrumbs will be laid out.
|
|
120
|
+
#
|
|
121
|
+
# ==== Options:
|
|
122
|
+
# * <tt>:from_top</tt> - How many below levels from the root the tree should start at.
|
|
123
|
+
# All sections at this level will be shown. The default is 0, which means show all
|
|
124
|
+
# nodes that are direct children of the root.
|
|
125
|
+
# * <tt>:show_parent</tt> - Determines if the name of the page itself show be shown as a breadcrumb link. Defaults to false, meaning
|
|
126
|
+
# that the parent section of the current page will be the 'last' breadcrumb link. (Note: This probably better renamed as 'show_page').
|
|
127
|
+
#
|
|
128
|
+
def render_breadcrumbs(options={})
|
|
129
|
+
return "" unless current_page
|
|
130
|
+
|
|
131
|
+
start = options[:from_top] || 0
|
|
132
|
+
show_parent = options[:show_parent].nil? ? false : options[:show_parent]
|
|
133
|
+
ancestors = current_page.ancestors
|
|
134
|
+
items = []
|
|
135
|
+
ancestors[start..ancestors.size].each_with_index do |sec, i|
|
|
136
|
+
items << content_tag(:li,
|
|
137
|
+
link_to(sec.name, sec.actual_path), (i == 0 ? {:class => "first"} : {}))
|
|
138
|
+
end
|
|
139
|
+
if !show_parent && current_page.landing_page?
|
|
140
|
+
items[items.size-1] = content_tag(:li, current_page.parent.name)
|
|
141
|
+
else
|
|
142
|
+
items << content_tag(:li, current_page.page_title)
|
|
143
|
+
end
|
|
144
|
+
content_tag(:ul, "\n #{items.join("\n ")}\n".html_safe, :class => "breadcrumbs")
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def render_portlet(name)
|
|
148
|
+
portlets = Portlet.all(:conditions => ["name = ?", name.to_s])
|
|
149
|
+
if portlets.size > 1
|
|
150
|
+
edit_mode? ? "ERROR: Multiple Portlets with name '#{name}'" : nil
|
|
151
|
+
elsif portlets.empty?
|
|
152
|
+
edit_mode? ? "ERROR: No Portlet with name '#{name}'" : nil
|
|
153
|
+
else
|
|
154
|
+
render_connectable(portlets.first)
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Determines if the current_user is able to do specific permissions.
|
|
159
|
+
def able_to?(*perms, &block)
|
|
160
|
+
block.call if current_user.able_to?(*perms)
|
|
161
|
+
return ''
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Determines whether this page is in edit mode or not.
|
|
165
|
+
def edit_mode?()
|
|
166
|
+
@mode == "edit"
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
module Cms
|
|
2
|
+
|
|
3
|
+
# @todo All methods really need to be renamed to match conventions for Engines.
|
|
4
|
+
# In CMS::Engine, shouldn't have cms_ in method name.
|
|
5
|
+
# From app, should be cms.xyz_path
|
|
6
|
+
module PathHelper
|
|
7
|
+
|
|
8
|
+
# @return A link if content is addressable, name otherwise.
|
|
9
|
+
# Link_to_if would call content.path even if it doesn't respond to '
|
|
10
|
+
def link_to_addressable_content(name, content)
|
|
11
|
+
if content.respond_to? :path
|
|
12
|
+
link_to name, content.path
|
|
13
|
+
else
|
|
14
|
+
name
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
# Returns the relative path to the given attachment.
|
|
18
|
+
# Content editors will see exact specific version path, while other users will see the 'public' url for the path.
|
|
19
|
+
def attachment_path_for(attachment)
|
|
20
|
+
return "" unless attachment
|
|
21
|
+
if current_user.able_to?(:edit_content)
|
|
22
|
+
attachment.attachment_version_path
|
|
23
|
+
else
|
|
24
|
+
attachment.url
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns a path to sort a table of Content Blocks by a given parameter. Retains other relevant parameters (like search criteria).
|
|
29
|
+
#
|
|
30
|
+
# @param [Cms::ContentType] content_type
|
|
31
|
+
# @param [String] column_to_sort The name of the column to sort on.
|
|
32
|
+
def sortable_column_path(content_type, column_to_sort)
|
|
33
|
+
filtered_params = params.clone
|
|
34
|
+
filtered_params.delete(:action)
|
|
35
|
+
filtered_params.delete(:controller)
|
|
36
|
+
filtered_params.merge!(:order => determine_order(filtered_params[:order], column_to_sort))
|
|
37
|
+
polymorphic_path(engine_aware_path(content_type.model_class), filtered_params)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def link_to_usages(block)
|
|
41
|
+
count = block.connected_pages.count
|
|
42
|
+
if count > 0
|
|
43
|
+
# Would love a cleaner solution to this problem, see http://stackoverflow.com/questions/702728
|
|
44
|
+
path = if Portlet === block
|
|
45
|
+
usages_portlet_path(block)
|
|
46
|
+
else
|
|
47
|
+
p = []
|
|
48
|
+
p << engine_for(block)
|
|
49
|
+
p << :usages
|
|
50
|
+
p << block
|
|
51
|
+
p
|
|
52
|
+
end
|
|
53
|
+
link_to count, path, :id => block.id, :block_type => block.content_block_type
|
|
54
|
+
else
|
|
55
|
+
count
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# Returns the route proxy (aka engine) for a given resource, which can then have named paths called on it.
|
|
61
|
+
# I.e. engine(@block).polymorphic_path([@block, :preview])
|
|
62
|
+
#
|
|
63
|
+
# @param [ActiveRecord::Base] resource
|
|
64
|
+
# @return [ActionDispatch::Routing::RoutesProxy]
|
|
65
|
+
def engine(resource)
|
|
66
|
+
name = EngineAwarePathBuilder.new(resource).engine_name
|
|
67
|
+
send(name)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# @deprecated
|
|
71
|
+
alias :engine_for :engine
|
|
72
|
+
|
|
73
|
+
# Return the path for a given resource. Determines the relevant engine, and the result can be passed to polymporhic_path
|
|
74
|
+
#
|
|
75
|
+
# @param [Object] model_or_class_or_content_type A content block, class or content type.
|
|
76
|
+
# @param [String] action (Optional) i.e. :edit
|
|
77
|
+
# @return [Array] An array of argument suitable to be passed to url_for or link_to helpers. This will be something like:
|
|
78
|
+
# [main_app, :dummy_products, @block, :edit]
|
|
79
|
+
# or [cms, :html_blocks, @block]
|
|
80
|
+
#
|
|
81
|
+
# This will work whether the block is:
|
|
82
|
+
# 1. A block in a project (namespaced to the project) (i.e. Dummy::Product)
|
|
83
|
+
# 2. A core CMS block (i.e. Cms::Portlet)
|
|
84
|
+
# 3. A block in a module (i.e. BcmsNews::NewsArticle)
|
|
85
|
+
# e.g.
|
|
86
|
+
# engine_aware_path(Dummy::Product.find(1)) => /dummy/products/1
|
|
87
|
+
# engine_aware_path(Cms::HtmlBlock.find(1)) => /cms/html_blocks/1
|
|
88
|
+
# engine_aware_path(BcmsNews::NewsArticle.find(1)) => /bcms_news/news_articles/1
|
|
89
|
+
#
|
|
90
|
+
def engine_aware_path(model_or_class_or_content_type, action = false)
|
|
91
|
+
elements = build_path_for(model_or_class_or_content_type)
|
|
92
|
+
elements << action if action
|
|
93
|
+
elements
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Wrappers edit_polymorphic_path to be engine aware.
|
|
97
|
+
def edit_engine_aware_path(model_or_class_or_content_type, options={})
|
|
98
|
+
edit_polymorphic_path(build_path_for(model_or_class_or_content_type), options)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Wrappers new_polymorphic_path to be engine aware.
|
|
102
|
+
def new_engine_aware_path(subject, options={})
|
|
103
|
+
new_polymorphic_path(build_path_for(subject), options)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
private
|
|
107
|
+
|
|
108
|
+
def build_path_for(model_or_class_or_content_type)
|
|
109
|
+
Cms::EngineAwarePathBuilder.new(model_or_class_or_content_type).build(self)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
end
|
|
113
|
+
end
|