refinerycms 0.9.9 → 0.9.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/Gemfile +8 -24
- data/Gemfile.lock +94 -69
- data/Rakefile +1 -1
- data/bin/refinerycms +118 -109
- data/changelog.md +13 -2
- data/config/cucumber.yml +3 -7
- data/config/settings.rb +0 -1
- data/lib/refinery.rb +14 -1
- data/lib/refinerycms.rb +2 -9
- data/refinerycms.gemspec +15 -855
- data/spec/spec_helper.rb +3 -2
- metadata +27 -907
- data/authentication/app/controllers/admin/users_controller.rb +0 -90
- data/authentication/app/controllers/passwords_controller.rb +0 -43
- data/authentication/app/controllers/registrations_controller.rb +0 -67
- data/authentication/app/controllers/sessions_controller.rb +0 -23
- data/authentication/app/helpers/sessions_helper.rb +0 -2
- data/authentication/app/helpers/users_helper.rb +0 -2
- data/authentication/app/mailers/user_mailer.rb +0 -20
- data/authentication/app/models/role.rb +0 -16
- data/authentication/app/models/roles_users.rb +0 -6
- data/authentication/app/models/user.rb +0 -58
- data/authentication/app/models/user_plugin.rb +0 -5
- data/authentication/app/views/admin/users/_form.html.erb +0 -92
- data/authentication/app/views/admin/users/_user.html.erb +0 -19
- data/authentication/app/views/admin/users/_users.html.erb +0 -4
- data/authentication/app/views/admin/users/edit.html.erb +0 -1
- data/authentication/app/views/admin/users/index.html.erb +0 -12
- data/authentication/app/views/admin/users/new.html.erb +0 -1
- data/authentication/app/views/layouts/login.html.erb +0 -21
- data/authentication/app/views/passwords/edit.html.erb +0 -31
- data/authentication/app/views/passwords/new.html.erb +0 -18
- data/authentication/app/views/registrations/new.html.erb +0 -41
- data/authentication/app/views/sessions/new.html.erb +0 -29
- data/authentication/app/views/user_mailer/reset_notification.html.erb +0 -12
- data/authentication/app/views/user_mailer/reset_notification.text.plain.erb +0 -7
- data/authentication/config/locales/cs.yml +0 -75
- data/authentication/config/locales/da.yml +0 -72
- data/authentication/config/locales/de.yml +0 -72
- data/authentication/config/locales/el.yml +0 -72
- data/authentication/config/locales/en.yml +0 -72
- data/authentication/config/locales/es.yml +0 -100
- data/authentication/config/locales/fr.yml +0 -72
- data/authentication/config/locales/it.yml +0 -97
- data/authentication/config/locales/lolcat.yml +0 -55
- data/authentication/config/locales/lt.yml +0 -55
- data/authentication/config/locales/lv.yml +0 -72
- data/authentication/config/locales/nb.yml +0 -72
- data/authentication/config/locales/nl.yml +0 -70
- data/authentication/config/locales/pl.yml +0 -100
- data/authentication/config/locales/pt-BR.yml +0 -68
- data/authentication/config/locales/rs.yml +0 -72
- data/authentication/config/locales/ru.yml +0 -97
- data/authentication/config/locales/sl.yml +0 -61
- data/authentication/config/locales/sv.yml +0 -64
- data/authentication/config/locales/zh-CN.yml +0 -72
- data/authentication/config/locales/zh-TW.yml +0 -72
- data/authentication/config/routes.rb +0 -31
- data/authentication/db/migrate/20100913234705_create_refinerycms_authentication_schema.rb +0 -43
- data/authentication/db/migrate/20100929035252_add_missing_indexes_to_roles_users.rb +0 -11
- data/authentication/db/migrate/20101206013505_change_to_devise_users_table.rb +0 -27
- data/authentication/db/migrate/20110106184757_add_remember_created_at_to_users.rb +0 -9
- data/authentication/features/lost_password.feature +0 -49
- data/authentication/features/manage_users.feature +0 -61
- data/authentication/features/step_definitions/lost_password.rb +0 -8
- data/authentication/features/step_definitions/user_steps.rb +0 -36
- data/authentication/features/support/factories.rb +0 -18
- data/authentication/features/support/paths.rb +0 -24
- data/authentication/lib/authenticated_system.rb +0 -29
- data/authentication/lib/authentication.rb +0 -30
- data/authentication/lib/generators/refinerycms_authentication_generator.rb +0 -8
- data/authentication/license.md +0 -21
- data/authentication/readme.md +0 -17
- data/authentication/refinerycms-authentication.gemspec +0 -20
- data/authentication/spec/models/user_spec.rb +0 -159
- data/base/db/migrate/20100913234706_create_refinerycms_core_schema.rb +0 -23
- data/base/db/migrate/20101217113424_add_locale_to_slugs.rb +0 -13
- data/base/features/step_definitions/web_steps.rb +0 -219
- data/base/features/support/env.rb +0 -84
- data/base/features/support/factories.rb +0 -1
- data/base/features/support/negative_expectations_helper.rb +0 -57
- data/base/features/support/paths.rb +0 -91
- data/base/lib/base.rb +0 -32
- data/base/lib/generators/refinerycms_base_generator.rb +0 -8
- data/base/lib/refinery.rb +0 -32
- data/base/lib/refinery/version.rb +0 -16
- data/base/license.md +0 -21
- data/base/refinerycms-base.gemspec +0 -18
- data/core/app/controllers/admin/base_controller.rb +0 -10
- data/core/app/controllers/admin/dialogs_controller.rb +0 -26
- data/core/app/controllers/admin/refinery_core_controller.rb +0 -12
- data/core/app/controllers/application_controller.rb +0 -6
- data/core/app/controllers/refinery/fast_controller.rb +0 -9
- data/core/app/controllers/sitemap_controller.rb +0 -14
- data/core/app/helpers/application_helper.rb +0 -5
- data/core/app/views/admin/_head.html.erb +0 -43
- data/core/app/views/admin/_javascripts.html.erb +0 -32
- data/core/app/views/admin/_menu.html.erb +0 -17
- data/core/app/views/admin/dialogs/show.html.erb +0 -19
- data/core/app/views/layouts/admin.html.erb +0 -24
- data/core/app/views/layouts/admin_dialog.html.erb +0 -14
- data/core/app/views/layouts/application.html.erb +0 -21
- data/core/app/views/shared/_content_page.html.erb +0 -63
- data/core/app/views/shared/_draft_page_message.html.erb +0 -3
- data/core/app/views/shared/_footer.html.erb +0 -4
- data/core/app/views/shared/_google_analytics.html.erb +0 -8
- data/core/app/views/shared/_head.html.erb +0 -42
- data/core/app/views/shared/_header.html.erb +0 -8
- data/core/app/views/shared/_html_tag.html.erb +0 -6
- data/core/app/views/shared/_ie6check.html.erb +0 -63
- data/core/app/views/shared/_javascripts.html.erb +0 -10
- data/core/app/views/shared/_menu.html.erb +0 -30
- data/core/app/views/shared/_menu_branch.html.erb +0 -26
- data/core/app/views/shared/_message.html.erb +0 -10
- data/core/app/views/shared/_no_script.html.erb +0 -9
- data/core/app/views/shared/_site_bar.html.erb +0 -25
- data/core/app/views/shared/admin/_continue_editing.html.erb +0 -3
- data/core/app/views/shared/admin/_error_messages.html.erb +0 -16
- data/core/app/views/shared/admin/_form_actions.html.erb +0 -77
- data/core/app/views/shared/admin/_image_picker.html.erb +0 -60
- data/core/app/views/shared/admin/_make_sortable.html.erb +0 -13
- data/core/app/views/shared/admin/_resource_picker.html.erb +0 -66
- data/core/app/views/shared/admin/_search.html.erb +0 -6
- data/core/app/views/shared/admin/_sortable_list.html.erb +0 -7
- data/core/app/views/shared/admin/_tabbed_fields.html.erb +0 -42
- data/core/app/views/welcome.html.erb +0 -17
- data/core/app/views/wymiframe.html.erb +0 -15
- data/core/config/locales/cs.yml +0 -77
- data/core/config/locales/da.yml +0 -75
- data/core/config/locales/de.yml +0 -75
- data/core/config/locales/el.yml +0 -75
- data/core/config/locales/en.yml +0 -75
- data/core/config/locales/es.yml +0 -68
- data/core/config/locales/fr.yml +0 -72
- data/core/config/locales/it.yml +0 -96
- data/core/config/locales/lolcat.yml +0 -68
- data/core/config/locales/lt.yml +0 -75
- data/core/config/locales/lv.yml +0 -72
- data/core/config/locales/nb.yml +0 -75
- data/core/config/locales/nl.yml +0 -75
- data/core/config/locales/pl.yml +0 -75
- data/core/config/locales/pt-BR.yml +0 -72
- data/core/config/locales/rs.yml +0 -76
- data/core/config/locales/ru.yml +0 -71
- data/core/config/locales/sl.yml +0 -72
- data/core/config/locales/sv.yml +0 -75
- data/core/config/locales/zh-CN.yml +0 -75
- data/core/config/locales/zh-TW.yml +0 -75
- data/core/config/routes.rb +0 -19
- data/core/crud.md +0 -197
- data/core/doc/included-jquery-ui-packages.jpg +0 -0
- data/core/engines.md +0 -179
- data/core/features/search.feature +0 -55
- data/core/features/site_bar.feature +0 -24
- data/core/features/step_definitions/core_steps.rb +0 -61
- data/core/features/support/paths.rb +0 -14
- data/core/features/uploads/beach.jpeg +0 -0
- data/core/features/uploads/refinery_is_awesome.txt +0 -1
- data/core/lib/core.rb +0 -143
- data/core/lib/generators/refinerycms_generator.rb +0 -107
- data/core/lib/generators/templates/.gitignore +0 -83
- data/core/lib/generators/templates/.rspec +0 -2
- data/core/lib/generators/templates/app/views/sitemap/index.xml.builder +0 -22
- data/core/lib/generators/templates/autotest/autotest.rb +0 -17
- data/core/lib/generators/templates/autotest/discover.rb +0 -2
- data/core/lib/generators/templates/config/cucumber.yml +0 -15
- data/core/lib/generators/templates/config/database.yml.mysql +0 -20
- data/core/lib/generators/templates/config/database.yml.postgresql +0 -57
- data/core/lib/generators/templates/config/database.yml.sqlite3 +0 -26
- data/core/lib/generators/templates/config/i18n-js.yml +0 -6
- data/core/lib/generators/templates/config/initializers/devise.rb +0 -142
- data/core/lib/generators/templates/config/settings.rb +0 -3
- data/core/lib/generators/templates/db/seeds.rb +0 -5
- data/core/lib/generators/templates/spec/rcov.opts +0 -2
- data/core/lib/generators/templates/spec/spec_helper.rb +0 -76
- data/core/lib/refinery/activity.rb +0 -45
- data/core/lib/refinery/admin/base_controller.rb +0 -111
- data/core/lib/refinery/admin_base_controller.rb +0 -5
- data/core/lib/refinery/application.rb +0 -76
- data/core/lib/refinery/application_controller.rb +0 -116
- data/core/lib/refinery/application_helper.rb +0 -19
- data/core/lib/refinery/base_presenter.rb +0 -27
- data/core/lib/refinery/catch_all_routes.rb +0 -11
- data/core/lib/refinery/crud.rb +0 -295
- data/core/lib/refinery/helpers/form_helper.rb +0 -66
- data/core/lib/refinery/helpers/head_helper.rb +0 -17
- data/core/lib/refinery/helpers/html_truncation_helper.rb +0 -25
- data/core/lib/refinery/helpers/image_helper.rb +0 -49
- data/core/lib/refinery/helpers/menu_helper.rb +0 -68
- data/core/lib/refinery/helpers/meta_helper.rb +0 -67
- data/core/lib/refinery/helpers/pagination_helper.rb +0 -16
- data/core/lib/refinery/helpers/script_helper.rb +0 -36
- data/core/lib/refinery/helpers/site_bar_helper.rb +0 -24
- data/core/lib/refinery/helpers/tag_helper.rb +0 -21
- data/core/lib/refinery/helpers/translation_helper.rb +0 -17
- data/core/lib/refinery/link_renderer.rb +0 -55
- data/core/lib/refinery/plugin.rb +0 -134
- data/core/lib/refinery/plugins.rb +0 -75
- data/core/lib/tasks/cucumber.rake +0 -53
- data/core/lib/tasks/doc.rake +0 -29
- data/core/lib/tasks/refinery.rake +0 -231
- data/core/lib/tasks/yard.rake +0 -30
- data/core/license.md +0 -21
- data/core/public/404.html +0 -26
- data/core/public/422.html +0 -26
- data/core/public/500.html +0 -26
- data/core/public/favicon.ico +0 -0
- data/core/public/images/refinery/add.png +0 -0
- data/core/public/images/refinery/admin_bg.png +0 -0
- data/core/public/images/refinery/ajax-loader.gif +0 -0
- data/core/public/images/refinery/branch-end.gif +0 -0
- data/core/public/images/refinery/branch-start.gif +0 -0
- data/core/public/images/refinery/branch.gif +0 -0
- data/core/public/images/refinery/carousel-left.png +0 -0
- data/core/public/images/refinery/carousel-right.png +0 -0
- data/core/public/images/refinery/cross.png +0 -0
- data/core/public/images/refinery/dialogLoadingAnimation.gif +0 -0
- data/core/public/images/refinery/header_background.png +0 -0
- data/core/public/images/refinery/hover-gradient.jpg +0 -0
- data/core/public/images/refinery/icons/accept.png +0 -0
- data/core/public/images/refinery/icons/add.png +0 -0
- data/core/public/images/refinery/icons/ajax-loader.gif +0 -0
- data/core/public/images/refinery/icons/application_edit.png +0 -0
- data/core/public/images/refinery/icons/application_go.png +0 -0
- data/core/public/images/refinery/icons/arrow_left.png +0 -0
- data/core/public/images/refinery/icons/arrow_switch.png +0 -0
- data/core/public/images/refinery/icons/arrow_up.png +0 -0
- data/core/public/images/refinery/icons/bin.png +0 -0
- data/core/public/images/refinery/icons/bin_closed.png +0 -0
- data/core/public/images/refinery/icons/cancel.png +0 -0
- data/core/public/images/refinery/icons/cog_add.png +0 -0
- data/core/public/images/refinery/icons/cog_edit.png +0 -0
- data/core/public/images/refinery/icons/cross.png +0 -0
- data/core/public/images/refinery/icons/delete.png +0 -0
- data/core/public/images/refinery/icons/doc.png +0 -0
- data/core/public/images/refinery/icons/down.gif +0 -0
- data/core/public/images/refinery/icons/edit.png +0 -0
- data/core/public/images/refinery/icons/email.png +0 -0
- data/core/public/images/refinery/icons/email_edit.png +0 -0
- data/core/public/images/refinery/icons/email_go.png +0 -0
- data/core/public/images/refinery/icons/email_open.png +0 -0
- data/core/public/images/refinery/icons/eye.png +0 -0
- data/core/public/images/refinery/icons/folder_page_white.png +0 -0
- data/core/public/images/refinery/icons/image_add.png +0 -0
- data/core/public/images/refinery/icons/image_edit.png +0 -0
- data/core/public/images/refinery/icons/img.png +0 -0
- data/core/public/images/refinery/icons/information.png +0 -0
- data/core/public/images/refinery/icons/layout_add.png +0 -0
- data/core/public/images/refinery/icons/layout_edit.png +0 -0
- data/core/public/images/refinery/icons/music.png +0 -0
- data/core/public/images/refinery/icons/page_add.png +0 -0
- data/core/public/images/refinery/icons/page_edit.png +0 -0
- data/core/public/images/refinery/icons/page_white_edit.png +0 -0
- data/core/public/images/refinery/icons/page_white_gear.png +0 -0
- data/core/public/images/refinery/icons/page_white_put.png +0 -0
- data/core/public/images/refinery/icons/pdf.png +0 -0
- data/core/public/images/refinery/icons/ppt.png +0 -0
- data/core/public/images/refinery/icons/star.png +0 -0
- data/core/public/images/refinery/icons/tick.png +0 -0
- data/core/public/images/refinery/icons/up.gif +0 -0
- data/core/public/images/refinery/icons/user_add.png +0 -0
- data/core/public/images/refinery/icons/user_comment.png +0 -0
- data/core/public/images/refinery/icons/user_edit.png +0 -0
- data/core/public/images/refinery/icons/xls.png +0 -0
- data/core/public/images/refinery/icons/zip.png +0 -0
- data/core/public/images/refinery/icons/zoom.png +0 -0
- data/core/public/images/refinery/logo-large.png +0 -0
- data/core/public/images/refinery/logo-medium.png +0 -0
- data/core/public/images/refinery/logo-site-bar.png +0 -0
- data/core/public/images/refinery/logo-small-medium.png +0 -0
- data/core/public/images/refinery/logo-small.png +0 -0
- data/core/public/images/refinery/logo-tiny.png +0 -0
- data/core/public/images/refinery/logo.png +0 -0
- data/core/public/images/refinery/nav-3-background.gif +0 -0
- data/core/public/images/refinery/nav_inactive_background.png +0 -0
- data/core/public/images/refinery/orange_button.png +0 -0
- data/core/public/images/refinery/page_bg.png +0 -0
- data/core/public/images/refinery/resolve_digital_footer_logo.png +0 -0
- data/core/public/images/refinery/text_field_background.png +0 -0
- data/core/public/images/refinery/tooltip-nib.gif +0 -0
- data/core/public/images/refinery/tooltip-nib.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/arrow_redo.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/arrow_undo.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/eye.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-blockquote.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-h1.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-h2.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-h3.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-h4.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-h5.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-h6.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-p.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/iframe/lbl-pre.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/link_add.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/link_break.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/page_code.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/page_paste.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/photo_add.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/right.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/style.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/table_add.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_align_center.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_align_justify.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_align_left.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_align_right.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_bold.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_heading_1.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_heading_2.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_heading_3.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_heading_4.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_heading_5.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_heading_6.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_indent.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_indent_remove.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_italic.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_list_bullets.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_list_numbers.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_paragraph.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_strikethrough.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_subscript.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_superscript.png +0 -0
- data/core/public/images/wymeditor/skins/refinery/text_underline.png +0 -0
- data/core/public/images/wymeditor/skins/wymeditor_icon.png +0 -0
- data/core/public/javascripts/admin.js +0 -7
- data/core/public/javascripts/application.js +0 -1
- data/core/public/javascripts/dd_belatedpng.js +0 -13
- data/core/public/javascripts/i18n-messages.js +0 -2
- data/core/public/javascripts/jquery-min.js +0 -154
- data/core/public/javascripts/jquery-ui-custom-min.js +0 -249
- data/core/public/javascripts/jquery.js +0 -6240
- data/core/public/javascripts/jquery/GPL-LICENSE.txt +0 -278
- data/core/public/javascripts/jquery/MIT-LICENSE.txt +0 -20
- data/core/public/javascripts/jquery/jquery.corner.js +0 -345
- data/core/public/javascripts/jquery/jquery.html5-placeholder-shim.js +0 -88
- data/core/public/javascripts/jquery/jquery.jcarousel.js +0 -900
- data/core/public/javascripts/jquery/jquery.textTruncate.js +0 -174
- data/core/public/javascripts/jquery/jquery.timers.js +0 -138
- data/core/public/javascripts/modernizr-min.js +0 -30
- data/core/public/javascripts/rails.js +0 -152
- data/core/public/javascripts/refinery/admin.js +0 -1114
- data/core/public/javascripts/refinery/boot_wym.js +0 -285
- data/core/public/javascripts/refinery/core.js +0 -18
- data/core/public/javascripts/refinery/i18n.js +0 -340
- data/core/public/javascripts/refinery/nestedsortables.js +0 -164
- data/core/public/javascripts/refinery/serializelist.js +0 -66
- data/core/public/javascripts/refinery/site_bar.js +0 -16
- data/core/public/javascripts/refinery/submenu.js +0 -49
- data/core/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +0 -5142
- data/core/public/javascripts/wymeditor/lang/ca.js +0 -45
- data/core/public/javascripts/wymeditor/lang/cs.js +0 -45
- data/core/public/javascripts/wymeditor/lang/da.js +0 -48
- data/core/public/javascripts/wymeditor/lang/de.js +0 -45
- data/core/public/javascripts/wymeditor/lang/en.js +0 -47
- data/core/public/javascripts/wymeditor/lang/es.js +0 -45
- data/core/public/javascripts/wymeditor/lang/fa.js +0 -46
- data/core/public/javascripts/wymeditor/lang/fr.js +0 -45
- data/core/public/javascripts/wymeditor/lang/he.js +0 -45
- data/core/public/javascripts/wymeditor/lang/hu.js +0 -45
- data/core/public/javascripts/wymeditor/lang/it.js +0 -45
- data/core/public/javascripts/wymeditor/lang/lv.js +0 -47
- data/core/public/javascripts/wymeditor/lang/nb.js +0 -48
- data/core/public/javascripts/wymeditor/lang/nl.js +0 -47
- data/core/public/javascripts/wymeditor/lang/nn.js +0 -45
- data/core/public/javascripts/wymeditor/lang/pl.js +0 -45
- data/core/public/javascripts/wymeditor/lang/pt-BR.js +0 -47
- data/core/public/javascripts/wymeditor/lang/pt.js +0 -45
- data/core/public/javascripts/wymeditor/lang/rs.js +0 -47
- data/core/public/javascripts/wymeditor/lang/ru.js +0 -45
- data/core/public/javascripts/wymeditor/lang/sl.js +0 -47
- data/core/public/javascripts/wymeditor/lang/sv.js +0 -45
- data/core/public/javascripts/wymeditor/lang/tr.js +0 -45
- data/core/public/javascripts/wymeditor/lang/zh_cn.js +0 -47
- data/core/public/javascripts/wymeditor/skins/refinery/skin.js +0 -48
- data/core/public/robots.txt +0 -3
- data/core/public/stylesheets/application.css +0 -4
- data/core/public/stylesheets/formatting.css +0 -4
- data/core/public/stylesheets/home.css +0 -4
- data/core/public/stylesheets/refinery/application.css +0 -72
- data/core/public/stylesheets/refinery/formatting.css +0 -57
- data/core/public/stylesheets/refinery/home.css +0 -0
- data/core/public/stylesheets/refinery/refinery.css +0 -1572
- data/core/public/stylesheets/refinery/site_bar.css +0 -87
- data/core/public/stylesheets/refinery/submenu.css +0 -22
- data/core/public/stylesheets/refinery/theme.css +0 -36
- data/core/public/stylesheets/refinery/tooltips.css +0 -34
- data/core/public/stylesheets/refinery/ui.css +0 -107
- data/core/public/stylesheets/theme.css +0 -4
- data/core/public/stylesheets/wymeditor/skins/refinery/skin.css +0 -528
- data/core/public/stylesheets/wymeditor/skins/refinery/wymiframe.css +0 -96
- data/core/public/wymeditor/GPL-license.txt +0 -278
- data/core/public/wymeditor/MIT-license.txt +0 -20
- data/core/public/wymeditor/README +0 -35
- data/core/refinerycms-core.gemspec +0 -20
- data/core/spec/lib/refinery/plugins_spec.rb +0 -90
- data/dashboard/app/controllers/admin/dashboard_controller.rb +0 -38
- data/dashboard/app/helpers/admin/dashboard_helper.rb +0 -24
- data/dashboard/app/views/admin/dashboard/_additional_dashboard_menu_items.html.erb +0 -1
- data/dashboard/app/views/admin/dashboard/_recent_activity.html.erb +0 -14
- data/dashboard/app/views/admin/dashboard/_recent_inquiries.html.erb +0 -11
- data/dashboard/app/views/admin/dashboard/index.html.erb +0 -70
- data/dashboard/app/views/admin/dashboard/index.rss.builder +0 -26
- data/dashboard/config/locales/cs.yml +0 -25
- data/dashboard/config/locales/da.yml +0 -25
- data/dashboard/config/locales/de.yml +0 -25
- data/dashboard/config/locales/el.yml +0 -25
- data/dashboard/config/locales/en.yml +0 -25
- data/dashboard/config/locales/es.yml +0 -28
- data/dashboard/config/locales/fr.yml +0 -25
- data/dashboard/config/locales/it.yml +0 -27
- data/dashboard/config/locales/lolcat.yml +0 -24
- data/dashboard/config/locales/lt.yml +0 -25
- data/dashboard/config/locales/lv.yml +0 -27
- data/dashboard/config/locales/nb.yml +0 -25
- data/dashboard/config/locales/nl.yml +0 -25
- data/dashboard/config/locales/pl.yml +0 -29
- data/dashboard/config/locales/pt-BR.yml +0 -29
- data/dashboard/config/locales/rs.yml +0 -26
- data/dashboard/config/locales/ru.yml +0 -29
- data/dashboard/config/locales/sl.yml +0 -24
- data/dashboard/config/locales/sv.yml +0 -25
- data/dashboard/config/locales/zh-CN.yml +0 -25
- data/dashboard/config/locales/zh-TW.yml +0 -25
- data/dashboard/config/routes.rb +0 -11
- data/dashboard/features/dashboard.feature +0 -35
- data/dashboard/features/support/paths.rb +0 -14
- data/dashboard/lib/dashboard.rb +0 -19
- data/dashboard/license.md +0 -21
- data/dashboard/readme.md +0 -22
- data/dashboard/refinerycms-dashboard.gemspec +0 -20
- data/images/app/controllers/admin/images_controller.rb +0 -108
- data/images/app/helpers/admin/images_helper.rb +0 -27
- data/images/app/models/image.rb +0 -72
- data/images/app/views/admin/images/_existing_image.html.erb +0 -73
- data/images/app/views/admin/images/_form.html.erb +0 -54
- data/images/app/views/admin/images/_grid_view.html.erb +0 -19
- data/images/app/views/admin/images/_images.html.erb +0 -2
- data/images/app/views/admin/images/_list_view.html.erb +0 -10
- data/images/app/views/admin/images/_list_view_image.html.erb +0 -17
- data/images/app/views/admin/images/edit.html.erb +0 -1
- data/images/app/views/admin/images/index.html.erb +0 -38
- data/images/app/views/admin/images/insert.html.erb +0 -47
- data/images/app/views/admin/images/new.html.erb +0 -1
- data/images/config/locales/cs.yml +0 -41
- data/images/config/locales/da.yml +0 -41
- data/images/config/locales/de.yml +0 -41
- data/images/config/locales/el.yml +0 -41
- data/images/config/locales/en.yml +0 -41
- data/images/config/locales/es.yml +0 -40
- data/images/config/locales/fr.yml +0 -41
- data/images/config/locales/it.yml +0 -47
- data/images/config/locales/lolcat.yml +0 -41
- data/images/config/locales/lt.yml +0 -41
- data/images/config/locales/lv.yml +0 -41
- data/images/config/locales/nb.yml +0 -42
- data/images/config/locales/nl.yml +0 -40
- data/images/config/locales/pl.yml +0 -42
- data/images/config/locales/pt-BR.yml +0 -42
- data/images/config/locales/rs.yml +0 -42
- data/images/config/locales/ru.yml +0 -41
- data/images/config/locales/sl.yml +0 -40
- data/images/config/locales/sv.yml +0 -41
- data/images/config/locales/zh-CN.yml +0 -41
- data/images/config/locales/zh-TW.yml +0 -41
- data/images/config/routes.rb +0 -11
- data/images/db/migrate/20100913234707_create_refinerycms_images_schema.rb +0 -23
- data/images/features/manage_images.feature +0 -49
- data/images/features/step_definitions/image_steps.rb +0 -40
- data/images/features/support/factories.rb +0 -5
- data/images/features/support/paths.rb +0 -17
- data/images/features/uploads/beach.jpeg +0 -0
- data/images/features/uploads/id-rather-be-here.jpg +0 -0
- data/images/features/uploads/refinery_is_awesome.txt +0 -1
- data/images/lib/generators/refinerycms_images_generator.rb +0 -8
- data/images/lib/images.rb +0 -59
- data/images/license.md +0 -21
- data/images/readme.md +0 -34
- data/images/refinerycms-images.gemspec +0 -20
- data/images/spec/models/image_spec.rb +0 -87
- data/images/spec/uploads/beach.jpeg +0 -0
- data/pages/app/controllers/admin/page_parts_controller.rb +0 -24
- data/pages/app/controllers/admin/pages_controller.rb +0 -37
- data/pages/app/controllers/admin/pages_dialogs_controller.rb +0 -87
- data/pages/app/controllers/pages_controller.rb +0 -32
- data/pages/app/helpers/pages_helper.rb +0 -2
- data/pages/app/models/page.rb +0 -290
- data/pages/app/models/page_part.rb +0 -23
- data/pages/app/presenters/page_presenter.rb +0 -7
- data/pages/app/views/admin/pages/_form.html.erb +0 -61
- data/pages/app/views/admin/pages/_form_advanced_options.html.erb +0 -79
- data/pages/app/views/admin/pages/_form_advanced_options_seo.html.erb +0 -24
- data/pages/app/views/admin/pages/_form_fields_after_title.html.erb +0 -1
- data/pages/app/views/admin/pages/_form_new_page_parts.html.erb +0 -14
- data/pages/app/views/admin/pages/_form_page_parts.html.erb +0 -47
- data/pages/app/views/admin/pages/_locale_picker.html.erb +0 -11
- data/pages/app/views/admin/pages/_page.html.erb +0 -33
- data/pages/app/views/admin/pages/_page_part_field.html.erb +0 -5
- data/pages/app/views/admin/pages/_sortable_list.html.erb +0 -5
- data/pages/app/views/admin/pages/edit.html.erb +0 -1
- data/pages/app/views/admin/pages/index.html.erb +0 -40
- data/pages/app/views/admin/pages/new.html.erb +0 -1
- data/pages/app/views/admin/pages_dialogs/_page_link.html.erb +0 -13
- data/pages/app/views/admin/pages_dialogs/link_to.html.erb +0 -141
- data/pages/app/views/pages/home.html.erb +0 -1
- data/pages/app/views/pages/show.html.erb +0 -1
- data/pages/config/locales/cs.yml +0 -84
- data/pages/config/locales/da.yml +0 -84
- data/pages/config/locales/de.yml +0 -84
- data/pages/config/locales/el.yml +0 -84
- data/pages/config/locales/en.yml +0 -84
- data/pages/config/locales/es.yml +0 -83
- data/pages/config/locales/fr.yml +0 -84
- data/pages/config/locales/it.yml +0 -98
- data/pages/config/locales/lolcat.yml +0 -83
- data/pages/config/locales/lt.yml +0 -85
- data/pages/config/locales/lv.yml +0 -86
- data/pages/config/locales/nb.yml +0 -85
- data/pages/config/locales/nl.yml +0 -81
- data/pages/config/locales/pl.yml +0 -85
- data/pages/config/locales/pt-BR.yml +0 -85
- data/pages/config/locales/rs.yml +0 -84
- data/pages/config/locales/ru.yml +0 -108
- data/pages/config/locales/sl.yml +0 -83
- data/pages/config/locales/sv.yml +0 -84
- data/pages/config/locales/zh-CN.yml +0 -84
- data/pages/config/locales/zh-TW.yml +0 -84
- data/pages/config/routes.rb +0 -21
- data/pages/db/migrate/20100913234708_create_refinerycms_pages_schema.rb +0 -53
- data/pages/db/migrate/20101214040815_translate_page_plugin.rb +0 -29
- data/pages/db/migrate/20101216194133_remove_cached_slug_from_pages.rb +0 -9
- data/pages/db/seeds/pages.rb +0 -43
- data/pages/features/manage_pages.feature +0 -47
- data/pages/features/step_definitions/page_steps.rb +0 -53
- data/pages/features/support/paths.rb +0 -26
- data/pages/features/visit_pages.feature +0 -47
- data/pages/lib/generators/refinerycms_pages_generator.rb +0 -8
- data/pages/lib/pages.rb +0 -36
- data/pages/lib/pages/marketable_routes.rb +0 -3
- data/pages/lib/pages/tabs.rb +0 -30
- data/pages/license.md +0 -21
- data/pages/readme.md +0 -156
- data/pages/refinerycms-pages.gemspec +0 -21
- data/pages/spec/models/page_spec.rb +0 -155
- data/resources/app/controllers/admin/resources_controller.rb +0 -89
- data/resources/app/models/resource.rb +0 -53
- data/resources/app/views/admin/resources/_existing_resource.html.erb +0 -32
- data/resources/app/views/admin/resources/_form.html.erb +0 -55
- data/resources/app/views/admin/resources/_resource.html.erb +0 -17
- data/resources/app/views/admin/resources/_resources.html.erb +0 -10
- data/resources/app/views/admin/resources/edit.html.erb +0 -1
- data/resources/app/views/admin/resources/index.html.erb +0 -31
- data/resources/app/views/admin/resources/insert.html.erb +0 -54
- data/resources/app/views/admin/resources/new.html.erb +0 -1
- data/resources/config/locales/cs.yml +0 -34
- data/resources/config/locales/da.yml +0 -34
- data/resources/config/locales/de.yml +0 -34
- data/resources/config/locales/el.yml +0 -34
- data/resources/config/locales/en.yml +0 -34
- data/resources/config/locales/es.yml +0 -33
- data/resources/config/locales/fr.yml +0 -34
- data/resources/config/locales/it.yml +0 -43
- data/resources/config/locales/lolcat.yml +0 -34
- data/resources/config/locales/lt.yml +0 -34
- data/resources/config/locales/lv.yml +0 -34
- data/resources/config/locales/nb.yml +0 -34
- data/resources/config/locales/nl.yml +0 -33
- data/resources/config/locales/pl.yml +0 -35
- data/resources/config/locales/pt-BR.yml +0 -34
- data/resources/config/locales/rs.yml +0 -35
- data/resources/config/locales/ru.yml +0 -34
- data/resources/config/locales/sl.yml +0 -33
- data/resources/config/locales/sv.yml +0 -34
- data/resources/config/locales/zh-CN.yml +0 -34
- data/resources/config/locales/zh-TW.yml +0 -34
- data/resources/config/routes.rb +0 -11
- data/resources/db/migrate/20100913234709_create_refinerycms_resources_schema.rb +0 -21
- data/resources/features/manage_files.feature +0 -43
- data/resources/features/step_definitions/file_steps.rb +0 -21
- data/resources/features/support/paths.rb +0 -17
- data/resources/features/uploads/beach.jpeg +0 -0
- data/resources/features/uploads/refinery_is_awesome.txt +0 -1
- data/resources/lib/generators/refinerycms_resources_generator.rb +0 -8
- data/resources/lib/resources.rb +0 -58
- data/resources/license.md +0 -21
- data/resources/readme.md +0 -9
- data/resources/refinerycms-resources.gemspec +0 -20
- data/resources/spec/models/resource_spec.rb +0 -91
- data/resources/spec/uploads/refinery_is_awesome.txt +0 -1
- data/settings/app/controllers/admin/refinery_settings_controller.rb +0 -77
- data/settings/app/helpers/refinery_settings_helper.rb +0 -25
- data/settings/app/models/refinery_setting.rb +0 -212
- data/settings/app/views/admin/refinery_settings/_form.html.erb +0 -62
- data/settings/app/views/admin/refinery_settings/_refinery_setting.html.erb +0 -23
- data/settings/app/views/admin/refinery_settings/_refinery_settings.html.erb +0 -5
- data/settings/app/views/admin/refinery_settings/edit.html.erb +0 -1
- data/settings/app/views/admin/refinery_settings/index.html.erb +0 -49
- data/settings/app/views/admin/refinery_settings/new.html.erb +0 -1
- data/settings/config/locales/cs.yml +0 -45
- data/settings/config/locales/da.yml +0 -46
- data/settings/config/locales/de.yml +0 -46
- data/settings/config/locales/el.yml +0 -46
- data/settings/config/locales/en.yml +0 -46
- data/settings/config/locales/es.yml +0 -43
- data/settings/config/locales/fr.yml +0 -44
- data/settings/config/locales/it.yml +0 -36
- data/settings/config/locales/lolcat.yml +0 -43
- data/settings/config/locales/lt.yml +0 -46
- data/settings/config/locales/lv.yml +0 -46
- data/settings/config/locales/nb.yml +0 -47
- data/settings/config/locales/nl.yml +0 -46
- data/settings/config/locales/pl.yml +0 -46
- data/settings/config/locales/pt-BR.yml +0 -44
- data/settings/config/locales/rs.yml +0 -46
- data/settings/config/locales/ru.yml +0 -43
- data/settings/config/locales/sl.yml +0 -25
- data/settings/config/locales/sv.yml +0 -45
- data/settings/config/locales/zh-CN.yml +0 -46
- data/settings/config/locales/zh-TW.yml +0 -46
- data/settings/config/routes.rb +0 -8
- data/settings/db/migrate/20100913234710_create_refinerycms_settings_schema.rb +0 -24
- data/settings/db/migrate/20100926142529_add_value_type_to_refinery_settings.rb +0 -9
- data/settings/features/manage_refinery_settings.feature +0 -5
- data/settings/features/step_definitions/setting_steps.rb +0 -9
- data/settings/features/support/paths.rb +0 -14
- data/settings/lib/generators/refinerycms_settings_generator.rb +0 -8
- data/settings/lib/settings.rb +0 -16
- data/settings/license.md +0 -21
- data/settings/readme.md +0 -55
- data/settings/refinerycms-settings.gemspec +0 -20
- data/settings/spec/models/refinery_setting_spec.rb +0 -101
Binary file
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Admin
|
2
|
-
class PagePartsController < Admin::BaseController
|
3
|
-
|
4
|
-
def new
|
5
|
-
render :partial => "/admin/pages/page_part_field", :locals => {
|
6
|
-
:part => PagePart.new(:title => params[:title], :body => params[:body]),
|
7
|
-
:new_part => true,
|
8
|
-
:part_index => params[:part_index]
|
9
|
-
}
|
10
|
-
end
|
11
|
-
|
12
|
-
def destroy
|
13
|
-
part = PagePart.find(params[:id])
|
14
|
-
page = part.page
|
15
|
-
if part.destroy
|
16
|
-
page.reposition_parts!
|
17
|
-
render :text => "'#{part.title}' deleted."
|
18
|
-
else
|
19
|
-
render :text => "'#{part.title}' not deleted."
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module Admin
|
2
|
-
class PagesController < Admin::BaseController
|
3
|
-
|
4
|
-
crudify :page,
|
5
|
-
:conditions => {:parent_id => nil},
|
6
|
-
:order => "lft ASC",
|
7
|
-
:include => [:parts, :slugs, :children, :parent, :translations],
|
8
|
-
:paging => false
|
9
|
-
|
10
|
-
rescue_from FriendlyId::ReservedError, :with => :show_errors_for_reserved_slug
|
11
|
-
|
12
|
-
def new
|
13
|
-
@page = Page.new
|
14
|
-
Page.default_parts.each_with_index do |page_part, index|
|
15
|
-
@page.parts << PagePart.new(:title => page_part, :position => index)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
protected
|
20
|
-
|
21
|
-
def globalize!
|
22
|
-
Thread.current[:globalize_locale] = (params[:switch_locale] || (@page.present? && @page.slug.present? && @page.slug.locale) || ::Refinery::I18n.default_frontend_locale)
|
23
|
-
end
|
24
|
-
|
25
|
-
def show_errors_for_reserved_slug(exception)
|
26
|
-
flash[:error] = t('reserved_system_word', :scope => 'admin.pages')
|
27
|
-
if params[:action] == 'update'
|
28
|
-
find_page
|
29
|
-
render :edit
|
30
|
-
else
|
31
|
-
@page = Page.new(params[:page])
|
32
|
-
render :new
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
@@ -1,87 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
|
3
|
-
module Admin
|
4
|
-
class PagesDialogsController < Admin::DialogsController
|
5
|
-
|
6
|
-
crudify :page
|
7
|
-
|
8
|
-
def link_to
|
9
|
-
@pages = Page.paginate :page => params[:page],
|
10
|
-
:conditions => {:parent_id => nil},
|
11
|
-
:order => 'position ASC',
|
12
|
-
:per_page => Page.per_page(dialog=true)
|
13
|
-
|
14
|
-
if ::Refinery::Plugins.registered.names.include?('refinery_files')
|
15
|
-
@resources = Resource.paginate :page => params[:resource_page],
|
16
|
-
:order => 'created_at DESC',
|
17
|
-
:per_page => Resource.per_page(dialog=true)
|
18
|
-
|
19
|
-
# resource link
|
20
|
-
if params[:current_link].present?
|
21
|
-
is_resource_link = params[:current_link].include?("/system/resources")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# web address link
|
26
|
-
@web_address_text = "http://"
|
27
|
-
@web_address_text = params[:current_link] if params[:current_link].to_s =~ /^http:\/\//
|
28
|
-
@web_address_target_blank = (params[:target_blank] == "true")
|
29
|
-
|
30
|
-
# mailto link
|
31
|
-
if params[:current_link].present?
|
32
|
-
if params[:current_link] =~ /^mailto:/
|
33
|
-
@email_address_text = params[:current_link].split("mailto:")[1].split('?')[0]
|
34
|
-
end
|
35
|
-
@email_default_subject_text = params[:current_link].split('?subject=')[1] || params[:subject]
|
36
|
-
@email_default_body_text = params[:current_link].split('?body=')[1] || params[:body]
|
37
|
-
end
|
38
|
-
|
39
|
-
if params[:paginating].present?
|
40
|
-
@page_area_selected = (params[:paginating] == "your_page")
|
41
|
-
@resource_area_selected = (params[:paginating] == "resource_file")
|
42
|
-
else
|
43
|
-
@page_area_selected = (!is_resource_link and @web_address_text == "http://" and @email_address_text.blank?)
|
44
|
-
@web_address_area_selected = (@web_address_text != "http://")
|
45
|
-
@email_address_area_selected = @email_address_text.present?
|
46
|
-
@resource_area_selected = is_resource_link
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_url
|
51
|
-
unless params[:url].blank?
|
52
|
-
url = URI.parse(params[:url])
|
53
|
-
if url.host.nil? && params[:url].start_with?('/')
|
54
|
-
url.host = URI.parse(request.url).host
|
55
|
-
end
|
56
|
-
|
57
|
-
http = Net::HTTP.new(url.host)
|
58
|
-
request = Net::HTTP::Get.new(url.path.blank? ? "/" : url.path)
|
59
|
-
|
60
|
-
response = http.request request
|
61
|
-
|
62
|
-
render :json => {:result => case response
|
63
|
-
when Net::HTTPSuccess, Net::HTTPRedirection
|
64
|
-
'success'
|
65
|
-
else
|
66
|
-
'failure'
|
67
|
-
end }
|
68
|
-
end
|
69
|
-
|
70
|
-
rescue
|
71
|
-
render :json => {:result => 'failure'}
|
72
|
-
end
|
73
|
-
|
74
|
-
def test_email
|
75
|
-
unless params[:email].blank?
|
76
|
-
valid = params[:email] =~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
|
77
|
-
|
78
|
-
render :json => if valid
|
79
|
-
{:result => 'success'}
|
80
|
-
else
|
81
|
-
{:result => 'failure'}
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
87
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
class PagesController < ApplicationController
|
2
|
-
|
3
|
-
# This action is usually accessed with the root path, normally '/'
|
4
|
-
def home
|
5
|
-
error_404 unless (@page = Page.where(:link_url => '/').first).present?
|
6
|
-
end
|
7
|
-
|
8
|
-
# This action can be accessed normally, or as nested pages.
|
9
|
-
# Assuming a page named "mission" that is a child of "about",
|
10
|
-
# you can access the pages with the following URLs:
|
11
|
-
#
|
12
|
-
# GET /pages/about
|
13
|
-
# GET /about
|
14
|
-
#
|
15
|
-
# GET /pages/mission
|
16
|
-
# GET /about/mission
|
17
|
-
#
|
18
|
-
def show
|
19
|
-
# Find the page by the newer 'path' or fallback to the page's id if no path.
|
20
|
-
@page = Page.find(params[:path] ? params[:path].to_s.split('/').last : params[:id])
|
21
|
-
|
22
|
-
if @page.try(:live?) or (refinery_user? and current_user.authorized_plugins.include?("refinery_pages"))
|
23
|
-
# if the admin wants this to be a "placeholder" page which goes to its first child, go to that instead.
|
24
|
-
if @page.skip_to_first_child and (first_live_child = @page.children.order('lft ASC').where(:draft=>false).first).present?
|
25
|
-
redirect_to first_live_child.url
|
26
|
-
end
|
27
|
-
else
|
28
|
-
error_404
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
data/pages/app/models/page.rb
DELETED
@@ -1,290 +0,0 @@
|
|
1
|
-
require 'globalize3'
|
2
|
-
|
3
|
-
class Page < ActiveRecord::Base
|
4
|
-
|
5
|
-
translates :title, :meta_keywords, :meta_description, :browser_title if self.respond_to?(:translates)
|
6
|
-
attr_accessor :locale # to hold temporarily
|
7
|
-
validates :title, :presence => true
|
8
|
-
|
9
|
-
acts_as_nested_set
|
10
|
-
|
11
|
-
# Docs for friendly_id http://github.com/norman/friendly_id
|
12
|
-
has_friendly_id :title, :use_slug => true,
|
13
|
-
:default_locale => (defined?(::Refinery::I18n.default_frontend_locale) ? ::Refinery::I18n.default_frontend_locale : :en),
|
14
|
-
:reserved_words => %w(index new session login logout users refinery admin images wymiframe),
|
15
|
-
:approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, false, :scoping => "pages")
|
16
|
-
|
17
|
-
has_many :parts,
|
18
|
-
:class_name => "PagePart",
|
19
|
-
:order => "position ASC",
|
20
|
-
:inverse_of => :page,
|
21
|
-
:dependent => :destroy
|
22
|
-
|
23
|
-
accepts_nested_attributes_for :parts, :allow_destroy => true
|
24
|
-
|
25
|
-
# Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
|
26
|
-
acts_as_indexed :fields => [:title, :meta_keywords, :meta_description,
|
27
|
-
:custom_title, :browser_title, :all_page_part_content]
|
28
|
-
|
29
|
-
before_destroy :deletable?
|
30
|
-
after_save :reposition_parts!
|
31
|
-
after_save :invalidate_child_cached_url
|
32
|
-
|
33
|
-
scope :live, where(:draft => false)
|
34
|
-
|
35
|
-
# shows all pages with :show_in_menu set to true, but it also
|
36
|
-
# rejects any page that has not been translated to the current locale.
|
37
|
-
scope :in_menu, lambda {
|
38
|
-
pages = Arel::Table.new(Page.table_name)
|
39
|
-
translations = Arel::Table.new(Page.translations_table_name)
|
40
|
-
|
41
|
-
includes(:translations).where(:show_in_menu => true).where(
|
42
|
-
translations[:locale].eq(Globalize.locale)).where(pages[:id].eq(translations[:page_id]))
|
43
|
-
}
|
44
|
-
|
45
|
-
# when a dialog pops up to link to a page, how many pages per page should there be
|
46
|
-
PAGES_PER_DIALOG = 14
|
47
|
-
|
48
|
-
# when listing pages out in the admin area, how many pages should show per page
|
49
|
-
PAGES_PER_ADMIN_INDEX = 20
|
50
|
-
|
51
|
-
# when collecting the pages path how is each of the pages seperated?
|
52
|
-
PATH_SEPARATOR = " - "
|
53
|
-
|
54
|
-
# Am I allowed to delete this page?
|
55
|
-
# If a link_url is set we don't want to break the link so we don't allow them to delete
|
56
|
-
# If deletable is set to false then we don't allow this page to be deleted. These are often Refinery system pages
|
57
|
-
def deletable?
|
58
|
-
deletable && link_url.blank? and menu_match.blank?
|
59
|
-
end
|
60
|
-
|
61
|
-
# Repositions the child page_parts that belong to this page.
|
62
|
-
# This ensures that they are in the correct 0,1,2,3,4... etc order.
|
63
|
-
def reposition_parts!
|
64
|
-
parts.each_with_index do |part, index|
|
65
|
-
part.update_attribute(:position, index)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
# Before destroying a page we check to see if it's a deletable page or not
|
70
|
-
# Refinery system pages are not deletable.
|
71
|
-
def destroy
|
72
|
-
if deletable?
|
73
|
-
super
|
74
|
-
else
|
75
|
-
unless Rails.env.test?
|
76
|
-
# give useful feedback when trying to delete from console
|
77
|
-
puts "This page is not deletable. Please use .destroy! if you really want it deleted "
|
78
|
-
puts "unset .link_url," if link_url.present?
|
79
|
-
puts "unset .menu_match," if menu_match.present?
|
80
|
-
puts "set .deletable to true" unless deletable
|
81
|
-
end
|
82
|
-
|
83
|
-
return false
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
# If you want to destroy a page that is set to be not deletable this is the way to do it.
|
88
|
-
def destroy!
|
89
|
-
self.menu_match = nil
|
90
|
-
self.link_url = nil
|
91
|
-
self.deletable = true
|
92
|
-
|
93
|
-
destroy
|
94
|
-
end
|
95
|
-
|
96
|
-
# Used for the browser title to get the full path to this page
|
97
|
-
# It automatically prints out this page title and all of it's parent page titles joined by a PATH_SEPARATOR
|
98
|
-
def path(options = {})
|
99
|
-
# Handle deprecated boolean
|
100
|
-
if [true, false].include?(options)
|
101
|
-
warning = "Page::path does not want a boolean (you gave #{options.inspect}) anymore. "
|
102
|
-
warning << "Please change this to {:reversed => #{options.inspect}}. "
|
103
|
-
warn(warning << "\nCalled from #{caller.first.inspect}")
|
104
|
-
options = {:reversed => options}
|
105
|
-
end
|
106
|
-
|
107
|
-
# Override default options with any supplied.
|
108
|
-
options = {:reversed => true}.merge(options)
|
109
|
-
|
110
|
-
unless parent.nil?
|
111
|
-
parts = [title, parent.path(options)]
|
112
|
-
parts.reverse! if options[:reversed]
|
113
|
-
parts.join(PATH_SEPARATOR)
|
114
|
-
else
|
115
|
-
title
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
# When this page is rendered in the navigation, where should it link?
|
120
|
-
# If a custom "link_url" is set, it uses that otherwise it defaults to a normal page URL.
|
121
|
-
# The "link_url" is often used to link to a plugin rather than a page.
|
122
|
-
#
|
123
|
-
# For example if I had a "Contact" page I don't want it to just render a contact us page
|
124
|
-
# I want it to show the Inquiries form so I can collect inquiries. So I would set the "link_url"
|
125
|
-
# to "/contact"
|
126
|
-
def url
|
127
|
-
if link_url.present?
|
128
|
-
link_url_localised?
|
129
|
-
elsif use_marketable_urls?
|
130
|
-
url_marketable
|
131
|
-
elsif to_param.present?
|
132
|
-
url_normal
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
def link_url_localised?
|
137
|
-
if link_url =~ %r{^/} and defined?(::Refinery::I18n) and ::Refinery::I18n.enabled? and
|
138
|
-
::I18n.locale != ::Refinery::I18n.default_frontend_locale
|
139
|
-
"/#{::I18n.locale}#{link_url}"
|
140
|
-
else
|
141
|
-
link_url
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
def url_marketable
|
146
|
-
# :id => nil is important to prevent any other params[:id] from interfering with this route.
|
147
|
-
{:controller => "/pages", :action => "show", :path => nested_url, :id => nil}
|
148
|
-
end
|
149
|
-
|
150
|
-
def url_normal
|
151
|
-
{:controller => "/pages", :action => "show", :id => to_param}
|
152
|
-
end
|
153
|
-
|
154
|
-
# Returns an array with all ancestors to_param, allow with its own
|
155
|
-
# Ex: with an About page and a Mission underneath,
|
156
|
-
# Page.find('mission').nested_url would return:
|
157
|
-
#
|
158
|
-
# ['about', 'mission']
|
159
|
-
#
|
160
|
-
def nested_url
|
161
|
-
Rails.cache.fetch(url_cache_key) { uncached_nested_url }
|
162
|
-
end
|
163
|
-
|
164
|
-
def uncached_nested_url
|
165
|
-
[parent.try(:nested_url), to_param].compact.flatten
|
166
|
-
end
|
167
|
-
|
168
|
-
# Returns the string version of nested_url, i.e., the path that should be generated
|
169
|
-
# by the router
|
170
|
-
def nested_path
|
171
|
-
@nested_path ||= "/#{nested_url.join('/')}"
|
172
|
-
end
|
173
|
-
|
174
|
-
def url_cache_key
|
175
|
-
"#{cache_key}#nested_url"
|
176
|
-
end
|
177
|
-
|
178
|
-
def cache_key
|
179
|
-
"#{Refinery.base_cache_key}/#{super}"
|
180
|
-
end
|
181
|
-
|
182
|
-
def use_marketable_urls?
|
183
|
-
RefinerySetting.find_or_set(:use_marketable_urls, true, :scoping => 'pages')
|
184
|
-
end
|
185
|
-
|
186
|
-
# Returns true if this page is "published"
|
187
|
-
def live?
|
188
|
-
not draft?
|
189
|
-
end
|
190
|
-
|
191
|
-
# Return true if this page can be shown in the navigation.
|
192
|
-
# If it's a draft or is set to not show in the menu it will return false.
|
193
|
-
def in_menu?
|
194
|
-
live? && show_in_menu?
|
195
|
-
end
|
196
|
-
|
197
|
-
# Returns true if this page is the home page or links to it.
|
198
|
-
def home?
|
199
|
-
link_url == "/"
|
200
|
-
end
|
201
|
-
|
202
|
-
# Returns all visible sibling pages that can be rendered for the menu
|
203
|
-
def shown_siblings
|
204
|
-
siblings.reject { |sibling| not sibling.in_menu? }
|
205
|
-
end
|
206
|
-
|
207
|
-
class << self
|
208
|
-
# Accessor to find out the default page parts created for each new page
|
209
|
-
def default_parts
|
210
|
-
RefinerySetting.find_or_set(:default_page_parts, ["Body", "Side Body"])
|
211
|
-
end
|
212
|
-
|
213
|
-
# Returns how many pages per page should there be when paginating pages
|
214
|
-
def per_page(dialog = false)
|
215
|
-
dialog ? PAGES_PER_DIALOG : PAGES_PER_ADMIN_INDEX
|
216
|
-
end
|
217
|
-
|
218
|
-
# Returns all the top level pages, usually to render the top level navigation.
|
219
|
-
def top_level
|
220
|
-
warn("Please use .live.in_menu instead of .top_level")
|
221
|
-
roots.where(:show_in_menu => true, :draft => false)
|
222
|
-
end
|
223
|
-
end
|
224
|
-
|
225
|
-
# Accessor method to get a page part from a page.
|
226
|
-
# Example:
|
227
|
-
#
|
228
|
-
# Page.first[:body]
|
229
|
-
#
|
230
|
-
# Will return the body page part of the first page.
|
231
|
-
def [](part_title)
|
232
|
-
# don't want to override a super method when trying to call a page part.
|
233
|
-
# the way that we call page parts seems flawed, will probably revert to page.parts[:title] in a future release.
|
234
|
-
if (super_value = super).blank?
|
235
|
-
# self.parts is already eager loaded so we can now just grab the first element matching the title we specified.
|
236
|
-
part = self.parts.detect do |part|
|
237
|
-
part.title.present? and #protecting against the problem that occurs when have nil title
|
238
|
-
part.title == part_title.to_s or
|
239
|
-
part.title.downcase.gsub(" ", "_") == part_title.to_s.downcase.gsub(" ", "_")
|
240
|
-
end
|
241
|
-
|
242
|
-
return part.body unless part.nil?
|
243
|
-
end
|
244
|
-
|
245
|
-
super_value
|
246
|
-
end
|
247
|
-
|
248
|
-
# In the admin area we use a slightly different title to inform the which pages are draft or hidden pages
|
249
|
-
def title_with_meta
|
250
|
-
title = self.title.to_s
|
251
|
-
title << " <em>(#{::I18n.t('hidden', :scope => 'admin.pages.page')})</em>" unless show_in_menu?
|
252
|
-
title << " <em>(#{::I18n.t('draft', :scope => 'admin.pages.page')})</em>" if draft?
|
253
|
-
|
254
|
-
title.strip
|
255
|
-
end
|
256
|
-
|
257
|
-
# Used to index all the content on this page so it can be easily searched.
|
258
|
-
def all_page_part_content
|
259
|
-
parts.collect {|p| p.body}.join(" ")
|
260
|
-
end
|
261
|
-
|
262
|
-
##
|
263
|
-
# Protects generated slugs from title if they are in the list of reserved words
|
264
|
-
# This applies mostly to plugin-generated pages.
|
265
|
-
#
|
266
|
-
# Returns the sluggified string
|
267
|
-
def normalize_friendly_id(slug_string)
|
268
|
-
sluggified = super
|
269
|
-
if use_marketable_urls? && self.class.friendly_id_config.reserved_words.include?(sluggified)
|
270
|
-
sluggified << "-page"
|
271
|
-
end
|
272
|
-
sluggified
|
273
|
-
end
|
274
|
-
|
275
|
-
private
|
276
|
-
|
277
|
-
def invalidate_child_cached_url
|
278
|
-
return true unless use_marketable_urls?
|
279
|
-
children.each do |child|
|
280
|
-
Rails.cache.delete(child.url_cache_key)
|
281
|
-
end
|
282
|
-
end
|
283
|
-
|
284
|
-
def warn(msg)
|
285
|
-
warning = ["\n*** DEPRECATION WARNING ***"]
|
286
|
-
warning << "#{msg}"
|
287
|
-
warning << ""
|
288
|
-
$stdout.puts warning.join("\n")
|
289
|
-
end
|
290
|
-
end
|