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
@@ -1,19 +0,0 @@
|
|
1
|
-
# Methods added to this helper will be available to all templates in the application.
|
2
|
-
Dir[File.expand_path('../helpers/*.rb', __FILE__).to_s].each {|helper| require helper}
|
3
|
-
|
4
|
-
module Refinery
|
5
|
-
module ApplicationHelper
|
6
|
-
def self.included(base)
|
7
|
-
base.send :include, Refinery::Helpers::HeadHelper
|
8
|
-
base.send :include, Refinery::Helpers::HtmlTruncationHelper
|
9
|
-
base.send :include, Refinery::Helpers::ImageHelper
|
10
|
-
base.send :include, Refinery::Helpers::MenuHelper
|
11
|
-
base.send :include, Refinery::Helpers::MetaHelper
|
12
|
-
base.send :include, Refinery::Helpers::PaginationHelper
|
13
|
-
base.send :include, Refinery::Helpers::ScriptHelper
|
14
|
-
base.send :include, Refinery::Helpers::SiteBarHelper
|
15
|
-
base.send :include, Refinery::Helpers::TagHelper
|
16
|
-
base.send :include, Refinery::Helpers::TranslationHelper
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
class Refinery::BasePresenter
|
2
|
-
|
3
|
-
DEFAULT_FIELDS = {
|
4
|
-
:title => Proc.new { |p| (p.model.class.name.titleize if p.model.present?) },
|
5
|
-
:path => Proc.new { |p| p.title },
|
6
|
-
:browser_title => nil,
|
7
|
-
:meta_description => nil,
|
8
|
-
:meta_keywords => nil
|
9
|
-
}
|
10
|
-
|
11
|
-
attr_reader :model
|
12
|
-
|
13
|
-
def initialize(obj)
|
14
|
-
@model = obj
|
15
|
-
end
|
16
|
-
|
17
|
-
def method_missing(method, *args)
|
18
|
-
if @model.respond_to? method
|
19
|
-
@model.send method
|
20
|
-
elsif DEFAULT_FIELDS.has_key? method
|
21
|
-
(value = DEFAULT_FIELDS[method]).is_a?(Proc) ? value.call(self) : value
|
22
|
-
else
|
23
|
-
raise NoMethodError.new("#{self.class.name} doesn't know #{method}. Define or delegate it.", method)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
::Refinery::Application.routes.draw do
|
2
|
-
match '/admin(/*path)', :to => redirect {|params, request|
|
3
|
-
request.flash[:message] = "<p>
|
4
|
-
The URL '/<strong>admin</strong>#{"/#{params[:path]}" unless params[:path].blank?}' will be removed in Refinery CMS version 1.0
|
5
|
-
<br/>
|
6
|
-
Please use '/<strong>refinery</strong>#{"/#{params[:path]}" unless params[:path].blank?}' instead.
|
7
|
-
</p>".html_safe
|
8
|
-
"/refinery#{"/#{params[:path]}" unless params[:path].blank?}"
|
9
|
-
}
|
10
|
-
match '/refinery/*path' => 'admin/base#error_404'
|
11
|
-
end
|
data/core/lib/refinery/crud.rb
DELETED
@@ -1,295 +0,0 @@
|
|
1
|
-
# Base methods for CRUD actions
|
2
|
-
# Simply override any methods in your action controller you want to be customised
|
3
|
-
# Don't forget to add:
|
4
|
-
# resources :plural_model_name_here
|
5
|
-
# to your routes.rb file.
|
6
|
-
# Full documentation about CRUD and resources go here:
|
7
|
-
# -> http://caboo.se/doc/classes/ActionController/Resources.html#M003716
|
8
|
-
# Example (add to your controller):
|
9
|
-
# crudify :foo, {:title_attribute => 'name'}
|
10
|
-
|
11
|
-
module Refinery
|
12
|
-
module Crud
|
13
|
-
|
14
|
-
def self.default_options(model_name)
|
15
|
-
singular_name = model_name.to_s
|
16
|
-
class_name = singular_name.camelize
|
17
|
-
plural_name = singular_name.pluralize
|
18
|
-
this_class = class_name.constantize
|
19
|
-
|
20
|
-
{
|
21
|
-
:title_attribute => "title",
|
22
|
-
:order => ('position ASC' if this_class.table_exists? and this_class.column_names.include?('position')),
|
23
|
-
:conditions => '',
|
24
|
-
:sortable => true,
|
25
|
-
:searchable => true,
|
26
|
-
:include => [],
|
27
|
-
:paging => true,
|
28
|
-
:search_conditions => '',
|
29
|
-
:redirect_to_url => "admin_#{plural_name}_url"
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.append_features(base)
|
34
|
-
super
|
35
|
-
base.extend(ClassMethods)
|
36
|
-
end
|
37
|
-
|
38
|
-
module ClassMethods
|
39
|
-
|
40
|
-
def crudify(model_name, options = {})
|
41
|
-
options = ::Refinery::Crud.default_options(model_name).merge(options)
|
42
|
-
|
43
|
-
singular_name = model_name.to_s
|
44
|
-
class_name = singular_name.camelize
|
45
|
-
plural_name = singular_name.pluralize
|
46
|
-
|
47
|
-
module_eval %(
|
48
|
-
prepend_before_filter :find_#{singular_name},
|
49
|
-
:only => [:update, :destroy, :edit, :show]
|
50
|
-
|
51
|
-
def new
|
52
|
-
@#{singular_name} = #{class_name}.new
|
53
|
-
end
|
54
|
-
|
55
|
-
def create
|
56
|
-
# if the position field exists, set this object as last object, given the conditions of this class.
|
57
|
-
if #{class_name}.column_names.include?("position")
|
58
|
-
params[:#{singular_name}].merge!({
|
59
|
-
:position => ((#{class_name}.maximum(:position, :conditions => #{options[:conditions].inspect})||-1) + 1)
|
60
|
-
})
|
61
|
-
end
|
62
|
-
|
63
|
-
if (@#{singular_name} = #{class_name}.create(params[:#{singular_name}])).valid?
|
64
|
-
(request.xhr? ? flash.now : flash).notice = t(
|
65
|
-
'refinery.crudify.created',
|
66
|
-
:what => "'\#{@#{singular_name}.#{options[:title_attribute]}}'"
|
67
|
-
)
|
68
|
-
|
69
|
-
unless from_dialog?
|
70
|
-
unless params[:continue_editing] =~ /true|on|1/
|
71
|
-
redirect_back_or_default(#{options[:redirect_to_url]})
|
72
|
-
else
|
73
|
-
unless request.xhr?
|
74
|
-
redirect_to :back
|
75
|
-
else
|
76
|
-
render :partial => "/shared/message"
|
77
|
-
end
|
78
|
-
end
|
79
|
-
else
|
80
|
-
render :text => "<script>parent.window.location = '\#{#{options[:redirect_to_url]}}';</script>"
|
81
|
-
end
|
82
|
-
else
|
83
|
-
unless request.xhr?
|
84
|
-
render :action => 'new'
|
85
|
-
else
|
86
|
-
render :partial => "/shared/admin/error_messages",
|
87
|
-
:locals => {
|
88
|
-
:object => @#{singular_name},
|
89
|
-
:include_object_name => true
|
90
|
-
}
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def edit
|
96
|
-
# object gets found by find_#{singular_name} function
|
97
|
-
end
|
98
|
-
|
99
|
-
def update
|
100
|
-
if @#{singular_name}.update_attributes(params[:#{singular_name}])
|
101
|
-
(request.xhr? ? flash.now : flash).notice = t(
|
102
|
-
'refinery.crudify.updated',
|
103
|
-
:what => "'\#{@#{singular_name}.#{options[:title_attribute]}}'"
|
104
|
-
)
|
105
|
-
|
106
|
-
unless from_dialog?
|
107
|
-
unless params[:continue_editing] =~ /true|on|1/
|
108
|
-
redirect_back_or_default(#{options[:redirect_to_url]})
|
109
|
-
else
|
110
|
-
unless request.xhr?
|
111
|
-
redirect_to :back
|
112
|
-
else
|
113
|
-
render :partial => "/shared/message"
|
114
|
-
end
|
115
|
-
end
|
116
|
-
else
|
117
|
-
render :text => "<script>parent.window.location = '\#{#{options[:redirect_to_url]}}';</script>"
|
118
|
-
end
|
119
|
-
else
|
120
|
-
unless request.xhr?
|
121
|
-
render :action => 'edit'
|
122
|
-
else
|
123
|
-
render :partial => "/shared/admin/error_messages",
|
124
|
-
:locals => {
|
125
|
-
:object => @#{singular_name},
|
126
|
-
:include_object_name => true
|
127
|
-
}
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
def destroy
|
133
|
-
# object gets found by find_#{singular_name} function
|
134
|
-
title = @#{singular_name}.#{options[:title_attribute]}
|
135
|
-
if @#{singular_name}.destroy
|
136
|
-
flash.notice = t('destroyed', :scope => 'refinery.crudify', :what => "'\#{title}'")
|
137
|
-
end
|
138
|
-
|
139
|
-
redirect_to #{options[:redirect_to_url]}
|
140
|
-
end
|
141
|
-
|
142
|
-
# Finds one single result based on the id params.
|
143
|
-
def find_#{singular_name}
|
144
|
-
@#{singular_name} = #{class_name}.find(params[:id],
|
145
|
-
:include => #{options[:include].map(&:to_sym).inspect})
|
146
|
-
end
|
147
|
-
|
148
|
-
# Find the collection of @#{plural_name} based on the conditions specified into crudify
|
149
|
-
# It will be ordered based on the conditions specified into crudify
|
150
|
-
# And eager loading is applied as specified into crudify.
|
151
|
-
def find_all_#{plural_name}(conditions = #{options[:conditions].inspect})
|
152
|
-
@#{plural_name} = #{class_name}.where(conditions).includes(
|
153
|
-
#{options[:include].map(&:to_sym).inspect}
|
154
|
-
).order("#{options[:order]}")
|
155
|
-
end
|
156
|
-
|
157
|
-
# Paginate a set of @#{plural_name} that may/may not already exist.
|
158
|
-
def paginate_all_#{plural_name}
|
159
|
-
# If we have already found a set then we don't need to again
|
160
|
-
find_all_#{plural_name} if @#{plural_name}.nil?
|
161
|
-
|
162
|
-
paging_options = {:page => params[:page]}
|
163
|
-
|
164
|
-
# Seems will_paginate doesn't always use the implicit method.
|
165
|
-
if #{class_name}.methods.map(&:to_sym).include?(:per_page)
|
166
|
-
paging_options.update({:per_page => #{class_name}.per_page})
|
167
|
-
end
|
168
|
-
|
169
|
-
@#{plural_name} = @#{plural_name}.paginate(paging_options)
|
170
|
-
end
|
171
|
-
|
172
|
-
# Returns a weighted set of results based on the query specified by the user.
|
173
|
-
def search_all_#{plural_name}
|
174
|
-
# First find normal results.
|
175
|
-
find_all_#{plural_name}(#{options[:search_conditions].inspect})
|
176
|
-
|
177
|
-
# Now get weighted results by running the query against the results already found.
|
178
|
-
@#{plural_name} = @#{plural_name}.with_query(params[:search])
|
179
|
-
end
|
180
|
-
|
181
|
-
# Ensure all methods are protected so that they should only be called
|
182
|
-
# from within the current controller.
|
183
|
-
protected :find_#{singular_name},
|
184
|
-
:find_all_#{plural_name},
|
185
|
-
:paginate_all_#{plural_name},
|
186
|
-
:search_all_#{plural_name}
|
187
|
-
)
|
188
|
-
|
189
|
-
# Methods that are only included when this controller is searchable.
|
190
|
-
if options[:searchable]
|
191
|
-
if options[:paging]
|
192
|
-
module_eval %(
|
193
|
-
def index
|
194
|
-
search_all_#{plural_name} if searching?
|
195
|
-
paginate_all_#{plural_name}
|
196
|
-
end
|
197
|
-
)
|
198
|
-
else
|
199
|
-
module_eval %(
|
200
|
-
def index
|
201
|
-
unless searching?
|
202
|
-
find_all_#{plural_name}
|
203
|
-
else
|
204
|
-
search_all_#{plural_name}
|
205
|
-
end
|
206
|
-
end
|
207
|
-
)
|
208
|
-
end
|
209
|
-
|
210
|
-
else
|
211
|
-
if options[:paging]
|
212
|
-
module_eval %(
|
213
|
-
def index
|
214
|
-
paginate_all_#{plural_name}
|
215
|
-
end
|
216
|
-
)
|
217
|
-
else
|
218
|
-
module_eval %(
|
219
|
-
def index
|
220
|
-
find_all_#{plural_name}
|
221
|
-
end
|
222
|
-
)
|
223
|
-
end
|
224
|
-
|
225
|
-
end
|
226
|
-
|
227
|
-
if options[:sortable]
|
228
|
-
module_eval %(
|
229
|
-
def reorder
|
230
|
-
find_all_#{plural_name}
|
231
|
-
end
|
232
|
-
|
233
|
-
# Based upon http://github.com/matenia/jQuery-Awesome-Nested-Set-Drag-and-Drop
|
234
|
-
def update_positions
|
235
|
-
previous = nil
|
236
|
-
# The list doesn't come to us in the correct order. Frustration.
|
237
|
-
0.upto((newlist ||= params[:ul]).length - 1) do |index|
|
238
|
-
hash = newlist[index.to_s]
|
239
|
-
moved_item_id = hash['id'].split(/#{singular_name}\\_?/)
|
240
|
-
@current_#{singular_name} = #{class_name}.find_by_id(moved_item_id)
|
241
|
-
|
242
|
-
if @current_#{singular_name}.respond_to?(:move_to_root)
|
243
|
-
if previous.present?
|
244
|
-
@current_#{singular_name}.move_to_right_of(#{class_name}.find_by_id(previous))
|
245
|
-
else
|
246
|
-
@current_#{singular_name}.move_to_root
|
247
|
-
end
|
248
|
-
else
|
249
|
-
@current_#{singular_name}.update_attribute(:position, index)
|
250
|
-
end
|
251
|
-
|
252
|
-
if hash['children'].present?
|
253
|
-
update_child_positions(hash, @current_#{singular_name})
|
254
|
-
end
|
255
|
-
|
256
|
-
previous = moved_item_id
|
257
|
-
end
|
258
|
-
|
259
|
-
#{class_name}.rebuild! if #{class_name}.respond_to?(:rebuild!)
|
260
|
-
render :nothing => true
|
261
|
-
end
|
262
|
-
|
263
|
-
def update_child_positions(node, #{singular_name})
|
264
|
-
0.upto(node['children'].length - 1) do |child_index|
|
265
|
-
child = node['children'][child_index.to_s]
|
266
|
-
child_id = child['id'].split(/#{singular_name}\_?/)
|
267
|
-
child_#{singular_name} = #{class_name}.find_by_id(child_id)
|
268
|
-
child_#{singular_name}.move_to_child_of(#{singular_name})
|
269
|
-
|
270
|
-
if child['children'].present?
|
271
|
-
update_child_positions(child, child_#{singular_name})
|
272
|
-
end
|
273
|
-
end
|
274
|
-
end
|
275
|
-
|
276
|
-
)
|
277
|
-
end
|
278
|
-
|
279
|
-
module_eval %(
|
280
|
-
def self.sortable?
|
281
|
-
#{options[:sortable].to_s}
|
282
|
-
end
|
283
|
-
|
284
|
-
def self.searchable?
|
285
|
-
#{options[:searchable].to_s}
|
286
|
-
end
|
287
|
-
)
|
288
|
-
|
289
|
-
|
290
|
-
end
|
291
|
-
|
292
|
-
end
|
293
|
-
|
294
|
-
end
|
295
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
require 'action_view'
|
2
|
-
require 'action_view/helpers'
|
3
|
-
|
4
|
-
ActionView::Helpers::FormHelper.module_eval do
|
5
|
-
|
6
|
-
def required_label(object_name, method, text = nil, options = {})
|
7
|
-
options = {:class => "required"}.merge!(options)
|
8
|
-
|
9
|
-
label(object_name, method, "#{label_humanize_text(object_name, method, text, options)} *", options)
|
10
|
-
end
|
11
|
-
|
12
|
-
|
13
|
-
def label_humanize_text object_name, method, text = nil, options = {}
|
14
|
-
if text.blank?
|
15
|
-
text = object_name.classify.constantize.respond_to?(:human_attribute_name) ? object_name.classify.constantize.human_attribute_name(method) : method.to_s
|
16
|
-
else
|
17
|
-
text = text.to_s
|
18
|
-
end
|
19
|
-
text.humanize
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
ActionView::Helpers::FormBuilder.module_eval do
|
25
|
-
|
26
|
-
def required_label(method, text = nil, options = {})
|
27
|
-
@template.required_label(@object_name, method, text, objectify_options(options))
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
|
32
|
-
ActionView::Helpers::FormTagHelper.module_eval do
|
33
|
-
|
34
|
-
def required_label_tag(name, text = nil, options = {})
|
35
|
-
options = {:class => "required"}.merge!(options)
|
36
|
-
text ||= "#{name.to_s.humanize} *"
|
37
|
-
|
38
|
-
label_tag(name, text, options)
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
# I18n labels automatically
|
45
|
-
module ActionView
|
46
|
-
module Helpers
|
47
|
-
class InstanceTag
|
48
|
-
def to_label_tag(text = nil, options = {})
|
49
|
-
options = options.stringify_keys
|
50
|
-
name_and_id = options.dup
|
51
|
-
add_default_name_and_id(name_and_id)
|
52
|
-
options.delete("index")
|
53
|
-
options["for"] ||= name_and_id["id"]
|
54
|
-
if text.blank?
|
55
|
-
content = method_name.humanize
|
56
|
-
if object.class.respond_to?(:human_attribute_name)
|
57
|
-
content = object.class.human_attribute_name(method_name)
|
58
|
-
end
|
59
|
-
else
|
60
|
-
content = text.to_s
|
61
|
-
end
|
62
|
-
label_tag(name_and_id["id"], content, options)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Refinery
|
2
|
-
module Helpers
|
3
|
-
module HeadHelper
|
4
|
-
|
5
|
-
def stylesheets_for_head(stylesheets, theme = false)
|
6
|
-
# you can disable the use of the built-in refinery stylesheets by disabling the setting.
|
7
|
-
stylesheets.map! {|ss| ["refinery/#{ss}", ss] }.flatten! if RefinerySetting.find_or_set(:frontend_refinery_stylesheets_enabled, true)
|
8
|
-
|
9
|
-
# if theme is set, use themed stylesheet links.
|
10
|
-
stylesheets.map! {|ss| ss =~ /^refinery\// ? ss : "/theme/stylesheets/#{ss}" } if theme
|
11
|
-
|
12
|
-
stylesheets
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require_dependency 'truncate_html'
|
2
|
-
|
3
|
-
module Refinery
|
4
|
-
module Helpers
|
5
|
-
module HtmlTruncationHelper
|
6
|
-
|
7
|
-
# Like the Rails _truncate_ helper but doesn't break HTML tags, entities, and words.
|
8
|
-
# <script> tags pass through and are not counted in the total.
|
9
|
-
# the omission specified _does_ count toward the total length count.
|
10
|
-
# use :link => link_to('more', post_path), or something to that effect
|
11
|
-
def truncate(text, options = {})
|
12
|
-
return unless text.present?
|
13
|
-
return super unless options.delete(:preserve_html_tags) == true # ensure preserve_html_tags doesn't pass through
|
14
|
-
|
15
|
-
max_length = options[:length] || 30
|
16
|
-
omission = options[:omission] || "..."
|
17
|
-
|
18
|
-
return truncate_html(text,
|
19
|
-
:length => max_length,
|
20
|
-
:word_boundary => true,
|
21
|
-
:omission => omission)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|