releaf 0.1.2 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +19 -21
- data/lib/releaf.rb +1 -34
- data/lib/releaf/all.rb +3 -0
- data/lib/releaf/rspec.rb +4 -0
- data/lib/releaf/rspec/features_matchers.rb +76 -0
- data/lib/releaf/rspec/helpers.rb +227 -0
- data/lib/releaf/rspec/matchers.rb +16 -0
- data/lib/releaf/test.rb +5 -0
- data/spec/factories/author.rb +6 -0
- data/spec/factories/book.rb +5 -0
- data/spec/factories/chapter.rb +7 -0
- data/spec/factories/common.rb +5 -0
- data/spec/factories/home_page.rb +5 -0
- data/spec/factories/node.rb +43 -0
- data/spec/factories/node_route.rb +7 -0
- data/spec/factories/publisher.rb +5 -0
- data/spec/factories/role.rb +21 -0
- data/spec/factories/text_page.rb +5 -0
- data/spec/factories/user.rb +22 -0
- data/spec/rails_helper.rb +122 -0
- data/spec/spec_helper.rb +81 -24
- data/spec/support/controller_macros.rb +8 -0
- data/spec/support/excel_helpers.rb +63 -0
- data/spec/support/shared/service_includer.rb +9 -0
- data/spec/support/wait_steps.rb +23 -0
- metadata +141 -499
- data/README.md +0 -77
- data/Rakefile +0 -70
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/close.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/loading.gif +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/next.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/prev.png +0 -0
- data/app/assets/images/releaf/add.png +0 -0
- data/app/assets/images/releaf/background.jpg +0 -0
- data/app/assets/images/releaf/button/button_bgr.gif +0 -0
- data/app/assets/images/releaf/button/button_hover_bgr.png +0 -0
- data/app/assets/images/releaf/controllers/content/close.gif +0 -0
- data/app/assets/images/releaf/controllers/content/close_active.gif +0 -0
- data/app/assets/images/releaf/controllers/content/close_hover.gif +0 -0
- data/app/assets/images/releaf/controllers/content/global_fields_bgr.png +0 -0
- data/app/assets/images/releaf/controllers/content/open.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_2.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_active.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_hover.gif +0 -0
- data/app/assets/images/releaf/controllers/sessions/background.jpg +0 -0
- data/app/assets/images/releaf/controllers/sessions/logo.jpg +0 -0
- data/app/assets/images/releaf/expand_tool/close.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_hover.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_hover_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/loader.gif +0 -0
- data/app/assets/images/releaf/expand_tool/open.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_hover.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_hover_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_shim.png +0 -0
- data/app/assets/images/releaf/favicon.ico +0 -0
- data/app/assets/images/releaf/globalFieldContainerBgr.png +0 -0
- data/app/assets/images/releaf/icons/129.png +0 -0
- data/app/assets/images/releaf/icons/130.png +0 -0
- data/app/assets/images/releaf/icons/accept.png +0 -0
- data/app/assets/images/releaf/icons/add.png +0 -0
- data/app/assets/images/releaf/icons/arrow_down.png +0 -0
- data/app/assets/images/releaf/icons/arrow_left.png +0 -0
- data/app/assets/images/releaf/icons/arrow_refresh.png +0 -0
- data/app/assets/images/releaf/icons/arrow_up.png +0 -0
- data/app/assets/images/releaf/icons/bin_empty.png +0 -0
- data/app/assets/images/releaf/icons/bullet_black.png +0 -0
- data/app/assets/images/releaf/icons/bullet_connect.png +0 -0
- data/app/assets/images/releaf/icons/bullet_start.png +0 -0
- data/app/assets/images/releaf/icons/bullet_tick.png +0 -0
- data/app/assets/images/releaf/icons/chrome.png +0 -0
- data/app/assets/images/releaf/icons/control_play.png +0 -0
- data/app/assets/images/releaf/icons/date.png +0 -0
- data/app/assets/images/releaf/icons/delete.png +0 -0
- data/app/assets/images/releaf/icons/disk.png +0 -0
- data/app/assets/images/releaf/icons/drag-handle.png +0 -0
- data/app/assets/images/releaf/icons/error.png +0 -0
- data/app/assets/images/releaf/icons/eye.png +0 -0
- data/app/assets/images/releaf/icons/firefox.png +0 -0
- data/app/assets/images/releaf/icons/google-not-available.gif +0 -0
- data/app/assets/images/releaf/icons/google.gif +0 -0
- data/app/assets/images/releaf/icons/keyboard.png +0 -0
- data/app/assets/images/releaf/icons/left_16.png +0 -0
- data/app/assets/images/releaf/icons/link.png +0 -0
- data/app/assets/images/releaf/icons/magnifier.png +0 -0
- data/app/assets/images/releaf/icons/notAllowed.png +0 -0
- data/app/assets/images/releaf/icons/page_white_add.png +0 -0
- data/app/assets/images/releaf/icons/page_white_edit.png +0 -0
- data/app/assets/images/releaf/icons/page_white_put.png +0 -0
- data/app/assets/images/releaf/icons/page_white_text.png +0 -0
- data/app/assets/images/releaf/icons/pencil.png +0 -0
- data/app/assets/images/releaf/icons/picture.png +0 -0
- data/app/assets/images/releaf/icons/right_16.png +0 -0
- data/app/assets/images/releaf/icons/tick.png +0 -0
- data/app/assets/images/releaf/icons/warning.png +0 -0
- data/app/assets/images/releaf/icons/world_go.png +0 -0
- data/app/assets/images/releaf/icons/world_link.png +0 -0
- data/app/assets/images/releaf/input/autocompleteExpandIcon.png +0 -0
- data/app/assets/images/releaf/input/input_bgr.gif +0 -0
- data/app/assets/images/releaf/language_root.png +0 -0
- data/app/assets/images/releaf/loader.gif +0 -0
- data/app/assets/images/releaf/logout.png +0 -0
- data/app/assets/images/releaf/main_menu/active_bgr.png +0 -0
- data/app/assets/images/releaf/main_menu/bgr.png +0 -0
- data/app/assets/images/releaf/main_menu/hover_bgr.png +0 -0
- data/app/assets/images/releaf/module.png +0 -0
- data/app/assets/images/releaf/panel_layout/active_bgr.png +0 -0
- data/app/assets/images/releaf/panel_layout/secondary_panel_horizontal_bgr.png +0 -0
- data/app/assets/images/releaf/panel_layout/secondary_panel_vertical_bgr.png +0 -0
- data/app/assets/images/releaf/releaf_table/selected_bgr.png +0 -0
- data/app/assets/images/releaf/releaf_table/th_bgr.gif +0 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/README.md +0 -73
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/jquery.cookie.js +0 -47
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/server.js +0 -24
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.html +0 -19
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.js +0 -80
- data/app/assets/javascripts/releaf/3rd_party/jquery-ui-timepicker-addon.js +0 -1882
- data/app/assets/javascripts/releaf/3rd_party/lightbox.js.erb +0 -379
- data/app/assets/javascripts/releaf/application.js +0 -14
- data/app/assets/javascripts/releaf/controllers/base.js +0 -130
- data/app/assets/javascripts/releaf/controllers/releaf/content.js +0 -90
- data/app/assets/javascripts/releaf/controllers/releaf/translations.js +0 -31
- data/app/assets/javascripts/releaf/include/continuous_scroll.js +0 -321
- data/app/assets/javascripts/releaf/include/field.type_autocomplete.js +0 -58
- data/app/assets/javascripts/releaf/include/field.type_date_or_datetime_or_time.js +0 -43
- data/app/assets/javascripts/releaf/include/field.type_richtext.js +0 -90
- data/app/assets/javascripts/releaf/include/localization.js +0 -12
- data/app/assets/javascripts/releaf/include/nested_fields.js +0 -64
- data/app/assets/javascripts/releaf/include/sortable.js +0 -29
- data/app/assets/javascripts/releaf/lib/request_url.js +0 -183
- data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-1.9.2.custom.css.erb +0 -464
- data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-timepicker-addon.css +0 -10
- data/app/assets/stylesheets/releaf/3rd_party/lightbox.css.erb +0 -157
- data/app/assets/stylesheets/releaf/application.css.erb +0 -122
- data/app/assets/stylesheets/releaf/controllers/base.css.erb +0 -205
- data/app/assets/stylesheets/releaf/controllers/releaf/content.css.erb +0 -422
- data/app/assets/stylesheets/releaf/controllers/releaf/sessions.css.scss.erb +0 -116
- data/app/assets/stylesheets/releaf/controllers/releaf/translations.css.erb +0 -205
- data/app/assets/stylesheets/releaf/include/button.css.erb +0 -176
- data/app/assets/stylesheets/releaf/include/field.css.erb +0 -281
- data/app/assets/stylesheets/releaf/include/input.css.erb +0 -40
- data/app/assets/stylesheets/releaf/include/main_menu.css.erb +0 -66
- data/app/assets/stylesheets/releaf/include/pagination.css.erb +0 -29
- data/app/assets/stylesheets/releaf/include/panel_layout.css.erb +0 -251
- data/app/assets/stylesheets/releaf/include/releaf_table.css.erb +0 -112
- data/app/assets/stylesheets/releaf/include/sortable.css.erb +0 -12
- data/app/controllers/releaf/admins_controller.rb +0 -55
- data/app/controllers/releaf/application_controller.rb +0 -11
- data/app/controllers/releaf/base_application_controller.rb +0 -18
- data/app/controllers/releaf/base_controller.rb +0 -571
- data/app/controllers/releaf/content_controller.rb +0 -183
- data/app/controllers/releaf/roles_controller.rb +0 -38
- data/app/controllers/releaf/sessions_controller.rb +0 -27
- data/app/controllers/releaf/tinymce_assets_controller.rb +0 -26
- data/app/controllers/releaf/translations_controller.rb +0 -117
- data/app/helpers/releaf/admin_helper.rb +0 -59
- data/app/helpers/releaf/application_helper.rb +0 -4
- data/app/helpers/releaf/pagination_renderer.rb +0 -44
- data/app/helpers/releaf/releaf_devise_helper.rb +0 -8
- data/app/models/releaf/admin.rb +0 -60
- data/app/models/releaf/blank_node_base.rb +0 -29
- data/app/models/releaf/node.rb +0 -222
- data/app/models/releaf/node_base.rb +0 -31
- data/app/models/releaf/role.rb +0 -126
- data/app/models/releaf/tinymce_asset.rb +0 -6
- data/app/views/layouts/releaf/admin.html.haml +0 -57
- data/app/views/layouts/releaf/devise.html.haml +0 -32
- data/app/views/releaf/aliases/_edit.body.html.haml +0 -50
- data/app/views/releaf/aliases/_edit.header.html.haml +0 -19
- data/app/views/releaf/aliases/_index.row.html.haml +0 -5
- data/app/views/releaf/aliases/_secondary_panel.html.haml +0 -13
- data/app/views/releaf/base/_edit.body.html.haml +0 -11
- data/app/views/releaf/base/_edit.field.html.haml +0 -23
- data/app/views/releaf/base/_edit.field_type_autocomplete.html.haml +0 -15
- data/app/views/releaf/base/_edit.field_type_boolean.html.haml +0 -5
- data/app/views/releaf/base/_edit.field_type_date.html.haml +0 -8
- data/app/views/releaf/base/_edit.field_type_datetime.html.haml +0 -8
- data/app/views/releaf/base/_edit.field_type_delete_nested.html.haml +0 -3
- data/app/views/releaf/base/_edit.field_type_file.html.haml +0 -10
- data/app/views/releaf/base/_edit.field_type_image.html.haml +0 -12
- data/app/views/releaf/base/_edit.field_type_item.html.haml +0 -31
- data/app/views/releaf/base/_edit.field_type_link.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_link_i18n.html.haml +0 -26
- data/app/views/releaf/base/_edit.field_type_password.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_richtext.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_richtext_i18n.html.haml +0 -27
- data/app/views/releaf/base/_edit.field_type_text.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_text_i18n.html.haml +0 -27
- data/app/views/releaf/base/_edit.field_type_textarea.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_textarea_i18n.html.haml +0 -27
- data/app/views/releaf/base/_edit.field_type_time.html.haml +0 -8
- data/app/views/releaf/base/_edit.fields.association.html.haml +0 -48
- data/app/views/releaf/base/_edit.fields.has_many_template.html.haml +0 -15
- data/app/views/releaf/base/_edit.fields.html.haml +0 -20
- data/app/views/releaf/base/_edit.footer.html.haml +0 -14
- data/app/views/releaf/base/_edit.form.html.haml +0 -4
- data/app/views/releaf/base/_edit.header.html.haml +0 -3
- data/app/views/releaf/base/_index.body.html.haml +0 -6
- data/app/views/releaf/base/_index.cell.html.haml +0 -20
- data/app/views/releaf/base/_index.footer.html.haml +0 -28
- data/app/views/releaf/base/_index.header.html.haml +0 -4
- data/app/views/releaf/base/_index.row.html.haml +0 -6
- data/app/views/releaf/base/_index.search.html.haml +0 -5
- data/app/views/releaf/base/_index.table.html.haml +0 -24
- data/app/views/releaf/base/_secondary_panel.html.haml +0 -10
- data/app/views/releaf/base/_show.body.html.haml +0 -3
- data/app/views/releaf/base/_show.field.html.haml +0 -20
- data/app/views/releaf/base/_show.field_type_date.html.haml +0 -9
- data/app/views/releaf/base/_show.field_type_date_time.html.haml +0 -9
- data/app/views/releaf/base/_show.field_type_email.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_file.html.haml +0 -7
- data/app/views/releaf/base/_show.field_type_image.html.haml +0 -10
- data/app/views/releaf/base/_show.field_type_item.html.haml +0 -11
- data/app/views/releaf/base/_show.field_type_link.html.haml +0 -14
- data/app/views/releaf/base/_show.field_type_password.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_richtext.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_text.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_textarea.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_time.html.haml +0 -9
- data/app/views/releaf/base/_show.field_type_url.html.haml +0 -7
- data/app/views/releaf/base/_show.fields.association.html.haml +0 -36
- data/app/views/releaf/base/_show.fields.has_many_template.html.haml +0 -12
- data/app/views/releaf/base/_show.fields.html.haml +0 -17
- data/app/views/releaf/base/_show.footer.html.haml +0 -18
- data/app/views/releaf/base/_show.header.html.haml +0 -3
- data/app/views/releaf/base/confirm_destroy.html.haml +0 -17
- data/app/views/releaf/base/edit.html.haml +0 -1
- data/app/views/releaf/base/index.html.haml +0 -3
- data/app/views/releaf/base/new.html.haml +0 -1
- data/app/views/releaf/base/show.html.haml +0 -3
- data/app/views/releaf/content/_edit.body.html.haml +0 -46
- data/app/views/releaf/content/_edit.content_fields.html.haml +0 -11
- data/app/views/releaf/content/_edit.fields.html.haml +0 -17
- data/app/views/releaf/content/_edit.slug.html.haml +0 -12
- data/app/views/releaf/content/_get_content_form.html.haml +0 -7
- data/app/views/releaf/content/_secondary_panel.html.haml +0 -3
- data/app/views/releaf/content/_tree_level.html.haml +0 -16
- data/app/views/releaf/content/ajax.new.html.haml +0 -3
- data/app/views/releaf/content/index.html.haml +0 -0
- data/app/views/releaf/roles/_edit.field.permissions.html.haml +0 -5
- data/app/views/releaf/roles/_show.field.default.html.haml +0 -6
- data/app/views/releaf/roles/_show.field.permissions.html.haml +0 -11
- data/app/views/releaf/sessions/new.html.haml +0 -17
- data/app/views/releaf/translations/_edit.body.html.haml +0 -50
- data/app/views/releaf/translations/_edit.header.html.haml +0 -19
- data/app/views/releaf/translations/_index.row.html.haml +0 -5
- data/app/views/releaf/translations/_secondary_panel.html.haml +0 -13
- data/bin/releaf +0 -25
- data/lib/generators/releaf/install_generator.rb +0 -87
- data/lib/generators/releaf/templates/config/common_fields.yml.example +0 -17
- data/lib/generators/releaf/templates/controllers/home_controller.rb +0 -4
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/close.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/loading.gif +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/next.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/prev.png +0 -0
- data/lib/generators/releaf/templates/initializers/releaf.rb +0 -20
- data/lib/generators/releaf/templates/initializers/releaf_i18n.rb +0 -25
- data/lib/generators/releaf/templates/initializers/releaf_store_current_template.rb +0 -25
- data/lib/generators/releaf/templates/javascripts/3rd_party/jquery.jcarousel.js +0 -1058
- data/lib/generators/releaf/templates/javascripts/3rd_party/jquery_ui.js +0 -14850
- data/lib/generators/releaf/templates/javascripts/3rd_party/lightbox.js.erb +0 -379
- data/lib/generators/releaf/templates/javascripts/application.js +0 -15
- data/lib/generators/releaf/templates/javascripts/lib/init_jcarousel.js +0 -40
- data/lib/generators/releaf/templates/javascripts/lib/js_check.js +0 -8
- data/lib/generators/releaf/templates/javascripts/lib/request_url.js +0 -169
- data/lib/generators/releaf/templates/javascripts/lib/sortable.js +0 -29
- data/lib/generators/releaf/templates/migrations/create_releaf_admins.rb +0 -53
- data/lib/generators/releaf/templates/migrations/create_releaf_nodes.rb +0 -25
- data/lib/generators/releaf/templates/migrations/create_releaf_roles.rb +0 -12
- data/lib/generators/releaf/templates/migrations/create_releaf_tinymce_assets.rb +0 -11
- data/lib/generators/releaf/templates/migrations/create_releaf_translations.rb +0 -31
- data/lib/generators/releaf/templates/models/admin_ability.rb +0 -51
- data/lib/generators/releaf/templates/seeds.rb +0 -64
- data/lib/generators/releaf/templates/stylesheets/3rd_party/jquery_ui/smoothness.css.erb +0 -1174
- data/lib/generators/releaf/templates/stylesheets/3rd_party/lightbox.css.erb +0 -157
- data/lib/generators/releaf/templates/stylesheets/3rd_party/reset.css +0 -48
- data/lib/generators/releaf/templates/stylesheets/application.scss +0 -15
- data/lib/generators/releaf/templates/stylesheets/style.scss +0 -45
- data/lib/generators/releaf/templates/views/home/index.html.haml +0 -1
- data/lib/generators/releaf/templates/views/layouts/application.html.haml +0 -26
- data/lib/i18n/backend/releaf.rb +0 -97
- data/lib/i18n/backend/releaf/translation.rb +0 -61
- data/lib/i18n/backend/releaf/translation_data.rb +0 -39
- data/lib/i18n/backend/releaf/translation_group.rb +0 -34
- data/lib/i18n/releaf.rb +0 -1
- data/lib/releaf/boolean_at.rb +0 -77
- data/lib/releaf/engine.rb +0 -4
- data/lib/releaf/globalize3/fallbacks.rb +0 -19
- data/lib/releaf/resources.rb +0 -101
- data/lib/releaf/slug.rb +0 -118
- data/lib/releaf/version.rb +0 -3
- data/lib/tasks/releaf_tasks.rake +0 -4
- data/spec/factories/factories.rb +0 -24
- data/spec/features/admin_spec.rb +0 -41
- data/templates/releaf/installer.rb +0 -207
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 273bdea6adcabae4eeb1e00fc2a6ac1b55448c89
|
|
4
|
+
data.tar.gz: 008087cea452ad5ef4f84382d4cf48bb81946f5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f8afd333a6dba8b34472f146dacad34bc76a828dcf7eb3407d09bd97cb1f3042c71c3c3b91bfb6ccccd0e5de91f531037422b99d25cff70d8f60cc861dc6561
|
|
7
|
+
data.tar.gz: b13e6a5eaa0c1b7e63fc2a67e9c93b5deae4a6f50fa1ab22cbdbdfc6a308faf126c2a2df0107471df4a97a3729c726db63a22a74e116a82894e0392de438f095
|
data/LICENSE
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
Copyright (c) 2012, CubeSystems <info@cubesystems.lv>
|
|
2
|
-
All rights reserved.
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
modification, are permitted provided that the following conditions are met:
|
|
6
|
-
* Redistributions of source code must retain the above copyright
|
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
9
|
-
notice, this list of conditions and the following disclaimer in the
|
|
10
|
-
documentation and/or other materials provided with the distribution.
|
|
11
|
-
* Neither the name of the CubeSystems nor the names of its contributors may
|
|
12
|
-
be used to endorse or promote products derived from this software without
|
|
13
|
-
specific prior written permission.
|
|
3
|
+
MIT License
|
|
14
4
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/releaf.rb
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
|
-
require
|
|
2
|
-
require 'releaf/globalize3/fallbacks'
|
|
3
|
-
require "releaf/engine"
|
|
4
|
-
require "releaf/resources"
|
|
5
|
-
require "releaf/boolean_at"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
module Releaf
|
|
9
|
-
mattr_accessor :main_menu
|
|
10
|
-
@@main_menu = [
|
|
11
|
-
'releaf/content',
|
|
12
|
-
'*permissions',
|
|
13
|
-
'releaf/translations'
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
mattr_accessor :base_menu
|
|
17
|
-
@@base_menu = {
|
|
18
|
-
'*permissions' => [
|
|
19
|
-
['permissions', %w[releaf/admins releaf/roles]],
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
mattr_accessor :devise_for
|
|
24
|
-
@@devise_for = 'releaf/admin'
|
|
25
|
-
|
|
26
|
-
mattr_accessor :layout
|
|
27
|
-
@@layout = "releaf/admin"
|
|
28
|
-
|
|
29
|
-
class << self
|
|
30
|
-
def setup
|
|
31
|
-
yield self
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
1
|
+
require 'releaf/all'
|
data/lib/releaf/all.rb
ADDED
data/lib/releaf/rspec.rb
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
module Capybara
|
|
2
|
+
class Session
|
|
3
|
+
|
|
4
|
+
def primary_header_css_rule
|
|
5
|
+
"main > section header"
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def has_cells_text?(cells, options = {})
|
|
9
|
+
cells_count = cells.count
|
|
10
|
+
cells_count += 1 if options.fetch(:with_toolbox, true)
|
|
11
|
+
type = options.fetch(:type, "td")
|
|
12
|
+
has_selector?(type, count: cells_count) && has_text?(cells.join(""))
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def has_header?(*args)
|
|
16
|
+
has_css?("#{primary_header_css_rule} h1", *args)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def has_no_header?(*args)
|
|
20
|
+
has_no_css?("#{primary_header_css_rule} h1", *args)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def has_number_of_resources?(count)
|
|
25
|
+
has_css?("#{primary_header_css_rule} .totals", text: "#{count} resources found")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# Allows to match againg validation errors within forms
|
|
30
|
+
# Support either model specific (base) errors with:
|
|
31
|
+
# expect(page).to have_error('Global form error message')
|
|
32
|
+
# and attribute specific errors with:
|
|
33
|
+
# expect(page).to have_error('Taken', field: 'Lol')
|
|
34
|
+
#
|
|
35
|
+
# @param error_message [String] error message to find
|
|
36
|
+
# @param options [Hash] available option is `field` that can be anything that is normally accepted by fill_in
|
|
37
|
+
# e.g., the label text or the id of the textarea
|
|
38
|
+
# @return [true] whether errors has been found otherwise will raise Capybara::ElementNotFound exception
|
|
39
|
+
def has_error?(error_message, options = {})
|
|
40
|
+
error_exists = false
|
|
41
|
+
if options[:field]
|
|
42
|
+
first('.field.has-error', minimum: 1) # wait for any errors to come from validation
|
|
43
|
+
all(".field.has-error").each do
|
|
44
|
+
if find(:field, options[:field]) && first(".error", text: error_message)
|
|
45
|
+
error_exists = true
|
|
46
|
+
break
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
else
|
|
50
|
+
if first(".form-error-box .error", text: error_message)
|
|
51
|
+
error_exists = true
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
raise Capybara::ElementNotFound.new("Unable to find given error message") unless error_exists
|
|
56
|
+
|
|
57
|
+
true
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def has_breadcrumbs?(*items)
|
|
61
|
+
items.each_with_index do|item, index|
|
|
62
|
+
has_css?("main header nav ul.breadcrumbs li:nth-child(#{index}) a", text: item)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def has_notification?(text, type="success")
|
|
67
|
+
result = has_css?(".notifications .notification[data-type='#{type}']", text: text)
|
|
68
|
+
if first(".notifications button.close")
|
|
69
|
+
find(".notifications .notification[data-type='#{type}'] button.close").click
|
|
70
|
+
has_no_css?(".notifications .notification[data-type='#{type}'] button.close")
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
result
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
module Releaf::Test
|
|
2
|
+
# Releaf::TestHelpers provides a facility to simplify admin functionality testing
|
|
3
|
+
module Helpers
|
|
4
|
+
def postgresql?
|
|
5
|
+
adapter_name == 'PostgreSQL'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def mysql?
|
|
9
|
+
adapter_name == "Mysql2"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def adapter_name
|
|
13
|
+
ActiveRecord::Base.connection.adapter_name
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def auth_as_user(full_login = false, factory = :user)
|
|
17
|
+
if factory.is_a? Releaf::Permissions::User
|
|
18
|
+
user = factory
|
|
19
|
+
else
|
|
20
|
+
user = create(factory)
|
|
21
|
+
end
|
|
22
|
+
if full_login
|
|
23
|
+
visit "/"
|
|
24
|
+
within("form.login") do
|
|
25
|
+
fill_in 'Email', with: user.email
|
|
26
|
+
fill_in 'Password', with: user.password
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
click_button 'Sign in'
|
|
30
|
+
else
|
|
31
|
+
login_as user
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
user
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def stub_settings(values)
|
|
38
|
+
unless @releaf_settings_default_stubbed
|
|
39
|
+
allow(Releaf::Settings).to receive(:[]).and_call_original
|
|
40
|
+
@releaf_settings_default_stubbed = true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
values.each_pair do|key, value|
|
|
44
|
+
allow(Releaf::Settings).to receive(:[]).with(key).and_return(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def update_resource
|
|
49
|
+
within "form.edit-resource" do
|
|
50
|
+
yield
|
|
51
|
+
end
|
|
52
|
+
save_and_check_response "Update succeeded"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def create_resource
|
|
56
|
+
click_link "Create new resource" unless first("form.new-resource")
|
|
57
|
+
within "form.new-resource" do
|
|
58
|
+
yield
|
|
59
|
+
end
|
|
60
|
+
save_and_check_response "Create succeeded"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def within_search
|
|
64
|
+
within("form.search") do
|
|
65
|
+
yield
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def search(text)
|
|
70
|
+
within_search do
|
|
71
|
+
fill_in 'search', with: text
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def within_dialog
|
|
76
|
+
within(".dialog.initialized") do
|
|
77
|
+
yield
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def close_dialog
|
|
82
|
+
within_dialog do
|
|
83
|
+
find("a[data-type='cancel']").click
|
|
84
|
+
end
|
|
85
|
+
expect(page).to have_no_css(".dialog")
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def wait_for_all_richtexts
|
|
89
|
+
# wait for all ckeditors to fully initialize before moving on.
|
|
90
|
+
# otherwise the page sometimes produces random js errors in fast tests
|
|
91
|
+
number_of_normal_richtexts = page.all('.field.type-richtext:not(.i18n)').length
|
|
92
|
+
number_of_localized_richtexts = page.all('.field.type-richtext.i18n .localization', visible: false).length
|
|
93
|
+
number_of_richtexts = number_of_normal_richtexts + number_of_localized_richtexts
|
|
94
|
+
if (number_of_richtexts > 0)
|
|
95
|
+
expect(page).to have_css(".ckeditor-initialized", visible: false, count: number_of_richtexts)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def switch_admin_locale(locale)
|
|
100
|
+
switch = page.first('.localization-switch')
|
|
101
|
+
|
|
102
|
+
current_locale = switch.text.downcase
|
|
103
|
+
new_locale = locale.to_s.downcase
|
|
104
|
+
|
|
105
|
+
if current_locale == new_locale
|
|
106
|
+
return current_locale
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
within( switch ) do
|
|
110
|
+
click_button current_locale
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
menu = page.find(:xpath, '/html//menu[@class="localization-menu-items"]')
|
|
114
|
+
within( menu ) do
|
|
115
|
+
click_button new_locale.capitalize
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
wait_for_all_richtexts
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def save_and_check_response(status_text)
|
|
122
|
+
wait_for_all_richtexts
|
|
123
|
+
click_button 'Save'
|
|
124
|
+
expect(page).to have_css('body > .notifications .notification[data-id="resource_status"][data-type="success"]', text: status_text)
|
|
125
|
+
wait_for_all_richtexts
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# As there is no visual UI for settings update being successful
|
|
129
|
+
# do check against database
|
|
130
|
+
def wait_for_settings_update(key, value = true)
|
|
131
|
+
safety = 5
|
|
132
|
+
loop do
|
|
133
|
+
if @user.settings.try(:[], key) == value
|
|
134
|
+
return
|
|
135
|
+
elsif safety > 0
|
|
136
|
+
safety -= 1
|
|
137
|
+
sleep 0.5
|
|
138
|
+
else
|
|
139
|
+
fail "'#{key}' setting didn't change to '#{value}' (#{value.class.name})"
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def open_toolbox_dialog(item_name, resource = nil, resource_selector_scope = ".view-index .table tr")
|
|
145
|
+
open_toolbox(item_name, resource, resource_selector_scope)
|
|
146
|
+
expect(page).to have_css('.dialog.initialized')
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def open_toolbox(item_name, resource = nil, resource_selector_scope = ".view-index .table tr")
|
|
150
|
+
if resource
|
|
151
|
+
find(resource_selector_scope + '[data-id="' + resource.id.to_s + '"] .toolbox.initialized button.trigger').click
|
|
152
|
+
else
|
|
153
|
+
find('main section header .toolbox-wrap .toolbox.initialized button.trigger').click
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
within('menu.toolbox-items') do
|
|
157
|
+
click_on(item_name)
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def fill_in_date field_locator, options
|
|
162
|
+
date = options[:with]
|
|
163
|
+
|
|
164
|
+
if date.is_a? Time
|
|
165
|
+
date = date.to_date
|
|
166
|
+
elsif date.is_a? Date
|
|
167
|
+
# do nothing
|
|
168
|
+
else
|
|
169
|
+
# try to convert it to string
|
|
170
|
+
date = Date.parse(date.to_s)
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# wrapper = find('.field.type-date')
|
|
174
|
+
field = find_field( field_locator )
|
|
175
|
+
field_id = field[:id]
|
|
176
|
+
|
|
177
|
+
if Capybara.current_driver == Capybara.javascript_driver
|
|
178
|
+
execute_script('$("#' + field_id + '").trigger("focus")')
|
|
179
|
+
|
|
180
|
+
expect(page.document).to have_css('.ui-datepicker-year')
|
|
181
|
+
expect(page.document).to have_css('.ui-datepicker-month')
|
|
182
|
+
|
|
183
|
+
year_string = date.year.to_s
|
|
184
|
+
execute_script('$(".ui-datepicker-year").val(' + year_string + ').change()')
|
|
185
|
+
expect(evaluate_script('$(".ui-datepicker-year").val();')).to eq year_string
|
|
186
|
+
|
|
187
|
+
month_string = (date.month - 1).to_s
|
|
188
|
+
execute_script('$(".ui-datepicker-month").val("' + month_string + '").change()')
|
|
189
|
+
expect(evaluate_script('$(".ui-datepicker-month").val();')).to eq month_string
|
|
190
|
+
|
|
191
|
+
execute_script('$("a.ui-state-default:contains(' + date.day.to_s + ')").filter(function() { return $(this).text() == "' + date.day.to_s + '"}).trigger("click")')
|
|
192
|
+
|
|
193
|
+
expect(page.document).to have_no_css('.ui-datepicker-year')
|
|
194
|
+
else
|
|
195
|
+
fill_in field_locator, with: date.to_s
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def fill_in_richtext(locator, options = {} )
|
|
201
|
+
# locator can be anything that is normally accepted by fill_in
|
|
202
|
+
# e.g., the label text or the id of the textarea
|
|
203
|
+
|
|
204
|
+
expect(page).to have_css('.field.type-richtext label')
|
|
205
|
+
|
|
206
|
+
# locate possibly hidden textarea among active/visible richtext fields ignoring hidden localization versions
|
|
207
|
+
textareas = []
|
|
208
|
+
richtext_boxes = all(".field.type-richtext:not(.i18n), .field.type-richtext.i18n .localization.active")
|
|
209
|
+
richtext_boxes.each do |richtext_box|
|
|
210
|
+
textarea = richtext_box.first(:field, locator, visible: false)
|
|
211
|
+
textareas << textarea if textarea.present?
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if textareas.count > 1
|
|
215
|
+
raise Capybara::Ambiguous.new("Ambiguous match, found #{target_textareas.count} richtext boxes matching #{locator}")
|
|
216
|
+
elsif textareas.count < 1
|
|
217
|
+
raise Capybara::ElementNotFound.new("Unable to find richtext box #{locator}")
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
textarea_id = textareas.first[:id].to_s
|
|
221
|
+
expect(page).to have_css("##{textarea_id}.ckeditor-initialized", visible: false) # wait for ckeditor appearance
|
|
222
|
+
html = options[:with].to_s
|
|
223
|
+
page.execute_script("CKEDITOR.instances['#{textarea_id}'].setData(#{html.to_json});")
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
end
|
|
227
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
RSpec::Matchers.define :match_html do |expected|
|
|
2
|
+
|
|
3
|
+
match do |actual|
|
|
4
|
+
normalize_html(actual) == normalize_html(expected)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def normalize_html string
|
|
8
|
+
string.strip.gsub(/\s+/,' ').gsub(/((>)\s+|\s+(<))/, '\2\3')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
failure_message do |actual|
|
|
12
|
+
"expected that #{actual} would match the HTML structure of #{expected}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
end
|
data/lib/releaf/test.rb
ADDED