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/lib/refinery/cli.rb
CHANGED
@@ -6,8 +6,8 @@ module Refinery
|
|
6
6
|
|
7
7
|
no_tasks do
|
8
8
|
def source_paths
|
9
|
-
Refinery::Plugins.registered.pathnames.map{|p|
|
10
|
-
%w(app vendor).map{|dir| p.join(dir, @override_kind[:dir])}
|
9
|
+
Refinery::Plugins.registered.pathnames.map{ |p|
|
10
|
+
%w(app vendor).map{ |dir| p.join(dir, @override_kind[:dir])}
|
11
11
|
}.flatten.uniq
|
12
12
|
end
|
13
13
|
end
|
@@ -44,7 +44,7 @@ module Refinery
|
|
44
44
|
:desc => 'javascript',
|
45
45
|
},
|
46
46
|
:stylesheet => {
|
47
|
-
:glob => '*.
|
47
|
+
:glob => '*.{s,}css',
|
48
48
|
:dir => 'assets/stylesheets',
|
49
49
|
:desc => 'stylesheet',
|
50
50
|
},
|
@@ -58,20 +58,24 @@ module Refinery
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
61
|
+
handle_invalid_override_input
|
62
|
+
end
|
63
|
+
|
64
|
+
desc "override_list", "lists files that you can override from any Refinery extension that you are using into your application"
|
65
|
+
def override_list(env)
|
66
|
+
OVERRIDES.keys.each do |kind|
|
67
|
+
which = env[kind.to_s] || (kind if env['type'] == kind.to_s)
|
68
|
+
if which.present? && @override_kind = OVERRIDES[kind]
|
69
|
+
matcher = [
|
70
|
+
"{refinery#{File::SEPARATOR},}", (which.presence || "**/*"), @override_kind[:glob]
|
71
|
+
].flatten.join
|
72
|
+
|
73
|
+
puts find_relative_matches(matcher).sort.join("\n")
|
74
|
+
return
|
73
75
|
end
|
74
76
|
end
|
77
|
+
|
78
|
+
handle_invalid_override_list_input
|
75
79
|
end
|
76
80
|
|
77
81
|
desc "uncrudify", "shows you the code that your controller using crudify is running for a given action"
|
@@ -91,11 +95,11 @@ module Refinery
|
|
91
95
|
abort "#{controller_class_name} is not defined"
|
92
96
|
end
|
93
97
|
|
94
|
-
crud_lines = Refinery.roots(
|
98
|
+
crud_lines = Refinery.roots('refinery/core').join('lib', 'refinery', 'crud.rb').read
|
95
99
|
if (matches = crud_lines.scan(/(\ +)(def #{action}.+?protected)/m).first).present? &&
|
96
100
|
(method_lines = "#{matches.last.split(%r{^#{matches.first}end}).first.strip}\nend".split("\n")).many?
|
97
101
|
indent = method_lines.second.index %r{[^ ]}
|
98
|
-
crud_method = method_lines.join("\n").gsub
|
102
|
+
crud_method = method_lines.join("\n").gsub(/^#{" " * indent}/, " ")
|
99
103
|
|
100
104
|
crud_options = controller_class.try(:crudify_options) || {}
|
101
105
|
crud_method.gsub! '#{options[:redirect_to_url]}', crud_options[:redirect_to_url].to_s
|
@@ -131,15 +135,46 @@ module Refinery
|
|
131
135
|
end
|
132
136
|
|
133
137
|
def find_matches(pattern)
|
134
|
-
Set.new source_paths.map {|path| Dir[path.join(pattern)] }.flatten
|
138
|
+
Set.new source_paths.map { |path| Dir[path.join(pattern)] }.flatten
|
135
139
|
end
|
136
140
|
|
137
141
|
def find_relative_matches(pattern)
|
138
|
-
find_matches(pattern).map {|match| strip_source_paths(match) }
|
142
|
+
find_matches(pattern).map { |match| strip_source_paths(match) }
|
139
143
|
end
|
140
144
|
|
141
145
|
def strip_source_paths(match)
|
142
146
|
match.gsub Regexp.new(source_paths.join('\/?|')), ''
|
143
147
|
end
|
148
|
+
|
149
|
+
def handle_invalid_override_input
|
150
|
+
puts "You didn't specify anything valid to override. Here are some examples:"
|
151
|
+
input_examples.each do |type, examples|
|
152
|
+
examples.each do |example|
|
153
|
+
puts "rake refinery:override #{type}=#{example}"
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def handle_invalid_override_list_input
|
159
|
+
puts "You didn't specify a valid type to list overrides for. Here are some examples:"
|
160
|
+
input_examples.each do |type, examples|
|
161
|
+
puts "\nrake refinery:override:list type=#{type}"
|
162
|
+
examples.each do |example|
|
163
|
+
puts "rake refinery:override:list #{type}=#{example}"
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def input_examples
|
169
|
+
{
|
170
|
+
:view => ['pages/home', 'refinery/pages/home', 'layouts/application'],
|
171
|
+
:javascript => %w(admin refinery/site_bar refinery**/{**/}*),
|
172
|
+
:stylesheet => %w(home refinery/site_bar),
|
173
|
+
:controller => %w(pages),
|
174
|
+
:model => %w(page refinery/page),
|
175
|
+
:helper => %w(site_bar refinery/site_bar_helper),
|
176
|
+
:presenter => %w(refinery/page_presenter)
|
177
|
+
}.freeze
|
178
|
+
end
|
144
179
|
end
|
145
180
|
end
|
data/lib/refinery/core.rb
CHANGED
@@ -2,9 +2,11 @@ require File.expand_path('../../refinery', __FILE__)
|
|
2
2
|
require 'truncate_html'
|
3
3
|
require 'will_paginate'
|
4
4
|
require 'refinery/i18n'
|
5
|
+
require 'zilch/authorisation'
|
5
6
|
|
6
7
|
module Refinery
|
7
8
|
module Core
|
9
|
+
require 'refinery/core/default_route'
|
8
10
|
require 'refinery/core/engine'
|
9
11
|
require 'refinery/core/configuration'
|
10
12
|
|
@@ -20,3 +22,6 @@ end
|
|
20
22
|
# see https://github.com/refinery/refinerycms/issues/2273
|
21
23
|
require 'decorators'
|
22
24
|
require 'jquery-rails'
|
25
|
+
require 'jquery-ui-rails'
|
26
|
+
require 'sass-rails'
|
27
|
+
require 'coffee-rails'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "zilch/authorisation/authorisation_manager"
|
2
|
+
require "refinery/core/authorisation_adapter"
|
3
|
+
|
4
|
+
module Refinery
|
5
|
+
module Core
|
6
|
+
class AuthorisationManager < Zilch::Authorisation::AuthorisationManager
|
7
|
+
|
8
|
+
def default_adapter
|
9
|
+
@default_adapter ||= Refinery::Core::AuthorisationAdapter.new
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -4,11 +4,12 @@ module Refinery
|
|
4
4
|
|
5
5
|
config_accessor :rescue_not_found, :s3_backend, :base_cache_key, :site_name,
|
6
6
|
:google_analytics_page_code, :authenticity_token_on_frontend,
|
7
|
-
:dragonfly_secret,
|
8
|
-
:wymeditor_whitelist_tags, :javascripts, :stylesheets,
|
7
|
+
:dragonfly_secret, :javascripts, :stylesheets, :mounted_path,
|
9
8
|
:s3_bucket_name, :s3_region, :s3_access_key_id,
|
10
9
|
:s3_secret_access_key, :force_ssl, :backend_route,
|
11
|
-
:dragonfly_custom_backend_class, :dragonfly_custom_backend_opts
|
10
|
+
:dragonfly_custom_backend_class, :dragonfly_custom_backend_opts,
|
11
|
+
:visual_editor_javascripts, :visual_editor_stylesheets,
|
12
|
+
:plugin_priority, :refinery_logout_path
|
12
13
|
|
13
14
|
self.rescue_not_found = false
|
14
15
|
self.s3_backend = false
|
@@ -17,7 +18,6 @@ module Refinery
|
|
17
18
|
self.google_analytics_page_code = "UA-xxxxxx-x"
|
18
19
|
self.authenticity_token_on_frontend = false
|
19
20
|
self.dragonfly_secret = Array.new(24) { rand(256) }.pack('C*').unpack('H*').first
|
20
|
-
self.wymeditor_whitelist_tags = {}
|
21
21
|
self.javascripts = []
|
22
22
|
self.stylesheets = []
|
23
23
|
self.s3_bucket_name = ENV['S3_BUCKET']
|
@@ -26,8 +26,12 @@ module Refinery
|
|
26
26
|
self.s3_secret_access_key = ENV['S3_SECRET']
|
27
27
|
self.force_ssl = false
|
28
28
|
self.backend_route = "refinery"
|
29
|
+
self.mounted_path = "/"
|
29
30
|
self.dragonfly_custom_backend_class = ''
|
30
31
|
self.dragonfly_custom_backend_opts = {}
|
32
|
+
self.visual_editor_javascripts = []
|
33
|
+
self.visual_editor_stylesheets = []
|
34
|
+
self.plugin_priority = []
|
31
35
|
|
32
36
|
def config.register_javascript(name)
|
33
37
|
self.javascripts << name
|
@@ -37,12 +41,25 @@ module Refinery
|
|
37
41
|
self.stylesheets << Stylesheet.new(*args)
|
38
42
|
end
|
39
43
|
|
44
|
+
def config.register_visual_editor_javascript(name)
|
45
|
+
self.visual_editor_javascripts << name
|
46
|
+
end
|
47
|
+
|
48
|
+
def config.register_visual_editor_stylesheet(*args)
|
49
|
+
self.visual_editor_stylesheets << Stylesheet.new(*args)
|
50
|
+
end
|
51
|
+
|
40
52
|
class << self
|
41
53
|
def backend_route
|
42
54
|
# prevent / at the start.
|
43
55
|
config.backend_route.to_s.gsub(%r{\A/}, '')
|
44
56
|
end
|
45
57
|
|
58
|
+
# See https://github.com/refinery/refinerycms/issues/2740
|
59
|
+
def backend_path
|
60
|
+
[mounted_path.gsub(%r{/\z}, ''), backend_route].join("/")
|
61
|
+
end
|
62
|
+
|
46
63
|
def clear_javascripts!
|
47
64
|
self.javascripts = []
|
48
65
|
end
|
@@ -62,6 +79,10 @@ module Refinery
|
|
62
79
|
def site_name
|
63
80
|
::I18n.t('site_name', :scope => 'refinery.core.config', :default => config.site_name)
|
64
81
|
end
|
82
|
+
|
83
|
+
def wymeditor_whitelist_tags=(tags)
|
84
|
+
raise "Please ensure refinerycms-wymeditor is being used and use Refinery::Wymeditor.whitelist_tags instead of Refinery::Core.wymeditor_whitelist_tags"
|
85
|
+
end
|
65
86
|
end
|
66
87
|
|
67
88
|
# wrapper for stylesheet registration
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Core
|
3
|
+
class DefaultRoute
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def load
|
7
|
+
Refinery::Core::Engine.routes.draw do
|
8
|
+
namespace :admin, :path => Refinery::Core.backend_route do
|
9
|
+
root :to => ::Refinery::Plugins.registered.in_menu.first.url
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/refinery/core/engine.rb
CHANGED
@@ -7,31 +7,31 @@ module Refinery
|
|
7
7
|
engine_name :refinery
|
8
8
|
|
9
9
|
class << self
|
10
|
-
# Register all decorators from app/decorators/ and registered plugins' paths.
|
11
|
-
def register_decorators!
|
12
|
-
Decorators.register! Rails.root, Refinery::Plugins.registered.pathnames
|
13
|
-
end
|
14
|
-
|
15
10
|
# Performs the Refinery inclusion process which extends the currently loaded Rails
|
16
11
|
# applications with Refinery's controllers and helpers. The process is wrapped by
|
17
12
|
# a before_inclusion and after_inclusion step that calls procs registered by the
|
18
13
|
# Refinery::Engine#before_inclusion and Refinery::Engine#after_inclusion class methods
|
19
14
|
def refinery_inclusion!
|
20
|
-
before_inclusion_procs.each(&:call)
|
15
|
+
before_inclusion_procs.each(&:call).tap do |c|
|
16
|
+
c.clear if Rails.application.config.cache_classes
|
17
|
+
end
|
21
18
|
|
22
19
|
Refinery.include_once(::ApplicationController, Refinery::ApplicationController)
|
23
20
|
::ApplicationController.send :helper, Refinery::Core::Engine.helpers
|
24
21
|
|
25
|
-
after_inclusion_procs.each(&:call)
|
22
|
+
after_inclusion_procs.each(&:call).tap do |c|
|
23
|
+
c.clear if Rails.application.config.cache_classes
|
24
|
+
end
|
25
|
+
|
26
|
+
# Register all decorators from app/decorators/ and registered plugins' paths.
|
27
|
+
Decorators.register! Rails.root, Refinery::Plugins.registered.pathnames
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
29
31
|
config.autoload_paths += %W( #{config.root}/lib )
|
30
32
|
|
31
33
|
# Include the refinery controllers and helpers dynamically
|
32
|
-
config.to_prepare
|
33
|
-
|
34
|
-
after_inclusion &method(:register_decorators!).to_proc
|
34
|
+
config.to_prepare(&method(:refinery_inclusion!).to_proc)
|
35
35
|
|
36
36
|
# Wrap errors in spans
|
37
37
|
config.to_prepare do
|
@@ -44,7 +44,7 @@ module Refinery
|
|
44
44
|
WillPaginate.per_page = 20
|
45
45
|
end
|
46
46
|
|
47
|
-
|
47
|
+
before_inclusion do
|
48
48
|
Refinery::Plugin.register do |plugin|
|
49
49
|
plugin.pathname = root
|
50
50
|
plugin.name = 'refinery_core'
|
@@ -53,9 +53,7 @@ module Refinery
|
|
53
53
|
plugin.always_allow_access = true
|
54
54
|
plugin.menu_match = /refinery\/(refinery_)?core$/
|
55
55
|
end
|
56
|
-
end
|
57
56
|
|
58
|
-
initializer "register refinery_dialogs plugin" do
|
59
57
|
Refinery::Plugin.register do |plugin|
|
60
58
|
plugin.pathname = root
|
61
59
|
plugin.name = 'refinery_dialogs'
|
@@ -75,21 +73,42 @@ module Refinery
|
|
75
73
|
app.config.autoload_paths += [
|
76
74
|
Rails.root.join('app', 'presenters'),
|
77
75
|
Rails.root.join('vendor', '**', '**', 'app', 'presenters'),
|
78
|
-
Refinery.roots.map{|r| r.join('**', 'app', 'presenters')}
|
76
|
+
Refinery.roots.map{ |r| r.join('**', 'app', 'presenters')}
|
79
77
|
].flatten
|
80
78
|
end
|
81
79
|
|
82
|
-
# set
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
80
|
+
# set assets to be precompiled
|
81
|
+
config.to_prepare do
|
82
|
+
|
83
|
+
# scripts
|
84
|
+
Rails.application.config.assets.precompile += %w(
|
85
|
+
refinery/*.js
|
86
|
+
refinery/icons/*
|
87
|
+
modernizr-min.js
|
88
|
+
admin.js
|
89
|
+
)
|
90
|
+
|
91
|
+
# stylesheets
|
92
|
+
Rails.application.config.assets.precompile += %w(
|
93
|
+
refinery/refinery.css
|
94
|
+
refinery/formatting.css
|
95
|
+
refinery/site_bar.css
|
96
|
+
refinery/theme.css
|
97
|
+
)
|
98
|
+
|
99
|
+
# images
|
100
|
+
Rails.application.config.assets.precompile += %w(
|
101
|
+
refinery/images/*
|
102
|
+
)
|
103
|
+
|
104
|
+
# fonts
|
105
|
+
Rails.application.config.assets.precompile += %w(
|
106
|
+
font-awesome/fontawesome-webfont.eot
|
107
|
+
font-awesome/fontawesome-webfont.woff2
|
108
|
+
font-awesome/fontawesome-webfont.woff
|
109
|
+
font-awesome/fontawesome-webfont.ttf
|
110
|
+
font-awesome/fontawesome-webfont.svg
|
111
|
+
)
|
93
112
|
end
|
94
113
|
|
95
114
|
# active model fields which may contain sensitive data to filter
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'zilch/authorisation/nil_user'
|
2
|
+
require 'refinery/plugins'
|
3
|
+
|
4
|
+
module Refinery
|
5
|
+
module Core
|
6
|
+
class NilUser < Zilch::Authorisation::NilUser
|
7
|
+
# The default NilUser has all roles and can access all plugins.
|
8
|
+
# Should be overridden in authentication solutions.
|
9
|
+
def has_role?(role)
|
10
|
+
true
|
11
|
+
end
|
12
|
+
|
13
|
+
# Returns all plugins that the user has access to, that are currently
|
14
|
+
# loaded in the system.
|
15
|
+
# For NilUser, this returns all registered plugins.
|
16
|
+
# Should be overridden in authentication solutions
|
17
|
+
def active_plugins
|
18
|
+
Refinery::Plugins.registered
|
19
|
+
end
|
20
|
+
|
21
|
+
# Returns all registered plugins.
|
22
|
+
# Should be overridden in authentication solutions.
|
23
|
+
def plugins
|
24
|
+
Refinery::Plugins.registered
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns true.
|
28
|
+
# Should be overridden in authentication solutions.
|
29
|
+
# A real solution might be: `Refinery::Plugins.active.names.include?(name)`
|
30
|
+
def has_plugin?(name)
|
31
|
+
true
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns a URL to the first plugin with a URL in the menu. Used for
|
35
|
+
# admin users' root admin url.
|
36
|
+
# Should be overridden in authentication solutions.
|
37
|
+
def landing_url
|
38
|
+
active_plugins.first_url_in_menu
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/refinery/crud.rb
CHANGED
@@ -34,7 +34,6 @@ module Refinery
|
|
34
34
|
:search_conditions => '',
|
35
35
|
:sortable => true,
|
36
36
|
:title_attribute => "title",
|
37
|
-
:xhr_paging => false,
|
38
37
|
:class_name => class_name,
|
39
38
|
:singular_name => singular_name,
|
40
39
|
:plural_name => plural_name
|
@@ -50,6 +49,7 @@ module Refinery
|
|
50
49
|
|
51
50
|
def crudify(model_name, options = {})
|
52
51
|
options = ::Refinery::Crud.default_options(model_name).merge(options)
|
52
|
+
Refinery.deprecate :xhr_paging, when: '3.1' if options[:xhr_paging]
|
53
53
|
class_name = options[:class_name]
|
54
54
|
singular_name = options[:singular_name]
|
55
55
|
plural_name = options[:plural_name]
|
@@ -59,16 +59,16 @@ module Refinery
|
|
59
59
|
#{options.inspect}
|
60
60
|
end
|
61
61
|
|
62
|
-
|
62
|
+
prepend_before_action :find_#{singular_name},
|
63
63
|
:only => [:update, :destroy, :edit, :show]
|
64
|
-
|
64
|
+
prepend_before_action :merge_position_into_params!, :only => :create
|
65
65
|
|
66
66
|
def new
|
67
67
|
@#{singular_name} = #{class_name}.new
|
68
68
|
end
|
69
69
|
|
70
70
|
def create
|
71
|
-
if (@#{singular_name} = #{class_name}.create(
|
71
|
+
if (@#{singular_name} = #{class_name}.create(#{singular_name}_params)).valid?
|
72
72
|
flash.notice = t(
|
73
73
|
'refinery.crudify.created',
|
74
74
|
:what => "'\#{@#{singular_name}.#{options[:title_attribute]}}'"
|
@@ -85,7 +85,7 @@ module Refinery
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def update
|
88
|
-
if @#{singular_name}.update_attributes(
|
88
|
+
if @#{singular_name}.update_attributes(#{singular_name}_params)
|
89
89
|
flash.notice = t(
|
90
90
|
'refinery.crudify.updated',
|
91
91
|
:what => "'\#{@#{singular_name}.#{options[:title_attribute]}}'"
|
@@ -109,24 +109,29 @@ module Refinery
|
|
109
109
|
|
110
110
|
# Finds one single result based on the id params.
|
111
111
|
def find_#{singular_name}
|
112
|
-
@#{singular_name} = #{
|
113
|
-
|
112
|
+
@#{singular_name} = find_#{singular_name}_scope.find(params[:id])
|
113
|
+
end
|
114
|
+
|
115
|
+
def find_#{singular_name}_scope
|
116
|
+
_finder_scope = #{class_name}.includes(#{options[:include].map(&:to_sym).inspect})
|
117
|
+
_finder_scope = _finder_scope.friendly if _finder_scope.respond_to?(:friendly)
|
118
|
+
_finder_scope
|
114
119
|
end
|
115
120
|
|
116
121
|
# Find the collection of @#{plural_name} based on the conditions specified into crudify
|
117
122
|
# It will be ordered based on the conditions specified into crudify
|
118
123
|
# And eager loading is applied as specified into crudify.
|
119
124
|
def find_all_#{plural_name}(conditions = #{options[:conditions].inspect})
|
120
|
-
@#{plural_name} = #{
|
121
|
-
|
122
|
-
|
125
|
+
@#{plural_name} = find_#{singular_name}_scope
|
126
|
+
.where(conditions)
|
127
|
+
.order("#{options[:order]}")
|
123
128
|
end
|
124
129
|
|
125
130
|
def merge_position_into_params!
|
126
131
|
# if the position field exists, set this object as last object, given the conditions of this class.
|
127
132
|
if #{class_name}.column_names.include?("position") && params[:#{singular_name}][:position].nil?
|
128
133
|
params[:#{singular_name}].merge!({
|
129
|
-
:
|
134
|
+
position: ((#{class_name}.where(#{options[:conditions].inspect}).maximum(:position)||-1) + 1)
|
130
135
|
})
|
131
136
|
end
|
132
137
|
end
|
@@ -204,14 +209,20 @@ module Refinery
|
|
204
209
|
@#{plural_name} = @#{plural_name}.with_query(params[:search])
|
205
210
|
end
|
206
211
|
|
212
|
+
def #{singular_name}_params
|
213
|
+
raise "Please override #{singular_name}_params with your desired parameter security."
|
214
|
+
end
|
215
|
+
|
207
216
|
# Ensure all methods are protected so that they should only be called
|
208
217
|
# from within the current controller.
|
209
218
|
protected :find_#{singular_name},
|
219
|
+
:find_#{singular_name}_scope,
|
210
220
|
:find_all_#{plural_name},
|
211
221
|
:paginate_all_#{plural_name},
|
212
222
|
:paginate_per_page,
|
213
223
|
:render_partial_response?,
|
214
224
|
:search_all_#{plural_name},
|
225
|
+
:#{singular_name}_params,
|
215
226
|
:redirect_url,
|
216
227
|
:create_or_update_successful,
|
217
228
|
:create_or_update_unsuccessful,
|
@@ -220,7 +231,7 @@ module Refinery
|
|
220
231
|
|
221
232
|
# Methods that are only included when this controller is searchable.
|
222
233
|
if options[:searchable]
|
223
|
-
if options[:paging]
|
234
|
+
if options[:paging]
|
224
235
|
module_eval %(
|
225
236
|
def index
|
226
237
|
search_all_#{plural_name} if searching?
|
@@ -232,10 +243,10 @@ module Refinery
|
|
232
243
|
else
|
233
244
|
module_eval %(
|
234
245
|
def index
|
235
|
-
|
236
|
-
find_all_#{plural_name}
|
237
|
-
else
|
246
|
+
if searching?
|
238
247
|
search_all_#{plural_name}
|
248
|
+
else
|
249
|
+
find_all_#{plural_name}
|
239
250
|
end
|
240
251
|
|
241
252
|
render_partial_response?
|
@@ -244,7 +255,7 @@ module Refinery
|
|
244
255
|
end
|
245
256
|
|
246
257
|
else
|
247
|
-
if options[:paging]
|
258
|
+
if options[:paging]
|
248
259
|
module_eval %(
|
249
260
|
def index
|
250
261
|
paginate_all_#{plural_name}
|
@@ -269,22 +280,22 @@ module Refinery
|
|
269
280
|
find_all_#{plural_name}
|
270
281
|
end
|
271
282
|
|
272
|
-
# Based upon
|
283
|
+
# Based upon https://github.com/matenia/jQuery-Awesome-Nested-Set-Drag-and-Drop
|
273
284
|
def update_positions
|
274
285
|
previous = nil
|
275
286
|
params[:ul].each do |_, list|
|
276
287
|
list.each do |index, hash|
|
277
|
-
moved_item_id = hash['id'][/\\d
|
288
|
+
moved_item_id = hash['id'][/\\d+\\z/]
|
278
289
|
@current_#{singular_name} = #{class_name}.find_by_id(moved_item_id)
|
279
290
|
|
280
291
|
if @current_#{singular_name}.respond_to?(:move_to_root)
|
281
292
|
if previous.present?
|
282
293
|
@current_#{singular_name}.move_to_right_of(#{class_name}.find_by_id(previous))
|
283
|
-
|
294
|
+
elsif !@current_#{singular_name}.root?
|
284
295
|
@current_#{singular_name}.move_to_root
|
285
296
|
end
|
286
297
|
else
|
287
|
-
@current_#{singular_name}.
|
298
|
+
@current_#{singular_name}.update_columns position: index
|
288
299
|
end
|
289
300
|
|
290
301
|
if hash['children'].present?
|
@@ -302,10 +313,14 @@ module Refinery
|
|
302
313
|
|
303
314
|
def update_child_positions(_node, #{singular_name})
|
304
315
|
list = _node['children']['0']
|
305
|
-
|
316
|
+
child_positions_changed = false
|
317
|
+
list.sort_by { |k, v| k.to_i}.map { |item| item[1] }.each_with_index do |child, index|
|
306
318
|
child_id = child['id'].split(/#{singular_name}\_?/).reject(&:empty?).first
|
307
319
|
child_#{singular_name} = #{class_name}.where(:id => child_id).first
|
308
|
-
|
320
|
+
child_positions_changed ||= #{singular_name}.children[index] != child_#{singular_name}
|
321
|
+
if child_positions_changed
|
322
|
+
child_#{singular_name}.move_to_child_of(#{singular_name})
|
323
|
+
end
|
309
324
|
|
310
325
|
if child['children'].present?
|
311
326
|
update_child_positions(child, child_#{singular_name})
|
@@ -324,20 +339,16 @@ module Refinery
|
|
324
339
|
module_eval %(
|
325
340
|
class << self
|
326
341
|
def pageable?
|
327
|
-
#{options[:paging]
|
342
|
+
#{options[:paging]}
|
328
343
|
end
|
329
344
|
alias_method :paging?, :pageable?
|
330
345
|
|
331
|
-
def xhr_pageable?
|
332
|
-
#{options[:xhr_paging].to_s}
|
333
|
-
end
|
334
|
-
|
335
346
|
def sortable?
|
336
|
-
#{options[:sortable]
|
347
|
+
#{options[:sortable]}
|
337
348
|
end
|
338
349
|
|
339
350
|
def searchable?
|
340
|
-
#{options[:searchable]
|
351
|
+
#{options[:searchable]}
|
341
352
|
end
|
342
353
|
end
|
343
354
|
)
|