releaf 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +24 -0
- data/README.md +74 -0
- data/Rakefile +62 -0
- 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 +73 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/jquery.cookie.js +47 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/server.js +24 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.html +19 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.js +80 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-ui-timepicker-addon.js +1882 -0
- data/app/assets/javascripts/releaf/3rd_party/lightbox.js.erb +379 -0
- data/app/assets/javascripts/releaf/application.js +14 -0
- data/app/assets/javascripts/releaf/controllers/base.js +170 -0
- data/app/assets/javascripts/releaf/controllers/releaf/content.js +90 -0
- data/app/assets/javascripts/releaf/controllers/releaf/translations.js +31 -0
- data/app/assets/javascripts/releaf/include/continuous_scroll.js +321 -0
- data/app/assets/javascripts/releaf/include/field.type_autocomplete.js +58 -0
- data/app/assets/javascripts/releaf/include/field.type_richtext.js +90 -0
- data/app/assets/javascripts/releaf/include/localization.js +12 -0
- data/app/assets/javascripts/releaf/include/nested_fields.js +71 -0
- data/app/assets/javascripts/releaf/include/sortable.js +27 -0
- data/app/assets/javascripts/releaf/lib/request_url.js +183 -0
- data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-1.9.2.custom.css.erb +464 -0
- data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-timepicker-addon.css +10 -0
- data/app/assets/stylesheets/releaf/3rd_party/lightbox.css.erb +157 -0
- data/app/assets/stylesheets/releaf/application.css.erb +122 -0
- data/app/assets/stylesheets/releaf/controllers/base.css.erb +205 -0
- data/app/assets/stylesheets/releaf/controllers/releaf/content.css.erb +416 -0
- data/app/assets/stylesheets/releaf/controllers/releaf/sessions.css.scss.erb +116 -0
- data/app/assets/stylesheets/releaf/controllers/releaf/translations.css.erb +205 -0
- data/app/assets/stylesheets/releaf/include/button.css.erb +176 -0
- data/app/assets/stylesheets/releaf/include/field.css.erb +257 -0
- data/app/assets/stylesheets/releaf/include/input.css.erb +40 -0
- data/app/assets/stylesheets/releaf/include/main_menu.css.erb +66 -0
- data/app/assets/stylesheets/releaf/include/pagination.css.erb +29 -0
- data/app/assets/stylesheets/releaf/include/panel_layout.css.erb +251 -0
- data/app/assets/stylesheets/releaf/include/releaf_table.css.erb +112 -0
- data/app/assets/stylesheets/releaf/include/sortable.css.erb +12 -0
- data/app/controllers/releaf/admins_controller.rb +48 -0
- data/app/controllers/releaf/application_controller.rb +11 -0
- data/app/controllers/releaf/base_application_controller.rb +15 -0
- data/app/controllers/releaf/base_controller.rb +310 -0
- data/app/controllers/releaf/content_controller.rb +166 -0
- data/app/controllers/releaf/roles_controller.rb +36 -0
- data/app/controllers/releaf/sessions_controller.rb +5 -0
- data/app/controllers/releaf/tinymce_assets_controller.rb +26 -0
- data/app/controllers/releaf/translations_controller.rb +121 -0
- data/app/helpers/releaf/admin_helper.rb +79 -0
- data/app/helpers/releaf/application_helper.rb +4 -0
- data/app/helpers/releaf/pagination_renderer.rb +44 -0
- data/app/helpers/releaf/releaf_devise_helper.rb +8 -0
- data/app/models/releaf/admin.rb +51 -0
- data/app/models/releaf/node.rb +221 -0
- data/app/models/releaf/node_base.rb +25 -0
- data/app/models/releaf/role.rb +119 -0
- data/app/models/releaf/tinymce_asset.rb +6 -0
- data/app/views/layouts/releaf/admin.html.haml +51 -0
- data/app/views/releaf/aliases/_edit.body.haml +50 -0
- data/app/views/releaf/aliases/_edit.header.haml +19 -0
- data/app/views/releaf/aliases/_index.row.haml +5 -0
- data/app/views/releaf/aliases/_secondary_panel.haml +13 -0
- data/app/views/releaf/base/_edit.body.haml +19 -0
- data/app/views/releaf/base/_edit.field.haml +96 -0
- data/app/views/releaf/base/_edit.field.type_autocomplete.haml +15 -0
- data/app/views/releaf/base/_edit.field.type_checkbox.haml +5 -0
- data/app/views/releaf/base/_edit.field.type_date.haml +8 -0
- data/app/views/releaf/base/_edit.field.type_datetime.haml +8 -0
- data/app/views/releaf/base/_edit.field.type_delete_nested.haml +3 -0
- data/app/views/releaf/base/_edit.field.type_file.haml +10 -0
- data/app/views/releaf/base/_edit.field.type_image.haml +14 -0
- data/app/views/releaf/base/_edit.field.type_link.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_password.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_richtext.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_richtext_i18n.haml +27 -0
- data/app/views/releaf/base/_edit.field.type_select.haml +11 -0
- data/app/views/releaf/base/_edit.field.type_text.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_text_i18n.haml +27 -0
- data/app/views/releaf/base/_edit.field.type_textarea.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_textarea_i18n.haml +27 -0
- data/app/views/releaf/base/_edit.field.type_time.haml +8 -0
- data/app/views/releaf/base/_edit.footer.haml +14 -0
- data/app/views/releaf/base/_edit.form.haml +4 -0
- data/app/views/releaf/base/_edit.has_many_associations.haml +45 -0
- data/app/views/releaf/base/_edit.header.haml +3 -0
- data/app/views/releaf/base/_index.body.haml +6 -0
- data/app/views/releaf/base/_index.cell.haml +19 -0
- data/app/views/releaf/base/_index.footer.haml +22 -0
- data/app/views/releaf/base/_index.header.haml +4 -0
- data/app/views/releaf/base/_index.row.haml +6 -0
- data/app/views/releaf/base/_index.search.haml +5 -0
- data/app/views/releaf/base/_index.table.haml +8 -0
- data/app/views/releaf/base/_secondary_panel.haml +9 -0
- data/app/views/releaf/base/_show.body.haml +7 -0
- data/app/views/releaf/base/_show.field.haml +78 -0
- data/app/views/releaf/base/_show.field.type_html.haml +1 -0
- data/app/views/releaf/base/_show.footer.haml +16 -0
- data/app/views/releaf/base/_show.header.haml +3 -0
- data/app/views/releaf/base/confirm_destroy.haml +10 -0
- data/app/views/releaf/base/edit.haml +1 -0
- data/app/views/releaf/base/index.haml +3 -0
- data/app/views/releaf/base/new.haml +1 -0
- data/app/views/releaf/base/show.haml +3 -0
- data/app/views/releaf/content/_edit.body.haml +45 -0
- data/app/views/releaf/content/_edit.content_fields.haml +19 -0
- data/app/views/releaf/content/_edit.slug.haml +12 -0
- data/app/views/releaf/content/_get_content_form.haml +7 -0
- data/app/views/releaf/content/_secondary_panel.haml +3 -0
- data/app/views/releaf/content/_show.field.content.haml +11 -0
- data/app/views/releaf/content/_tree_level.haml +16 -0
- data/app/views/releaf/content/ajax.new.haml +3 -0
- data/app/views/releaf/content/index.haml +0 -0
- data/app/views/releaf/roles/_edit.field.admins.haml +0 -0
- data/app/views/releaf/roles/_edit.field.permissions.haml +5 -0
- data/app/views/releaf/roles/_show.field.default.haml +6 -0
- data/app/views/releaf/roles/_show.field.permissions.haml +11 -0
- data/app/views/releaf/sessions/new.html.haml +17 -0
- data/app/views/releaf/translations/_edit.body.haml +50 -0
- data/app/views/releaf/translations/_edit.header.haml +19 -0
- data/app/views/releaf/translations/_index.row.haml +5 -0
- data/app/views/releaf/translations/_secondary_panel.haml +13 -0
- data/bin/releaf +25 -0
- data/lib/generators/releaf/install_generator.rb +87 -0
- data/lib/generators/releaf/templates/config/common_fields.yml.example +17 -0
- data/lib/generators/releaf/templates/controllers/home_controller.rb +4 -0
- 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 +59 -0
- data/lib/generators/releaf/templates/initializers/releaf_i18n.rb +8 -0
- data/lib/generators/releaf/templates/initializers/releaf_store_current_template.rb +25 -0
- data/lib/generators/releaf/templates/javascripts/3rd_party/jquery_ui.js +14850 -0
- data/lib/generators/releaf/templates/javascripts/3rd_party/lightbox.js.erb +379 -0
- data/lib/generators/releaf/templates/javascripts/application.js +15 -0
- data/lib/generators/releaf/templates/javascripts/lib/js_check.js +8 -0
- data/lib/generators/releaf/templates/javascripts/lib/request_url.js +169 -0
- data/lib/generators/releaf/templates/javascripts/lib/sortable.js +29 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_admins.rb +53 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_nodes.rb +25 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_roles.rb +11 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_tinymce_assets.rb +10 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_translations.rb +31 -0
- data/lib/generators/releaf/templates/models/admin_ability.rb +51 -0
- data/lib/generators/releaf/templates/seeds.rb +64 -0
- data/lib/generators/releaf/templates/stylesheets/3rd_party/jquery_ui/smoothness.css.erb +1174 -0
- data/lib/generators/releaf/templates/stylesheets/3rd_party/lightbox.css.erb +157 -0
- data/lib/generators/releaf/templates/stylesheets/3rd_party/reset.css +48 -0
- data/lib/generators/releaf/templates/stylesheets/application.scss +15 -0
- data/lib/generators/releaf/templates/stylesheets/style.scss +45 -0
- data/lib/generators/releaf/templates/views/home/index.html.haml +1 -0
- data/lib/generators/releaf/templates/views/layouts/application.html.haml +26 -0
- data/lib/i18n/backend/releaf.rb +96 -0
- data/lib/i18n/backend/releaf/translation.rb +56 -0
- data/lib/i18n/backend/releaf/translation_data.rb +32 -0
- data/lib/i18n/backend/releaf/translation_group.rb +30 -0
- data/lib/i18n/releaf.rb +1 -0
- data/lib/releaf.rb +30 -0
- data/lib/releaf/engine.rb +4 -0
- data/lib/releaf/slug.rb +79 -0
- data/lib/releaf/version.rb +3 -0
- data/lib/tasks/releaf_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/images/rails.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/admin_ability.rb +51 -0
- data/spec/dummy/app/models/settings.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.haml +10 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +68 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/common_fields.yml.example +17 -0
- data/spec/dummy/config/database.yml +42 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +232 -0
- data/spec/dummy/config/initializers/dragonfly.rb +1 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/releaf.rb +59 -0
- data/spec/dummy/config/initializers/releaf_i18n.rb +8 -0
- data/spec/dummy/config/initializers/releaf_store_current_template.rb +25 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/devise.en.yml +58 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +11 -0
- data/spec/dummy/db/migrate/20130204164516_create_settings.rb +17 -0
- data/spec/dummy/db/migrate/20130204164523_create_releaf_nodes.rb +25 -0
- data/spec/dummy/db/migrate/20130204164524_create_releaf_roles.rb +11 -0
- data/spec/dummy/db/migrate/20130204164525_create_releaf_translations.rb +31 -0
- data/spec/dummy/db/migrate/20130204164526_create_releaf_admins.rb +53 -0
- data/spec/dummy/db/schema.rb +112 -0
- data/spec/dummy/db/seeds.rb +64 -0
- data/spec/dummy/doc/README_FOR_APP +2 -0
- data/spec/dummy/log/development.log +74 -0
- data/spec/dummy/log/test.log +129 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/tmp/cache/9C5/660/settings%3Ai18n_updated_at +1 -0
- data/spec/factories/factories.rb +24 -0
- data/spec/features/admin_spec.rb +41 -0
- data/spec/spec_helper.rb +23 -0
- data/templates/releaf/installer.rb +196 -0
- metadata +777 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
.list[data-sortable] > .item {
|
2
|
+
position: relative;
|
3
|
+
}
|
4
|
+
|
5
|
+
.list[data-sortable] > .item > .handle {
|
6
|
+
top: 5px;
|
7
|
+
right: 50px;
|
8
|
+
width: 24px;
|
9
|
+
height: 24px;
|
10
|
+
position: absolute;
|
11
|
+
background: url(<%= asset_path('releaf/icons/drag-handle.png') %>) center center no-repeat;
|
12
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Releaf
|
2
|
+
class AdminsController < BaseController
|
3
|
+
|
4
|
+
def current_object_class
|
5
|
+
Releaf::Admin
|
6
|
+
end
|
7
|
+
|
8
|
+
def columns( view = nil )
|
9
|
+
fields = super - %w[
|
10
|
+
authentication_token
|
11
|
+
confirmation_sent_at
|
12
|
+
confirmation_token
|
13
|
+
confirmed_at
|
14
|
+
current_sign_in_at
|
15
|
+
current_sign_in_ip
|
16
|
+
encrypted_password
|
17
|
+
failed_attempts
|
18
|
+
last_sign_in_at
|
19
|
+
last_sign_in_ip
|
20
|
+
locked_at
|
21
|
+
remember_created_at
|
22
|
+
reset_password_sent_at
|
23
|
+
reset_password_token
|
24
|
+
sign_in_count
|
25
|
+
unconfirmed_email
|
26
|
+
unlock_token
|
27
|
+
]
|
28
|
+
|
29
|
+
if view == 'index'
|
30
|
+
fields -= ['avatar_uid']
|
31
|
+
end
|
32
|
+
|
33
|
+
if %w[new create edit update].include? view
|
34
|
+
fields += ['password', 'password_confirmation']
|
35
|
+
end
|
36
|
+
|
37
|
+
return fields
|
38
|
+
end
|
39
|
+
|
40
|
+
protected
|
41
|
+
|
42
|
+
def admin_params( action )
|
43
|
+
return [] unless [:create, :update].include? action
|
44
|
+
%w[name surname role_id email password password_confirmation phone avatar retained_avatar]
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Releaf
|
2
|
+
class ApplicationController < BaseController
|
3
|
+
# I've no idea where this route to releaf/application.index comes from
|
4
|
+
|
5
|
+
def index
|
6
|
+
respond_to do |format|
|
7
|
+
format.html { redirect_to url_for(:action => 'index', :controller => 'releaf/content') }
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Releaf
|
2
|
+
class BaseApplicationController < ActionController::Base
|
3
|
+
# include ReleafDeviseHelper
|
4
|
+
|
5
|
+
before_filter "authenticate_#{ReleafDeviseHelper.devise_admin_model_name}!"
|
6
|
+
# check_authorization :unless => :devise_controller?
|
7
|
+
layout Releaf.layout
|
8
|
+
protect_from_forgery
|
9
|
+
|
10
|
+
def current_ability
|
11
|
+
@current_ability ||= AdminAbility.new(self.send("current_#{ReleafDeviseHelper.devise_admin_model_name}"))
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,310 @@
|
|
1
|
+
module Releaf
|
2
|
+
class BaseController < BaseApplicationController
|
3
|
+
before_filter do
|
4
|
+
filter_templates
|
5
|
+
set_locale
|
6
|
+
setup
|
7
|
+
end
|
8
|
+
|
9
|
+
def setup
|
10
|
+
@controller = self # this is used later in views
|
11
|
+
@features = { :create => true, :show => true, :edit => true, :destroy => true}
|
12
|
+
@panel_layout = true
|
13
|
+
@continuous_scroll = false
|
14
|
+
@items_per_page = 40
|
15
|
+
end
|
16
|
+
|
17
|
+
def secondary_panel
|
18
|
+
return '' unless @panel_layout
|
19
|
+
@_secondary_panel ||= render_to_string( :partial => "secondary_panel", :layout => false, :locals => build_secondary_panel_variables)
|
20
|
+
end
|
21
|
+
|
22
|
+
def build_secondary_panel_variables
|
23
|
+
menu_item_name = self.class.name.underscore.sub(/_controller$/, '')
|
24
|
+
|
25
|
+
# if this item is defined in main menu, then there will be no altmenu
|
26
|
+
# defined for it in alt menu, instead this method should be overriden in
|
27
|
+
# particular controller to return structure needed to render alt menu
|
28
|
+
return {} if Releaf.main_menu.include? menu_item_name
|
29
|
+
|
30
|
+
# if this item was not found in main menu, then we need to find it in one
|
31
|
+
# of alt menus. This way we'll know which alt menu to render.
|
32
|
+
base_menus = Releaf.main_menu.reject { |item| item[0] != '*' }
|
33
|
+
base_menus.each do |base_menu_name|
|
34
|
+
if view_context.base_menu_items(base_menu_name).include?(menu_item_name)
|
35
|
+
build_menu = { :menu => {} }
|
36
|
+
|
37
|
+
base_menu = Releaf.base_menu[base_menu_name]
|
38
|
+
|
39
|
+
base_menu.each do |section|
|
40
|
+
section_name = section[0].to_sym
|
41
|
+
build_menu[:menu][section_name] = []
|
42
|
+
section[1].each do |item|
|
43
|
+
build_menu[:menu][section_name].push({:controller => item.split(/#/, 2).first})
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
return build_menu
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# coundn't find current controller in base_menu
|
52
|
+
return {}
|
53
|
+
end
|
54
|
+
|
55
|
+
def current_object_class
|
56
|
+
@_current_object_class ||= self.class.name.split('::').last.sub(/\s?Controller$/, '').classify.constantize
|
57
|
+
end
|
58
|
+
|
59
|
+
def current_object_class_name
|
60
|
+
current_object_class.name.underscore.tr('/', '_')
|
61
|
+
end
|
62
|
+
|
63
|
+
def columns view=params[:action]
|
64
|
+
cols = current_object_class.column_names - %w[id created_at updated_at encrypted_password position]
|
65
|
+
unless %w[new edit update create].include? view
|
66
|
+
cols -= %w[password password_confirmation]
|
67
|
+
end
|
68
|
+
return cols
|
69
|
+
end
|
70
|
+
|
71
|
+
def list_action
|
72
|
+
if !cookies['base_module:list_action'].blank?
|
73
|
+
feature = cookies['base_module:list_action']
|
74
|
+
if feature == 'confirm_destroy'
|
75
|
+
feature = 'destroy'
|
76
|
+
end
|
77
|
+
feature = feature.to_sym
|
78
|
+
if !@features[ feature ].blank?
|
79
|
+
return cookies['base_module:list_action']
|
80
|
+
end
|
81
|
+
end
|
82
|
+
if !@features[ :show ].blank?
|
83
|
+
return 'show'
|
84
|
+
end
|
85
|
+
return 'edit';
|
86
|
+
end
|
87
|
+
|
88
|
+
def has_template( name )
|
89
|
+
lookup_context.template_exists?( name, lookup_context.prefixes, false )
|
90
|
+
end
|
91
|
+
|
92
|
+
def find_parent_template( name )
|
93
|
+
lookup_context.find_template( name, lookup_context.prefixes.slice( 1, lookup_context.prefixes.length ), false )
|
94
|
+
end
|
95
|
+
|
96
|
+
def render_parent_template( name, locals = {} )
|
97
|
+
template = find_parent_template( name )
|
98
|
+
if template.blank?
|
99
|
+
return 'blank'
|
100
|
+
end
|
101
|
+
arguments = { :layout => false, :locals => locals, :template => template.virtual_path }
|
102
|
+
return render_to_string( arguments ).html_safe
|
103
|
+
end
|
104
|
+
|
105
|
+
def input_type_for( column_type, name )
|
106
|
+
input_type = 'text'
|
107
|
+
case column_type
|
108
|
+
when :boolean
|
109
|
+
input_type = 'checkbox'
|
110
|
+
when :text
|
111
|
+
input_type = 'textarea'
|
112
|
+
if name.end_with?( '_html' )
|
113
|
+
input_type = 'richtext'
|
114
|
+
end
|
115
|
+
end
|
116
|
+
return input_type
|
117
|
+
end
|
118
|
+
|
119
|
+
# actions
|
120
|
+
|
121
|
+
def autocomplete
|
122
|
+
authorize! :edit, current_object_class
|
123
|
+
|
124
|
+
c_obj = current_object_class
|
125
|
+
|
126
|
+
if params[:query_field] and params[:q] and params[:field] #and params[:field] =~ /_id\z/ and c_obj.column_names.include?(params[:field]) and c_obj.respond_to?(:reflect_on_association) and c_obj.reflect_on_association(params[:field].sub(/_id\z/, '').to_sym)
|
127
|
+
|
128
|
+
obj = c_obj.reflect_on_association(params[:field].sub(/_id\z/, '').to_sym).klass
|
129
|
+
obj_fields = obj.column_names
|
130
|
+
|
131
|
+
sql = []
|
132
|
+
sql_params = {}
|
133
|
+
|
134
|
+
params[:q].split(' ').each_with_index do |part, i|
|
135
|
+
sql.push "#{params[:query_field]} LIKE :part#{i}"
|
136
|
+
sql_params[:"part#{i}"] = "%#{part}%"
|
137
|
+
end
|
138
|
+
|
139
|
+
order_by = nil
|
140
|
+
|
141
|
+
if params[:order]
|
142
|
+
order_by = []
|
143
|
+
|
144
|
+
params[:order].split(',').each do |order_part|
|
145
|
+
if obj_fields.include? order_part.sub(/ (asc|desc)\z/i, '')
|
146
|
+
order_by.push order_part
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
order_by = [params[:query_field],'id'] if order_by.blank?
|
152
|
+
|
153
|
+
query = obj.where(sql.join(' AND '), sql_params).order(order_by.join(', '))
|
154
|
+
|
155
|
+
matching_items_count = query.count
|
156
|
+
list = query.limit(20)
|
157
|
+
|
158
|
+
@items = []
|
159
|
+
list.each do |item|
|
160
|
+
@items.push({ :id => item.id, :text => item.to_text })
|
161
|
+
end
|
162
|
+
|
163
|
+
respond_to do |format|
|
164
|
+
format.json { render :json => {:matching_items_count => matching_items_count, :query => params[:q], :results => @items } }
|
165
|
+
end
|
166
|
+
|
167
|
+
else
|
168
|
+
respond_to do |format|
|
169
|
+
format.json { raise }
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
def index
|
175
|
+
authorize! :list, current_object_class
|
176
|
+
if current_object_class.respond_to?( :filter )
|
177
|
+
@list = current_object_class.filter(:search => params[:search])
|
178
|
+
else
|
179
|
+
@list = current_object_class
|
180
|
+
end
|
181
|
+
@list = @list.page( params[:page] ).per_page( @items_per_page )
|
182
|
+
if !params[:ajax].blank?
|
183
|
+
render :layout => false
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
def urls
|
188
|
+
respond_to do |format|
|
189
|
+
format.json do
|
190
|
+
json = {}
|
191
|
+
params[:ids].each do |id|
|
192
|
+
json[id] = url_for( :action => params[:to_action], :id => id, :only_path => true )
|
193
|
+
end
|
194
|
+
render :json => json, :layout => false
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
def new
|
200
|
+
authorize! :create, current_object_class
|
201
|
+
@item = current_object_class.new
|
202
|
+
end
|
203
|
+
|
204
|
+
def show
|
205
|
+
@item = current_object_class.find(params[:id])
|
206
|
+
authorize! :show, @item
|
207
|
+
end
|
208
|
+
|
209
|
+
def edit
|
210
|
+
@item = current_object_class.find(params[:id])
|
211
|
+
authorize! :edit, @item
|
212
|
+
end
|
213
|
+
|
214
|
+
def create
|
215
|
+
authorize! :create, current_object_class
|
216
|
+
@item = current_object_class.new
|
217
|
+
|
218
|
+
if self.respond_to?(:"#{current_object_class_name}_params")
|
219
|
+
variables = params.require( current_object_class_name ).permit( *self.send(:"#{current_object_class_name}_params", :update) )
|
220
|
+
elsif @item.respond_to? :allowed_params
|
221
|
+
variables = params.require( current_object_class_name ).permit( *@item.allowed_params(:create) )
|
222
|
+
else
|
223
|
+
variables = params.require( current_object_class_name ).permit( *current_object_class.column_names )
|
224
|
+
end
|
225
|
+
|
226
|
+
@item.assign_attributes( variables )
|
227
|
+
|
228
|
+
respond_to do |format|
|
229
|
+
if @item.save
|
230
|
+
format.html { redirect_to url_for( :action => 'show', :id => @item.id ) }
|
231
|
+
else
|
232
|
+
format.html { render :action => "new" }
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
def update
|
238
|
+
@item = current_object_class.find(params[:id])
|
239
|
+
authorize! :edit, @item
|
240
|
+
|
241
|
+
if self.respond_to?(:"#{current_object_class_name}_params")
|
242
|
+
variables = params.require( current_object_class_name ).permit( *self.send(:"#{current_object_class_name}_params", :update) )
|
243
|
+
elsif @item.respond_to? :allowed_params
|
244
|
+
variables = params.require( current_object_class_name ).permit( *@item.allowed_params(:update) )
|
245
|
+
else
|
246
|
+
variables = params.require( current_object_class_name ).permit( *current_object_class.column_names )
|
247
|
+
end
|
248
|
+
|
249
|
+
respond_to do |format|
|
250
|
+
if @item.update_attributes( variables )
|
251
|
+
format.html { redirect_to url_for( :action => 'show', :id => @item.id ) }
|
252
|
+
else
|
253
|
+
format.html { render :action => "edit" }
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
def confirm_destroy
|
259
|
+
@item = current_object_class.find(params[:id])
|
260
|
+
authorize! :destroy, @item
|
261
|
+
end
|
262
|
+
|
263
|
+
def destroy
|
264
|
+
@item = current_object_class.find(params[:id])
|
265
|
+
authorize! :destroy, @item
|
266
|
+
@item.destroy
|
267
|
+
|
268
|
+
respond_to do |format|
|
269
|
+
format.html { redirect_to url_for( :action => 'index' ) }
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
|
274
|
+
private
|
275
|
+
|
276
|
+
def set_locale
|
277
|
+
I18n.locale = if params[:locale] && Settings.i18n_locales.include?(params[:locale])
|
278
|
+
params[:locale]
|
279
|
+
elsif cookies[:locale] && Settings.i18n_locales.include?(cookies[:locale])
|
280
|
+
cookies[:locale]
|
281
|
+
else
|
282
|
+
I18n.default_locale
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
def filter_templates
|
287
|
+
filter_templates_from_hash params
|
288
|
+
end
|
289
|
+
|
290
|
+
def filter_templates_from_array arr
|
291
|
+
return unless arr.is_a? Array
|
292
|
+
arr.each do |item|
|
293
|
+
if item.is_a? Hash
|
294
|
+
filter_templates_from_hash item
|
295
|
+
elsif item.is_a? Array
|
296
|
+
filter_templates_from_array item
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
def filter_templates_from_hash hsk
|
302
|
+
return unless hsk.is_a? Hash
|
303
|
+
hsk.delete :_template_
|
304
|
+
hsk.delete '_template_'
|
305
|
+
|
306
|
+
filter_templates_from_array hsk.values
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
310
|
+
end
|
@@ -0,0 +1,166 @@
|
|
1
|
+
module Releaf
|
2
|
+
class ContentController < BaseController
|
3
|
+
|
4
|
+
def columns( view = nil )
|
5
|
+
if view == 'show'
|
6
|
+
return %w[name parent_id visible protected content]
|
7
|
+
else
|
8
|
+
return super
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def build_secondary_panel_variables
|
13
|
+
@nodes = Node.roots
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
17
|
+
def index
|
18
|
+
authorize! :index, Node
|
19
|
+
respond_to do |format|
|
20
|
+
format.html
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
content_type = _node_params[:content_type].constantize
|
26
|
+
authorize! :create, content_type
|
27
|
+
@item = current_object_class.new(_node_params)
|
28
|
+
@item.assign_attributes(_node_common_fields_params)
|
29
|
+
|
30
|
+
respond_to do |format|
|
31
|
+
if @item.save
|
32
|
+
format.html { redirect_to url_for(:action => "index", :controller => 'content')}
|
33
|
+
else
|
34
|
+
form_extras
|
35
|
+
@order_nodes = Node.where(:parent_id => (params[:parent_id] ? params[:parent_id] : nil))
|
36
|
+
format.html { render action: "new" }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def generate_url
|
42
|
+
tmp_item = nil
|
43
|
+
|
44
|
+
if params[:id]
|
45
|
+
tmp_item = Node.find(params[:id])
|
46
|
+
elsif params[:parent_id].blank? == false
|
47
|
+
parent = Node.find(params[:parent_id])
|
48
|
+
tmp_item = parent.children.new
|
49
|
+
else
|
50
|
+
tmp_item = Node.new
|
51
|
+
end
|
52
|
+
|
53
|
+
tmp_item.name = params[:name]
|
54
|
+
tmp_item.slug = nil
|
55
|
+
# FIXME calling private method
|
56
|
+
tmp_item.send(:ensure_unique_url)
|
57
|
+
|
58
|
+
respond_to do |format|
|
59
|
+
format.js { render :text => tmp_item.slug }
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def update
|
64
|
+
@item = current_object_class.find(params[:id])
|
65
|
+
authorize! :edit, @item
|
66
|
+
|
67
|
+
form_extras
|
68
|
+
@order_nodes = Node.where(:parent_id => (@item.parent_id ? @item.parent_id : nil)).where('id != :id', :id => params[:id])
|
69
|
+
|
70
|
+
@item.assign_attributes(_node_params)
|
71
|
+
@item.assign_attributes(_node_common_fields_params)
|
72
|
+
|
73
|
+
|
74
|
+
respond_to do |format|
|
75
|
+
if @item.save
|
76
|
+
format.html { redirect_to url_for(:action => "edit") }
|
77
|
+
else
|
78
|
+
format.html { render action: "edit" }
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def new
|
84
|
+
authorize! :create, current_object_class
|
85
|
+
unless params[:ajax] == '1'
|
86
|
+
super
|
87
|
+
@order_nodes = Node.where(:parent_id => (params[:parent_id] ? params[:parent_id] : nil))
|
88
|
+
@position = 1
|
89
|
+
@item.parent_id = params[:parent_id]
|
90
|
+
form_extras
|
91
|
+
else
|
92
|
+
Rails.application.eager_load!
|
93
|
+
get_base_models
|
94
|
+
render 'ajax.new', :layout => nil
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def edit
|
99
|
+
super
|
100
|
+
@order_nodes = Node.where(:parent_id => (@item.parent_id ? @item.parent_id : nil)).where('id != :id', :id => params[:id])
|
101
|
+
|
102
|
+
if @item.higher_item
|
103
|
+
@position = @item.higher_item.position
|
104
|
+
else
|
105
|
+
@position = 1
|
106
|
+
end
|
107
|
+
|
108
|
+
form_extras
|
109
|
+
end
|
110
|
+
|
111
|
+
def get_content_form
|
112
|
+
Rails.application.eager_load!
|
113
|
+
raise ArgumentError unless NodeBase.node_classes.map { |nc| nc.name }.include? params[:content_type]
|
114
|
+
@node = current_object_class.find(params[:id])
|
115
|
+
authorize! :edit, @item
|
116
|
+
|
117
|
+
@item = params[:content_type].constantize.new
|
118
|
+
|
119
|
+
respond_to do |format|
|
120
|
+
format.html { render :partial => 'get_content_form', :layout => false }
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
|
125
|
+
|
126
|
+
def current_object_class
|
127
|
+
Node
|
128
|
+
end
|
129
|
+
|
130
|
+
protected
|
131
|
+
|
132
|
+
def _node_common_fields_params
|
133
|
+
allowed_params = (@item.common_field_names).map { |f| f.sub(/_uid$/, '') }
|
134
|
+
params.require(current_object_class_name).permit(*allowed_params)
|
135
|
+
end
|
136
|
+
|
137
|
+
def _node_params
|
138
|
+
allowed_params = (%w[parent_id name content_type slug position data visible protected content_object_attributes]).map { |f| f.sub(/_uid$/, '') }
|
139
|
+
params.require(current_object_class_name).permit(*allowed_params)
|
140
|
+
end
|
141
|
+
|
142
|
+
private
|
143
|
+
|
144
|
+
def form_extras
|
145
|
+
Rails.application.eager_load!
|
146
|
+
get_base_models
|
147
|
+
|
148
|
+
new_content_if_needed
|
149
|
+
end
|
150
|
+
|
151
|
+
def node_params(action)
|
152
|
+
# make sure none of actions, that are defined by BaseController can update item
|
153
|
+
[]
|
154
|
+
end
|
155
|
+
|
156
|
+
def new_content_if_needed
|
157
|
+
return if @item.content
|
158
|
+
@item.content = @item.content_type.constantize.new if get_base_models.map { |bm| bm.name }.include? @item.content_type
|
159
|
+
end
|
160
|
+
|
161
|
+
def get_base_models
|
162
|
+
@base_models ||= NodeBase.node_classes
|
163
|
+
end
|
164
|
+
|
165
|
+
end
|
166
|
+
end
|