crystal-ext 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Rakefile +66 -0
- data/lib/abstract_interface/controller_helper.rb +30 -0
- data/lib/abstract_interface/form_builders/abstract_form_builder.rb +79 -0
- data/lib/abstract_interface/form_builders/themed_form_builder.rb +46 -0
- data/lib/abstract_interface/form_builders/themed_form_tag_builder.rb +13 -0
- data/lib/abstract_interface/haml_builder.rb +56 -0
- data/lib/abstract_interface/model_stub.rb +20 -0
- data/lib/abstract_interface/support.rb +56 -0
- data/lib/abstract_interface/theme.rb +37 -0
- data/lib/abstract_interface/view_builder.rb +158 -0
- data/lib/abstract_interface/view_helper.rb +31 -0
- data/lib/abstract_interface.rb +78 -0
- data/lib/common_interface/MIT-LICENSE +20 -0
- data/lib/common_interface/README.md +51 -0
- data/lib/common_interface/app/controllers/theme_controller.rb +65 -0
- data/lib/common_interface/app/controllers/theme_site_controller.rb +2 -0
- data/lib/common_interface/app/views/layouts/theme.html.erb +1 -0
- data/lib/common_interface/app/views/layouts/theme.js.erb +11 -0
- data/lib/common_interface/app/views/theme/_dialog.html.haml +7 -0
- data/lib/common_interface/app/views/theme/_popup.html.haml +4 -0
- data/lib/common_interface/app/views/theme/aspects.html.haml +32 -0
- data/lib/common_interface/app/views/theme/basic.html.haml +123 -0
- data/lib/common_interface/app/views/theme/dialog.js.erb +1 -0
- data/lib/common_interface/app/views/theme/folder.html.haml +45 -0
- data/lib/common_interface/app/views/theme/help.html.haml +7 -0
- data/lib/common_interface/app/views/theme/index.html.haml +24 -0
- data/lib/common_interface/app/views/theme/items.html.haml +91 -0
- data/lib/common_interface/app/views/theme/list.html.haml +23 -0
- data/lib/common_interface/app/views/theme/page/_folder.html.haml +10 -0
- data/lib/common_interface/app/views/theme/page/_note.html.haml +4 -0
- data/lib/common_interface/app/views/theme/page/_toolbar.html.haml +5 -0
- data/lib/common_interface/app/views/theme/page.html.haml +19 -0
- data/lib/common_interface/app/views/theme/popup.js.erb +1 -0
- data/lib/common_interface/app/views/theme/selector.html.haml +38 -0
- data/lib/common_interface/app/views/theme/style.html.erb +113 -0
- data/lib/common_interface/app/views/theme/tmp.html.erb +31 -0
- data/lib/common_interface/app/views/theme/user.html.haml +16 -0
- data/lib/common_interface/app/views/theme_shared/_comments.html.haml +11 -0
- data/lib/common_interface/app/views/theme_shared/_core_tools.html.haml +6 -0
- data/lib/common_interface/app/views/theme_shared/_line_previews.html.haml +39 -0
- data/lib/common_interface/app/views/theme_shared/_paginator.html.haml +7 -0
- data/lib/common_interface/app/views/theme_shared/_tools.html.haml +27 -0
- data/lib/common_interface/app/views/theme_shared/_top_navigation_bottom.html.haml +32 -0
- data/lib/common_interface/app/views/theme_site/blog.html.haml +13 -0
- data/lib/common_interface/app/views/theme_site/home.html.haml +9 -0
- data/lib/common_interface/app/views/theme_site/post.html.haml +11 -0
- data/lib/common_interface/app/views/theme_site/style.html.haml +9 -0
- data/lib/common_interface/app/views/themes/default/_application_t.html.haml +29 -0
- data/lib/common_interface/app/views/themes/default/_help_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/aspects/_comment_t.html.haml +14 -0
- data/lib/common_interface/app/views/themes/default/aspects/_controls_t.html.haml +3 -0
- data/lib/common_interface/app/views/themes/default/aspects/_details_t.html.haml +6 -0
- data/lib/common_interface/app/views/themes/default/aspects/_discussion_t.html.haml +9 -0
- data/lib/common_interface/app/views/themes/default/aspects/_paginator_t.html.haml +8 -0
- data/lib/common_interface/app/views/themes/default/aspects/_tag_selector_t.html.haml +11 -0
- data/lib/common_interface/app/views/themes/default/basic/_bottom_panel_t.html.haml +9 -0
- data/lib/common_interface/app/views/themes/default/basic/_dialog_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/basic/_divider_t.html.haml +2 -0
- data/lib/common_interface/app/views/themes/default/basic/_html_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/basic/_inplace_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/basic/_message_t.html.haml +3 -0
- data/lib/common_interface/app/views/themes/default/basic/_more_t.html.haml +5 -0
- data/lib/common_interface/app/views/themes/default/basic/_narrow_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/basic/_navigation_t.html.haml +9 -0
- data/lib/common_interface/app/views/themes/default/basic/_popup_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/basic/_text_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/basic/_title_t.html.haml +3 -0
- data/lib/common_interface/app/views/themes/default/basic/_tool_t.html.haml +4 -0
- data/lib/common_interface/app/views/themes/default/basic/_top_panel_t.html.haml +18 -0
- data/lib/common_interface/app/views/themes/default/components/_basic_list_item_t.html.haml +4 -0
- data/lib/common_interface/app/views/themes/default/components/_basic_list_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/components/_table_row_t.html.haml +5 -0
- data/lib/common_interface/app/views/themes/default/components/_table_t.html.haml +12 -0
- data/lib/common_interface/app/views/themes/default/components/_tabs_item_t.html.haml +4 -0
- data/lib/common_interface/app/views/themes/default/components/_tabs_t.html.haml +4 -0
- data/lib/common_interface/app/views/themes/default/components/_toolbar_t.html.haml +14 -0
- data/lib/common_interface/app/views/themes/default/forms/_begin_t.html.erb +3 -0
- data/lib/common_interface/app/views/themes/default/forms/_end_t.html.erb +3 -0
- data/lib/common_interface/app/views/themes/default/forms/_errors_t.html.haml +5 -0
- data/lib/common_interface/app/views/themes/default/forms/_field_t.html.haml +19 -0
- data/lib/common_interface/app/views/themes/default/forms/_line_t.html.haml +6 -0
- data/lib/common_interface/app/views/themes/default/items/_file_t.html.haml +19 -0
- data/lib/common_interface/app/views/themes/default/items/_folder_t.html.haml +23 -0
- data/lib/common_interface/app/views/themes/default/items/_line_t.html.haml +34 -0
- data/lib/common_interface/app/views/themes/default/items/_list_item_t.html.haml +16 -0
- data/lib/common_interface/app/views/themes/default/items/_list_t.html.haml +35 -0
- data/lib/common_interface/app/views/themes/default/items/_note_t.html.haml +16 -0
- data/lib/common_interface/app/views/themes/default/items/_page_t.html.haml +29 -0
- data/lib/common_interface/app/views/themes/default/items/_selector_t.html.haml +18 -0
- data/lib/common_interface/app/views/themes/default/items/_thumb_t.html.haml +12 -0
- data/lib/common_interface/app/views/themes/default/items/_user_t.html.haml +12 -0
- data/lib/common_interface/app/views/themes/default/layout_templates/_dashboard_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/default/layout_templates/_default_t.html.haml +11 -0
- data/lib/common_interface/app/views/themes/default/metadata.rb +117 -0
- data/lib/common_interface/app/views/themes/simple_organization/_application_js_t.html.erb +12 -0
- data/lib/common_interface/app/views/themes/simple_organization/_application_t.html.erb +45 -0
- data/lib/common_interface/app/views/themes/simple_organization/_help_t.html.erb +1 -0
- data/lib/common_interface/app/views/themes/simple_organization/aspects/_comment_t.html.haml +21 -0
- data/lib/common_interface/app/views/themes/simple_organization/aspects/_discussion_t.html.haml +14 -0
- data/lib/common_interface/app/views/themes/simple_organization/aspects/_paginator_t.html.haml +5 -0
- data/lib/common_interface/app/views/themes/simple_organization/aspects/_tag_selector_t.html.haml +10 -0
- data/lib/common_interface/app/views/themes/simple_organization/basic/_bottom_panel_t.html.erb +12 -0
- data/lib/common_interface/app/views/themes/simple_organization/basic/_divider_t.html.erb +3 -0
- data/lib/common_interface/app/views/themes/simple_organization/basic/_message_t.html.erb +7 -0
- data/lib/common_interface/app/views/themes/simple_organization/basic/_more_t.html.haml +5 -0
- data/lib/common_interface/app/views/themes/simple_organization/basic/_navigation_t.html.erb +15 -0
- data/lib/common_interface/app/views/themes/simple_organization/basic/_text_t.html.haml +1 -0
- data/lib/common_interface/app/views/themes/simple_organization/basic/_tool_t.html.erb +9 -0
- data/lib/common_interface/app/views/themes/simple_organization/basic/_top_panel_t.html.erb +14 -0
- data/lib/common_interface/app/views/themes/simple_organization/items/_line_t.html.haml +17 -0
- data/lib/common_interface/app/views/themes/simple_organization/items/_note_t.html.haml +16 -0
- data/lib/common_interface/app/views/themes/simple_organization/items/_selector_t.html.haml +11 -0
- data/lib/common_interface/app/views/themes/simple_organization/layout_templates/_default_t.html.erb +20 -0
- data/lib/common_interface/app/views/themes/simple_organization/layout_templates/_home_t.html.erb +14 -0
- data/lib/common_interface/app/views/themes/simple_organization/metadata.rb +193 -0
- data/lib/common_interface/asset_packages.yml +89 -0
- data/lib/common_interface/init.rb +21 -0
- data/lib/common_interface/lib/common_interface_helper.rb +49 -0
- data/lib/common_interface/public/common_interface/images/img1.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img1_200.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img1_icon.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img1_thumb.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img2.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img2_200.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img2_icon.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img2_thumb.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img3.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img3_200.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img3_icon.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/img3_thumb.jpg +0 -0
- data/lib/common_interface/public/common_interface/images/video_icon.png +0 -0
- data/lib/common_interface/public/common_interface/js/aspects.js +0 -0
- data/lib/common_interface/public/common_interface/js/basic.js +229 -0
- data/lib/common_interface/public/common_interface/js/files_upload.js +115 -0
- data/lib/common_interface/public/common_interface/js/items.js +118 -0
- data/lib/common_interface/public/common_interface/js/style.js +50 -0
- data/lib/common_interface/public/common_interface/lib/jquery.elastic.js +117 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/blank.gif +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_close.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_loading.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_nav_left.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_nav_right.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_e.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_n.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_ne.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_nw.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_s.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_se.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_sw.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_w.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_title_left.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_title_main.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_title_over.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_title_right.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancybox-x.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancybox-y.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancybox.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.easing-1.3.pack.js +72 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.fancybox-1.3.1.js +1077 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.fancybox.css +363 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.fancybox.js +44 -0
- data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.mousewheel-3.0.2.pack.js +13 -0
- data/lib/common_interface/public/common_interface/lib/jquery.form.js +660 -0
- data/lib/common_interface/public/common_interface/lib/jquery.hoverIntent.js +111 -0
- data/lib/common_interface/public/common_interface/lib/jquery.jgrowl/jquery.jgrowl.css +128 -0
- data/lib/common_interface/public/common_interface/lib/jquery.jgrowl/jquery.jgrowl.js +307 -0
- data/lib/common_interface/public/common_interface/lib/jquery.js +4376 -0
- data/lib/common_interface/public/common_interface/lib/jquery.json.js +178 -0
- data/lib/common_interface/public/common_interface/lib/jquery.swfupload/cancel.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.swfupload/jquery.swfupload.js +64 -0
- data/lib/common_interface/public/common_interface/lib/jquery.swfupload/style.css +8 -0
- data/lib/common_interface/public/common_interface/lib/jquery.swfupload/swfupload/swfupload.js +980 -0
- data/lib/common_interface/public/common_interface/lib/jquery.swfupload/swfupload/swfupload.queue.js +98 -0
- data/lib/common_interface/public/common_interface/lib/jquery.swfupload/swfupload/swfupload.swf +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.swfupload/swfupload/wdp_buttons_upload_61x22.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.template.js +255 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_222222_256x240.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_228ef1_256x240.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_ef8c08_256x240.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_ffd27a_256x240.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_ffffff_256x240.png +0 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/jquery.ui.css +406 -0
- data/lib/common_interface/public/common_interface/lib/jquery.ui/jquery.ui.js +71 -0
- data/lib/common_interface/public/common_interface/themes/default/_aspects.scss +58 -0
- data/lib/common_interface/public/common_interface/themes/default/_basic.scss +228 -0
- data/lib/common_interface/public/common_interface/themes/default/_components.scss +151 -0
- data/lib/common_interface/public/common_interface/themes/default/_custom_reset.scss +12 -0
- data/lib/common_interface/public/common_interface/themes/default/_elastic.scss +72 -0
- data/lib/common_interface/public/common_interface/themes/default/_items.scss +88 -0
- data/lib/common_interface/public/common_interface/themes/default/_mixins.scss +39 -0
- data/lib/common_interface/public/common_interface/themes/default/_special.scss +34 -0
- data/lib/common_interface/public/common_interface/themes/default/_variables.scss +15 -0
- data/lib/common_interface/public/common_interface/themes/default/_yui_reset.scss +127 -0
- data/lib/common_interface/public/common_interface/themes/default/elastic.js +307 -0
- data/lib/common_interface/public/common_interface/themes/default/elastic.print.css +8 -0
- data/lib/common_interface/public/common_interface/themes/default/reset.css +157 -0
- data/lib/common_interface/public/common_interface/themes/default/reset.scss +5 -0
- data/lib/common_interface/public/common_interface/themes/default/style.css +580 -0
- data/lib/common_interface/public/common_interface/themes/default/style.js +84 -0
- data/lib/common_interface/public/common_interface/themes/default/style.scss +11 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/_fixes.scss +130 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/_original.scss +852 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/comment-arrow.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/comment-gravatar.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/comment-reply.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/logo-small.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/logo.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/main-two-columns-left.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/main-two-columns.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/sample-event.jpg +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/sample-gravatar.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/sample-image.jpg +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/img/sample-thumbnail.jpg +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/archives.html +389 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/comments.html +486 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/empty-page.html +107 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/comment-arrow.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/comment-gravatar.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/comment-reply.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/logo-small.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/logo.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/main-two-columns-left.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/main-two-columns.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/sample-event.jpg +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/sample-gravatar.gif +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/sample-image.jpg +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/sample-thumbnail.jpg +0 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/index.html +307 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/left-sidebar.html +307 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/no-subnavigation.html +290 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/single-column.html +209 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/style-demo.html +355 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/original/style.css +658 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/style.css +965 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/style.scss +2 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/tmp/comments.html +486 -0
- data/lib/common_interface/public/common_interface/themes/simple_organization/tmp/tmp.html +307 -0
- data/lib/common_interface/spec/controllers/theme_controller_spec.rb +50 -0
- data/lib/common_interface/spec/spec.opts +4 -0
- data/lib/common_interface/spec/spec_helper.rb +1 -0
- data/lib/common_interface/tmp/html.html +39 -0
- data/lib/common_interface/tmp/js.js +78 -0
- data/lib/mongo_mapper_ext/db_config.rb +76 -0
- data/lib/mongo_mapper_ext/hacks/fixes.rb +32 -0
- data/lib/mongo_mapper_ext/hacks/time_measuring.rb +44 -0
- data/lib/mongo_mapper_ext/micelaneous.rb +9 -0
- data/lib/mongo_mapper_ext/migrate.rake +33 -0
- data/lib/mongo_mapper_ext/migration.rb +108 -0
- data/lib/mongo_mapper_ext/mongo_mapper.rb +25 -0
- data/lib/mongo_mapper_ext/plugins/attributes_cache.rb +22 -0
- data/lib/mongo_mapper_ext/plugins/default_scope.rb +76 -0
- data/lib/mongo_mapper_ext/plugins/micelaneous.rb +81 -0
- data/lib/mongo_mapper_ext/spec_helper.rb +10 -0
- data/lib/mongo_mapper_ext/view_helpers.rb +10 -0
- data/lib/mongo_mapper_ext.rb +29 -0
- data/lib/rails_ext/README.markdown +13 -0
- data/lib/rails_ext/action_controller/global_path_prefix.rb +56 -0
- data/lib/rails_ext/action_controller/micelaneous.rb +118 -0
- data/lib/rails_ext/action_controller/persistent_params.rb +96 -0
- data/lib/rails_ext/action_controller/redirect_helper.rb +14 -0
- data/lib/rails_ext/action_controller/reload_page.rb +7 -0
- data/lib/rails_ext/action_controller.rb +19 -0
- data/lib/rails_ext/action_view/common_helper.rb +96 -0
- data/lib/rails_ext/action_view/ruby_template.rb +13 -0
- data/lib/rails_ext/action_view.rb +5 -0
- data/lib/rails_ext/active_record/merge_default_scope/hash_poser.rb +40 -0
- data/lib/rails_ext/active_record/merge_default_scope.rb +16 -0
- data/lib/rails_ext/active_record/micelaneous.rb +14 -0
- data/lib/rails_ext/active_record.rb +7 -0
- data/lib/rails_ext/active_support/micelaneous.rb +7 -0
- data/lib/rails_ext/active_support.rb +1 -0
- data/lib/rails_ext/asset_packager/action_view.rb +47 -0
- data/lib/rails_ext/asset_packager/asset_packager.rb +112 -0
- data/lib/rails_ext/asset_packager/jsmin.rb +205 -0
- data/lib/rails_ext/asset_packager/tasks.rb +27 -0
- data/lib/rails_ext/asset_packager.rb +4 -0
- data/lib/rails_ext/basic/handy_environment.rb +45 -0
- data/lib/rails_ext/basic/user_error.rb +12 -0
- data/lib/rails_ext/basic.rb +6 -0
- data/lib/rails_ext/hacks/ajax_flash.rb +9 -0
- data/lib/rails_ext/hacks/ajax_redirect_to.rb +19 -0
- data/lib/rails_ext/hacks/defer_static_javascripts.rb +18 -0
- data/lib/rails_ext/hacks/global_path_prefix.rb +33 -0
- data/lib/rails_ext/hacks/link_to.rb +105 -0
- data/lib/rails_ext/hacks/merge_default_scope.rb +20 -0
- data/lib/rails_ext/hacks/persistent_params.rb +16 -0
- data/lib/rails_ext/hacks/rjs_layout.rb +2 -0
- data/lib/rails_ext/micelaneous/addressable_uri.rb +45 -0
- data/lib/rails_ext/micelaneous/config_files.rb +18 -0
- data/lib/rails_ext/micelaneous/create_public_symlinks.rb +11 -0
- data/lib/rails_ext/micelaneous/defer_static_javascripts.rb +50 -0
- data/lib/rails_ext/micelaneous/email_config.rb +8 -0
- data/lib/rails_ext/micelaneous/i18n_helper.rb +143 -0
- data/lib/rails_ext/micelaneous/rails_require.rb +4 -0
- data/lib/rails_ext/micelaneous/safe_hash.rb +104 -0
- data/lib/rails_ext/micelaneous.rb +17 -0
- data/lib/rails_ext/public/rails_ext/rails_ext.css +2 -0
- data/lib/rails_ext/public/rails_ext/rails_ext.js +283 -0
- data/lib/rails_ext/spec/mongo_mapper_ext/micelaneous_plugin_spec.rb +56 -0
- data/lib/rails_ext/spec/mongo_mapper_ext/micelaneous_spec.rb +51 -0
- data/lib/rails_ext/spec/mongo_mapper_ext/mongo_mapper_migration_spec.rb +76 -0
- data/lib/rails_ext/spec/mongo_mapper_ext/scope_spec.rb +125 -0
- data/lib/rails_ext/spec/rails_ext/haml_builder_spec.rb +136 -0
- data/lib/rails_ext/spec/rails_ext/safe_hash_spec.rb +71 -0
- data/lib/rails_ext/spec/spec.opts +3 -0
- data/lib/sunspot/mongo_mapper/adapters.rb +79 -0
- data/lib/sunspot/mongo_mapper/searchable.rb +409 -0
- data/lib/sunspot/spec_helper.rb +11 -0
- data/readme.md +1 -0
- data/spec/mongo_mapper_ext/micelaneous_plugin_spec.rb +56 -0
- data/spec/mongo_mapper_ext/micelaneous_spec.rb +51 -0
- data/spec/mongo_mapper_ext/mongo_mapper_migration_spec.rb +76 -0
- data/spec/mongo_mapper_ext/scope_spec.rb +125 -0
- data/spec/rails_ext/haml_builder_spec.rb +136 -0
- data/spec/rails_ext/safe_hash_spec.rb +71 -0
- data/spec/spec.opts +4 -0
- metadata +405 -0
@@ -0,0 +1,307 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
6
|
+
<meta name="description" content=""/>
|
7
|
+
<meta name="keywords" content="" />
|
8
|
+
<meta name="author" content="" />
|
9
|
+
<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
|
10
|
+
<title>Website Template: Simple Organization (demo)</title>
|
11
|
+
</head>
|
12
|
+
|
13
|
+
<body>
|
14
|
+
|
15
|
+
<div id="site-wrapper">
|
16
|
+
|
17
|
+
<div id="header">
|
18
|
+
|
19
|
+
<div id="top">
|
20
|
+
|
21
|
+
<div class="left" id="logo">
|
22
|
+
<a href="index.html"><img src="img/logo.gif" alt="" /></a>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="left navigation" id="main-nav">
|
26
|
+
|
27
|
+
<ul class="tabbed">
|
28
|
+
<li class="current-tab"><a href="index.html">Blog</a></li>
|
29
|
+
<li><a href="#">Events</a></li>
|
30
|
+
<li><a href="#">About</a></li>
|
31
|
+
<li><a href="#">Archives</a></li>
|
32
|
+
<li><a href="#">Join Us!</a></li>
|
33
|
+
</ul>
|
34
|
+
|
35
|
+
<div class="clearer"> </div>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="clearer"> </div>
|
40
|
+
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div class="navigation" id="sub-nav">
|
44
|
+
|
45
|
+
<ul class="tabbed">
|
46
|
+
<li class="current-tab"><a href="index.html">Template Info</a></li>
|
47
|
+
<li><a href="style-demo.html">Style Demo</a></li>
|
48
|
+
<li><a href="comments.html">Comments</a></li>
|
49
|
+
<li><a href="archives.html">Archives</a></li>
|
50
|
+
<li><a href="no-subnavigation.html">No Subnavigation</a></li>
|
51
|
+
<li><a href="left-sidebar.html">Left Sidebar</a></li>
|
52
|
+
<li><a href="single-column.html">Single Column</a></li>
|
53
|
+
<li><a href="empty-page.html">Empty Page</a></li>
|
54
|
+
</ul>
|
55
|
+
|
56
|
+
<div class="clearer"> </div>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="splash">
|
63
|
+
|
64
|
+
<div class="col3 left">
|
65
|
+
|
66
|
+
<h2 class="label label-green">Mission Statement</h2>
|
67
|
+
|
68
|
+
<p class="quiet large">What we want to achieve</p>
|
69
|
+
|
70
|
+
<p>Vestibulum eu pellentesque ante. Sed tincidunt quam eu nisl luctus id mattis tellus rhoncus.</p>
|
71
|
+
<p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae. Donec dapibus eros vitae nibh venenatis faucibus.</p>
|
72
|
+
<p><a href="#" class="more">Learn more »</a></p>
|
73
|
+
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<div class="col3-mid left">
|
77
|
+
|
78
|
+
<h2 class="label label-orange">Next Event</h2>
|
79
|
+
|
80
|
+
<p class="quiet large">Friday, August 18, 2009</p>
|
81
|
+
|
82
|
+
<p><img src="img/sample-event.jpg" width="240" height="80" alt="" class="bordered" /></p>
|
83
|
+
<p><em>Aliquam augue neque, rhoncus et dictum in, cursus eget mauris.</em></p>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div class="col3 right">
|
88
|
+
|
89
|
+
<h2 class="label label-blue">Follow Us</h2>
|
90
|
+
|
91
|
+
<p class="quiet large">http://twitter.com/username</p>
|
92
|
+
|
93
|
+
<p>Nulla mollis sollicitudin nulla et mattis.<span class="quiet">(2 hours ago)</span></p>
|
94
|
+
<p>Torquent per conubia nostra, per inceptos himenaeos. <span class="quiet">(2 hours ago)</span></p>
|
95
|
+
<p>In sed ante at velit hendrerit blandit a et nibh. Cras sed cursus nulla. <span class="quiet">(3 hours ago)</span></p>
|
96
|
+
<p>Nullam vitae mi at nulla blandit. <span class="quiet">(5 hours ago)</span></p>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
<div class="clearer"> </div>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div class="main" id="main-two-columns">
|
105
|
+
|
106
|
+
<div class="left" id="main-content">
|
107
|
+
|
108
|
+
<div class="section">
|
109
|
+
|
110
|
+
<div class="section-title">Blog</div>
|
111
|
+
|
112
|
+
<div class="section-content">
|
113
|
+
|
114
|
+
<div class="post">
|
115
|
+
|
116
|
+
<div class="post-title"><h2><a href="#">Template Information</a></h2></div>
|
117
|
+
|
118
|
+
<div class="post-date">Saturday, September 19, 2009 by Viktor Persson</div>
|
119
|
+
|
120
|
+
<div class="post-body">
|
121
|
+
|
122
|
+
<p><a href="#"><img src="img/sample-image.jpg" alt="" class="bordered" /></a></p>
|
123
|
+
|
124
|
+
<p class="large">This is a free website template by <a href="http://arcsin.se/">Arcsin</a>, built using tableless XHTML and CSS.</p>
|
125
|
+
|
126
|
+
<p>This template is distributed under a <a href="http://templates.arcsin.se/license/">Creative Commons Attribution 2.5 License</a>, which allows you to use and modify it for any purpose (personal and commercial), under the condition that you keep the provided credit links in the footer.</p>
|
127
|
+
|
128
|
+
<p>The latest template version and CMS conversions for platforms such as WordPress and Blogger can be found at the official <a href="http://templates.arcsin.se/simple-organization-website-template/">Simple Organization Website Template</a> page.</p>
|
129
|
+
|
130
|
+
<p>For more templates, questions and comments please visit <a href="http://templates.arcsin.se/">Arcsin Web Templates</a>.</p>
|
131
|
+
|
132
|
+
<a href="http://templates.arcsin.se/" class="more">Read more »</a>
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div class="content-separator"></div>
|
139
|
+
|
140
|
+
<div class="col3 left">
|
141
|
+
<div class="column-content">
|
142
|
+
|
143
|
+
<div class="post">
|
144
|
+
<h3><a href="#">Article title</a></h3>
|
145
|
+
<p>Integer diam elit, condi mentum ac semper ut, tincidunt non diam. Ut congue at commodo aenean euismod tincidunt lorem euismod.</p>
|
146
|
+
<a href="#" class="more">Read more »</a>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div class="col3 col3-mid left">
|
153
|
+
<div class="column-content">
|
154
|
+
|
155
|
+
<div class="post">
|
156
|
+
<h3><a href="#">Second Article Title</a></h3>
|
157
|
+
<p>Sed congue lacinia leo, sed dignissim odio pharetra vel. Fusce a dignissim dui. Fusce semper porttitor enim dapibus venenatis.</p>
|
158
|
+
<a href="#" class="more">Read more »</a>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
<div class="col3 right">
|
165
|
+
<div class="column-content">
|
166
|
+
|
167
|
+
<div class="post">
|
168
|
+
<h3><a href="#">Third title</a></h3>
|
169
|
+
<p>Sed auctor hendrerit eros eu eleifend. Cras hendrerit iaculis sodales. Pellentesque interdum rhoncus magna.</p>
|
170
|
+
<a href="#" class="more">Read more »</a>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div class="clearer"> </div>
|
177
|
+
|
178
|
+
</div>
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div class="clearer"> </div>
|
183
|
+
|
184
|
+
</div>
|
185
|
+
|
186
|
+
<div class="right sidebar" id="sidebar">
|
187
|
+
|
188
|
+
<div class="section">
|
189
|
+
|
190
|
+
<div class="section-title">Search</div>
|
191
|
+
|
192
|
+
<div class="section-content">
|
193
|
+
<form method="post" action="">
|
194
|
+
<input type="text" class="text" size="28" /> <input type="submit" class="button" value="Submit" />
|
195
|
+
</form>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div class="section">
|
201
|
+
|
202
|
+
<div class="section-title">Recent Entries</div>
|
203
|
+
|
204
|
+
<div class="section-content">
|
205
|
+
|
206
|
+
<ul class="nice-list">
|
207
|
+
<li>
|
208
|
+
<div class="left"><a href="#">Aenean tempor arcu..</a></div>
|
209
|
+
<div class="right">Oct 12</div>
|
210
|
+
<div class="clearer"> </div>
|
211
|
+
</li>
|
212
|
+
<li>
|
213
|
+
<div class="left"><a href="#">Justo interdum rutrum</a></div>
|
214
|
+
<div class="right">Sep 15</div>
|
215
|
+
<div class="clearer"> </div>
|
216
|
+
</li>
|
217
|
+
<li>
|
218
|
+
<div class="left"><a href="#">In nec justo in urna</a></div>
|
219
|
+
<div class="right">Sep 12</div>
|
220
|
+
<div class="clearer"> </div>
|
221
|
+
</li>
|
222
|
+
<li>
|
223
|
+
<div class="left"><a href="#">Accumsan condimentum</a></div>
|
224
|
+
<div class="right">Sep 6</div>
|
225
|
+
<div class="clearer"> </div>
|
226
|
+
</li>
|
227
|
+
<li>
|
228
|
+
<div class="left"><a href="#">Etiam commodo bibendum</a></div>
|
229
|
+
<div class="right">Aug 27</div>
|
230
|
+
<div class="clearer"> </div>
|
231
|
+
</li>
|
232
|
+
<li>
|
233
|
+
<div class="left"><a href="#">Mauris euismod justo</a></div>
|
234
|
+
<div class="right">Aug 21</div>
|
235
|
+
<div class="clearer"> </div>
|
236
|
+
</li>
|
237
|
+
<li><a href="#" class="more">Browse Archives »</a></li>
|
238
|
+
</ul>
|
239
|
+
|
240
|
+
</div>
|
241
|
+
|
242
|
+
</div>
|
243
|
+
|
244
|
+
<div class="section">
|
245
|
+
|
246
|
+
<div class="section-title">Board of Members</div>
|
247
|
+
|
248
|
+
<div class="section-content">
|
249
|
+
|
250
|
+
<ul class="nice-list">
|
251
|
+
<li><a href="#">Elem Semper</a> <span class="quiet">- Director</span></li>
|
252
|
+
<li><a href="#">Porttitor Urna</a> <span class="quiet">- Lead Writer</span></li>
|
253
|
+
<li><a href="#">Congue Porttitor</a> <span class="quiet">- Editor</span></li>
|
254
|
+
<li><a href="#">Etiam Blandit</a> <span class="quiet">- Writer</span></li>
|
255
|
+
<li><a href="#">Diet Tesque</a> <span class="quiet">- Writer</span></li>
|
256
|
+
</ul>
|
257
|
+
|
258
|
+
</div>
|
259
|
+
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div class="section">
|
263
|
+
|
264
|
+
<div class="section-title">Topics</div>
|
265
|
+
|
266
|
+
<div class="section-content">
|
267
|
+
<div class="quiet">
|
268
|
+
<a href="#" style="font-size: 120%">vestibulum</a> <a href="#" style="font-size: 120%">ante</a> <a href="#" style="font-size: 150%">ipsum</a> <a href="#" style="font-size: 120%">faucibus</a> <a href="#" style="font-size: 90%">orci luctus</a> <a href="#" style="font-size: 80%">ultrices</a> <a href="#" style="font-size: 220%">posuere cubilia</a> <a href="#" style="font-size: 100%">curae</a> <a href="#" style="font-size: 110%">quisque</a> <a href="#" style="font-size: 150%">ut arcu</a> <a href="#" style="font-size: 140%">eros</a> <a href="#" style="font-size: 100%">vestibulum</a> <a href="#" style="font-size: 90%">dapibus</a> <a href="#" style="font-size: 120%">volutpat</a> <a href="#" style="font-size: 200%">elementum</a>
|
269
|
+
</div>
|
270
|
+
</div>
|
271
|
+
|
272
|
+
</div>
|
273
|
+
|
274
|
+
</div>
|
275
|
+
|
276
|
+
<div class="clearer"> </div>
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div id="footer">
|
281
|
+
|
282
|
+
<div class="left" id="footer-left">
|
283
|
+
|
284
|
+
<img src="img/logo-small.gif" alt="" class="left" />
|
285
|
+
|
286
|
+
<p>© 2002-2009 Simple Organization. All rights Reserved</p>
|
287
|
+
|
288
|
+
<p class="quiet"><a href="http://templates.arcsin.se/">Website template</a> by <a href="http://arcsin.se/">Arcsin</a></p>
|
289
|
+
|
290
|
+
<div class="clearer"> </div>
|
291
|
+
|
292
|
+
</div>
|
293
|
+
|
294
|
+
<div class="right" id="footer-right">
|
295
|
+
|
296
|
+
<p class="large"><a href="#">Blog</a> <span class="text-separator">|</span> <a href="#">Events</a> <span class="text-separator">|</span> <a href="#">About</a> <span class="text-separator">|</span> <a href="#">Archives</a> <span class="text-separator">|</span> <strong><a href="#">Join Us!</a></strong> <span class="text-separator">|</span> <a href="#top" class="quiet">Page Top ↑</a></p>
|
297
|
+
|
298
|
+
</div>
|
299
|
+
|
300
|
+
<div class="clearer"> </div>
|
301
|
+
|
302
|
+
</div>
|
303
|
+
|
304
|
+
</div>
|
305
|
+
|
306
|
+
</body>
|
307
|
+
</html>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
CORE_CASES = %w{aspects basic folder items list page selector}
|
4
|
+
SPECIAL_CASES = %w{user style}
|
5
|
+
|
6
|
+
THEME_LAYOUTS = {
|
7
|
+
:default => [[:home, :default], [:style, :default], [:blog, :default], [:post, :default]],
|
8
|
+
:simple_organization => [[:home, :home], [:style, :default], [:blog, :default], [:post, :default]]
|
9
|
+
}
|
10
|
+
|
11
|
+
describe "Common Interface" do
|
12
|
+
controller_name "theme"
|
13
|
+
integrate_views
|
14
|
+
|
15
|
+
it "should display general help page" do
|
16
|
+
get :help
|
17
|
+
response.should be_success
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
AbstractInterface.available_themes.each do |theme_name|
|
22
|
+
describe "'#{theme_name}' theme" do
|
23
|
+
controller_name 'theme'
|
24
|
+
integrate_views
|
25
|
+
|
26
|
+
(CORE_CASES + SPECIAL_CASES).each do |action_name|
|
27
|
+
it "should display '#{action_name}'" do
|
28
|
+
get action_name, :_theme => theme_name
|
29
|
+
response.should be_success
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should display help page for #{theme_name} theme" do
|
34
|
+
get :help, :_theme => theme_name
|
35
|
+
response.should be_success
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "'#{theme_name}' Theme for Site" do
|
40
|
+
controller_name 'theme_site'
|
41
|
+
integrate_views
|
42
|
+
|
43
|
+
THEME_LAYOUTS[theme_name.to_sym].each do |action_name, ltemplate|
|
44
|
+
it "should display #{action_name}" do
|
45
|
+
get action_name, :_theme => theme_name, :_layout_template => ltemplate
|
46
|
+
response.should be_success
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../spec/spec_helper'
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<div class='_files_wiget files'>
|
2
|
+
|
3
|
+
<div class='_templates' style='display:none'>
|
4
|
+
|
5
|
+
<textarea class='_file_progress_template'>
|
6
|
+
<li class="_file_#{id}">
|
7
|
+
<em>#{name}</em>
|
8
|
+
(#{size_in_kb} KB)
|
9
|
+
<em class='_cancel'>[#{cancel}]</em>
|
10
|
+
<span class="progressvalue _progressvalue" ></span>
|
11
|
+
<div class="progressbar" ><div class="progress _progress" ></div></div>
|
12
|
+
<!-- <span class="_cancel cancel" > </span> -->
|
13
|
+
</li>
|
14
|
+
</textarea>
|
15
|
+
|
16
|
+
<textarea class="_file_template">
|
17
|
+
<div class='#{file_id}'>
|
18
|
+
<a href='#{url}'>#{name}</a> <a class="_delete" href="#">[#{delete}]</a>
|
19
|
+
</div>
|
20
|
+
</textarea>
|
21
|
+
|
22
|
+
<textarea class="_content_template">
|
23
|
+
<div class="_files"></div>
|
24
|
+
<ol class="log _queue"></ol>
|
25
|
+
<span class='_flash_holder'></span>
|
26
|
+
|
27
|
+
<br/><a class="_upload" href="#"></a>
|
28
|
+
</textarea>
|
29
|
+
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="_content">
|
33
|
+
</div>
|
34
|
+
|
35
|
+
</div>
|
36
|
+
|
37
|
+
folder_wiget object, {}, {
|
38
|
+
:wiget => '._files_wiget'
|
39
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
//Inline HTML Tooltip script: By JavaScript Kit: http://www.javascriptkit.com
|
2
|
+
//Created: July 10th, 08'
|
3
|
+
|
4
|
+
var htmltooltip={
|
5
|
+
tipclass: 'htmltooltip',
|
6
|
+
fadeeffect: [true, 500],
|
7
|
+
anchors: [],
|
8
|
+
tooltips: [], //array to contain references to all tooltip DIVs on the page
|
9
|
+
|
10
|
+
positiontip:function($, tipindex, e){
|
11
|
+
var anchor=this.anchors[tipindex]
|
12
|
+
var tooltip=this.tooltips[tipindex]
|
13
|
+
var scrollLeft=window.pageXOffset? window.pageXOffset : this.iebody.scrollLeft
|
14
|
+
var scrollTop=window.pageYOffset? window.pageYOffset : this.iebody.scrollTop
|
15
|
+
var docwidth=(window.innerWidth)? window.innerWidth-15 : htmltooltip.iebody.clientWidth-15
|
16
|
+
var docheight=(window.innerHeight)? window.innerHeight-18 : htmltooltip.iebody.clientHeight-15
|
17
|
+
var tipx=anchor.dimensions.offsetx
|
18
|
+
var tipy=anchor.dimensions.offsety+anchor.dimensions.h
|
19
|
+
tipx=(tipx+tooltip.dimensions.w-scrollLeft>docwidth)? tipx-tooltip.dimensions.w : tipx //account for right edge
|
20
|
+
tipy=(tipy+tooltip.dimensions.h-scrollTop>docheight)? tipy-tooltip.dimensions.h-anchor.dimensions.h : tipy //account for bottom edge
|
21
|
+
$(tooltip).css({left: tipx, top: tipy})
|
22
|
+
},
|
23
|
+
|
24
|
+
showtip:function($, tipindex, e){
|
25
|
+
var tooltip=this.tooltips[tipindex]
|
26
|
+
if (this.fadeeffect[0])
|
27
|
+
$(tooltip).hide().fadeIn(this.fadeeffect[1])
|
28
|
+
else
|
29
|
+
$(tooltip).show()
|
30
|
+
},
|
31
|
+
|
32
|
+
hidetip:function($, tipindex, e){
|
33
|
+
var tooltip=this.tooltips[tipindex]
|
34
|
+
if (this.fadeeffect[0])
|
35
|
+
$(tooltip).fadeOut(this.fadeeffect[1])
|
36
|
+
else
|
37
|
+
$(tooltip).hide()
|
38
|
+
},
|
39
|
+
|
40
|
+
updateanchordimensions:function($){
|
41
|
+
var $anchors=$('*[@rel="'+htmltooltip.tipclass+'"]')
|
42
|
+
$anchors.each(function(index){
|
43
|
+
this.dimensions={w:this.offsetWidth, h:this.offsetHeight, offsetx:$(this).offset().left, offsety:$(this).offset().top}
|
44
|
+
})
|
45
|
+
},
|
46
|
+
|
47
|
+
render:function(){
|
48
|
+
jQuery(document).ready(function($){
|
49
|
+
htmltooltip.iebody=(document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
|
50
|
+
var $anchors=$('*[@rel="'+htmltooltip.tipclass+'"]')
|
51
|
+
var $tooltips=$('div[@class="'+htmltooltip.tipclass+'"]')
|
52
|
+
$anchors.each(function(index){ //find all links with "title=htmltooltip" declaration
|
53
|
+
this.dimensions={w:this.offsetWidth, h:this.offsetHeight, offsetx:$(this).offset().left, offsety:$(this).offset().top} //store anchor dimensions
|
54
|
+
this.tippos=index+' pos' //store index of corresponding tooltip
|
55
|
+
var tooltip=$tooltips.eq(index).get(0) //ref corresponding tooltip
|
56
|
+
if (tooltip==null) //if no corresponding tooltip found
|
57
|
+
return //exist
|
58
|
+
tooltip.dimensions={w:tooltip.offsetWidth, h:tooltip.offsetHeight}
|
59
|
+
$(tooltip).remove().appendTo('body') //add tooltip to end of BODY for easier positioning
|
60
|
+
htmltooltip.tooltips.push(tooltip) //store reference to each tooltip
|
61
|
+
htmltooltip.anchors.push(this) //store reference to each anchor
|
62
|
+
var $anchor=$(this)
|
63
|
+
$anchor.hover(
|
64
|
+
function(e){ //onMouseover element
|
65
|
+
htmltooltip.positiontip($, parseInt(this.tippos), e)
|
66
|
+
htmltooltip.showtip($, parseInt(this.tippos), e)
|
67
|
+
},
|
68
|
+
function(e){ //onMouseout element
|
69
|
+
htmltooltip.hidetip($, parseInt(this.tippos), e)
|
70
|
+
}
|
71
|
+
)
|
72
|
+
$(window).bind("resize", function(){htmltooltip.updateanchordimensions($)})
|
73
|
+
})
|
74
|
+
})
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
htmltooltip.render()
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module MongoMapper
|
2
|
+
class ConnectionsPool < Hash
|
3
|
+
attr_accessor :mongo_mapper
|
4
|
+
def initialize mongo_mapper
|
5
|
+
self.mongo_mapper = mongo_mapper
|
6
|
+
end
|
7
|
+
|
8
|
+
def [](database_alias)
|
9
|
+
database_alias = database_alias.to_s
|
10
|
+
unless connection = super(database_alias)
|
11
|
+
mongo_mapper.db_config.should! :include, database_alias
|
12
|
+
db_options = mongo_mapper.db_config[database_alias]
|
13
|
+
connection = Mongo::Connection.new(db_options['host'], db_options['port'], :logger => mongo_mapper.logger)
|
14
|
+
|
15
|
+
if defined?(PhusionPassenger)
|
16
|
+
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
17
|
+
connection.connect_to_master if forked
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
self[database_alias] = connection
|
22
|
+
end
|
23
|
+
return connection
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class DatabasesPool < Hash
|
28
|
+
attr_accessor :mongo_mapper
|
29
|
+
def initialize mongo_mapper
|
30
|
+
self.mongo_mapper = mongo_mapper
|
31
|
+
end
|
32
|
+
|
33
|
+
def [](database_alias)
|
34
|
+
database_alias = database_alias.to_s
|
35
|
+
unless db = super(database_alias)
|
36
|
+
mongo_mapper.db_config.should! :include, database_alias
|
37
|
+
db_options = mongo_mapper.db_config[database_alias]
|
38
|
+
db = mongo_mapper.connections[database_alias].db db_options['name'].should!(:be_a, String)
|
39
|
+
self[database_alias] = db
|
40
|
+
end
|
41
|
+
return db
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class << self
|
46
|
+
attr_accessor :db_config
|
47
|
+
|
48
|
+
def db_config
|
49
|
+
unless @db_config
|
50
|
+
if defined?(::Rails) and defined?(DATABASE)
|
51
|
+
@db_config = {}
|
52
|
+
DATABASE["#{::Rails.env}!"].to_h.each do |db_alias, options|
|
53
|
+
@db_config[db_alias.to_s] = {
|
54
|
+
'name' => options.name!,
|
55
|
+
'host' => options.host(nil),
|
56
|
+
'port' => options.port(nil)
|
57
|
+
}
|
58
|
+
end
|
59
|
+
else
|
60
|
+
@db_config = {}
|
61
|
+
# raise "If you don't using Rails you must override this method and provide your own config!"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
@db_config
|
65
|
+
end
|
66
|
+
|
67
|
+
def connections
|
68
|
+
@connections ||= ConnectionsPool.new(self)
|
69
|
+
end
|
70
|
+
|
71
|
+
def databases
|
72
|
+
@databases ||= DatabasesPool.new(self)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#
|
2
|
+
# ObjectID
|
3
|
+
#
|
4
|
+
# Mongo::ObjectID.class_eval do
|
5
|
+
# def == other
|
6
|
+
# self.to_s == other.to_s
|
7
|
+
# end
|
8
|
+
#
|
9
|
+
# def to_yaml *args
|
10
|
+
# to_s.to_yaml *args
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
|
14
|
+
|
15
|
+
#
|
16
|
+
# Fixes
|
17
|
+
#
|
18
|
+
if Object.const_defined?(:RAILS_ENV) and Object.const_get(:RAILS_ENV) != 'production'
|
19
|
+
MongoMapper::Document::ClassMethods.class_eval do
|
20
|
+
def ensure_index(name_or_array, options={})
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
MongoMapper::Plugins::Associations::InArrayProxy.class_eval do
|
27
|
+
def delete(doc)
|
28
|
+
ids.delete(doc.id)
|
29
|
+
klass.delete(doc.id)
|
30
|
+
reset
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Measures MongoDB requests time and adds it to log
|
2
|
+
|
3
|
+
if defined?(Rails) and RAILS_ENV == 'development'
|
4
|
+
Mongo::Connection.class_eval do
|
5
|
+
def send_message_with_time operation, message, log_message=nil
|
6
|
+
begin
|
7
|
+
logger = @logger
|
8
|
+
@logger = nil
|
9
|
+
t = Time.now
|
10
|
+
send_message_without_time operation, message, log_message
|
11
|
+
ensure
|
12
|
+
logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
|
13
|
+
@logger = logger
|
14
|
+
end
|
15
|
+
end
|
16
|
+
alias_method_chain :send_message, :time
|
17
|
+
|
18
|
+
def send_message_with_safe_check_with_time operation, message, db_name, log_message=nil
|
19
|
+
begin
|
20
|
+
logger = @logger
|
21
|
+
@logger = nil
|
22
|
+
t = Time.now
|
23
|
+
send_message_with_safe_check_without_time operation, message, db_name, log_message
|
24
|
+
ensure
|
25
|
+
logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
|
26
|
+
@logger = logger
|
27
|
+
end
|
28
|
+
end
|
29
|
+
alias_method_chain :send_message_with_safe_check, :time
|
30
|
+
|
31
|
+
def receive_message_with_time operation, message, log_message=nil, socket=nil
|
32
|
+
begin
|
33
|
+
logger = @logger
|
34
|
+
@logger = nil
|
35
|
+
t = Time.now
|
36
|
+
receive_message_without_time operation, message, log_message, socket
|
37
|
+
ensure
|
38
|
+
logger.debug(" MONGODB (#{Time.now - t}) #{log_message || message}") if logger
|
39
|
+
@logger = logger
|
40
|
+
end
|
41
|
+
end
|
42
|
+
alias_method_chain :receive_message, :time
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Rake::TaskManager.class_eval do
|
2
|
+
def remove_task(task_name)
|
3
|
+
@tasks.delete(task_name.to_s)
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
def remove_task(task_name)
|
8
|
+
Rake.application.remove_task(task_name)
|
9
|
+
end
|
10
|
+
|
11
|
+
namespace :db do
|
12
|
+
|
13
|
+
remove_task 'db:migrate'
|
14
|
+
desc "Migrate Database"
|
15
|
+
task :migrate => :environment do
|
16
|
+
::Migration = MongoMapper::Migration
|
17
|
+
Dir["#{Rails.root}/lib/db/**/*.rb"].each{|f| require f.sub(/\.rb$/, '')}
|
18
|
+
|
19
|
+
database_alias = ENV['d'] || ENV['database']
|
20
|
+
database_alias = 'accounts' if database_alias.blank?
|
21
|
+
|
22
|
+
version = ENV['v'] || ENV['version']
|
23
|
+
if version.blank?
|
24
|
+
size = MongoMapper::Migration.definitions[database_alias].size
|
25
|
+
highest_defined_version = size == 0 ? 0 : size - 1
|
26
|
+
version = highest_defined_version
|
27
|
+
else
|
28
|
+
version = version.to_i
|
29
|
+
end
|
30
|
+
|
31
|
+
MongoMapper::Migration.update database_alias, version
|
32
|
+
end
|
33
|
+
end
|