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
data/refinerycms-core.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require File.expand_path('../../core/lib/refinery/version', __FILE__)
|
3
3
|
|
4
4
|
version = Refinery::Version.to_s
|
5
|
-
rails_version = ['>=
|
5
|
+
rails_version = ['>= 4.2.3', '< 5.0']
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.version = version
|
11
11
|
s.summary = %q{Core extension for Refinery CMS}
|
12
12
|
s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most extensions}
|
13
|
-
s.email = %q{
|
13
|
+
s.email = %q{refinerycms@p.arndt.io}
|
14
14
|
s.homepage = %q{http://refinerycms.com}
|
15
15
|
s.rubyforge_project = %q{refinerycms}
|
16
16
|
s.authors = ['Philip Arndt', 'Uģis Ozols', 'Rob Yurkowski']
|
@@ -20,16 +20,19 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
21
21
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
22
22
|
|
23
|
-
s.required_ruby_version =
|
23
|
+
s.required_ruby_version = Refinery::Version.required_ruby_version
|
24
24
|
|
25
|
-
s.add_dependency 'refinerycms-i18n', '~>
|
26
|
-
s.add_dependency 'awesome_nested_set', '~>
|
25
|
+
s.add_dependency 'refinerycms-i18n', '~> 3.0.0'
|
26
|
+
s.add_dependency 'awesome_nested_set', '~> 3.0.0'
|
27
27
|
s.add_dependency 'railties', rails_version
|
28
28
|
s.add_dependency 'activerecord', rails_version
|
29
29
|
s.add_dependency 'actionpack', rails_version
|
30
30
|
s.add_dependency 'truncate_html', '~> 0.9'
|
31
31
|
s.add_dependency 'will_paginate', '~> 3.0.2'
|
32
|
-
s.add_dependency 'sass-rails', '
|
33
|
-
s.add_dependency '
|
34
|
-
s.add_dependency '
|
32
|
+
s.add_dependency 'sass-rails', '>= 4.0', '< 5.1'
|
33
|
+
s.add_dependency 'coffee-rails', ['~> 4.0', '>= 4.0.0']
|
34
|
+
s.add_dependency 'jquery-rails', '>= 2.3.0'
|
35
|
+
s.add_dependency 'jquery-ui-rails', '~> 5.0.0'
|
36
|
+
s.add_dependency 'decorators', '~> 2.0.0'
|
37
|
+
s.add_dependency 'zilch-authorisation'
|
35
38
|
end
|
@@ -12,41 +12,53 @@ end
|
|
12
12
|
|
13
13
|
module Refinery
|
14
14
|
module Admin
|
15
|
-
describe DummyController do
|
15
|
+
describe DummyController, :type => :controller do
|
16
|
+
before do
|
17
|
+
@routes = ActionDispatch::Routing::RouteSet.new.tap do |r|
|
18
|
+
r.draw do
|
19
|
+
namespace :refinery do
|
20
|
+
namespace :admin do
|
21
|
+
resources :dummy
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
16
28
|
context "as refinery user" do
|
17
|
-
|
29
|
+
refinery_login
|
18
30
|
|
19
31
|
context "with permission" do
|
20
|
-
let(:controller_permission) { true }
|
21
32
|
it "allows access" do
|
22
|
-
controller.
|
33
|
+
allow(controller).to receive(:allow_controller?).and_return(true)
|
34
|
+
expect(controller).not_to receive :error_404
|
23
35
|
get :index
|
24
36
|
end
|
25
37
|
end
|
26
38
|
|
27
39
|
context "without permission" do
|
28
|
-
let(:controller_permission) { false }
|
29
40
|
it "denies access" do
|
30
|
-
controller.
|
41
|
+
allow(controller).to receive(:allow_controller?).and_return(false)
|
42
|
+
expect(controller).to receive :error_404
|
31
43
|
get :index
|
32
44
|
end
|
33
45
|
end
|
34
46
|
|
35
47
|
describe "force_ssl!" do
|
36
48
|
before do
|
37
|
-
controller.
|
49
|
+
allow(controller).to receive(:require_refinery_users!).and_return(false)
|
38
50
|
end
|
39
51
|
|
40
52
|
it "is false so standard HTTP is used" do
|
41
|
-
Refinery::Core.
|
42
|
-
controller.
|
53
|
+
allow(Refinery::Core).to receive(:force_ssl).and_return(false)
|
54
|
+
expect(controller).not_to receive(:redirect_to).with(:protocol => 'https')
|
43
55
|
|
44
56
|
get :index
|
45
57
|
end
|
46
58
|
|
47
59
|
it "is true so HTTPS is used" do
|
48
|
-
Refinery::Core.
|
49
|
-
controller.
|
60
|
+
allow(Refinery::Core).to receive(:force_ssl).and_return(true)
|
61
|
+
expect(controller).to receive(:redirect_to).with(:protocol => 'https')
|
50
62
|
|
51
63
|
get :index
|
52
64
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe SitemapController do
|
4
|
+
describe SitemapController, :type => :controller do
|
5
5
|
before (:each) do
|
6
6
|
@request.env['HTTP_ACCEPT'] = 'application/xml'
|
7
7
|
end
|
@@ -9,7 +9,7 @@ module Refinery
|
|
9
9
|
it "shows a valid xml response" do
|
10
10
|
get :index
|
11
11
|
|
12
|
-
response.
|
12
|
+
expect(response).to be_success
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -1,30 +1,32 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe "custom" do
|
5
|
-
|
4
|
+
describe "custom", :type => :feature do
|
5
|
+
refinery_login
|
6
|
+
after do
|
7
|
+
Refinery::Core.javascripts.reject! { |j| %w[custom_js].include?(j) }
|
8
|
+
Refinery::Core.stylesheets.reject! { |s| %w[custom_css].include?(s.path) }
|
9
|
+
end
|
6
10
|
|
7
11
|
context "javascripts" do
|
8
12
|
before do
|
9
|
-
::Refinery::Core.
|
13
|
+
::Refinery::Core.config.register_javascript('custom_js')
|
10
14
|
end
|
11
15
|
|
12
16
|
it "should be rendered when specified" do
|
13
|
-
|
14
|
-
|
15
|
-
page.body.include?('custom_js.js').should be
|
17
|
+
visit Refinery::Core.backend_path
|
18
|
+
expect(page.body.include?('custom_js.js')).to be
|
16
19
|
end
|
17
20
|
end
|
18
21
|
|
19
22
|
context "stylesheets" do
|
20
23
|
before do
|
21
|
-
::Refinery::Core.
|
24
|
+
::Refinery::Core.config.register_stylesheet('custom_css')
|
22
25
|
end
|
23
26
|
|
24
27
|
it "should be rendered when specified" do
|
25
|
-
|
26
|
-
|
27
|
-
page.body.include?('custom_css.css').should be
|
28
|
+
visit Refinery::Core.backend_path
|
29
|
+
expect(page.body).to include('custom_css.css')
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
@@ -1,26 +1,26 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe "dialog" do
|
5
|
-
|
4
|
+
describe "dialog", :type => :feature do
|
5
|
+
refinery_login
|
6
6
|
|
7
7
|
context "links" do
|
8
8
|
it "have iframe src" do
|
9
9
|
visit refinery.admin_dialog_path('Link')
|
10
|
-
page.
|
10
|
+
expect(page).to have_selector("iframe[src='/refinery/pages_dialogs/link_to']")
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
context "images" do
|
15
15
|
it "have iframe src" do
|
16
16
|
visit refinery.admin_dialog_path('Image')
|
17
|
-
page.
|
17
|
+
expect(page).to have_selector("iframe[src='/refinery/images/insert?modal=true']")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
context "a" do
|
22
22
|
it "404s" do
|
23
|
-
Admin::DialogsController.
|
23
|
+
expect_any_instance_of(Admin::DialogsController).to receive(:error_404).once
|
24
24
|
|
25
25
|
visit refinery.admin_dialog_path('a')
|
26
26
|
end
|
@@ -1,53 +1,39 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe "Crudify" do
|
5
|
-
|
4
|
+
describe "Crudify", type: :feature do
|
5
|
+
refinery_login
|
6
|
+
|
7
|
+
describe "xhr_paging", :js do
|
8
|
+
# Refinery::Admin::ImagesController specifies :order => 'created_at DESC' in crudify
|
9
|
+
let(:first_image) { Image.order('created_at DESC').first }
|
10
|
+
let(:last_image) { Image.order('created_at DESC').last }
|
11
|
+
let!(:image_1) { FactoryGirl.create :image }
|
12
|
+
let!(:image_2) { FactoryGirl.create :image }
|
6
13
|
|
7
|
-
describe "xhr_paging", :js => true do
|
8
|
-
# Refinery::Admin::UsersController specifies :order => 'username ASC' in crudify
|
9
|
-
let(:first_user) { User.order('username ASC').first }
|
10
|
-
let(:last_user) { User.order('username ASC').last }
|
11
14
|
before do
|
12
|
-
|
13
|
-
Admin::UsersController.should_receive(:xhr_pageable?).
|
14
|
-
at_least(1).times.and_return(xhr_pageable)
|
15
|
-
User.stub(:per_page).and_return(1)
|
15
|
+
allow(Image).to receive(:per_page).and_return(1)
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
it 'should perform ajax paging of index' do
|
21
|
-
visit refinery.admin_users_path
|
18
|
+
it 'performs ajax paging of index' do
|
19
|
+
visit refinery.admin_images_path
|
22
20
|
|
23
|
-
|
24
|
-
|
21
|
+
expect(page).to have_selector('ul#image_grid li > img', count: 1)
|
22
|
+
expect(page).to have_css(%Q{img[alt="#{first_image.title}"]})
|
25
23
|
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
# placeholder which would disappear in a full page refresh.
|
25
|
+
page.evaluate_script(
|
26
|
+
%{$('body').append('<i id="has_not_refreshed_entire_page"/>')}
|
27
|
+
)
|
29
28
|
|
30
|
-
|
31
|
-
|
29
|
+
within '.pagination' do
|
30
|
+
click_link '2'
|
32
31
|
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe 'set to false' do
|
36
|
-
let(:xhr_pageable) { false }
|
37
|
-
it 'should not perform ajax paging of index' do
|
38
|
-
visit refinery.admin_users_path
|
39
|
-
|
40
|
-
expect(page).to have_selector('li.record', :count => 1)
|
41
|
-
expect(page).to have_content(first_user.email)
|
42
32
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
expect(page.evaluate_script('jQuery.active')).to eq(0)
|
48
|
-
expect(page).to have_content(last_user.email)
|
49
|
-
|
50
|
-
end
|
33
|
+
expect(page).to have_css(%Q{img[alt="#{last_image.title}"]})
|
34
|
+
expect(page.evaluate_script(
|
35
|
+
%{$('i#has_not_refreshed_entire_page').length}
|
36
|
+
)).to eq(1)
|
51
37
|
end
|
52
38
|
end
|
53
39
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe 'layout' do
|
5
|
-
|
4
|
+
describe 'layout', :type => :feature do
|
5
|
+
refinery_login
|
6
6
|
|
7
7
|
let(:home_page) do
|
8
8
|
FactoryGirl.create :page, :title => 'Home', :link_url => '/'
|
@@ -12,7 +12,7 @@ module Refinery
|
|
12
12
|
it "id is the page's canonical id" do
|
13
13
|
visit home_page.url
|
14
14
|
|
15
|
-
page.
|
15
|
+
expect(page).to have_css 'body#home-page'
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -1,49 +1,70 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe "site bar" do
|
5
|
-
|
4
|
+
describe "site bar", :type => :feature do
|
5
|
+
refinery_login
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
describe "logout link" do
|
8
|
+
let(:logout_path) { '/refinery/logout' }
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
context "when set" do
|
11
|
+
before do
|
12
|
+
allow(Refinery::Core).to receive(:refinery_logout_path).and_return(logout_path)
|
13
|
+
visit Refinery::Core.backend_path
|
14
|
+
end
|
15
|
+
|
16
|
+
it "is present" do
|
17
|
+
expect(page).to have_selector("a[href='#{logout_path}']")
|
18
|
+
expect(page).to have_content("Log out")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context "when not set" do
|
23
|
+
it "is not present" do
|
24
|
+
visit Refinery::Core.backend_path
|
25
|
+
expect(page).not_to have_content("Log out")
|
26
|
+
expect(page).not_to have_selector("a[href='#{logout_path}']")
|
27
|
+
end
|
28
|
+
end
|
12
29
|
end
|
13
30
|
|
14
31
|
context "when in backend" do
|
15
|
-
before
|
32
|
+
before do
|
33
|
+
visit Refinery::Core.backend_path
|
34
|
+
end
|
16
35
|
|
17
|
-
it "
|
18
|
-
page.
|
19
|
-
page.
|
36
|
+
it "has a 'switch to your website button'" do
|
37
|
+
expect(page).to have_content("Switch to your website")
|
38
|
+
expect(page).to have_selector("a[href='/']")
|
20
39
|
end
|
21
40
|
|
22
41
|
it "switches to frontend" do
|
23
|
-
page.current_path.
|
42
|
+
expect(page.current_path).to match(/\A#{Refinery::Core.backend_path}/)
|
24
43
|
click_link "Switch to your website"
|
25
|
-
page.current_path.
|
44
|
+
expect(page.current_path).to eq(refinery.root_path)
|
26
45
|
end
|
27
46
|
end
|
28
47
|
|
29
48
|
context "when in frontend" do
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
visit refinery.root_path
|
35
|
-
end
|
49
|
+
# make a page in order to avoid 404
|
50
|
+
let!(:root_page) { FactoryGirl.create(:page, :link_url => "/") }
|
51
|
+
before { visit refinery.root_path }
|
36
52
|
|
37
|
-
it "
|
38
|
-
page.
|
39
|
-
page.
|
53
|
+
it "has a 'switch to your website editor' button" do
|
54
|
+
expect(page).to have_content("Switch to your website editor")
|
55
|
+
expect(page).to have_selector("a[href='/refinery']")
|
40
56
|
end
|
41
57
|
|
42
58
|
it "switches to backend" do
|
43
|
-
page.current_path.
|
59
|
+
expect(page.current_path).to eq(refinery.root_path)
|
44
60
|
click_link "Switch to your website editor"
|
45
|
-
page.current_path.
|
61
|
+
expect(page.current_path).to match(/\A#{Refinery::Core.backend_path}/)
|
46
62
|
end
|
63
|
+
|
64
|
+
it "has an 'edit this page' button" do
|
65
|
+
expect(page).to have_link("Edit this page", :href => refinery.edit_admin_page_path(root_page))
|
66
|
+
end
|
67
|
+
|
47
68
|
end
|
48
69
|
end
|
49
70
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
describe AdminHelper, :type => :helper do
|
5
|
+
describe "locale_country" do
|
6
|
+
it "should return the second part of a dialect" do
|
7
|
+
expect(helper.locale_country('zh-TW')).to eq("TW")
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should return the locale if it is not a dialect" do
|
11
|
+
expect(helper.locale_country('en')).to eq("EN")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,52 +1,44 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe CustomAssetsHelper do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
describe CustomAssetsHelper, :type => :helper do
|
5
|
+
def clear_assets_used_by_spec
|
6
|
+
Refinery::Core.javascripts.reject! {|j| %w[test parndt].include?(j) }
|
7
|
+
Refinery::Core.stylesheets.reject! {|s| %w[test parndt].include?(s.path) }
|
8
|
+
end
|
9
9
|
|
10
|
+
before { clear_assets_used_by_spec }
|
11
|
+
after { clear_assets_used_by_spec }
|
12
|
+
|
13
|
+
describe "custom_javascripts" do
|
10
14
|
it "should return one custom javascript in array when one javascript is registred" do
|
11
15
|
Refinery::Core.config.register_javascript("test")
|
12
|
-
helper.custom_javascripts.
|
16
|
+
expect(helper.custom_javascripts.last).to eq("test")
|
13
17
|
end
|
14
18
|
|
15
19
|
it "should return two custom javascripts in array when two javascripts are registred" do
|
16
20
|
Refinery::Core.config.register_javascript("test")
|
17
21
|
Refinery::Core.config.register_javascript("parndt")
|
18
|
-
helper.custom_javascripts.
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should return empty array when no javascript is registred" do
|
22
|
-
helper.custom_javascripts.should eq []
|
22
|
+
expect(helper.custom_javascripts).to include("test", "parndt")
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe "custom_stylesheets" do
|
27
|
-
before do
|
28
|
-
Refinery::Core.clear_stylesheets!
|
29
|
-
end
|
30
|
-
|
31
27
|
it "should return one custom stylesheet class in array when one stylesheet is registred" do
|
32
28
|
Refinery::Core.config.register_stylesheet("test")
|
33
|
-
helper.custom_stylesheets.
|
29
|
+
expect(helper.custom_stylesheets.last.path).to eq("test")
|
34
30
|
end
|
35
31
|
|
36
32
|
it "should return two custom stylesheet classes in array when two stylesheets are registred" do
|
37
33
|
Refinery::Core.config.register_stylesheet("test")
|
38
34
|
Refinery::Core.config.register_stylesheet("parndt")
|
39
|
-
helper.custom_stylesheets.
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should return empty array when no stylesheet is registred" do
|
43
|
-
helper.custom_stylesheets.should eq []
|
35
|
+
expect(helper.custom_stylesheets.map(&:path)).to include("test", "parndt")
|
44
36
|
end
|
45
37
|
|
46
38
|
it "should return stylesheet class with path and options when both are specified" do
|
47
39
|
Refinery::Core.config.register_stylesheet("test", :media => 'screen')
|
48
|
-
helper.custom_stylesheets.
|
49
|
-
helper.custom_stylesheets.
|
40
|
+
expect(helper.custom_stylesheets.last.path).to eq("test")
|
41
|
+
expect(helper.custom_stylesheets.last.options).to eq({:media => 'screen'})
|
50
42
|
end
|
51
43
|
end
|
52
44
|
end
|