refinerycms-core 2.1.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/refinery/add.png +0 -0
- data/app/assets/images/refinery/admin_bg.png +0 -0
- data/app/assets/images/refinery/ajax-loader.gif +0 -0
- data/app/assets/images/refinery/branch-end.gif +0 -0
- data/app/assets/images/refinery/branch.gif +0 -0
- data/app/assets/images/refinery/cross.png +0 -0
- data/app/assets/images/refinery/dialogLoadingAnimation.gif +0 -0
- data/app/assets/images/refinery/header_background.png +0 -0
- data/app/assets/images/refinery/hover-gradient.jpg +0 -0
- data/app/assets/images/refinery/icons/accept.png +0 -0
- data/app/assets/images/refinery/icons/add.png +0 -0
- data/app/assets/images/refinery/icons/ajax-loader.gif +0 -0
- data/app/assets/images/refinery/icons/application_edit.png +0 -0
- data/app/assets/images/refinery/icons/application_go.png +0 -0
- data/app/assets/images/refinery/icons/arrow_left.png +0 -0
- data/app/assets/images/refinery/icons/arrow_left_right.png +0 -0
- data/app/assets/images/refinery/icons/arrow_switch.png +0 -0
- data/app/assets/images/refinery/icons/arrow_up.png +0 -0
- data/app/assets/images/refinery/icons/arrow_up_down.png +0 -0
- data/app/assets/images/refinery/icons/bin.png +0 -0
- data/app/assets/images/refinery/icons/bin_closed.png +0 -0
- data/app/assets/images/refinery/icons/cancel.png +0 -0
- data/app/assets/images/refinery/icons/cog_add.png +0 -0
- data/app/assets/images/refinery/icons/cog_edit.png +0 -0
- data/app/assets/images/refinery/icons/cross.png +0 -0
- data/app/assets/images/refinery/icons/delete.png +0 -0
- data/app/assets/images/refinery/icons/doc.png +0 -0
- data/app/assets/images/refinery/icons/down.gif +0 -0
- data/app/assets/images/refinery/icons/edit.png +0 -0
- data/app/assets/images/refinery/icons/email.png +0 -0
- data/app/assets/images/refinery/icons/email_edit.png +0 -0
- data/app/assets/images/refinery/icons/email_go.png +0 -0
- data/app/assets/images/refinery/icons/email_open.png +0 -0
- data/app/assets/images/refinery/icons/eye.png +0 -0
- data/app/assets/images/refinery/icons/folder.png +0 -0
- data/app/assets/images/refinery/icons/folder_open.png +0 -0
- data/app/assets/images/refinery/icons/folder_page_white.png +0 -0
- data/app/assets/images/refinery/icons/image_add.png +0 -0
- data/app/assets/images/refinery/icons/image_edit.png +0 -0
- data/app/assets/images/refinery/icons/img.png +0 -0
- data/app/assets/images/refinery/icons/information.png +0 -0
- data/app/assets/images/refinery/icons/layout_add.png +0 -0
- data/app/assets/images/refinery/icons/layout_edit.png +0 -0
- data/app/assets/images/refinery/icons/locale-blue.svg +15 -0
- data/app/assets/images/refinery/icons/locale.svg +11 -0
- data/app/assets/images/refinery/icons/music.png +0 -0
- data/app/assets/images/refinery/icons/page.png +0 -0
- data/app/assets/images/refinery/icons/page_add.png +0 -0
- data/app/assets/images/refinery/icons/page_edit.png +0 -0
- data/app/assets/images/refinery/icons/page_white_edit.png +0 -0
- data/app/assets/images/refinery/icons/page_white_gear.png +0 -0
- data/app/assets/images/refinery/icons/page_white_put.png +0 -0
- data/app/assets/images/refinery/icons/pdf.png +0 -0
- data/app/assets/images/refinery/icons/ppt.png +0 -0
- data/app/assets/images/refinery/icons/star.png +0 -0
- data/app/assets/images/refinery/icons/tick.png +0 -0
- data/app/assets/images/refinery/icons/up.gif +0 -0
- data/app/assets/images/refinery/icons/user_add.png +0 -0
- data/app/assets/images/refinery/icons/user_comment.png +0 -0
- data/app/assets/images/refinery/icons/user_edit.png +0 -0
- data/app/assets/images/refinery/icons/xls.png +0 -0
- data/app/assets/images/refinery/icons/zip.png +0 -0
- data/app/assets/images/refinery/icons/zoom.png +0 -0
- data/app/assets/images/refinery/logo-large.png +0 -0
- data/app/assets/images/refinery/logo-medium.png +0 -0
- data/app/assets/images/refinery/logo-site-bar.png +0 -0
- data/app/assets/images/refinery/logo-small-medium.png +0 -0
- data/app/assets/images/refinery/logo-small.png +0 -0
- data/app/assets/images/refinery/logo-tiny.png +0 -0
- data/app/assets/images/refinery/logo.png +0 -0
- data/app/assets/images/refinery/nav-3-background.gif +0 -0
- data/app/assets/images/refinery/nav_inactive_background.png +0 -0
- data/app/assets/images/refinery/orange_button.png +0 -0
- data/app/assets/images/refinery/page_bg.png +0 -0
- data/app/assets/images/refinery/text_field_background.png +0 -0
- data/app/assets/images/refinery/tooltip-nib.gif +0 -0
- data/app/assets/images/refinery/tooltip-nib.png +0 -0
- data/app/assets/javascripts/admin.js +7 -6
- data/app/assets/javascripts/refinery/admin.js.erb +99 -60
- data/app/assets/javascripts/refinery/ajaxy_pagination.js.coffee +2 -5
- data/app/assets/javascripts/refinery/application.js +8 -0
- data/app/assets/javascripts/refinery/core.js +4 -18
- data/app/assets/javascripts/refinery/interface.js.coffee.erb +5 -29
- data/app/assets/javascripts/refinery/modal_dialogs.js.erb +0 -105
- data/app/assets/javascripts/refinery/nestedsortables.js +183 -110
- data/app/assets/javascripts/refinery/refinery.js.erb +3 -9
- data/app/assets/javascripts/refinery/serializelist.js +1 -1
- data/app/assets/javascripts/refinery/site_bar.js +0 -5
- data/app/assets/javascripts/refinery/sortable_list.js +10 -11
- data/app/assets/javascripts/refinery/submit_continue.js.coffee.erb +1 -1
- data/app/assets/stylesheets/application.scss +2 -0
- data/app/assets/stylesheets/refinery/_colours.scss +18 -0
- data/app/assets/stylesheets/refinery/_icons.scss +85 -0
- data/app/assets/stylesheets/refinery/{layout.css.scss → _layout.scss} +306 -338
- data/app/assets/stylesheets/refinery/_mixins.scss +84 -0
- data/app/assets/stylesheets/refinery/{submenu.css.scss → _submenu.scss} +2 -2
- data/app/assets/stylesheets/refinery/{tooltips.css.scss → _tooltips.scss} +0 -0
- data/app/assets/stylesheets/refinery/_ui.scss +252 -0
- data/app/assets/stylesheets/refinery/{formatting.css.scss → formatting.scss} +0 -0
- data/app/assets/stylesheets/refinery/refinery.scss +10 -0
- data/app/assets/stylesheets/refinery/site_bar.scss +126 -0
- data/app/assets/stylesheets/refinery/{theme.css.scss → theme.scss} +0 -0
- data/app/controllers/refinery/admin/core_controller.rb +2 -7
- data/app/controllers/refinery/admin/dialogs_controller.rb +4 -3
- data/app/controllers/refinery/admin_controller.rb +0 -1
- data/app/controllers/refinery/fast_controller.rb +0 -4
- data/app/helpers/refinery/admin/visual_editor_helper.rb +13 -0
- data/app/helpers/refinery/admin_helper.rb +4 -0
- data/app/helpers/refinery/custom_assets_helper.rb +2 -2
- data/app/helpers/refinery/image_helper.rb +9 -8
- data/app/helpers/refinery/meta_helper.rb +1 -1
- data/app/helpers/refinery/site_bar_helper.rb +16 -2
- data/app/helpers/refinery/tag_helper.rb +38 -5
- data/app/models/refinery/core/base_model.rb +3 -1
- data/app/views/layouts/refinery/admin.html.erb +12 -10
- data/app/views/layouts/refinery/admin_dialog.html.erb +1 -4
- data/app/views/refinery/_content_page.html.erb +1 -1
- data/app/views/refinery/_google_analytics.html.erb +8 -9
- data/app/views/refinery/_head.html.erb +1 -1
- data/app/views/refinery/_javascripts.html.erb +0 -15
- data/app/views/refinery/_message.html.erb +1 -1
- data/app/views/refinery/_site_bar.html.erb +9 -6
- data/app/views/refinery/admin/_error_messages.html.erb +4 -4
- data/app/views/refinery/admin/_form_actions.html.erb +1 -0
- data/app/views/refinery/admin/_form_advanced_options_menu.html.erb +3 -4
- data/app/views/refinery/admin/_head.html.erb +3 -0
- data/app/views/refinery/admin/_image_picker.html.erb +4 -5
- data/app/views/refinery/admin/_javascripts.html.erb +4 -9
- data/app/views/refinery/admin/_locale_picker.html.erb +9 -2
- data/app/views/refinery/admin/_make_sortable.html.erb +8 -6
- data/app/views/refinery/admin/_menu.html.erb +2 -15
- data/app/views/refinery/admin/_menu_item.html.erb +3 -0
- data/app/views/refinery/admin/_resource_picker.html.erb +12 -22
- data/app/views/refinery/admin/_search.html.erb +1 -1
- data/app/views/refinery/admin/_tabbed_fields.html.erb +2 -2
- data/app/views/refinery/admin/_wysiwyg.html.erb +1 -1
- data/{lib/generators/refinery/cms/templates/app/decorators/controllers/refinery/.gitkeep → app/views/refinery/admin/dialog_success.html.erb} +0 -0
- data/app/views/refinery/admin/dialogs/show.html.erb +1 -19
- data/config/initializers/assets.rb +6 -0
- data/config/locales/ca.yml +84 -0
- data/config/locales/cs.yml +12 -5
- data/config/locales/en.yml +6 -2
- data/config/locales/fr.yml +15 -11
- data/config/locales/hu.yml +3 -1
- data/config/locales/it.yml +5 -1
- data/config/locales/ja.yml +2 -2
- data/config/locales/pt.yml +5 -3
- data/config/locales/ru.yml +7 -0
- data/config/locales/sl.yml +0 -3
- data/config/locales/tr.yml +43 -41
- data/config/routes.rb +1 -4
- data/lib/generators/refinery/cms/cms_generator.rb +68 -26
- data/lib/generators/refinery/cms/templates/app/decorators/{models/refinery/.gitkeep → controllers/refinery/.keep} +0 -0
- data/lib/generators/refinery/{form/templates/.gitkeep → cms/templates/app/decorators/models/refinery/.keep} +0 -0
- data/lib/generators/refinery/cms/templates/config/database.yml.mysql +3 -3
- data/lib/generators/refinery/cms/templates/config/database.yml.postgresql +3 -3
- data/lib/generators/refinery/core/templates/config/initializers/refinery/core.rb.erb +18 -5
- data/lib/generators/refinery/dummy/dummy_generator.rb +3 -1
- data/lib/generators/refinery/dummy/templates/rails/application.js +3 -0
- data/lib/generators/refinery/dummy/templates/rails/application.rb.erb +0 -2
- data/lib/generators/refinery/dummy/templates/rails/blank.png +0 -0
- data/lib/generators/refinery/dummy/templates/rails/routes.rb +1 -1
- data/lib/generators/refinery/engine/engine_generator.rb +3 -2
- data/lib/generators/refinery/engine/templates/Gemfile +9 -4
- data/lib/generators/refinery/engine/templates/Rakefile +3 -4
- data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +11 -2
- data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +2 -2
- data/lib/generators/refinery/engine/templates/app/models/refinery/namespace/singular_name.rb.erb +5 -5
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_actions.html.erb +7 -12
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_form.html.erb +8 -8
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +3 -3
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +6 -11
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +1 -1
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/plural_name/show.html.erb +4 -4
- data/lib/generators/refinery/engine/templates/db/migrate/1_create_namespace_plural_name.rb.erb +2 -9
- data/lib/generators/refinery/engine/templates/db/seeds.rb.erb +13 -19
- data/lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb +0 -4
- data/lib/generators/refinery/engine/templates/readme.md +3 -3
- data/lib/generators/refinery/engine/templates/refinerycms-extension_plural_name.gemspec +1 -0
- data/lib/generators/refinery/engine/templates/spec/features/refinery/namespace/admin/plural_name_spec.rb.erb +25 -28
- data/lib/generators/refinery/engine/templates/spec/models/refinery/namespace/singular_name_spec.rb.erb +1 -1
- data/lib/generators/refinery/engine/templates/spec/spec_helper.rb +1 -1
- data/lib/refinery.rb +7 -9
- data/lib/refinery/admin/base_controller.rb +42 -32
- data/lib/refinery/application_controller.rb +25 -17
- data/lib/refinery/cli.rb +54 -19
- data/lib/refinery/core.rb +5 -0
- data/lib/refinery/core/authorisation_adapter.rb +11 -0
- data/lib/refinery/core/authorisation_manager.rb +14 -0
- data/lib/refinery/core/configuration.rb +25 -4
- data/lib/refinery/core/default_route.rb +16 -0
- data/lib/refinery/core/engine.rb +44 -25
- data/lib/refinery/core/nil_user.rb +42 -0
- data/lib/refinery/crud.rb +40 -29
- data/lib/refinery/extension_generation.rb +11 -22
- data/lib/refinery/generators/generated_attribute.rb +54 -0
- data/lib/refinery/generators/named_base.rb +16 -0
- data/lib/refinery/menu.rb +3 -2
- data/lib/refinery/menu_item.rb +1 -1
- data/lib/refinery/plugin.rb +27 -43
- data/lib/refinery/plugins.rb +22 -26
- data/lib/refinery/users_manager.rb +8 -0
- data/lib/refinery/version.rb +7 -3
- data/lib/tasks/refinery.rake +7 -0
- data/license.md +1 -1
- data/refinerycms-core.gemspec +11 -8
- data/spec/controllers/refinery/admin/dummy_controller_spec.rb +23 -11
- data/spec/controllers/refinery/sitemap_controller_spec.rb +2 -2
- data/spec/features/refinery/admin/custom_assets_spec.rb +12 -10
- data/spec/features/refinery/admin/dialogs_spec.rb +5 -5
- data/spec/features/refinery/admin/xhr_paging_spec.rb +24 -38
- data/spec/features/refinery/application_layout_spec.rb +3 -3
- data/spec/features/refinery/core_spec.rb +1 -1
- data/spec/features/refinery/site_bar_spec.rb +44 -23
- data/spec/helpers/refinery/admin_helper_spec.rb +15 -0
- data/spec/helpers/refinery/custom_assets_helper_spec.rb +15 -23
- data/spec/helpers/refinery/html_truncation_helper_spec.rb +10 -5
- data/spec/helpers/refinery/meta_helper_spec.rb +3 -3
- data/spec/helpers/refinery/pagination_helper_spec.rb +7 -7
- data/spec/helpers/refinery/tag_helper_spec.rb +4 -4
- data/spec/helpers/refinery/translation_helper_spec.rb +3 -3
- data/spec/lib/generators/refinery/cms/cms_generator_spec.rb +30 -25
- data/spec/lib/generators/refinery/core/core_generator_spec.rb +1 -1
- data/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb +7 -8
- data/spec/lib/generators/refinery/engine/engine_generator_sanity_check_spec.rb +15 -15
- data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +9 -9
- data/spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb +1 -1
- data/spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb +1 -1
- data/spec/lib/refinery/application_controller_spec.rb +16 -16
- data/spec/lib/refinery/authorisation_manager_spec.rb +10 -0
- data/spec/lib/refinery/cli_spec.rb +83 -21
- data/spec/lib/refinery/core/configuration_spec.rb +5 -5
- data/spec/lib/refinery/core/nil_user_spec.rb +39 -0
- data/spec/lib/refinery/core_spec.rb +39 -30
- data/spec/lib/refinery/crud_spec.rb +70 -59
- data/spec/lib/refinery/menu_spec.rb +4 -4
- data/spec/lib/refinery/plugin_spec.rb +56 -45
- data/spec/lib/refinery/plugins_spec.rb +39 -87
- data/spec/lib/refinery/users_manager_spec.rb +9 -0
- data/spec/support/refinery.rb +3 -8
- data/vendor/assets/fonts/font-awesome/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.svg +565 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/stylesheets/_font-awesome-compass.scss +5 -0
- data/vendor/assets/stylesheets/_font-awesome-sprockets.scss +5 -0
- data/vendor/assets/stylesheets/_font-awesome.scss +17 -0
- data/vendor/assets/stylesheets/font-awesome/_animated.scss +34 -0
- data/vendor/assets/stylesheets/font-awesome/_bordered-pulled.scss +16 -0
- data/vendor/assets/stylesheets/font-awesome/_core.scss +12 -0
- data/vendor/assets/stylesheets/font-awesome/_extras.scss +44 -0
- data/vendor/assets/stylesheets/font-awesome/_fixed-width.scss +6 -0
- data/vendor/assets/stylesheets/font-awesome/_icons.scss +596 -0
- data/vendor/assets/stylesheets/font-awesome/_larger.scss +13 -0
- data/vendor/assets/stylesheets/font-awesome/_list.scss +19 -0
- data/vendor/assets/stylesheets/font-awesome/_mixins.scss +26 -0
- data/vendor/assets/stylesheets/font-awesome/_path.scss +14 -0
- data/vendor/assets/stylesheets/font-awesome/_rotated-flipped.scss +20 -0
- data/vendor/assets/stylesheets/font-awesome/_stacked.scss +20 -0
- data/vendor/assets/stylesheets/font-awesome/_variables.scss +606 -0
- metadata +144 -441
- data/app/assets/images/refinery/carousel-left.png +0 -0
- data/app/assets/images/refinery/carousel-right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/arrow_redo.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/arrow_undo.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/eye.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/article.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/aside.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/blockquote.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/command.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/details.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/figcaption.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/figure.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/footer.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/header.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/hgroup.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/mark.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/meter.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/nav.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/p.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/pre.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/progress.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/readme.md +0 -1
- data/app/assets/images/wymeditor/skins/refinery/html5/rp.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/rt.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/ruby.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/section.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/summary.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/time.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-blockquote.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-p.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-pre.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/link_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/link_break.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/page_code.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/page_paste.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/photo_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/style.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/table_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_center.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_justify.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_left.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_bold.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_indent.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_indent_remove.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_italic.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_list_bullets.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_list_numbers.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_paragraph.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_strikethrough.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_subscript.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_superscript.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_underline.png +0 -0
- data/app/assets/images/wymeditor/skins/wymeditor_icon.png +0 -0
- data/app/assets/javascripts/refinery/boot_wym.js.erb +0 -285
- data/app/assets/javascripts/refinery/sortable_menu.js.coffee.erb +0 -20
- data/app/assets/javascripts/refinery/wymeditor.js +0 -37
- data/app/assets/javascripts/wymeditor/GPL-license.txt +0 -278
- data/app/assets/javascripts/wymeditor/MIT-license.txt +0 -20
- data/app/assets/javascripts/wymeditor/README +0 -35
- data/app/assets/javascripts/wymeditor/browsers/ie.js.erb +0 -224
- data/app/assets/javascripts/wymeditor/browsers/mozilla.js.erb +0 -292
- data/app/assets/javascripts/wymeditor/browsers/opera.js.erb +0 -123
- data/app/assets/javascripts/wymeditor/browsers/webkit.js.erb +0 -283
- data/app/assets/javascripts/wymeditor/classes.js.erb +0 -1575
- data/app/assets/javascripts/wymeditor/functions.js.erb +0 -222
- data/app/assets/javascripts/wymeditor/lang/bg.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/ca.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/cs.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/da.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/de.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/en.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/es.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/fa.js +0 -46
- data/app/assets/javascripts/wymeditor/lang/fi.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/fr.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/he.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/hu.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/it.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/ja.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/lv.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/nb.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/nl.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/nn.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/pl.js +0 -56
- data/app/assets/javascripts/wymeditor/lang/pt-BR.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/pt.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/rs.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/ru.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/sk.js +0 -56
- data/app/assets/javascripts/wymeditor/lang/sl.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/sv.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/tr.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/vi.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/zh-CN.js +0 -47
- data/app/assets/javascripts/wymeditor/prototypes.js.erb +0 -1103
- data/app/assets/javascripts/wymeditor/setup.js.erb +0 -622
- data/app/assets/javascripts/wymeditor/skins/refinery/skin.js +0 -45
- data/app/assets/javascripts/wymeditor/validators.js.erb +0 -777
- data/app/assets/stylesheets/refinery/refinery.css +0 -15
- data/app/assets/stylesheets/refinery/site_bar.css.scss +0 -92
- data/app/assets/stylesheets/refinery/ui.css.scss +0 -103
- data/app/assets/stylesheets/wymeditor/skins/refinery/skin.css.scss +0 -530
- data/app/assets/stylesheets/wymeditor/skins/refinery/wymiframe.css.scss +0 -156
- data/app/helpers/refinery/admin/core_helper.rb +0 -6
- data/app/helpers/refinery/admin/dialogs_helper.rb +0 -6
- data/app/helpers/refinery/fast_helper.rb +0 -4
- data/app/helpers/refinery/sitemap_helper.rb +0 -4
- data/app/views/refinery/wymiframe.html.erb +0 -14
- data/lib/generators/refinery/form/USAGE +0 -20
- data/lib/generators/refinery/form/form_generator.rb +0 -25
- data/lib/generators/refinery/form/templates/.gitignore +0 -2
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +0 -54
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/settings_controller.rb.erb +0 -45
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +0 -53
- data/lib/generators/refinery/form/templates/app/mailers/refinery/namespace/mailer.rb.erb +0 -22
- data/lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb +0 -34
- data/lib/generators/refinery/form/templates/app/models/refinery/namespace/singular_name.rb.erb +0 -49
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +0 -23
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +0 -25
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_submenu.html.erb +0 -29
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +0 -4
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/show.html.erb +0 -52
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/spam.html.erb +0 -27
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_confirmation_email_form.html.erb +0 -51
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_notification_recipients_form.html.erb +0 -21
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/edit.html.erb +0 -5
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/mailer/confirmation.html.erb +0 -1
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/mailer/notification.html.erb +0 -17
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb +0 -43
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/thank_you.html.erb +0 -1
- data/lib/generators/refinery/form/templates/config/locales/cs.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/da.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/de.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/en.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/es.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/fr.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/it.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/lv.yml +0 -77
- data/lib/generators/refinery/form/templates/config/locales/nb.yml +0 -75
- data/lib/generators/refinery/form/templates/config/locales/nl.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/pt-BR.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/ru.yml +0 -77
- data/lib/generators/refinery/form/templates/config/locales/sk.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/sl.yml +0 -67
- data/lib/generators/refinery/form/templates/config/locales/tr.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/zh-CN.yml +0 -78
- data/lib/generators/refinery/form/templates/config/routes.rb.erb +0 -26
- data/lib/generators/refinery/form/templates/db/migrate/1_create_plural_name.rb.erb +0 -39
- data/lib/generators/refinery/form/templates/db/seeds.rb.erb +0 -31
- data/lib/generators/refinery/form/templates/lib/generators/refinery/plural_name_generator.rb.erb +0 -20
- data/lib/generators/refinery/form/templates/lib/refinery/plural_name.rb.erb +0 -18
- data/lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb +0 -27
- data/lib/generators/refinery/form/templates/lib/refinerycms-plural_name.rb.erb +0 -1
- data/lib/generators/refinery/form/templates/refinerycms-plural_name.gemspec +0 -16
- data/lib/generators/refinery/form/templates/script/rails +0 -10
- data/lib/refinery/activity.rb +0 -113
- data/lib/refinery/ext/action_view/helpers/form_builder.rb +0 -9
- data/lib/refinery/ext/action_view/helpers/form_helper.rb +0 -20
- data/lib/refinery/ext/action_view/helpers/form_tag_helper.rb +0 -10
- data/spec/controllers/refinery/admin/refinery_core_controller_spec.rb +0 -19
- data/spec/controllers/refinery/fast_controller_spec.rb +0 -12
- data/spec/lib/generators/refinery/form/form_generator_spec.rb +0 -99
- data/spec/lib/refinery/activity_spec.rb +0 -46
- data/spec/support/background_selenium_firefox_driver.rb +0 -14
- data/vendor/assets/javascripts/jquery/jquery.jcarousel.js +0 -900
@@ -11,24 +11,59 @@ describe "CLI" do
|
|
11
11
|
Rake::Task.define_task(:environment)
|
12
12
|
end
|
13
13
|
|
14
|
+
context "rake refinery:override:list" do
|
15
|
+
it "shows info message" do
|
16
|
+
msg = capture { rake["refinery:override:list"].invoke }
|
17
|
+
|
18
|
+
expect(msg).to include("You didn't specify a valid type to list overrides for. Here are some examples:")
|
19
|
+
|
20
|
+
expect(msg).to include("type=view")
|
21
|
+
expect(msg).to include("view=pages/home")
|
22
|
+
expect(msg).to include("view=refinery/pages/home")
|
23
|
+
expect(msg).to include("view=layouts/application")
|
24
|
+
|
25
|
+
expect(msg).to include("type=javascript")
|
26
|
+
expect(msg).to include("javascript=admin")
|
27
|
+
expect(msg).to include("javascript=refinery/site_bar")
|
28
|
+
expect(msg).to include("javascript=refinery**/{**/}*")
|
29
|
+
|
30
|
+
expect(msg).to include("type=stylesheet")
|
31
|
+
expect(msg).to include("stylesheet=home")
|
32
|
+
expect(msg).to include("stylesheet=refinery/site_bar")
|
33
|
+
|
34
|
+
expect(msg).to include("type=controller")
|
35
|
+
expect(msg).to include("controller=pages")
|
36
|
+
|
37
|
+
expect(msg).to include("type=model")
|
38
|
+
expect(msg).to include("model=page")
|
39
|
+
expect(msg).to include("model=refinery/page")
|
40
|
+
|
41
|
+
expect(msg).to include("type=helper")
|
42
|
+
expect(msg).to include("helper=site_bar")
|
43
|
+
expect(msg).to include("helper=refinery/site_bar_helper")
|
44
|
+
|
45
|
+
expect(msg).to include("type=presenter")
|
46
|
+
expect(msg).to include("presenter=refinery/page_presenter")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
14
50
|
context "when called with no args" do
|
15
51
|
it "shows info message" do
|
16
|
-
msg = capture
|
17
|
-
|
18
|
-
msg.
|
19
|
-
msg.
|
20
|
-
msg.
|
21
|
-
msg.
|
22
|
-
msg.
|
23
|
-
msg.
|
24
|
-
msg.
|
25
|
-
msg.
|
26
|
-
msg.
|
27
|
-
msg.
|
28
|
-
msg.
|
29
|
-
msg.
|
30
|
-
msg.
|
31
|
-
msg.should match("rake refinery:override helper=refinery/site_bar_helper")
|
52
|
+
msg = capture { rake["refinery:override"].invoke }
|
53
|
+
|
54
|
+
expect(msg).to include("You didn't specify anything valid to override. Here are some examples:")
|
55
|
+
expect(msg).to include("rake refinery:override view=pages/home")
|
56
|
+
expect(msg).to include("rake refinery:override view=refinery/pages/home")
|
57
|
+
expect(msg).to include("rake refinery:override view=layouts/application")
|
58
|
+
expect(msg).to include("rake refinery:override javascript=admin")
|
59
|
+
expect(msg).to include("rake refinery:override javascript=refinery/site_bar")
|
60
|
+
expect(msg).to include("rake refinery:override stylesheet=home")
|
61
|
+
expect(msg).to include("rake refinery:override stylesheet=refinery/site_bar")
|
62
|
+
expect(msg).to include("rake refinery:override controller=pages")
|
63
|
+
expect(msg).to include("rake refinery:override model=page")
|
64
|
+
expect(msg).to include("rake refinery:override model=refinery/page")
|
65
|
+
expect(msg).to include("rake refinery:override helper=site_bar")
|
66
|
+
expect(msg).to include("rake refinery:override helper=refinery/site_bar_helper")
|
32
67
|
end
|
33
68
|
end
|
34
69
|
|
@@ -39,9 +74,9 @@ describe "CLI" do
|
|
39
74
|
it "shows message" do
|
40
75
|
ENV[env] = "non-existent"
|
41
76
|
|
42
|
-
msg = capture
|
77
|
+
msg = capture { rake["refinery:override"].invoke }
|
43
78
|
|
44
|
-
msg.
|
79
|
+
expect(msg).to include(not_found_message)
|
45
80
|
end
|
46
81
|
end
|
47
82
|
|
@@ -58,12 +93,12 @@ describe "CLI" do
|
|
58
93
|
it "copies file to app folder" do
|
59
94
|
ENV[env] = env_file_location
|
60
95
|
|
61
|
-
msg = capture
|
96
|
+
msg = capture { rake["refinery:override"].invoke }
|
62
97
|
|
63
98
|
Array(spec_success_message).each do |message_fragment|
|
64
|
-
msg.
|
99
|
+
expect(msg).to include(message_fragment)
|
65
100
|
end
|
66
|
-
File.exists?(Rails.root.join(copied_file_location)).
|
101
|
+
expect(File.exists?(Rails.root.join(copied_file_location))).to be_truthy
|
67
102
|
end
|
68
103
|
end
|
69
104
|
end
|
@@ -133,4 +168,31 @@ describe "CLI" do
|
|
133
168
|
let(:copied_file_location) { "app/assets/stylesheets/refinery/#{file_name}" }
|
134
169
|
end
|
135
170
|
end
|
171
|
+
|
172
|
+
private
|
173
|
+
|
174
|
+
# From episode 029 of Ruby Tapas by Avdi
|
175
|
+
# https://rubytapas.dpdcart.com/subscriber/post?id=88
|
176
|
+
def capture(stream=STDOUT, &block)
|
177
|
+
old_stdout = stream.clone
|
178
|
+
pipe_r, pipe_w = IO.pipe
|
179
|
+
pipe_r.sync = true
|
180
|
+
output = ""
|
181
|
+
reader = Thread.new do
|
182
|
+
begin
|
183
|
+
loop do
|
184
|
+
output << pipe_r.readpartial(1024)
|
185
|
+
end
|
186
|
+
rescue EOFError
|
187
|
+
end
|
188
|
+
end
|
189
|
+
stream.reopen(pipe_w)
|
190
|
+
yield
|
191
|
+
ensure
|
192
|
+
stream.reopen(old_stdout)
|
193
|
+
pipe_w.close
|
194
|
+
reader.join
|
195
|
+
pipe_r.close
|
196
|
+
return output
|
197
|
+
end
|
136
198
|
end
|
@@ -11,8 +11,8 @@ module Refinery
|
|
11
11
|
|
12
12
|
context 'when set in configuration' do
|
13
13
|
it 'returns name set by Refinery::Core.config' do
|
14
|
-
Refinery::Core.
|
15
|
-
Refinery::Core.site_name.
|
14
|
+
allow(Refinery::Core).to receive(:site_name).and_return('Test Site Name')
|
15
|
+
expect(Refinery::Core.site_name).to eq('Test Site Name')
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -28,14 +28,14 @@ module Refinery
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'returns name set in locale' do
|
31
|
-
Refinery::Core.site_name.
|
31
|
+
expect(Refinery::Core.site_name).to eq('I18n Site Name')
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
describe 'custom storage backend' do
|
37
37
|
it 'class should be nil by default' do
|
38
|
-
Refinery::Core.dragonfly_custom_backend_class.
|
38
|
+
expect(Refinery::Core.dragonfly_custom_backend_class).to eq(nil)
|
39
39
|
end
|
40
40
|
|
41
41
|
context 'is set in core' do
|
@@ -45,7 +45,7 @@ module Refinery
|
|
45
45
|
|
46
46
|
it 'and is set to a class that exists' do
|
47
47
|
Refinery::Core.dragonfly_custom_backend_class = 'Refinery::Core::DummyBackend'
|
48
|
-
Refinery::Core.dragonfly_custom_backend_class.
|
48
|
+
expect(Refinery::Core.dragonfly_custom_backend_class).to eq(backend.class)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper_no_rails'
|
2
|
+
require 'refinery/core/nil_user'
|
3
|
+
|
4
|
+
module Refinery
|
5
|
+
module Core
|
6
|
+
RSpec.describe NilUser do
|
7
|
+
describe "plugins" do
|
8
|
+
it "has all" do
|
9
|
+
expect(subject.plugins).to eq(Refinery::Plugins.registered)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "landing url" do
|
14
|
+
let(:active_plugins) { double("active_plugins") }
|
15
|
+
|
16
|
+
before do
|
17
|
+
allow(subject).to receive(:active_plugins).and_return(active_plugins)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "queries for the first landable url" do
|
21
|
+
expect(active_plugins).to receive(:first_url_in_menu)
|
22
|
+
subject.landing_url
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
describe "roles" do
|
28
|
+
it "responds to #has_role?" do
|
29
|
+
expect(subject).to respond_to(:has_role?)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should have all roles by default" do
|
33
|
+
expect(subject).to have_role(:zilch)
|
34
|
+
expect(subject).to have_role(:arbitrary)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -14,16 +14,16 @@ describe Refinery do
|
|
14
14
|
target::INCLUSIONS = []
|
15
15
|
subject.include_once(target, mod)
|
16
16
|
subject.include_once(target, mod)
|
17
|
-
target::INCLUSIONS.
|
17
|
+
expect(target::INCLUSIONS.size).to eq(1)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
describe "#extensions" do
|
23
23
|
it "should return an array of modules representing registered extensions" do
|
24
|
-
subject.extensions.
|
24
|
+
expect(subject.extensions).to be_a(Array)
|
25
25
|
subject.extensions.each do |e|
|
26
|
-
e.
|
26
|
+
expect(e).to be_a(Module)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -34,15 +34,15 @@ describe Refinery do
|
|
34
34
|
it "should add the extension's module to the array of registered extensions" do
|
35
35
|
subject.register_extension(Refinery::Core)
|
36
36
|
|
37
|
-
Refinery.extensions.
|
38
|
-
Refinery.extensions.
|
37
|
+
expect(Refinery.extensions).to include(Refinery::Core)
|
38
|
+
expect(Refinery.extensions.size).to eq(1)
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should not allow same extension to be registered twice" do
|
42
42
|
subject.register_extension(Refinery::Core)
|
43
43
|
subject.register_extension(Refinery::Core)
|
44
44
|
|
45
|
-
Refinery.extensions.
|
45
|
+
expect(Refinery.extensions.size).to eq(1)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -51,7 +51,7 @@ describe Refinery do
|
|
51
51
|
before { subject.register_extension(Refinery::Core) }
|
52
52
|
|
53
53
|
it "should return true if the extension is registered" do
|
54
|
-
subject.extension_registered?(Refinery::Core).
|
54
|
+
expect(subject.extension_registered?(Refinery::Core)).to eq(true)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -59,7 +59,7 @@ describe Refinery do
|
|
59
59
|
before { subject.extensions.clear }
|
60
60
|
|
61
61
|
it "should return false if the extension is not registered" do
|
62
|
-
subject.extension_registered?(Refinery::Core).
|
62
|
+
expect(subject.extension_registered?(Refinery::Core)).to eq(false)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
@@ -73,43 +73,43 @@ describe Refinery do
|
|
73
73
|
it "should remove the extension's module from the array of registered extensions" do
|
74
74
|
subject.unregister_extension(Refinery::Images)
|
75
75
|
|
76
|
-
subject.extensions.
|
76
|
+
expect(subject.extensions.size).to eq(0)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
80
|
describe "#validate_extension!" do
|
81
81
|
context "with a valid extension" do
|
82
82
|
it "should return nil" do
|
83
|
-
subject.send(:validate_extension!, Refinery::ValidEngine).
|
83
|
+
expect(subject.send(:validate_extension!, Refinery::ValidEngine)).to be_nil
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
87
|
context "with an invalid extension" do
|
88
88
|
it "should raise invalid extension exception" do
|
89
|
-
|
89
|
+
expect {
|
90
90
|
subject.send(:validate_extension!, Refinery::InvalidEngine)
|
91
|
-
}.
|
91
|
+
}.to raise_error(::Refinery::InvalidEngineError)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
96
|
describe "#roots" do
|
97
97
|
it "should return pathname to extension root when given constant as parameter" do
|
98
|
-
subject.roots(Refinery::Core).
|
98
|
+
expect(subject.roots(Refinery::Core)).to eq(Refinery::Core.root)
|
99
99
|
end
|
100
100
|
|
101
101
|
it "should return pathname to extension root when given symbol as parameter" do
|
102
|
-
subject.roots(:'refinery/core').
|
102
|
+
expect(subject.roots(:'refinery/core')).to eq(Refinery::Core.root)
|
103
103
|
end
|
104
104
|
|
105
105
|
it "should return pathname to extension root when given string as parameter" do
|
106
|
-
subject.roots("refinery/core").
|
106
|
+
expect(subject.roots("refinery/core")).to eq(Refinery::Core.root)
|
107
107
|
end
|
108
108
|
|
109
109
|
it "should return an array of all pathnames if no extension_name is specified" do
|
110
|
-
subject.roots.
|
110
|
+
expect(subject.roots).to be_a(Array)
|
111
111
|
subject.roots.each do |root|
|
112
|
-
root.
|
112
|
+
expect(root).to be_a(Pathname)
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
@@ -126,19 +126,19 @@ describe Refinery do
|
|
126
126
|
it "shows a deprecation warning" do
|
127
127
|
Refinery.deprecate("ugis")
|
128
128
|
@errors.rewind
|
129
|
-
@errors.read.
|
129
|
+
expect(@errors.read).to eq("\n-- DEPRECATION WARNING --\nThe use of 'ugis' is deprecated.\n")
|
130
130
|
end
|
131
131
|
|
132
132
|
it "takes when option" do
|
133
133
|
Refinery.deprecate("ugis", :when => "10.0")
|
134
134
|
@errors.rewind
|
135
|
-
@errors.read.
|
135
|
+
expect(@errors.read).to eq("\n-- DEPRECATION WARNING --\nThe use of 'ugis' is deprecated and will be removed at version 10.0.\n")
|
136
136
|
end
|
137
137
|
|
138
138
|
it "takes replacement option" do
|
139
139
|
Refinery.deprecate("ugis", :when => "10.0", :replacement => "philip")
|
140
140
|
@errors.rewind
|
141
|
-
@errors.read.
|
141
|
+
expect(@errors.read).to eq("\n-- DEPRECATION WARNING --\nThe use of 'ugis' is deprecated and will be removed at version 10.0.\nPlease use philip instead.\n")
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
@@ -148,12 +148,12 @@ describe Refinery do
|
|
148
148
|
end
|
149
149
|
|
150
150
|
it "returns admin_dummy_path" do
|
151
|
-
Refinery.route_for_model(Refinery::Dummy).
|
151
|
+
expect(Refinery.route_for_model(Refinery::Dummy)).to eq("admin_dummy_path")
|
152
152
|
end
|
153
153
|
|
154
154
|
context ":plural => true" do
|
155
155
|
it "returns admin_dummies_path" do
|
156
|
-
Refinery.route_for_model(Refinery::Dummy, :plural => true).
|
156
|
+
expect(Refinery.route_for_model(Refinery::Dummy, :plural => true)).to eq("admin_dummies_path")
|
157
157
|
end
|
158
158
|
end
|
159
159
|
end
|
@@ -163,7 +163,7 @@ describe Refinery do
|
|
163
163
|
end
|
164
164
|
|
165
165
|
it "returns admin_group_class_path" do
|
166
|
-
Refinery.route_for_model(Refinery::GroupClass).
|
166
|
+
expect(Refinery.route_for_model(Refinery::GroupClass)).to eq("admin_group_class_path")
|
167
167
|
end
|
168
168
|
end
|
169
169
|
|
@@ -172,12 +172,12 @@ describe Refinery do
|
|
172
172
|
end
|
173
173
|
|
174
174
|
it "returns admin_dummy_name_path" do
|
175
|
-
Refinery.route_for_model(Refinery::DummyName).
|
175
|
+
expect(Refinery.route_for_model(Refinery::DummyName)).to eq("admin_dummy_name_path")
|
176
176
|
end
|
177
177
|
|
178
178
|
context ":plural => true" do
|
179
179
|
it "returns admin_dummy_names_path" do
|
180
|
-
Refinery.route_for_model(Refinery::DummyName, :plural => true).
|
180
|
+
expect(Refinery.route_for_model(Refinery::DummyName, :plural => true)).to eq("admin_dummy_names_path")
|
181
181
|
end
|
182
182
|
end
|
183
183
|
end
|
@@ -189,24 +189,24 @@ describe Refinery do
|
|
189
189
|
end
|
190
190
|
|
191
191
|
it "returns dummy_admin_name_path" do
|
192
|
-
Refinery.route_for_model(Refinery::Dummy::Name).
|
192
|
+
expect(Refinery.route_for_model(Refinery::Dummy::Name)).to eq("dummy_admin_name_path")
|
193
193
|
end
|
194
194
|
|
195
195
|
context ":plural => true" do
|
196
196
|
it "returns dummy_admin_names_path" do
|
197
|
-
Refinery.route_for_model(Refinery::Dummy::Name, :plural => true).
|
197
|
+
expect(Refinery.route_for_model(Refinery::Dummy::Name, :plural => true)).to eq("dummy_admin_names_path")
|
198
198
|
end
|
199
199
|
end
|
200
200
|
|
201
201
|
context ":admin => false" do
|
202
202
|
it "returns dummy_name_path" do
|
203
|
-
Refinery.route_for_model(Refinery::Dummy::Name, :admin => false).
|
203
|
+
expect(Refinery.route_for_model(Refinery::Dummy::Name, :admin => false)).to eq('dummy_name_path')
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
207
|
context ":admin => false, :plural => true" do
|
208
208
|
it "returns dummy_names_path" do
|
209
|
-
Refinery.route_for_model(Refinery::Dummy::Name, :admin => false, :plural => true).
|
209
|
+
expect(Refinery.route_for_model(Refinery::Dummy::Name, :admin => false, :plural => true)).to eq('dummy_names_path')
|
210
210
|
end
|
211
211
|
end
|
212
212
|
end
|
@@ -215,8 +215,17 @@ describe Refinery do
|
|
215
215
|
describe Refinery::Core::Engine do
|
216
216
|
describe "#helpers" do
|
217
217
|
it "should not include ApplicationHelper" do
|
218
|
-
Refinery::Core::Engine.helpers.ancestors.map(&:name).
|
218
|
+
expect(Refinery::Core::Engine.helpers.ancestors.map(&:name)).not_to include("ApplicationHelper")
|
219
219
|
end
|
220
220
|
end
|
221
221
|
end
|
222
|
+
|
223
|
+
describe "backend_path" do
|
224
|
+
let(:root_path) { "/custom/path" }
|
225
|
+
|
226
|
+
it "should take into account the mount point" do
|
227
|
+
allow(Refinery::Core).to receive(:mounted_path).and_return(root_path)
|
228
|
+
expect(Refinery::Core.backend_path).to eq("#{root_path}/refinery")
|
229
|
+
end
|
230
|
+
end
|
222
231
|
end
|
@@ -11,7 +11,6 @@ end
|
|
11
11
|
|
12
12
|
module Refinery
|
13
13
|
class CrudDummy < ActiveRecord::Base
|
14
|
-
attr_accessible :parent_id
|
15
14
|
acts_as_nested_set
|
16
15
|
end
|
17
16
|
|
@@ -22,79 +21,92 @@ end
|
|
22
21
|
|
23
22
|
module Refinery
|
24
23
|
describe CrudDummyController, :type => :controller do
|
24
|
+
before do
|
25
|
+
@routes = ActionDispatch::Routing::RouteSet.new.tap do |r|
|
26
|
+
r.draw do
|
27
|
+
namespace :refinery do
|
28
|
+
resources :crud_dummy, except: :show do
|
29
|
+
post :update_positions, on: :collection
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
25
35
|
|
26
36
|
describe "#update_positions" do
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
"
|
35
|
-
"0" => {
|
36
|
-
|
37
|
-
|
37
|
+
context "with existing dummies" do
|
38
|
+
let!(:crud_dummy_one) { Refinery::CrudDummy.create! }
|
39
|
+
let!(:crud_dummy_two) { Refinery::CrudDummy.create! }
|
40
|
+
let!(:crud_dummy_three) { Refinery::CrudDummy.create! }
|
41
|
+
|
42
|
+
it "orders dummies" do
|
43
|
+
post :update_positions, {
|
44
|
+
"ul" => {
|
45
|
+
"0" => {
|
46
|
+
"0" => {"id" => "crud_dummy_#{crud_dummy_three.id}"},
|
47
|
+
"1" => {"id" => "crud_dummy_#{crud_dummy_two.id}"},
|
48
|
+
"2" => {"id" => "crud_dummy_#{crud_dummy_one.id}"}
|
49
|
+
}
|
38
50
|
}
|
39
51
|
}
|
40
|
-
}
|
41
52
|
|
42
|
-
|
43
|
-
|
44
|
-
|
53
|
+
dummy = crud_dummy_three.reload
|
54
|
+
expect(dummy.lft).to eq(1)
|
55
|
+
expect(dummy.rgt).to eq(2)
|
45
56
|
|
46
|
-
|
47
|
-
|
48
|
-
|
57
|
+
dummy = crud_dummy_two.reload
|
58
|
+
expect(dummy.lft).to eq(3)
|
59
|
+
expect(dummy.rgt).to eq(4)
|
49
60
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
61
|
+
dummy = crud_dummy_one.reload
|
62
|
+
expect(dummy.lft).to eq(5)
|
63
|
+
expect(dummy.rgt).to eq(6)
|
64
|
+
end
|
54
65
|
|
55
|
-
|
56
|
-
|
57
|
-
|
66
|
+
it "orders nested dummies" do
|
67
|
+
nested_crud_dummy_one = Refinery::CrudDummy.create! :parent_id => crud_dummy_one.id
|
68
|
+
nested_crud_dummy_two = Refinery::CrudDummy.create! :parent_id => crud_dummy_one.id
|
58
69
|
|
59
|
-
|
60
|
-
|
61
|
-
"0" => {
|
70
|
+
post :update_positions, {
|
71
|
+
"ul" => {
|
62
72
|
"0" => {
|
63
|
-
"
|
64
|
-
|
65
|
-
"
|
66
|
-
"0" => {
|
67
|
-
|
73
|
+
"0" => {
|
74
|
+
"id" => "crud_dummy_#{crud_dummy_three.id}",
|
75
|
+
"children" => {
|
76
|
+
"0" => {
|
77
|
+
"0" => {"id" => "crud_dummy_#{nested_crud_dummy_one.id}"},
|
78
|
+
"1" => {"id" => "crud_dummy_#{nested_crud_dummy_two.id}"}
|
79
|
+
}
|
68
80
|
}
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
|
81
|
+
},
|
82
|
+
"1" => {"id" => "crud_dummy_#{crud_dummy_two.id}"},
|
83
|
+
"2" => {"id" => "crud_dummy_#{crud_dummy_one.id}"}
|
84
|
+
}
|
73
85
|
}
|
74
86
|
}
|
75
|
-
}
|
76
87
|
|
77
|
-
|
78
|
-
|
79
|
-
|
88
|
+
dummy = crud_dummy_three.reload
|
89
|
+
expect(dummy.lft).to eq(1)
|
90
|
+
expect(dummy.rgt).to eq(6)
|
80
91
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
92
|
+
dummy = nested_crud_dummy_one.reload
|
93
|
+
expect(dummy.lft).to eq(2)
|
94
|
+
expect(dummy.rgt).to eq(3)
|
95
|
+
expect(dummy.parent_id).to eq(crud_dummy_three.id)
|
85
96
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
97
|
+
dummy = nested_crud_dummy_two.reload
|
98
|
+
expect(dummy.lft).to eq(4)
|
99
|
+
expect(dummy.rgt).to eq(5)
|
100
|
+
expect(dummy.parent_id).to eq(crud_dummy_three.id)
|
90
101
|
|
91
|
-
|
92
|
-
|
93
|
-
|
102
|
+
dummy = crud_dummy_two.reload
|
103
|
+
expect(dummy.lft).to eq(7)
|
104
|
+
expect(dummy.rgt).to eq(8)
|
94
105
|
|
95
|
-
|
96
|
-
|
97
|
-
|
106
|
+
dummy = crud_dummy_one.reload
|
107
|
+
expect(dummy.lft).to eq(9)
|
108
|
+
expect(dummy.rgt).to eq(10)
|
109
|
+
end
|
98
110
|
end
|
99
111
|
|
100
112
|
# Regression test for https://github.com/refinery/refinerycms/issues/1585
|
@@ -105,13 +117,12 @@ module Refinery
|
|
105
117
|
# sorted above #2 if we are sorting by strings.
|
106
118
|
11.times do |n|
|
107
119
|
dummy << Refinery::CrudDummy.create!
|
108
|
-
dummy_params[
|
120
|
+
dummy_params[n.to_s] = {"id" => "crud_dummy_#{dummy[n].id}"}
|
109
121
|
end
|
110
122
|
|
111
123
|
post :update_positions, { "ul" => { "0" => dummy_params } }
|
112
124
|
|
113
|
-
dummy
|
114
|
-
dummy.lft.should eq(21)
|
125
|
+
expect(dummy.last.reload.lft).to eq(21)
|
115
126
|
end
|
116
127
|
end
|
117
128
|
|