browsercms 3.3.4 → 3.4.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +24 -0
- data/.rvmrc +2 -0
- data/COPYRIGHT.txt +26 -0
- data/GPL.txt +674 -0
- data/Gemfile +29 -0
- data/Gemfile.lock +192 -0
- data/README.markdown +4 -14
- data/Rakefile +97 -0
- data/app/assets/images/browsercms/.gitkeep +0 -0
- data/{public → app/assets}/images/cms/administration/user_browser_bg.gif +0 -0
- data/{public → app/assets}/images/cms/bg.png +0 -0
- data/{public → app/assets}/images/cms/bl_curve.png +0 -0
- data/{public → app/assets}/images/cms/bottom_cap.png +0 -0
- data/{public → app/assets}/images/cms/bottom_cap_content.png +0 -0
- data/{public → app/assets}/images/cms/browse.gif +0 -0
- data/{public → app/assets}/images/cms/browser_media_logo.png +0 -0
- data/{public → app/assets}/images/cms/browsercms_logo.png +0 -0
- data/{public → app/assets}/images/cms/buttons/button.png +0 -0
- data/{public → app/assets}/images/cms/buttons/button_bg.png +0 -0
- data/{public → app/assets}/images/cms/buttons/button_cap.png +0 -0
- data/{public → app/assets}/images/cms/buttons/button_cap_h.png +0 -0
- data/{public → app/assets}/images/cms/buttons/button_cap_off.gif +0 -0
- data/{public → app/assets}/images/cms/buttons/button_cap_off_middle.gif +0 -0
- data/{public → app/assets}/images/cms/buttons/button_h.png +0 -0
- data/{public → app/assets}/images/cms/buttons/button_left_bg.png +0 -0
- data/{public → app/assets}/images/cms/buttons/button_off.png +0 -0
- data/{public → app/assets}/images/cms/buttons/button_off_middle.png +0 -0
- data/{public → app/assets}/images/cms/buttons/delete_x.png +0 -0
- data/{public → app/assets}/images/cms/buttons/delete_x_disabled.png +0 -0
- data/{public → app/assets}/images/cms/buttons/delete_x_h.png +0 -0
- data/{public → app/assets}/images/cms/buttons/sm_button.gif +0 -0
- data/{public → app/assets}/images/cms/buttons/sm_button_2.gif +0 -0
- data/{public → app/assets}/images/cms/buttons/sm_button_2_h.gif +0 -0
- data/{public → app/assets}/images/cms/buttons/sm_button_h.gif +0 -0
- data/{public → app/assets}/images/cms/containers/add.gif +0 -0
- data/{public → app/assets}/images/cms/containers/alpha.png +0 -0
- data/{public → app/assets}/images/cms/containers/beta.png +0 -0
- data/{public → app/assets}/images/cms/containers/delete.gif +0 -0
- data/{public → app/assets}/images/cms/containers/down.gif +0 -0
- data/{public → app/assets}/images/cms/containers/edit.gif +0 -0
- data/{public → app/assets}/images/cms/containers/up.gif +0 -0
- data/{public → app/assets}/images/cms/containers/view.gif +0 -0
- data/{public → app/assets}/images/cms/content_bg.gif +0 -0
- data/{public → app/assets}/images/cms/dashboard/bottom_cap.png +0 -0
- data/{public → app/assets}/images/cms/dashboard/bottom_cap_content.png +0 -0
- data/{public → app/assets}/images/cms/dashboard/header_bg.gif +0 -0
- data/{public → app/assets}/images/cms/dashboard/header_left_bg.gif +0 -0
- data/{public → app/assets}/images/cms/dashboard/table_header_bg.gif +0 -0
- data/{public → app/assets}/images/cms/dashboard/top_cap.png +0 -0
- data/{public → app/assets}/images/cms/dashed.gif +0 -0
- data/{public → app/assets}/images/cms/datepicker/clear.gif +0 -0
- data/{public → app/assets}/images/cms/datepicker/close.gif +0 -0
- data/{public → app/assets}/images/cms/dk_button_l.gif +0 -0
- data/{public → app/assets}/images/cms/dk_button_r.gif +0 -0
- data/{public → app/assets}/images/cms/dot.png +0 -0
- data/{public → app/assets}/images/cms/draft_status.gif +0 -0
- data/{public → app/assets}/images/cms/gray_long_bg.gif +0 -0
- data/{public → app/assets}/images/cms/icons/actions/add.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/config.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/connect.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/delete.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/down.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/edit.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/folder.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/folder_add.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/folder_delete.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/folder_edit.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/folder_move.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/folder_open.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/history.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/home.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/left.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/link.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/page.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/page_add.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/page_edit.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/page_move.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/redo.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/refresh.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/right.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/root_folder.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/root_link.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/root_page.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/undo.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/up.png +0 -0
- data/{public → app/assets}/images/cms/icons/actions/view.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/doc.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/file.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/gif.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/htm.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/pdf.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/ppt.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/swf.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/txt.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/xls.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/xml.png +0 -0
- data/{public → app/assets}/images/cms/icons/file_types/zip.png +0 -0
- data/{public → app/assets}/images/cms/icons/status/archived.gif +0 -0
- data/{public → app/assets}/images/cms/icons/status/draft.gif +0 -0
- data/{public → app/assets}/images/cms/icons/status/hidden.gif +0 -0
- data/{public → app/assets}/images/cms/icons/status/locked.gif +0 -0
- data/{public → app/assets}/images/cms/icons/status/published.gif +0 -0
- data/{public → app/assets}/images/cms/icons/status/unlocked.gif +0 -0
- data/{public → app/assets}/images/cms/icons/user.png +0 -0
- data/{public → app/assets}/images/cms/login_bg.jpg +0 -0
- data/{public → app/assets}/images/cms/login_bottom.jpg +0 -0
- data/{public → app/assets}/images/cms/login_top.gif +0 -0
- data/{public → app/assets}/images/cms/lt_button_bg.gif +0 -0
- data/{public → app/assets}/images/cms/lt_button_l.gif +0 -0
- data/{public → app/assets}/images/cms/lt_button_r.gif +0 -0
- data/{public → app/assets}/images/cms/menu.png +0 -0
- data/{public → app/assets}/images/cms/menu/block_cap_h.gif +0 -0
- data/{public → app/assets}/images/cms/menu/bottom_cap.png +0 -0
- data/{public → app/assets}/images/cms/menu/bottom_cap_menu.png +0 -0
- data/{public → app/assets}/images/cms/menu/bottom_cap_menu_first.png +0 -0
- data/{public → app/assets}/images/cms/menu/menu_header_first_bg.gif +0 -0
- data/{public → app/assets}/images/cms/menu/selected_block_cap.gif +0 -0
- data/{public → app/assets}/images/cms/menu/top_cap.png +0 -0
- data/{public → app/assets}/images/cms/menu/top_cap_menu_header.png +0 -0
- data/{public → app/assets}/images/cms/menu_h.gif +0 -0
- data/{public → app/assets}/images/cms/menu_header.png +0 -0
- data/{public → app/assets}/images/cms/menu_open.png +0 -0
- data/{public → app/assets}/images/cms/menu_open_bg.gif +0 -0
- data/{public → app/assets}/images/cms/nav.png +0 -0
- data/{public → app/assets}/images/cms/nav/on_bg.gif +0 -0
- data/{public → app/assets}/images/cms/nav_admin.gif +0 -0
- data/{public → app/assets}/images/cms/nav_admin_h.gif +0 -0
- data/{public → app/assets}/images/cms/nav_admin_on.gif +0 -0
- data/{public → app/assets}/images/cms/nav_cap.png +0 -0
- data/{public → app/assets}/images/cms/nav_cap_h.gif +0 -0
- data/{public → app/assets}/images/cms/nav_content_library.gif +0 -0
- data/{public → app/assets}/images/cms/nav_content_library_h.gif +0 -0
- data/{public → app/assets}/images/cms/nav_content_library_on.gif +0 -0
- data/{public → app/assets}/images/cms/nav_dash.gif +0 -0
- data/{public → app/assets}/images/cms/nav_dash_h.gif +0 -0
- data/{public → app/assets}/images/cms/nav_dash_on.gif +0 -0
- data/{public → app/assets}/images/cms/nav_h.gif +0 -0
- data/{public → app/assets}/images/cms/nav_sitemap.gif +0 -0
- data/{public → app/assets}/images/cms/nav_sitemap_h.gif +0 -0
- data/{public → app/assets}/images/cms/nav_sitemap_on.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_bg.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_bg.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_draft_bg.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_draft_l.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_draft_r.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_l.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_published_bg.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_published_l.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_published_r.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_inset_r.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_l.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/page_toolbar_r.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/status_draft_bg.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/status_draft_l.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/status_l.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/status_published_bg.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/status_published_l.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/visual_editor_bg.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/visual_editor_end.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/visual_editor_r.gif +0 -0
- data/{public → app/assets}/images/cms/page_toolbar/visual_editor_state_bg.gif +0 -0
- data/{public → app/assets}/images/cms/pages/add_connectable.gif +0 -0
- data/{public → app/assets}/images/cms/pages/connect_connectable.gif +0 -0
- data/{public → app/assets}/images/cms/pages/container_border.gif +0 -0
- data/{public → app/assets}/images/cms/pages/container_border_l.gif +0 -0
- data/{public → app/assets}/images/cms/pages/container_border_r.gif +0 -0
- data/{public → app/assets}/images/cms/pages/delete_connectable.gif +0 -0
- data/{public → app/assets}/images/cms/pages/down_connectable.gif +0 -0
- data/{public → app/assets}/images/cms/pages/down_connectable_disabled.gif +0 -0
- data/{public → app/assets}/images/cms/pages/edit_connectable.gif +0 -0
- data/{public → app/assets}/images/cms/pages/edit_connectable_2.gif +0 -0
- data/{public → app/assets}/images/cms/pages/show_connectable.gif +0 -0
- data/{public → app/assets}/images/cms/pages/up_connectable.gif +0 -0
- data/{public → app/assets}/images/cms/pages/up_connectable_disabled.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/first.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/first_h.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/input.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/last.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/last_h.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/next.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/next_h.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/previous.gif +0 -0
- data/{public → app/assets}/images/cms/pagination/previous_h.gif +0 -0
- data/{public → app/assets}/images/cms/published_status.gif +0 -0
- data/{public → app/assets}/images/cms/search.png +0 -0
- data/{public → app/assets}/images/cms/search_submit.gif +0 -0
- data/{public → app/assets}/images/cms/search_submit_h.gif +0 -0
- data/{public → app/assets}/images/cms/searchbox_gradient.gif +0 -0
- data/{public → app/assets}/images/cms/select_bg.gif +0 -0
- data/{public → app/assets}/images/cms/select_bg_2.gif +0 -0
- data/{public → app/assets}/images/cms/sitemap/bottom_cap.png +0 -0
- data/{public → app/assets}/images/cms/sitemap/buffer_caps.png +0 -0
- data/{public → app/assets}/images/cms/sitemap/contract.png +0 -0
- data/{public → app/assets}/images/cms/sitemap/corners.gif +0 -0
- data/{public → app/assets}/images/cms/sitemap/corners_hover.gif +0 -0
- data/{public → app/assets}/images/cms/sitemap/divider.gif +0 -0
- data/{public → app/assets}/images/cms/sitemap/expand.png +0 -0
- data/{public → app/assets}/images/cms/sitemap/gradient.gif +0 -0
- data/{public → app/assets}/images/cms/sitemap/gray_contract.png +0 -0
- data/{public → app/assets}/images/cms/sitemap/gray_expand.png +0 -0
- data/{public → app/assets}/images/cms/sitemap/no_contents.png +0 -0
- data/{public → app/assets}/images/cms/sitemap/site_root_cap.png +0 -0
- data/{public → app/assets}/images/cms/sitemap/tooltip.gif +0 -0
- data/{public → app/assets}/images/cms/sitemap/top_cap_content.png +0 -0
- data/{public → app/assets}/images/cms/solid.gif +0 -0
- data/{public → app/assets}/images/cms/table/bl.gif +0 -0
- data/{public → app/assets}/images/cms/table/br.gif +0 -0
- data/{public → app/assets}/images/cms/table/divider.gif +0 -0
- data/{public → app/assets}/images/cms/table/td_cap_first_h.gif +0 -0
- data/{public → app/assets}/images/cms/table/td_cap_first_s.gif +0 -0
- data/{public → app/assets}/images/cms/table/td_cap_last_h.gif +0 -0
- data/{public → app/assets}/images/cms/table/td_cap_last_s.gif +0 -0
- data/{public → app/assets}/images/cms/table/td_last_bg.gif +0 -0
- data/{public → app/assets}/images/cms/table/th_bg.gif +0 -0
- data/{public → app/assets}/images/cms/table/th_divider.gif +0 -0
- data/{public → app/assets}/images/cms/table/th_last_bg.gif +0 -0
- data/{public → app/assets}/images/cms/table/tl.gif +0 -0
- data/{public → app/assets}/images/cms/table/tr.gif +0 -0
- data/{public → app/assets}/images/cms/table/tr_bg.gif +0 -0
- data/{public → app/assets}/images/cms/toolbar_bg.png +0 -0
- data/{public → app/assets}/images/cms/top_cap.png +0 -0
- data/{public → app/assets}/images/cms/top_cap_content.png +0 -0
- data/{public → app/assets}/images/cms/top_cap_menu_header.png +0 -0
- data/{public → app/assets}/images/cms/user_search_submit.gif +0 -0
- data/{public → app/assets}/images/cms/usercontrols_bg.png +0 -0
- data/{public → app/assets}/images/cms/usercontrols_bg_cap.png +0 -0
- data/app/assets/javascripts/browsercms/application.js +9 -0
- data/app/assets/javascripts/cms/application.js +11 -0
- data/app/assets/javascripts/cms/content_library.js +102 -0
- data/app/assets/javascripts/cms/core_library.js +158 -0
- data/app/assets/javascripts/cms/sitemap.js.erb +464 -0
- data/app/assets/javascripts/cms/toolbar.js +5 -0
- data/app/assets/javascripts/jquery.taglist.js +143 -0
- data/app/assets/stylesheets/browsercms/application.css +7 -0
- data/app/assets/stylesheets/cms/administration.css.erb +91 -0
- data/app/assets/stylesheets/cms/application.css.erb +170 -0
- data/{public → app/assets}/stylesheets/cms/block.css +0 -0
- data/app/assets/stylesheets/cms/buttons.css.erb +120 -0
- data/app/assets/stylesheets/cms/content_library.css.erb +139 -0
- data/{public → app/assets}/stylesheets/cms/content_types.css +0 -0
- data/app/assets/stylesheets/cms/dashboard.css.erb +118 -0
- data/app/assets/stylesheets/cms/data_table.css.erb.erb +156 -0
- data/app/assets/stylesheets/cms/date_picker.css.erb +82 -0
- data/app/assets/stylesheets/cms/form_layout.css.erb +281 -0
- data/app/assets/stylesheets/cms/login.css.erb +78 -0
- data/app/assets/stylesheets/cms/menu.css.erb +116 -0
- data/app/assets/stylesheets/cms/nav.css.erb +99 -0
- data/app/assets/stylesheets/cms/page_toolbar.css.erb +135 -0
- data/{public → app/assets}/stylesheets/cms/reset.css +0 -0
- data/app/assets/stylesheets/cms/selectbox.css.erb +56 -0
- data/app/assets/stylesheets/cms/sitemap.css.erb +390 -0
- data/{public → app/assets}/stylesheets/cms/taglist.css +0 -0
- data/app/controllers/browsercms/application_controller.rb +4 -0
- data/app/controllers/cms/application_controller.rb +5 -2
- data/app/controllers/cms/attachments_controller.rb +3 -1
- data/app/controllers/cms/base_controller.rb +3 -1
- data/app/controllers/cms/cache_controller.rb +3 -1
- data/app/controllers/cms/categories_controller.rb +6 -4
- data/app/controllers/cms/category_types_controller.rb +5 -3
- data/app/controllers/cms/connectors_controller.rb +3 -1
- data/app/controllers/cms/content_block_controller.rb +26 -21
- data/app/controllers/cms/content_controller.rb +14 -7
- data/app/controllers/cms/content_types_controller.rb +3 -1
- data/app/controllers/cms/dashboard_controller.rb +5 -3
- data/app/controllers/cms/dynamic_views_controller.rb +58 -51
- data/app/controllers/cms/email_messages_controller.rb +3 -1
- data/app/controllers/cms/file_blocks_controller.rb +3 -1
- data/app/controllers/cms/groups_controller.rb +4 -2
- data/app/controllers/cms/home_controller.rb +5 -3
- data/app/controllers/cms/html_blocks_controller.rb +4 -2
- data/app/controllers/cms/image_blocks_controller.rb +3 -1
- data/app/controllers/cms/links_controller.rb +9 -7
- data/app/controllers/cms/page_route_conditions_controller.rb +3 -1
- data/app/controllers/cms/page_route_options_controller.rb +3 -1
- data/app/controllers/cms/page_route_requirements_controller.rb +3 -1
- data/app/controllers/cms/page_routes_controller.rb +6 -4
- data/app/controllers/cms/pages_controller.rb +8 -6
- data/app/controllers/cms/portlet_controller.rb +18 -15
- data/app/controllers/cms/portlets_controller.rb +8 -6
- data/app/controllers/cms/redirects_controller.rb +3 -1
- data/app/controllers/cms/resource_controller.rb +10 -4
- data/app/controllers/cms/routes_controller.rb +4 -2
- data/app/controllers/cms/section_nodes_controller.rb +3 -1
- data/app/controllers/cms/sections_controller.rb +12 -12
- data/app/controllers/cms/sessions_controller.rb +4 -2
- data/app/controllers/cms/tags_controller.rb +5 -1
- data/app/controllers/cms/tasks_controller.rb +6 -4
- data/app/controllers/cms/toolbar_controller.rb +4 -2
- data/app/controllers/cms/users_controller.rb +8 -6
- data/app/helpers/cms/application_helper.rb +17 -25
- data/app/helpers/cms/content_block_helper.rb +27 -0
- data/app/helpers/cms/menu_helper.rb +1 -1
- data/app/helpers/cms/page_helper.rb +13 -12
- data/app/helpers/cms/path_helper.rb +59 -24
- data/app/helpers/cms/rendering_helper.rb +1 -0
- data/app/helpers/cms/template_support.rb +4 -1
- data/app/helpers/cms/ui_elements_helper.rb +21 -0
- data/app/models/cms/abstract_file_block.rb +41 -0
- data/app/models/cms/attachment.rb +184 -0
- data/app/models/cms/category.rb +41 -0
- data/app/models/cms/category_type.rb +37 -0
- data/app/models/cms/connector.rb +83 -0
- data/app/models/cms/content_type.rb +130 -0
- data/app/models/cms/content_type_group.rb +13 -0
- data/app/models/cms/dynamic_view.rb +102 -0
- data/app/models/cms/email_message.rb +31 -0
- data/app/models/cms/email_message_mailer.rb +12 -0
- data/app/models/cms/file_block.rb +11 -0
- data/app/models/cms/forgot_password_mailer.rb +14 -0
- data/app/models/cms/group.rb +49 -0
- data/app/models/cms/group_permission.rb +10 -0
- data/app/models/cms/group_section.rb +6 -0
- data/app/models/cms/group_type.rb +14 -0
- data/app/models/cms/group_type_permission.rb +6 -0
- data/app/models/cms/guest_user.rb +57 -0
- data/app/models/cms/html_block.rb +42 -0
- data/app/models/cms/image_block.rb +11 -0
- data/app/models/cms/link.rb +18 -0
- data/app/models/cms/page.rb +321 -0
- data/app/models/cms/page_partial.rb +32 -0
- data/app/models/cms/page_route.rb +136 -0
- data/app/models/cms/page_route_condition.rb +4 -0
- data/app/models/cms/page_route_option.rb +5 -0
- data/app/models/cms/page_route_requirement.rb +4 -0
- data/app/models/cms/page_template.rb +40 -0
- data/app/models/cms/permission.rb +12 -0
- data/app/models/cms/portlet.rb +182 -0
- data/app/models/cms/redirect.rb +6 -0
- data/app/models/cms/section.rb +199 -0
- data/app/models/cms/section_node.rb +108 -0
- data/app/models/cms/site.rb +42 -0
- data/app/models/cms/tag.rb +65 -0
- data/app/models/cms/tagging.rb +11 -0
- data/app/models/cms/task.rb +78 -0
- data/app/models/cms/templates.rb +32 -0
- data/app/models/cms/user.rb +173 -0
- data/app/models/cms/user_group_membership.rb +6 -0
- data/app/models/cms/view_context.rb +1 -1
- data/app/portlets/dynamic_portlet.rb +2 -2
- data/app/portlets/email_page_portlet.rb +8 -7
- data/app/portlets/forgot_password_portlet.rb +4 -3
- data/app/portlets/login_portlet.rb +2 -2
- data/app/portlets/reset_password_portlet.rb +2 -2
- data/app/portlets/tag_cloud_portlet.rb +3 -3
- data/app/views/cms/blocks/_toolbar_for_member.html.erb +6 -6
- data/app/views/cms/blocks/edit.html.erb +2 -4
- data/app/views/cms/blocks/index.html.erb +14 -54
- data/app/views/cms/blocks/new.html.erb +1 -3
- data/app/views/cms/blocks/show.html.erb +1 -1
- data/app/views/cms/blocks/versions.html.erb +2 -2
- data/app/views/cms/cache/show.html.erb +1 -1
- data/app/views/cms/categories/_form.html.erb +8 -8
- data/app/views/cms/connectors/new.html.erb +4 -4
- data/app/views/cms/content_types/index.html.erb +3 -3
- data/app/views/cms/dashboard/_page_drafts.html.erb +1 -1
- data/app/views/cms/dashboard/_tasks.html.erb +1 -1
- data/app/views/cms/dashboard/index.html.erb +2 -2
- data/app/views/cms/dynamic_views/_form.html.erb +2 -2
- data/app/views/cms/dynamic_views/index.html.erb +7 -7
- data/app/views/cms/dynamic_views/new.html.erb +1 -1
- data/app/views/cms/email_messages/index.html.erb +2 -2
- data/app/views/cms/file_blocks/_form.html.erb +4 -3
- data/app/views/cms/file_blocks/render.html.erb +1 -1
- data/app/views/cms/form_builder/_cms_template_editor.html.erb +1 -0
- data/app/views/cms/groups/_form.html.erb +4 -5
- data/app/views/cms/groups/_permissions.html.erb +2 -2
- data/app/views/cms/groups/_sections.html.erb +1 -1
- data/app/views/cms/groups/index.html.erb +5 -5
- data/app/views/cms/image_blocks/_form.html.erb +1 -1
- data/app/views/cms/links/edit.html.erb +3 -4
- data/app/views/cms/links/new.html.erb +3 -4
- data/app/views/cms/page_routes/_form.html.erb +3 -3
- data/app/views/cms/page_routes/edit.html.erb +1 -1
- data/app/views/cms/page_routes/index.html.erb +2 -2
- data/app/views/cms/page_routes/new.html.erb +1 -1
- data/app/views/cms/page_routes/show.html.erb +5 -6
- data/app/views/cms/pages/_edit_connector.html.erb +5 -5
- data/app/views/cms/pages/_edit_container.html.erb +3 -3
- data/app/views/cms/pages/_form.html.erb +1 -1
- data/app/views/cms/pages/edit.html.erb +2 -2
- data/app/views/cms/pages/new.html.erb +3 -3
- data/app/views/cms/redirects/_form.html.erb +1 -1
- data/app/views/cms/redirects/index.html.erb +1 -1
- data/app/views/cms/redirects/new.html.erb +1 -1
- data/app/views/cms/routes/index.html.erb +1 -1
- data/app/views/cms/section_nodes/_section_node.html.erb +10 -0
- data/app/views/cms/sections/edit.html.erb +2 -3
- data/app/views/cms/sections/new.html.erb +2 -2
- data/app/views/cms/sessions/new.html.erb +1 -1
- data/app/views/cms/shared/_admin_sidebar.html.erb +8 -8
- data/app/views/cms/tags/render.html.erb +2 -2
- data/app/views/cms/tasks/new.html.erb +2 -2
- data/app/views/cms/users/_form.html.erb +1 -1
- data/app/views/cms/users/_groups.html.erb +1 -1
- data/app/views/cms/users/_toolbar.html.erb +4 -2
- data/app/views/cms/users/change_password.html.erb +3 -3
- data/app/views/cms/users/edit.html.erb +2 -2
- data/app/views/cms/users/index.html.erb +5 -5
- data/app/views/cms/users/new.html.erb +1 -1
- data/app/views/cms/users/show.html.erb +2 -2
- data/app/views/layouts/_cms_toolbar.html.erb +14 -14
- data/app/views/layouts/_page_toolbar.html.erb +8 -8
- data/app/views/layouts/browsercms/application.html.erb +14 -0
- data/app/views/layouts/cms/_head.html.erb +1 -1
- data/app/views/layouts/cms/content_library.html.erb +10 -8
- data/app/views/layouts/cms/toolbar.html.erb +1 -2
- data/app/views/portlets/email_page/_form.html.erb +1 -2
- data/app/views/portlets/email_page/render.html.erb +2 -2
- data/app/views/portlets/login/render.html.erb +2 -2
- data/app/views/portlets/portlets/_form.html.erb +4 -4
- data/app/views/portlets/reset_password/_form.html.erb +2 -2
- data/bin/bcms +212 -47
- data/bin/bcms-upgrade +118 -17
- data/browsercms.gemspec +7 -20
- data/config/cucumber.yml +8 -0
- data/config/database.jdbcmysql.yml +30 -0
- data/config/database.mysql.yml +27 -0
- data/config/database.postgres.yml +25 -0
- data/config/database.sqlite3.yml +11 -0
- data/config/environment.rb +6 -0
- data/config/initializers/query_reviewer_patch.rb +12 -0
- data/config/initializers/rack_1_2_1_patch.rb +12 -0
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +101 -0
- data/db/browsercms.seeds.rb +64 -0
- data/db/migrate/20080815014337_browsercms_3_0_0.rb +68 -76
- data/db/migrate/20091109175123_browsercms_3_0_5.rb +2 -2
- data/db/migrate/20100117144039_browsercms315.rb +22 -21
- data/db/migrate/20100705083859_browsercms_3_3_0.rb +5 -5
- data/db/migrate/20111130221145_browsercms340.rb +59 -0
- data/db/seeds.rb +1 -58
- 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/installing_browsercms_in_project.md +7 -0
- data/doc/release_notes.md +390 -0
- data/doc/test_procedure.txt +141 -0
- data/doc/upgrading_to_3_3.txt +90 -0
- data/doc/upgrading_to_3_4.md +19 -0
- data/features/acts_as_content_page.feature +48 -0
- data/features/add_content_to_pages.feature +46 -0
- data/features/caching.feature +13 -0
- data/features/ckeditor.feature +11 -0
- data/features/commands/confirm_aruba_works.feature +24 -0
- data/features/commands/generate_module.feature +54 -0
- data/features/commands/install_browsercms.feature +21 -0
- data/features/commands/new_demo_project.feature +30 -0
- data/features/commands/new_projects.feature +43 -0
- data/features/commands/upgrade_modules_from_3_1_to_3_4.feature +19 -0
- data/features/commands/upgrading_modules.feature +66 -0
- data/features/content_blocks/manage_custom_blocks.feature +48 -0
- data/features/content_blocks/manage_html_blocks.feature +42 -0
- data/features/content_blocks/manage_image_blocks.feature +41 -0
- data/features/content_files.feature +37 -0
- data/features/content_pages.feature +21 -0
- data/features/create_pages.feature +15 -0
- data/features/generators/content_blocks_for_modules.feature +58 -0
- data/features/generators/content_blocks_for_projects.feature +109 -0
- data/features/install_content.feature +25 -0
- data/features/jquery-testplan.txt +12 -0
- data/features/manage_groups.feature +33 -0
- data/features/manage_page_routes.feature +72 -0
- data/features/manage_redirects.feature +20 -0
- data/features/manage_sections.feature +12 -0
- data/features/page_templates.feature +25 -0
- data/features/portlets/email_friend_portlet.feature +29 -0
- data/features/portlets/portlets.feature +93 -0
- data/features/portlets/tag_cloud_portlet.feature +28 -0
- data/features/sitemap.feature +18 -0
- data/features/step_definitions/acts_as_content_page_steps.rb.rb +3 -0
- data/features/step_definitions/ckeditor_steps.rb +13 -0
- data/features/step_definitions/command_line_steps.rb +115 -0
- data/features/step_definitions/content_pages_steps.rb +149 -0
- data/features/step_definitions/data_steps.rb +48 -0
- data/features/step_definitions/html_blocks_steps.rb +9 -0
- data/features/step_definitions/install_content_steps.rb +4 -0
- data/features/step_definitions/manage_content_blocks_steps.rb +26 -0
- data/features/step_definitions/manage_image_blocks_steps.rb +31 -0
- data/features/step_definitions/manage_sections_steps.rb +18 -0
- data/features/step_definitions/page_route_steps.rb +65 -0
- data/features/step_definitions/page_template_steps.rb +5 -0
- data/features/step_definitions/permissions_steps.rb +13 -0
- data/features/step_definitions/portlets_steps.rb +64 -0
- data/features/step_definitions/redirect_steps.rb +12 -0
- data/features/step_definitions/sitemap_steps.rb +18 -0
- data/features/step_definitions/tag_cloud_steps.rb +11 -0
- data/features/step_definitions/taxonomy_steps.rb +16 -0
- data/features/step_definitions/upgrade_module_steps.rb +74 -0
- data/features/step_definitions/web_steps.rb +211 -0
- data/features/support/command_line_helpers.rb +45 -0
- data/features/support/debug_formatter.rb +7 -0
- data/features/support/debugging.rb +28 -0
- data/features/support/env.rb +73 -0
- data/features/support/git_api.rb +9 -0
- data/features/support/open_on_first_failure.rb +25 -0
- data/features/support/paths.rb +32 -0
- data/features/support/rails_api.rb +8 -0
- data/features/support/selectors.rb +39 -0
- data/features/support/transforms.rb +7 -0
- data/features/taxonomy/add_content_with_category.feature +30 -0
- data/features/taxonomy/manage_categories.feature +20 -0
- data/features/taxonomy/manage_category_types.feature +16 -0
- data/lib/browsercms.rb +9 -2
- data/lib/cms/acts/cms_user.rb +118 -0
- data/lib/cms/acts/content_block.rb +15 -3
- data/lib/cms/addressable.rb +62 -60
- data/lib/cms/authentication/controller.rb +20 -20
- data/lib/cms/authoring.rb +9 -0
- data/lib/cms/behaviors/attaching.rb +5 -4
- data/lib/cms/behaviors/categorizing.rb +1 -1
- data/lib/cms/behaviors/connecting.rb +9 -4
- data/lib/cms/behaviors/dynamic_attributes.rb +77 -66
- data/lib/cms/behaviors/namespacing.rb +45 -0
- data/lib/cms/behaviors/publishing.rb +1 -1
- data/lib/cms/behaviors/rendering.rb +38 -52
- data/lib/cms/behaviors/searching.rb +8 -3
- data/lib/cms/behaviors/taggable.rb +7 -7
- data/lib/cms/behaviors/userstamping.rb +4 -3
- data/lib/cms/behaviors/versioning.rb +9 -6
- data/lib/cms/commands/actions.rb +37 -0
- data/lib/cms/content_rendering_support.rb +2 -2
- data/lib/cms/data_loader.rb +12 -5
- data/lib/cms/engine.rb +13 -9
- data/lib/cms/engine_helper.rb +59 -0
- data/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +37 -9
- data/lib/cms/extensions/active_support/dependencies.rb +21 -0
- data/lib/cms/init.rb +11 -36
- data/lib/cms/installation_actions.rb +8 -0
- data/lib/cms/module.rb +20 -1
- data/lib/cms/module_installation.rb +11 -18
- data/lib/cms/route_extensions.rb +60 -0
- data/lib/cms/version.rb +1 -1
- data/lib/generators/browser_cms/cms/cms_generator.rb +5 -18
- data/lib/generators/browser_cms/demo_site/USAGE +3 -1
- data/lib/generators/browser_cms/demo_site/templates/demo.seeds.rb +251 -0
- data/{public/themes/blue_steel/images → lib/generators/browser_cms/demo_site/templates}/logo.jpg +0 -0
- data/{public/themes/blue_steel/images → lib/generators/browser_cms/demo_site/templates}/splash.jpg +0 -0
- data/{public/themes/blue_steel/stylesheets → lib/generators/browser_cms/demo_site/templates}/style.css +0 -0
- data/lib/generators/cms/content_block/content_block_generator.rb +73 -24
- data/lib/generators/cms/install/install_generator.rb +0 -2
- data/lib/generators/cms/portlet/templates/portlet.rb +1 -1
- data/lib/generators/cms/project/USAGE +1 -0
- data/lib/generators/cms/{upgrade_module → project}/templates/COPYRIGHT.txt +0 -0
- data/lib/generators/cms/{upgrade_module → project}/templates/GPL.txt +0 -0
- data/lib/generators/cms/{upgrade_module → project}/templates/LICENSE.txt +0 -0
- data/lib/generators/cms/{upgrade_module → project}/templates/README +0 -0
- data/lib/generators/cms/project/templates/USAGE +3 -0
- data/lib/generators/cms/{upgrade_module → project}/templates/gitignore.erb +0 -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/template_generator.rb +3 -1
- data/lib/generators/cms/template/templates/template.erb +2 -2
- data/lib/tasks/db.rake +1 -1
- data/lib/templates/active_record/model/model.rb +11 -0
- data/log/.gitignore +0 -0
- data/performance_tuning_notes.md +12 -0
- data/public/styled_file_field/index.html +72 -0
- data/script/cucumber +10 -0
- data/script/rails +6 -0
- data/test/console_helper.rb +5 -0
- data/test/custom_assertions.rb +84 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +9 -0
- data/test/dummy/app/assets/stylesheets/application.css +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/cms/products_controller.rb +2 -0
- data/test/dummy/app/controllers/cms/sample_blocks_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/.gitkeep +0 -0
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/app/models/cms/sample_block.rb +22 -0
- data/test/dummy/app/models/product.rb +5 -0
- data/test/dummy/app/views/cms/products/_form.html.erb +7 -0
- data/test/dummy/app/views/cms/products/render.html.erb +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/test_route/index.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +45 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +27 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +32 -0
- data/test/dummy/config/environments/production.rb +60 -0
- data/test/dummy/config/environments/test.rb +46 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/browsercms.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/quiet_sprocket_assets.rb +8 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +20 -0
- data/test/dummy/db/migrate/20111228141250_create_products.rb +16 -0
- data/test/dummy/db/schema.rb +524 -0
- data/test/dummy/db/seeds.rb +1 -0
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/factories.rb +234 -0
- data/test/fixtures/multipart/foo.jpg +0 -0
- data/test/fixtures/multipart/sample_upload.txt +1 -0
- data/test/fixtures/multipart/second_upload.txt +1 -0
- data/test/fixtures/multipart/test.jpg +0 -0
- data/test/fixtures/multipart/version1.txt +1 -0
- data/test/fixtures/multipart/version2.txt +1 -0
- data/test/functional/cms/cache_controller_test.rb +16 -0
- data/test/functional/cms/categories_controller_test.rb +28 -0
- data/test/functional/cms/connectors_controller_test.rb +64 -0
- data/test/functional/cms/content_block_controller_test.rb +127 -0
- data/test/functional/cms/content_controller_test.rb +351 -0
- data/test/functional/cms/dashboard_controller_test.rb +20 -0
- data/test/functional/cms/file_blocks_controller_test.rb +55 -0
- data/test/functional/cms/home_controller_test.rb +160 -0
- data/test/functional/cms/html_blocks_controller_test.rb +159 -0
- data/test/functional/cms/image_blocks_controller_test.rb +78 -0
- data/test/functional/cms/links_controller_test.rb +151 -0
- data/test/functional/cms/log/test.log +0 -0
- data/test/functional/cms/pages_controller_test.rb +233 -0
- data/test/functional/cms/portlets_controller_test.rb +57 -0
- data/test/functional/cms/sections_controller_test.rb +234 -0
- data/test/functional/cms/sessions_controller_test.rb +80 -0
- data/test/functional/cms/tasks_controller_test.rb +64 -0
- data/test/functional/cms/toolbar_controller_test.rb +76 -0
- data/test/functional/cms/users_controller_test.rb +242 -0
- data/test/integration/cms/password_management_test.rb +66 -0
- data/test/integration/sitemap_performance_test.rb +26 -0
- data/test/mock_file.rb +33 -0
- data/test/performance/browsing_test.rb +9 -0
- data/test/support/engine_controller_hacks.rb +34 -0
- data/test/support/factory_helpers.rb +57 -0
- data/test/support/rails_3_1_routes_hack.rb +70 -0
- data/test/test_helper.rb +199 -0
- data/test/test_logging.rb +67 -0
- data/test/unit/active_record_callbacks.rb +50 -0
- data/test/unit/behaviors/attaching_test.rb +370 -0
- data/test/unit/behaviors/cms_user_test.rb +67 -0
- data/test/unit/behaviors/connectable_test.rb +32 -0
- data/test/unit/behaviors/connecting_test.rb +56 -0
- data/test/unit/behaviors/dynamic_attributes_test.rb +74 -0
- data/test/unit/behaviors/namespacing_test.rb +76 -0
- data/test/unit/behaviors/publishable_test.rb +83 -0
- data/test/unit/behaviors/rendering_test.rb +68 -0
- data/test/unit/behaviors/searching_test.rb +102 -0
- data/test/unit/behaviors/taggable_test.rb +110 -0
- data/test/unit/behaviors/userstamping_test.rb +27 -0
- data/test/unit/behaviors/versioning_test.rb +102 -0
- data/test/unit/extensions/active_record/base_test.rb +25 -0
- data/test/unit/extensions/hash_test.rb +26 -0
- data/test/unit/extensions/integer_test.rb +10 -0
- data/test/unit/extensions/string_test.rb +14 -0
- data/test/unit/factories_test.rb +50 -0
- data/test/unit/generators/cms_generator_test.rb +44 -0
- data/test/unit/generators/install_generator_test.rb +15 -0
- data/test/unit/helpers/application_helper_test.rb +104 -0
- data/test/unit/helpers/date_picker_test.rb +17 -0
- data/test/unit/helpers/menu_helper_test.rb +240 -0
- data/test/unit/helpers/page_helper_test.rb +69 -0
- data/test/unit/helpers/path_helper_test.rb +58 -0
- data/test/unit/helpers/rendering_helper_test.rb +8 -0
- data/test/unit/lib/acts_as_content_page_test.rb +72 -0
- data/test/unit/lib/cms/authentication/controller_test.rb +20 -0
- data/test/unit/lib/cms/engine_helper_test.rb +119 -0
- data/test/unit/lib/cms/sitemap_test.rb +210 -0
- data/test/unit/lib/cms_domain_support_test.rb +44 -0
- data/test/unit/lib/command_line_test.rb +70 -0
- data/test/unit/lib/content_block_test.rb +304 -0
- data/test/unit/lib/content_rendering_support_test.rb +40 -0
- data/test/unit/lib/generators_test.rb +40 -0
- data/test/unit/lib/routes_test.rb +98 -0
- data/test/unit/mock_file_test.rb +19 -0
- data/test/unit/models/attachment_test.rb +160 -0
- data/test/unit/models/category_test.rb +40 -0
- data/test/unit/models/category_type_test.rb +8 -0
- data/test/unit/models/connector_test.rb +152 -0
- data/test/unit/models/content_type_group_test.rb +26 -0
- data/test/unit/models/content_type_test.rb +150 -0
- data/test/unit/models/dynamic_views_test.rb +36 -0
- data/test/unit/models/email_page_portlet_test.rb +20 -0
- data/test/unit/models/file_block_test.rb +246 -0
- data/test/unit/models/group_test.rb +29 -0
- data/test/unit/models/html_block_test.rb +121 -0
- data/test/unit/models/image_block_test.rb +35 -0
- data/test/unit/models/link_test.rb +52 -0
- data/test/unit/models/namespaces_test.rb +57 -0
- data/test/unit/models/page_partial_test.rb +37 -0
- data/test/unit/models/page_route_test.rb +113 -0
- data/test/unit/models/page_template_test.rb +50 -0
- data/test/unit/models/page_test.rb +879 -0
- data/test/unit/models/permission_test.rb +10 -0
- data/test/unit/models/portlet_test.rb +99 -0
- data/test/unit/models/sections_test.rb +278 -0
- data/test/unit/models/site_test.rb +50 -0
- data/test/unit/models/task_test.rb +150 -0
- data/test/unit/models/user_test.rb +358 -0
- data/test/unit/schema_statements_test.rb +137 -0
- data/todo_list.markdown +68 -0
- data/vendor/assets/javascripts/bcms/ckeditor.js +6 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/ckeditor.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/config.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/_bootstrap.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/ajax.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/ckeditor.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/ckeditor_base.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/ckeditor_basic.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/command.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/commanddefinition.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/config.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/document.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/documentfragment.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/domobject.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/element.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/elementpath.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/event.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/node.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/nodelist.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/range.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/text.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/walker.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dom/window.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/dtd.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/editor.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/editor_basic.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/env.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/event.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/eventInfo.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/focusmanager.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/htmlparser.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/htmlparser/basicwriter.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/htmlparser/cdata.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/htmlparser/comment.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/htmlparser/element.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/htmlparser/filter.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/htmlparser/fragment.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/htmlparser/text.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/imagecacher.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/lang.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/loader.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/plugindefinition.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/plugins.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/resourcemanager.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/scriptloader.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/skins.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/test.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/themes.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/tools.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/ui.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/core/xml.js +0 -0
- data/vendor/assets/javascripts/bcms/ckeditor/editor.js +54 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/_languages.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/_translationstatus.txt +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/af.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/ar.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/bg.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/bn.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/bs.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/ca.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/cs.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/da.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/de.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/el.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/en-au.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/en-ca.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/en-uk.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/en.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/eo.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/es.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/et.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/eu.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/fa.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/fi.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/fo.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/fr-ca.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/fr.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/gl.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/gu.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/he.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/hi.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/hr.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/hu.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/is.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/it.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/ja.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/km.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/ko.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/lt.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/lv.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/mn.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/ms.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/nb.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/nl.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/no.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/pl.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/pt-br.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/pt.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/ro.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/ru.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/sk.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/sl.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/sr-latn.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/sr.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/sv.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/th.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/tr.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/uk.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/vi.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/zh-cn.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/lang/zh.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/about/dialogs/about.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/about/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/basicstyles/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/blockquote/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/button/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/clipboard/dialogs/paste.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/clipboard/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/colorbutton/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/contextmenu/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/dialog/dialogDefinition.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/dialog/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/dialogui/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/domiterator/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/editingblock/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/elementspath/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/enterkey/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/entities/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/fakeobjects/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/filebrowser/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/find/dialogs/find.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/find/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/flash/dialogs/flash.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/flash/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/floatpanel/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/font/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/format/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/dialogs/button.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/dialogs/checkbox.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/dialogs/form.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/dialogs/hiddenfield.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/dialogs/radio.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/dialogs/select.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/dialogs/textarea.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/dialogs/textfield.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/forms/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/horizontalrule/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/htmldataprocessor/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/htmlwriter/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/iframedialog/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/image/dialogs/image.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/image/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/indent/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/justify/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/keystrokes/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/link/dialogs/anchor.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/link/dialogs/link.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/link/images/anchor.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/link/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/list/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/listblock/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/maximize/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/menu/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/menubutton/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/newpage/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/pagebreak/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/panel/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/panelbutton/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/pastefromword/dialogs/pastefromword.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/pastefromword/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/pastetext/dialogs/pastetext.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/pastetext/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/popup/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/preview/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/print/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/removeformat/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/resize/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/richcombo/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/save/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/scayt/dialogs/options.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/scayt/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/selection/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/showblocks/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/dialogs/smiley.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/smiley/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/sourcearea/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/specialchar/dialogs/specialchar.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/specialchar/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/styles/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/stylescombo/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/stylescombo/styles/default.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/tab/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/table/dialogs/table.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/table/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/tabletools/dialogs/tableCell.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/tabletools/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/templates/dialogs/templates.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/templates/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/templates/templates/default.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/toolbar/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/dialogs/uicolor.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/lang/en.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/uicolor.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/yui/assets/yui.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/uicolor/yui/yui.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/undo/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/wsc/dialogs/wsc.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/wsc/dialogs/wsc.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/wsc/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/plugins/wysiwygarea/plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/dialog.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/editor.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/elementspath.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/icons.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/icons.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/images/dialog_sides.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/images/mini.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/images/noimage.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/images/sprites.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/mainui.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/menu.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/panel.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/presets.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/reset.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/richcombo.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/skin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/templates.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/kama/toolbar.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/dialog.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/editor.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/elementspath.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/icons.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/icons.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/images/mini.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/images/noimage.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/images/sprites.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/mainui.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/menu.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/panel.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/presets.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/reset.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/richcombo.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/skin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/templates.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/office2003/toolbar.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/dialog.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/editor.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/elementspath.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/icons.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/icons.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/images/dialog_sides.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/images/mini.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/images/noimage.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/images/sprites.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/mainui.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/menu.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/panel.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/presets.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/reset.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/richcombo.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/skin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/templates.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/skins/v2/toolbar.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/_assets/sample.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/_assets/sample.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/_assets/sample.txt +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/_assets/sample.xml +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/_assets/sample_xml.txt +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/_editor/custom_config_1.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/_editor/custom_config_2.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/ajax.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/bootstrap.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/ckeditor.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/dom/document.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/dom/documentfragment.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/dom/element.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/dom/node.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/dom/range.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/dom/text.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/dom/walker.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/dom/window.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/editor.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/env.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/event.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/htmlparser/fragment.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/htmlparser/htmlparser.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/plugins.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/plugins/myplugins/sample/my_plugin.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/scriptloader.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/tools.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/core/xml.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/plugins/domiterator/domiterator.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/plugins/htmldataprocessor/htmldataprocessor.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/plugins/link/link.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/plugins/list/list.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/plugins/selection/selection.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/plugins/styles/styles.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/test.css +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/test.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/testall.html +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/tests/yuitest.js +0 -0
- data/{public → vendor/assets/javascripts}/bcms/ckeditor/themes/default/theme.js +0 -0
- data/{public → vendor/assets}/javascripts/jquery.cookie.js +0 -0
- data/{public/javascripts/jquery.selectbox-0.5.js → vendor/assets/javascripts/jquery.selectbox.js} +0 -0
- data/vendor/plugins/.gitkeep +0 -0
- metadata +1386 -939
- data/app/models/abstract_file_block.rb +0 -32
- data/app/models/attachment.rb +0 -192
- data/app/models/category.rb +0 -40
- data/app/models/category_type.rb +0 -34
- data/app/models/connector.rb +0 -81
- data/app/models/content_type.rb +0 -95
- data/app/models/content_type_group.rb +0 -3
- data/app/models/dynamic_view.rb +0 -80
- data/app/models/email_message.rb +0 -31
- data/app/models/email_message_mailer.rb +0 -11
- data/app/models/file_block.rb +0 -9
- data/app/models/forgot_password_mailer.rb +0 -12
- data/app/models/group.rb +0 -41
- data/app/models/group_permission.rb +0 -7
- data/app/models/group_section.rb +0 -4
- data/app/models/group_type.rb +0 -12
- data/app/models/group_type_permission.rb +0 -4
- data/app/models/guest_user.rb +0 -53
- data/app/models/html_block.rb +0 -40
- data/app/models/image_block.rb +0 -10
- data/app/models/link.rb +0 -18
- data/app/models/page.rb +0 -319
- data/app/models/page_partial.rb +0 -22
- data/app/models/page_route.rb +0 -122
- data/app/models/page_route_condition.rb +0 -2
- data/app/models/page_route_option.rb +0 -3
- data/app/models/page_route_requirement.rb +0 -2
- data/app/models/page_template.rb +0 -31
- data/app/models/permission.rb +0 -10
- data/app/models/portlet.rb +0 -177
- data/app/models/redirect.rb +0 -4
- data/app/models/section.rb +0 -195
- data/app/models/section_node.rb +0 -110
- data/app/models/site.rb +0 -41
- data/app/models/tag.rb +0 -62
- data/app/models/tagging.rb +0 -9
- data/app/models/task.rb +0 -74
- data/app/models/templates.rb +0 -31
- data/app/models/user.rb +0 -169
- data/app/models/user_group_membership.rb +0 -4
- data/db/demo/data.rb +0 -97
- data/db/demo/page_partials/_footer.html.erb +0 -6
- data/db/demo/page_partials/_header.html.erb +0 -24
- data/db/demo/page_templates/home_page.html.erb +0 -49
- data/db/demo/page_templates/sub_page.html.erb +0 -37
- data/lib/cms/routes.rb +0 -145
- data/lib/generators/browser_cms/demo_site/demo_site_generator.rb +0 -138
- data/lib/generators/browser_cms/demo_site/templates/migration.erb +0 -15
- data/lib/generators/cms/content_block/templates/content_block.rb +0 -27
- data/lib/generators/cms/content_block/templates/controller.rb +0 -2
- data/lib/generators/cms/content_block/templates/functional_test.erb +0 -11
- data/lib/generators/cms/content_block/templates/migration.erb +0 -38
- data/lib/generators/cms/content_block/templates/unit_test.erb +0 -9
- data/lib/generators/cms/upgrade_module/README.txt +0 -3
- data/lib/generators/cms/upgrade_module/templates/20100705083859_browsercms_3_3_0.rb +0 -56
- data/lib/generators/cms/upgrade_module/templates/USAGE.erb +0 -10
- data/lib/generators/cms/upgrade_module/templates/build_gem.rake +0 -5
- data/lib/generators/cms/upgrade_module/templates/engine.erb +0 -7
- data/lib/generators/cms/upgrade_module/templates/gemspec.erb +0 -25
- data/lib/generators/cms/upgrade_module/templates/install.erb +0 -9
- data/lib/generators/cms/upgrade_module/templates/module_file.erb +0 -3
- data/lib/generators/cms/upgrade_module/templates/routes.erb +0 -7
- data/lib/generators/cms/upgrade_module/upgrade_module_generator.rb +0 -61
- data/public/bcms/ckeditor/editor.js +0 -51
- data/public/javascripts/cms/application.js +0 -157
- data/public/javascripts/cms/content_library.js +0 -36
- data/public/javascripts/cms/sitemap.js +0 -464
- data/public/javascripts/jquery-ui.js +0 -782
- data/public/javascripts/jquery.js +0 -16
- data/public/javascripts/jquery.taglist.js +0 -143
- data/public/site/customconfig.js +0 -1
- data/public/stylesheets/cms/administration.css +0 -91
- data/public/stylesheets/cms/application.css +0 -166
- data/public/stylesheets/cms/buttons.css +0 -120
- data/public/stylesheets/cms/content_library.css +0 -139
- data/public/stylesheets/cms/dashboard.css +0 -118
- data/public/stylesheets/cms/data_table.css +0 -156
- data/public/stylesheets/cms/date_picker.css +0 -82
- data/public/stylesheets/cms/form_layout.css +0 -279
- data/public/stylesheets/cms/login.css +0 -78
- data/public/stylesheets/cms/menu.css +0 -116
- data/public/stylesheets/cms/nav.css +0 -99
- data/public/stylesheets/cms/page_toolbar.css +0 -135
- data/public/stylesheets/cms/selectbox.css +0 -56
- data/public/stylesheets/cms/sitemap.css +0 -390
- data/rails/init.rb +0 -2
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class PageTemplateTest < ActiveSupport::TestCase
|
4
|
+
def setup
|
5
|
+
@page_template = Factory.build(:page_template, :name => "test")
|
6
|
+
File.delete(@page_template.file_path) if File.exists?(@page_template.file_path)
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
File.delete(@page_template.file_path) if File.exists?(@page_template.file_path)
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
test "Name used to build the form" do
|
15
|
+
assert_equal "page_template", Cms::PageTemplate.resource_collection_name
|
16
|
+
end
|
17
|
+
|
18
|
+
test "resource_name works for namespaced templates" do
|
19
|
+
assert_equal "page_templates", Cms::PageTemplate.resource_name
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_create_and_destroy
|
24
|
+
assert !File.exists?(@page_template.file_path), "template file already exists"
|
25
|
+
assert_valid @page_template
|
26
|
+
assert @page_template.save
|
27
|
+
assert File.exists?(@page_template.file_path), "template file was not written to disk"
|
28
|
+
@page_template.destroy
|
29
|
+
assert !File.exists?(@page_template.file_path), "template file was not removed on destroy"
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_for_valid_name
|
33
|
+
assert_not_valid Factory.build(:page_template, :name => "Fancy")
|
34
|
+
assert_not_valid Factory.build(:page_template, :name => "foo bar")
|
35
|
+
assert_valid Factory.build(:page_template, :name => "subpage_1_column")
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_find_by_file_name
|
39
|
+
assert @page_template.save, "Could not save page template"
|
40
|
+
assert_equal @page_template, Cms::PageTemplate.find_by_file_name("test.html.erb")
|
41
|
+
assert_nil Cms::PageTemplate.find_by_file_name("fail.html.erb")
|
42
|
+
assert_nil Cms::PageTemplate.find_by_file_name("fail.erb")
|
43
|
+
assert_nil Cms::PageTemplate.find_by_file_name("fail")
|
44
|
+
assert_nil Cms::PageTemplate.find_by_file_name(nil)
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_default_body
|
48
|
+
assert_not_nil Cms::PageTemplate.default_body
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,879 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Cms
|
4
|
+
class CreatingPageTest < ActiveSupport::TestCase
|
5
|
+
|
6
|
+
test "Testing Database should be empty and have no pages" do
|
7
|
+
assert_nil Cms::Page.with_path("/").first
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_creating_a_page_and_updating_the_attributes
|
11
|
+
@page = Cms::Page.new(
|
12
|
+
:name => "Test",
|
13
|
+
:path => "test",
|
14
|
+
:section => root_section,
|
15
|
+
:publish_on_save => true)
|
16
|
+
|
17
|
+
assert @page.save
|
18
|
+
assert_path_is_unique
|
19
|
+
|
20
|
+
@page.update_attributes(:name => "Test v2")
|
21
|
+
page = Cms::Page.find_live_by_path("/test")
|
22
|
+
assert_equal "Test", page.name
|
23
|
+
|
24
|
+
assert_equal 1, page.version
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
test "Creating a page builds a section node" do
|
29
|
+
@page = Page.create!(:name => "Hello", :path => "/hello", :section => Factory(:root_section))
|
30
|
+
assert_not_nil @page.section_node
|
31
|
+
end
|
32
|
+
|
33
|
+
test "page with no parent" do
|
34
|
+
@page = Page.new
|
35
|
+
assert_nil @page.parent
|
36
|
+
end
|
37
|
+
|
38
|
+
test "#section is alias for #parent" do
|
39
|
+
@page = Page.new
|
40
|
+
assert_nil @page.section
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
protected
|
45
|
+
def assert_path_is_unique
|
46
|
+
page = Factory.build(:page, :path => @page.path)
|
47
|
+
assert_not_valid page
|
48
|
+
assert_has_error_on page, :path
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
class VersionTest < ActiveSupport::TestCase
|
54
|
+
|
55
|
+
def setup
|
56
|
+
@page = Factory(:public_page)
|
57
|
+
@another_page = Factory(:public_page)
|
58
|
+
end
|
59
|
+
|
60
|
+
test "#latest_version set set when page is created" do
|
61
|
+
assert_equal 1, @page.version
|
62
|
+
assert_equal 1, @page.latest_version
|
63
|
+
end
|
64
|
+
|
65
|
+
test "#latest_version is incremented when page#update occurs" do
|
66
|
+
@page.name = "New"
|
67
|
+
@page.save!
|
68
|
+
@page.reload
|
69
|
+
|
70
|
+
assert_equal 1, @page.version
|
71
|
+
assert_equal 2, @page.latest_version
|
72
|
+
|
73
|
+
assert_equal 1, @another_page.reload.latest_version, "Should only update its own version, not other tables"
|
74
|
+
end
|
75
|
+
|
76
|
+
test "live? using latest version" do
|
77
|
+
assert @page.live?
|
78
|
+
|
79
|
+
@page.update_attributes(:name => "New")
|
80
|
+
@page.reload
|
81
|
+
refute @page.live?
|
82
|
+
|
83
|
+
@page.publish!
|
84
|
+
@page.reload
|
85
|
+
assert @page.live?
|
86
|
+
end
|
87
|
+
|
88
|
+
test "live? as_of_version" do
|
89
|
+
@page.update_attributes(:name => "New")
|
90
|
+
@page.publish!
|
91
|
+
|
92
|
+
v1 = @page.as_of_version(1)
|
93
|
+
assert v1.live?
|
94
|
+
end
|
95
|
+
end
|
96
|
+
class PageTest < ActiveSupport::TestCase
|
97
|
+
|
98
|
+
def test_creating_page_with_reserved_path
|
99
|
+
@page = Cms::Page.new(:name => "FAIL", :path => "/cms")
|
100
|
+
assert_not_valid @page
|
101
|
+
assert_has_error_on(@page, :path, "is invalid, '/cms' a reserved path")
|
102
|
+
|
103
|
+
@page = Cms::Page.new(:name => "FAIL", :path => "/cache")
|
104
|
+
assert_not_valid @page
|
105
|
+
assert_has_error_on(@page, :path, "is invalid, '/cache' a reserved path")
|
106
|
+
|
107
|
+
@page = Cms::Page.new(:name => "FTW", :path => "/whatever")
|
108
|
+
|
109
|
+
assert_valid @page
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_creating_page_with_trailing_slash
|
113
|
+
@page = Factory.build(:page, :path => "/slashed/")
|
114
|
+
@page.save
|
115
|
+
assert_equal @page.path, "/slashed"
|
116
|
+
|
117
|
+
@page = Factory.build(:page, :path => "/slashed/loooong/path/")
|
118
|
+
@page.save
|
119
|
+
assert_equal @page.path, "/slashed/loooong/path"
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_find_live_by_path
|
123
|
+
@page = Factory.build(:page, :path => '/foo')
|
124
|
+
assert_nil Cms::Page.find_live_by_path('/foo')
|
125
|
+
|
126
|
+
@page.publish!
|
127
|
+
reset(:page)
|
128
|
+
assert_equal @page, Cms::Page.find_live_by_path('/foo')
|
129
|
+
|
130
|
+
@page.update_attributes(:path => '/bar')
|
131
|
+
assert_equal @page, Cms::Page.find_live_by_path('/foo')
|
132
|
+
assert_nil Cms::Page.find_live_by_path('/bar')
|
133
|
+
|
134
|
+
@page.publish!
|
135
|
+
reset(:page)
|
136
|
+
assert_nil Cms::Page.find_live_by_path('/foo')
|
137
|
+
assert_equal @page, Cms::Page.find_live_by_path('/bar')
|
138
|
+
end
|
139
|
+
|
140
|
+
test "It should be possible to create a new page, using the same path as a previously deleted page" do
|
141
|
+
Cms::Page.delete_all
|
142
|
+
p = Time.now.to_f.to_s #use a unique, but consistent path
|
143
|
+
|
144
|
+
@page = Factory(:published_page, :path => "/#{p}")
|
145
|
+
@page.destroy
|
146
|
+
|
147
|
+
@page2 = Factory(:published_page, :path => "/#{p}")
|
148
|
+
assert_not_equal(@page, @page2)
|
149
|
+
end
|
150
|
+
|
151
|
+
test "Find by live path should not located deleted blocks, even if they share paths with live ones" do
|
152
|
+
@page = Factory.build(:page, :path => '/foo')
|
153
|
+
@page.publish!
|
154
|
+
reset(:page)
|
155
|
+
|
156
|
+
@page.mark_as_deleted!
|
157
|
+
assert_nil Cms::Page.find_live_by_path('/foo')
|
158
|
+
|
159
|
+
@new_page = Factory.build(:page, :path => '/foo')
|
160
|
+
assert_nil Cms::Page.find_live_by_path('/foo')
|
161
|
+
|
162
|
+
@new_page.publish!
|
163
|
+
reset(:new_page)
|
164
|
+
assert_equal @new_page, Cms::Page.find_live_by_path('/foo')
|
165
|
+
assert_not_equal @page, @new_page
|
166
|
+
end
|
167
|
+
|
168
|
+
def test_path_normalization
|
169
|
+
page = Factory.build(:page, :path => 'foo/bar')
|
170
|
+
assert_valid page
|
171
|
+
assert_equal "/foo/bar", page.path
|
172
|
+
|
173
|
+
page = Factory.build(:page, :path => '/foo/bar')
|
174
|
+
assert_valid page
|
175
|
+
assert_equal "/foo/bar", page.path
|
176
|
+
end
|
177
|
+
|
178
|
+
def test_template
|
179
|
+
page_template = Factory(:page_template, :name => 'test')
|
180
|
+
page = Factory.build(:page, :template_file_name => 'test.html.erb')
|
181
|
+
assert_equal 'test.html.erb', page.template_file_name
|
182
|
+
assert_equal 'Test (html/erb)', page.template_name
|
183
|
+
assert_equal page_template, page.template
|
184
|
+
assert_equal 'templates/test', page.layout
|
185
|
+
|
186
|
+
page = Factory.build(:page, :template_file_name => 'foo.html.erb')
|
187
|
+
assert_equal 'foo.html.erb', page.template_file_name
|
188
|
+
assert_equal 'Foo (html/erb)', page.template_name
|
189
|
+
assert_nil page.template
|
190
|
+
assert_equal 'templates/foo', page.layout
|
191
|
+
end
|
192
|
+
|
193
|
+
def test_revision_comments
|
194
|
+
page = Factory(:page, :section => root_section, :name => "V1")
|
195
|
+
|
196
|
+
assert_equal 'Created', page.live_version.version_comment
|
197
|
+
|
198
|
+
assert page.reload.save
|
199
|
+
assert_equal 'Created', page.reload.live_version.version_comment
|
200
|
+
assert_equal page.live_version.version_comment,
|
201
|
+
page.as_of_version(page.version).live_version.version_comment
|
202
|
+
|
203
|
+
page.update_attributes(:name => "V2")
|
204
|
+
assert_equal 'Changed name', page.draft.version_comment
|
205
|
+
assert_equal 'Created', page.live_version.version_comment
|
206
|
+
|
207
|
+
block = Factory(:html_block, :name => "Hello, World!")
|
208
|
+
page.create_connector(block, "main")
|
209
|
+
assert_equal "Html Block 'Hello, World!' was added to the 'main' container",
|
210
|
+
page.draft.version_comment
|
211
|
+
assert_equal 'Created', page.live_version.version_comment
|
212
|
+
assert_equal 3, page.reload.draft.version
|
213
|
+
|
214
|
+
page.create_connector(Factory(:html_block, :name => "Whatever"), "main")
|
215
|
+
assert_equal 4, page.reload.draft.version
|
216
|
+
|
217
|
+
page.move_connector_down(page.connectors.for_page_version(page.reload.draft.version).for_connectable(block).first)
|
218
|
+
assert_equal "Html Block 'Hello, World!' was moved down within the 'main' container",
|
219
|
+
page.draft.version_comment
|
220
|
+
assert_equal 'Created', page.live_version.version_comment
|
221
|
+
|
222
|
+
page.move_connector_up(page.connectors.for_page_version(page.reload.draft.version).for_connectable(block).first)
|
223
|
+
assert_equal "Html Block 'Hello, World!' was moved up within the 'main' container",
|
224
|
+
page.draft.version_comment
|
225
|
+
assert_equal 'Created', page.live_version.version_comment
|
226
|
+
|
227
|
+
page.remove_connector(page.connectors.for_page_version(page.reload.draft.version).for_connectable(block).first)
|
228
|
+
assert_equal "Html Block 'Hello, World!' was removed from the 'main' container",
|
229
|
+
page.draft.version_comment
|
230
|
+
assert_equal 'Created', page.live_version.version_comment
|
231
|
+
|
232
|
+
page.revert_to(1)
|
233
|
+
assert_equal "Reverted to version 1",
|
234
|
+
page.reload.draft.version_comment
|
235
|
+
assert_equal 'Created', page.live_version.version_comment
|
236
|
+
|
237
|
+
assert_equal "Created", page.as_of_version(1).current_version.version_comment
|
238
|
+
assert_equal "Changed name", page.as_of_version(2).current_version.version_comment
|
239
|
+
assert_equal "Reverted to version 1", page.draft.version_comment
|
240
|
+
|
241
|
+
end
|
242
|
+
|
243
|
+
def test_container_live
|
244
|
+
page = Factory(:page)
|
245
|
+
published = Factory(:html_block, :publish_on_save => true)
|
246
|
+
unpublished = Factory(:html_block)
|
247
|
+
page.create_connector(published, "main")
|
248
|
+
page.create_connector(unpublished, "main")
|
249
|
+
assert !page.container_published?("main")
|
250
|
+
assert unpublished.publish
|
251
|
+
assert page.container_published?("main")
|
252
|
+
end
|
253
|
+
|
254
|
+
def test_move_page_to_another_section
|
255
|
+
page = Factory(:public_page)
|
256
|
+
new_section = Factory(:public_section)
|
257
|
+
|
258
|
+
assert_not_equal new_section, page.section
|
259
|
+
page.section = new_section
|
260
|
+
assert page.save
|
261
|
+
assert_equal new_section, page.section
|
262
|
+
end
|
263
|
+
|
264
|
+
def test_deleting_page
|
265
|
+
page = Factory(:page)
|
266
|
+
page_count = Cms::Page.count_with_deleted
|
267
|
+
|
268
|
+
page_version_count = page.versions.count
|
269
|
+
assert !page.deleted?
|
270
|
+
|
271
|
+
page.destroy
|
272
|
+
|
273
|
+
assert_equal page_count, Cms::Page.count_with_deleted
|
274
|
+
assert_incremented page_version_count, page.versions.count
|
275
|
+
assert page.deleted?
|
276
|
+
assert_raise ActiveRecord::RecordNotFound do
|
277
|
+
Cms::Page.find(page.id)
|
278
|
+
end
|
279
|
+
|
280
|
+
end
|
281
|
+
|
282
|
+
def test_adding_a_block_to_a_page_puts_page_in_draft_mode
|
283
|
+
@page = Factory(:page, :section => root_section, :publish_on_save => true)
|
284
|
+
@block = Factory(:html_block, :publish_on_save => true)
|
285
|
+
reset(:page, :block)
|
286
|
+
assert @page.published?
|
287
|
+
assert @block.published?
|
288
|
+
@page.create_connector(@block, "main")
|
289
|
+
reset(:page, :block)
|
290
|
+
assert !@page.live?
|
291
|
+
end
|
292
|
+
|
293
|
+
def test_reverting_and_then_publishing_a_page
|
294
|
+
@page = Factory(:page, :section => root_section, :publish_on_save => true)
|
295
|
+
|
296
|
+
@block = Factory(:html_block,
|
297
|
+
:connect_to_page_id => @page.id,
|
298
|
+
:connect_to_container => "main")
|
299
|
+
@page.publish
|
300
|
+
|
301
|
+
reset(:page, :block)
|
302
|
+
|
303
|
+
assert_equal 2, @page.version
|
304
|
+
assert_equal 1, @page.connectors.for_page_version(@page.version).count
|
305
|
+
|
306
|
+
@block.update_attributes(:content => "Something else")
|
307
|
+
@page.publish!
|
308
|
+
reset(:page, :block)
|
309
|
+
|
310
|
+
assert_equal 1, @page.connectors.for_page_version(@page.version).count
|
311
|
+
assert_equal 2, @block.version
|
312
|
+
assert_equal 3, @page.version
|
313
|
+
assert @block.live?
|
314
|
+
assert @page.live?
|
315
|
+
|
316
|
+
@page.revert_to(2)
|
317
|
+
reset(:page, :block)
|
318
|
+
|
319
|
+
assert_equal 3, @page.version
|
320
|
+
assert_equal 4, @page.draft.version
|
321
|
+
assert_equal 2, @block.version
|
322
|
+
assert_equal 3, @block.draft.version
|
323
|
+
assert_equal 1, @page.connectors.for_page_version(@page.version).count
|
324
|
+
assert_equal 1, @page.connectors.for_page_version(@page.draft.version).count
|
325
|
+
assert !@page.live?
|
326
|
+
assert !@block.live?
|
327
|
+
|
328
|
+
end
|
329
|
+
|
330
|
+
end
|
331
|
+
|
332
|
+
class UserStampingTest < ActiveSupport::TestCase
|
333
|
+
|
334
|
+
def setup
|
335
|
+
@first_guy = Factory(:user, :login => "first_guy")
|
336
|
+
@next_guy = Factory(:user, :login => "next_guy")
|
337
|
+
Cms::User.current = @first_guy
|
338
|
+
end
|
339
|
+
|
340
|
+
def teardown
|
341
|
+
Cms::User.current = nil
|
342
|
+
end
|
343
|
+
|
344
|
+
def test_user_stamps_are_applied_to_versions
|
345
|
+
page = Factory(:page, :name => "Original Value")
|
346
|
+
|
347
|
+
assert_equal page, page.draft.page
|
348
|
+
assert_equal @first_guy, page.updated_by
|
349
|
+
|
350
|
+
Cms::User.current = @new_guy
|
351
|
+
|
352
|
+
page.update_attributes(:name => "Something Different")
|
353
|
+
|
354
|
+
assert_equal "Something Different", page.draft.name
|
355
|
+
assert_equal "Original Value", page.reload.name
|
356
|
+
assert_equal "Original Value", page.versions.first.name
|
357
|
+
assert_equal @first_guy, page.versions.first.updated_by
|
358
|
+
assert_equal @new_guy, page.versions.last.updated_by
|
359
|
+
assert_equal 2, page.versions.count
|
360
|
+
end
|
361
|
+
|
362
|
+
end
|
363
|
+
|
364
|
+
class PageInSectionTest < ActiveSupport::TestCase
|
365
|
+
|
366
|
+
def setup
|
367
|
+
@root = Factory(:root_section, :name => "First Section")
|
368
|
+
@football_section = Factory :public_section, :name => "Football", :parent => @root
|
369
|
+
@baseball_section = Factory :public_section, :name => "Baseball", :parent => @root
|
370
|
+
|
371
|
+
@football_page = Factory :public_page, :section => @football_section
|
372
|
+
@baseball_page = Factory :public_page, :section => @baseball_section
|
373
|
+
end
|
374
|
+
|
375
|
+
test "in_section if immediate parent section is included" do
|
376
|
+
assert @football_page.in_section?("Football")
|
377
|
+
assert !@baseball_page.in_section?("Football")
|
378
|
+
end
|
379
|
+
|
380
|
+
test "in_section if immediate parent's name is included" do
|
381
|
+
assert @football_page.in_section?("Football")
|
382
|
+
assert !@baseball_page.in_section?("Football")
|
383
|
+
end
|
384
|
+
|
385
|
+
test "in_section if any ancestor is included" do
|
386
|
+
assert @football_page.in_section?(@root)
|
387
|
+
assert @baseball_page.in_section?(@root)
|
388
|
+
assert @football_page.in_section?("First Section")
|
389
|
+
assert @baseball_page.in_section?("First Section")
|
390
|
+
end
|
391
|
+
|
392
|
+
test "#top_level_section" do
|
393
|
+
assert_equal @football_section, @football_page.top_level_section
|
394
|
+
assert_equal @baseball_section, @baseball_page.top_level_section
|
395
|
+
|
396
|
+
second_level_section = Factory(:public_section, :parent => @football_section)
|
397
|
+
second_level_page = Factory(:public_page, :section => second_level_section)
|
398
|
+
assert_equal @football_section, second_level_page.top_level_section
|
399
|
+
end
|
400
|
+
|
401
|
+
test "#top_level_section caches result to avoid repeated requests" do
|
402
|
+
top = @football_page.top_level_section
|
403
|
+
assert_equal top.object_id, @football_page.top_level_section.object_id
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
407
|
+
class PageWithAssociatedBlocksTest < ActiveSupport::TestCase
|
408
|
+
def setup
|
409
|
+
super
|
410
|
+
@page = Factory(:page, :section => root_section, :name => "Bar")
|
411
|
+
@block = Factory(:html_block)
|
412
|
+
@other_connector = Factory(:connector, :connectable => @block, :connectable_version => @block.version)
|
413
|
+
@page_connector = Factory(:connector, :page => @page, :page_version => @page.version, :connectable => @block, :connectable_version => @block.version)
|
414
|
+
end
|
415
|
+
|
416
|
+
# It should create a new page version and a new connector
|
417
|
+
def test_updating_the_page_with_changes
|
418
|
+
Cms::Page.delete_all
|
419
|
+
connector_count = Cms::Connector.count
|
420
|
+
|
421
|
+
page_version = @page.version
|
422
|
+
@page.update_attributes(:name => "Foo")
|
423
|
+
|
424
|
+
assert_incremented connector_count, Cms::Connector.count
|
425
|
+
assert_equal page_version, @page.version
|
426
|
+
assert_incremented page_version, @page.draft.version
|
427
|
+
end
|
428
|
+
|
429
|
+
# It should not create a new page version or a new connector
|
430
|
+
def test_updating_the_page_without_changes
|
431
|
+
connector_count = Cms::Connector.count
|
432
|
+
page_version = @page.version
|
433
|
+
|
434
|
+
@page.update_attributes(:name => @page.name)
|
435
|
+
|
436
|
+
assert_equal connector_count, Cms::Connector.count
|
437
|
+
|
438
|
+
assert_equal page_version, @page.version
|
439
|
+
end
|
440
|
+
|
441
|
+
# Verifies that 'after_destroy' callbacks happen on Page/SoftDeleting objects, such that
|
442
|
+
# a deleted page is disassociated with any blocks it was connected to.
|
443
|
+
test "Destroying a page with a block should remove its connectors from the database completely." do
|
444
|
+
|
445
|
+
connector_count = Cms::Connector.count
|
446
|
+
assert Cms::Connector.exists?(@page_connector.id)
|
447
|
+
assert Cms::Connector.exists?(@other_connector.id)
|
448
|
+
|
449
|
+
@page.destroy
|
450
|
+
|
451
|
+
assert_decremented connector_count, Cms::Connector.count
|
452
|
+
assert !Cms::Connector.exists?(@page_connector.id)
|
453
|
+
assert Cms::Connector.exists?(@other_connector.id)
|
454
|
+
assert Cms::HtmlBlock.exists?(@block.id)
|
455
|
+
assert !@block.deleted?
|
456
|
+
end
|
457
|
+
|
458
|
+
|
459
|
+
end
|
460
|
+
|
461
|
+
class AddingBlocksTest < ActiveSupport::TestCase
|
462
|
+
|
463
|
+
def setup
|
464
|
+
@page = Factory(:page)
|
465
|
+
@block = Factory(:html_block)
|
466
|
+
@original_versions_count = @page.versions.count
|
467
|
+
@connector_count = Cms::Connector.count
|
468
|
+
|
469
|
+
@connector = @page.create_connector(@block, "main")
|
470
|
+
reset(:page, :block)
|
471
|
+
end
|
472
|
+
|
473
|
+
test "Adding a block to a page without publishing" do
|
474
|
+
assert_equal 1, @page.version, "The unpublished page should still be version 1"
|
475
|
+
assert_equal 2, @connector.page_version, "The connector should point to version 2 of the page"
|
476
|
+
assert_equal 1, @connector.connectable_version, "Connector should point to version 1 of the block"
|
477
|
+
assert_incremented @original_versions_count, @page.versions.count # "There should be a new version of the page"
|
478
|
+
assert_equal 1, @page.connectors.for_page_version(@page.draft.version).count
|
479
|
+
|
480
|
+
assert_equal @connector_count + 1, Cms::Connector.count, "Adding the first block to a page should add exactly one connector"
|
481
|
+
end
|
482
|
+
|
483
|
+
test "Adding additional blocks to a page" do
|
484
|
+
block2 = Factory(:html_block)
|
485
|
+
|
486
|
+
|
487
|
+
conn = @page.create_connector(block2, "main")
|
488
|
+
|
489
|
+
assert_equal 1, @page.version
|
490
|
+
assert_equal 1, conn.connectable_version
|
491
|
+
assert_equal 3, @page.versions.count, "Should be three versions of the page now"
|
492
|
+
assert_equal 3, @page.draft.version, "Latest draft of a page should be 3"
|
493
|
+
assert_equal 2, @page.connectors.for_page_version(@page.draft.version).count
|
494
|
+
assert_equal @connector_count + 3, Cms::Connector.count, "Adding a second block to an existing page should add 3 total connectors."
|
495
|
+
end
|
496
|
+
|
497
|
+
test "Creating a new block to a page should update all existing connectors to the new page version." do
|
498
|
+
Rails.logger.warn "Creating a new connector"
|
499
|
+
@page.create_connector(Factory(:html_block), "main")
|
500
|
+
expected_version = 3
|
501
|
+
Rails.logger.warn "Done"
|
502
|
+
connectors = @page.connectors.for_page_version(expected_version)
|
503
|
+
assert_equal expected_version, connectors[0].page_version, "There should be two connectors with the same version as the page"
|
504
|
+
assert_equal expected_version, connectors[1].page_version
|
505
|
+
assert_equal 2, connectors.count, "There should be two connectors total for the page for this version (3) of the page."
|
506
|
+
|
507
|
+
end
|
508
|
+
end
|
509
|
+
|
510
|
+
class AddingBlocksToPageTest < ActiveSupport::TestCase
|
511
|
+
|
512
|
+
|
513
|
+
def test_that_it_works
|
514
|
+
@page = Factory(:page, :section => root_section)
|
515
|
+
@block = Factory(:html_block)
|
516
|
+
@block2 = Factory(:html_block)
|
517
|
+
@first_conn = @page.create_connector(@block, "testing")
|
518
|
+
@second_conn = @page.create_connector(@block2, "testing")
|
519
|
+
|
520
|
+
page_version_count = @page.versions.count
|
521
|
+
connector_count = Cms::Connector.count
|
522
|
+
|
523
|
+
@conn = @page.create_connector(@block2, "testing")
|
524
|
+
|
525
|
+
assert_equal 1, @page.reload.version
|
526
|
+
assert_equal 4, @conn.page_version
|
527
|
+
assert_equal 1, @conn.connectable_version
|
528
|
+
assert_incremented page_version_count, @page.versions.count
|
529
|
+
assert_equal 3, @page.connectors.for_page_version(@page.draft.version).count
|
530
|
+
assert_equal connector_count + 3, Cms::Connector.count
|
531
|
+
|
532
|
+
|
533
|
+
# should leave the previous connectors untouched
|
534
|
+
@conns = @page.connectors.all(:conditions => ["page_version < 4"], :order => "id")
|
535
|
+
|
536
|
+
assert_equal 3, @conns.size
|
537
|
+
|
538
|
+
assert_properties @conns[0], {
|
539
|
+
:connectable => @block,
|
540
|
+
:page => @page,
|
541
|
+
:page_version => 2,
|
542
|
+
:connectable_version => 1
|
543
|
+
}
|
544
|
+
|
545
|
+
assert_properties @conns[1], {
|
546
|
+
:connectable => @block,
|
547
|
+
:page => @page,
|
548
|
+
:page_version => 3,
|
549
|
+
:connectable_version => 1
|
550
|
+
}
|
551
|
+
|
552
|
+
assert_properties @conns[2], {
|
553
|
+
:connectable => @block2,
|
554
|
+
:page => @page,
|
555
|
+
:page_version => 3,
|
556
|
+
:connectable_version => 1
|
557
|
+
}
|
558
|
+
|
559
|
+
@conns = @page.connectors.for_page_version(4).all(:order => "id")
|
560
|
+
assert_equal 3, @conns.size
|
561
|
+
|
562
|
+
assert_properties @conns[0], {
|
563
|
+
:connectable => @block,
|
564
|
+
:page => @page,
|
565
|
+
:page_version => 4,
|
566
|
+
:connectable_version => 1
|
567
|
+
}
|
568
|
+
|
569
|
+
assert_properties @conns[1], {
|
570
|
+
:connectable => @block2,
|
571
|
+
:page => @page,
|
572
|
+
:page_version => 4,
|
573
|
+
:connectable_version => 1
|
574
|
+
}
|
575
|
+
|
576
|
+
assert_properties @conns[2], {
|
577
|
+
:connectable => @block2,
|
578
|
+
:page => @page,
|
579
|
+
:page_version => 4,
|
580
|
+
:connectable_version => 1
|
581
|
+
}
|
582
|
+
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
class PageWithTwoBlocksTest < ActiveSupport::TestCase
|
587
|
+
def setup
|
588
|
+
super
|
589
|
+
@page = Factory(:page, :section => root_section)
|
590
|
+
@foo_block = Factory(:html_block, :name => "Foo Block")
|
591
|
+
@bar_block = Factory(:html_block, :name => "Bar Block")
|
592
|
+
@page.create_connector(@foo_block, "whatever")
|
593
|
+
@page.reload
|
594
|
+
@page.create_connector(@bar_block, "whatever")
|
595
|
+
@page.reload
|
596
|
+
end
|
597
|
+
|
598
|
+
def test_editing_one_of_the_blocks_creates_a_new_version_of_the_page
|
599
|
+
page_version = @page.draft.version
|
600
|
+
@foo_block.update_attributes(:name => "Something Else")
|
601
|
+
assert_incremented page_version, @page.draft.version
|
602
|
+
end
|
603
|
+
|
604
|
+
# A page that had 2 blocks added to it and then had them removed,
|
605
|
+
# when reverting to the previous version,
|
606
|
+
# should restore the connectors from the version being reverted to
|
607
|
+
def test_removing_and_reverting_to_previous_version
|
608
|
+
remove_both_connectors!
|
609
|
+
|
610
|
+
connector_count = Cms::Connector.count
|
611
|
+
|
612
|
+
@page.revert
|
613
|
+
|
614
|
+
assert_incremented connector_count, Cms::Connector.count
|
615
|
+
assert_properties @page.reload.connectors.for_page_version(@page.draft.version).first, {
|
616
|
+
:page => @page,
|
617
|
+
:page_version => 6,
|
618
|
+
:connectable => @bar_block,
|
619
|
+
:connectable_version => 1,
|
620
|
+
:container => "whatever"}
|
621
|
+
end
|
622
|
+
|
623
|
+
# A page that had 2 blocks added to it and then had then removed,
|
624
|
+
# when reverting to the version that had both connectors,
|
625
|
+
# should restore the connectors that version
|
626
|
+
def test_removing_and_reverting_to_version_with_both_connectors
|
627
|
+
remove_both_connectors!
|
628
|
+
|
629
|
+
connector_count = Cms::Connector.count
|
630
|
+
|
631
|
+
@page.revert_to(3)
|
632
|
+
|
633
|
+
assert_equal connector_count + 2, Cms::Connector.count
|
634
|
+
|
635
|
+
foo, bar = @page.reload.connectors.for_page_version(@page.draft.version).find(:all, :order => "#{Cms::Connector.table_name}.position")
|
636
|
+
|
637
|
+
assert_properties foo, {
|
638
|
+
:page => @page,
|
639
|
+
:page_version => 6,
|
640
|
+
:connectable => @foo_block,
|
641
|
+
:connectable_version => 1,
|
642
|
+
:container => "whatever"}
|
643
|
+
assert_properties bar, {
|
644
|
+
:page => @page,
|
645
|
+
:page_version => 6,
|
646
|
+
:connectable => @bar_block,
|
647
|
+
:connectable_version => 1,
|
648
|
+
:container => "whatever"}
|
649
|
+
|
650
|
+
end
|
651
|
+
|
652
|
+
def test_updating_one_of_the_blocks_and_reverting_to_version_before_the_update
|
653
|
+
target_version = @page.draft.version
|
654
|
+
@foo_block.update_attributes!(:name => "Foo V2")
|
655
|
+
@page.reload
|
656
|
+
|
657
|
+
page_version = @page.draft.version
|
658
|
+
foo_block_version = @foo_block.draft.version
|
659
|
+
|
660
|
+
@page.revert_to(target_version)
|
661
|
+
|
662
|
+
assert_incremented page_version, @page.draft.version
|
663
|
+
assert_incremented foo_block_version, @foo_block.draft.version
|
664
|
+
assert_equal "Foo Block", @page.connectors.for_page_version(@page.draft.version).reload.first.connectable.name
|
665
|
+
end
|
666
|
+
|
667
|
+
protected
|
668
|
+
def remove_both_connectors!
|
669
|
+
@page.remove_connector(@page.connectors.for_page_version(@page.draft.version).first(:order => "#{Cms::Connector.table_name}.position"))
|
670
|
+
@page.remove_connector(@page.connectors.for_page_version(@page.draft.version).first(:order => "#{Cms::Connector.table_name}.position"))
|
671
|
+
end
|
672
|
+
|
673
|
+
|
674
|
+
end
|
675
|
+
|
676
|
+
class PageWithBlockTest < ActiveSupport::TestCase
|
677
|
+
def setup
|
678
|
+
@page = Factory(:page, :section => root_section)
|
679
|
+
@block = Factory(:html_block)
|
680
|
+
@conn = @page.create_connector(@block, "bar")
|
681
|
+
@page.publish!
|
682
|
+
@conn = @page.connectors.for_page_version(@page.version).for_connectable(@block).first
|
683
|
+
end
|
684
|
+
|
685
|
+
def test_removing_connector
|
686
|
+
page_version = @page.draft.version
|
687
|
+
page_version_count = Cms::Page::Version.count
|
688
|
+
assert @page.published?
|
689
|
+
|
690
|
+
@page.remove_connector(@conn)
|
691
|
+
|
692
|
+
assert_incremented page_version_count, Cms::Page::Version.count
|
693
|
+
|
694
|
+
assert_incremented page_version, @page.draft.version
|
695
|
+
|
696
|
+
conns = @page.connectors.for_page_version(@page.draft.version-1).all
|
697
|
+
assert_equal 1, conns.size
|
698
|
+
|
699
|
+
assert_properties conns.first, {
|
700
|
+
:page => @page,
|
701
|
+
:page_version => page_version,
|
702
|
+
:connectable => @block,
|
703
|
+
:connectable_version => @block.version
|
704
|
+
}
|
705
|
+
|
706
|
+
assert @page.reload.connectors.for_page_version(@page.draft.version).empty?
|
707
|
+
assert !@page.live?
|
708
|
+
end
|
709
|
+
|
710
|
+
def test_removing_multiple_connectors
|
711
|
+
@block2 = Factory(:html_block)
|
712
|
+
@conn2 = @page.create_connector(@block2, "bar")
|
713
|
+
@conn3 = @page.create_connector(@block2, "foo")
|
714
|
+
#Need to get the new connector that matches @conn2, otherwise you will delete an older version, not the latest connector
|
715
|
+
@conn2 = Cms::Connector.first(:conditions => {:page_id => @page.reload.id, :page_version => @page.draft.version, :connectable_id => @block2.id, :connectable_version => @block2.version, :container => "bar"})
|
716
|
+
@page.remove_connector(@conn2)
|
717
|
+
|
718
|
+
page_version_count = Cms::Page::Version.count
|
719
|
+
page_version = @page.draft.version
|
720
|
+
page_connector_count = @page.connectors.for_page_version(@page.draft.version).count
|
721
|
+
|
722
|
+
@conn = Cms::Connector.first(:conditions => {:page_id => @page.reload.id, :page_version => @page.draft.version, :connectable_id => @block2.id, :connectable_version => @block2.version, :container => "foo"})
|
723
|
+
@page.remove_connector(@conn)
|
724
|
+
@page.reload
|
725
|
+
|
726
|
+
assert_incremented page_version_count, Cms::Page::Version.count
|
727
|
+
assert_incremented page_version, @page.draft.version
|
728
|
+
assert_decremented page_connector_count, @page.connectors.for_page_version(@page.draft.version).count
|
729
|
+
|
730
|
+
conns = Cms::Connector.where("page_id = ?", @page.id).order("id")
|
731
|
+
|
732
|
+
assert_equal 9, conns.size
|
733
|
+
|
734
|
+
assert_properties conns[0], {:page => @page, :page_version => 2, :connectable => @block, :connectable_version => 1, :container => "bar", :position => 1}
|
735
|
+
assert_properties conns[1], {:page => @page, :page_version => 3, :connectable => @block, :connectable_version => 1, :container => "bar", :position => 1}
|
736
|
+
assert_properties conns[2], {:page => @page, :page_version => 3, :connectable => @block2, :connectable_version => 1, :container => "bar", :position => 2}
|
737
|
+
assert_properties conns[3], {:page => @page, :page_version => 4, :connectable => @block, :connectable_version => 1, :container => "bar", :position => 1}
|
738
|
+
assert_properties conns[4], {:page => @page, :page_version => 4, :connectable => @block2, :connectable_version => 1, :container => "bar", :position => 2}
|
739
|
+
assert_properties conns[5], {:page => @page, :page_version => 4, :connectable => @block2, :connectable_version => 1, :container => "foo", :position => 1}
|
740
|
+
assert_properties conns[6], {:page => @page, :page_version => 5, :connectable => @block, :connectable_version => 1, :container => "bar", :position => 1}
|
741
|
+
assert_properties conns[7], {:page => @page, :page_version => 5, :connectable => @block2, :connectable_version => 1, :container => "foo", :position => 1}
|
742
|
+
assert_properties conns[8], {:page => @page, :page_version => 6, :connectable => @block, :connectable_version => 1, :container => "bar", :position => 1}
|
743
|
+
end
|
744
|
+
|
745
|
+
end
|
746
|
+
|
747
|
+
class UnpublishedPageWithOnePublishedAndOneUnpublishedBlockTest < ActiveSupport::TestCase
|
748
|
+
def setup
|
749
|
+
@page = Factory(:page, :section => root_section)
|
750
|
+
@published_block = Factory(:html_block, :name => "Published")
|
751
|
+
@unpublished_block = Factory(:html_block, :name => "Unpublished")
|
752
|
+
@page.create_connector(@published_block, "main")
|
753
|
+
@page.create_connector(@unpublished_block, "main")
|
754
|
+
@published_block.publish!
|
755
|
+
@page.reload
|
756
|
+
end
|
757
|
+
|
758
|
+
def test_publishing_the_block
|
759
|
+
@unpublished_block.publish!
|
760
|
+
assert @unpublished_block.reload.published?
|
761
|
+
@page.reload
|
762
|
+
assert !@page.live?
|
763
|
+
end
|
764
|
+
|
765
|
+
def test_publishing_the_page
|
766
|
+
page_version_count = Cms::Page::Version.count
|
767
|
+
unpublished_block_version_count = @unpublished_block.versions.count
|
768
|
+
published_block_version_count = @published_block.versions.count
|
769
|
+
|
770
|
+
@page.publish!
|
771
|
+
|
772
|
+
assert_equal page_version_count, Cms::Page::Version.count
|
773
|
+
assert_equal unpublished_block_version_count, @unpublished_block.versions.count
|
774
|
+
assert_equal published_block_version_count, @published_block.versions.count
|
775
|
+
assert @page.live?
|
776
|
+
assert @unpublished_block.reload.live?
|
777
|
+
assert @published_block.reload.live?
|
778
|
+
end
|
779
|
+
|
780
|
+
end
|
781
|
+
|
782
|
+
class RevertingABlockThatIsOnMultiplePagesTest < ActiveSupport::TestCase
|
783
|
+
def test_that_it_reverts_both_pages
|
784
|
+
Cms::Page.delete_all
|
785
|
+
|
786
|
+
# 1. Create a new page (Page 1, v1)
|
787
|
+
@page1 = Factory(:page, :name => "Page 1")
|
788
|
+
assert_equal 1, @page1.version
|
789
|
+
|
790
|
+
# 2. Create a new page (Page 2, v1)
|
791
|
+
@page2 = Factory(:page, :name => "Page 2")
|
792
|
+
|
793
|
+
# 3. Add a new html block to Page 1. Save, don't publish. (Page 1, v2)
|
794
|
+
@block = Factory(:html_block, :name => "Block v1",
|
795
|
+
:connect_to_page_id => @page1.id, :connect_to_container => "main")
|
796
|
+
reset(:page1, :page2, :block)
|
797
|
+
assert_equal 2, @page1.draft.version
|
798
|
+
assert_equal 1, @page2.draft.version
|
799
|
+
|
800
|
+
# 4. Goto page 2, and select that block. (Page 2, v2)
|
801
|
+
@page2.create_connector(@block, "main")
|
802
|
+
reset(:page1, :page2, :block)
|
803
|
+
assert_equal 2, @page1.draft.version
|
804
|
+
assert_equal 2, @page2.draft.version
|
805
|
+
|
806
|
+
# 5. Edit the block (Page 1, v3, Page 2, v3, Block v2)
|
807
|
+
@block.update_attributes!(:name => "Block v2")
|
808
|
+
reset(:page1, :page2, :block)
|
809
|
+
assert_equal 3, @page1.draft.version
|
810
|
+
assert_equal 3, @page2.draft.version
|
811
|
+
assert_equal 2, @block.draft.version
|
812
|
+
|
813
|
+
# 6. Revert page 1 to version 2. (Page 1, v4, Page 2, v4, Block v3)
|
814
|
+
@page1.revert_to(2)
|
815
|
+
reset(:page1, :page2, :block)
|
816
|
+
assert_equal 4, @page1.draft.version
|
817
|
+
assert_equal 3, @block.draft.version
|
818
|
+
assert_equal 4, @page2.draft.version
|
819
|
+
|
820
|
+
# Expected: Both page 1 and 2 will display the same version of the block (v1).
|
821
|
+
assert_equal "Block v1", @page1.connectors.first.connectable.name
|
822
|
+
assert_equal "Block v1", @page2.connectors.first.connectable.name
|
823
|
+
|
824
|
+
end
|
825
|
+
|
826
|
+
end
|
827
|
+
|
828
|
+
class ViewingAPreviousVersionOfAPageTest < ActiveSupport::TestCase
|
829
|
+
|
830
|
+
def test_that_it_shows_the_correct_version_of_the_blocks_it_is_connected_to
|
831
|
+
# 1. Create Page A (v1)
|
832
|
+
@page = Factory(:page, :section => root_section)
|
833
|
+
|
834
|
+
# 2. Add new Html Block A to Page A (Page A v2, Block A v1)
|
835
|
+
@block = Factory(:html_block, :name => "Block 1", :connect_to_page_id => @page.id, :connect_to_container => "main")
|
836
|
+
reset(:page, :block)
|
837
|
+
assert_equal 2, @page.draft.version
|
838
|
+
assert_equal 1, @block.draft.version
|
839
|
+
|
840
|
+
# 3. Publish Page A (Page A v3, Block A v2)
|
841
|
+
@page.publish!
|
842
|
+
reset(:page, :block)
|
843
|
+
assert_equal 2, @page.draft.version
|
844
|
+
assert_equal 1, @block.draft.version
|
845
|
+
|
846
|
+
# 4. Edit Block A (Page A v4, Block A v3)
|
847
|
+
@block.update_attributes!(:name => "Block 2")
|
848
|
+
reset(:page, :block)
|
849
|
+
assert_equal 2, @page.version
|
850
|
+
assert_equal 3, @page.draft.version
|
851
|
+
assert_equal 2, @block.draft.version
|
852
|
+
|
853
|
+
# Open Page A in a different browser (as guest)
|
854
|
+
@live_page = Cms::Page.find_live_by_path(@page.path)
|
855
|
+
assert_equal 2, @live_page.version
|
856
|
+
assert_equal "Block 1", @live_page.connectors.for_page_version(@live_page.version).first.connectable.live_version.name
|
857
|
+
|
858
|
+
end
|
859
|
+
end
|
860
|
+
|
861
|
+
class PortletsDontHaveDraftsTest < ActiveSupport::TestCase
|
862
|
+
|
863
|
+
def test_connectors_with_portlets_should_correctly_be_copied
|
864
|
+
@page = Factory(:page, :section => root_section)
|
865
|
+
@portlet = TagCloudPortlet.create(:name => "Portlet", :connect_to_page_id => @page.id, :connect_to_container => "main")
|
866
|
+
|
867
|
+
# Check some assumptions.
|
868
|
+
assert_equal 2, @page.draft.version, "Verifying that adding a portlet correctly increments page version."
|
869
|
+
connectors = Cms::Connector.for_connectable(@portlet)
|
870
|
+
assert_equal 1, connectors.size, "This portlet should have only 1 connector."
|
871
|
+
|
872
|
+
# Verifies that an exception is not thrown while removing connectors
|
873
|
+
@page.remove_connector(connectors[0])
|
874
|
+
|
875
|
+
assert_equal 3, @page.draft.version
|
876
|
+
assert @page.reload.connectors.for_page_version(@page.draft.version).empty?, "Verify that all connectors for the latest page are removed."
|
877
|
+
end
|
878
|
+
end
|
879
|
+
end
|