kirgudu_base 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +40 -0
- data/app/assets/images/kirgudu_base/404-fry.png +0 -0
- data/app/assets/images/kirgudu_base/Documents.gif +0 -0
- data/app/assets/images/kirgudu_base/Meetings.gif +0 -0
- data/app/assets/images/kirgudu_base/Repair.gif +0 -0
- data/app/assets/images/kirgudu_base/ajax-loader.gif +0 -0
- data/app/assets/images/kirgudu_base/alpha.png +0 -0
- data/app/assets/images/kirgudu_base/alpha2.png +0 -0
- data/app/assets/images/kirgudu_base/arrow.png +0 -0
- data/app/assets/images/kirgudu_base/box.gif +0 -0
- data/app/assets/images/kirgudu_base/chosen-sprite.png +0 -0
- data/app/assets/images/kirgudu_base/company_pxg.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/back_disabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/back_enabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/back_enabled_hover.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/forward_disabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/forward_enabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/forward_enabled_hover.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_asc.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_asc_disabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_both.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_desc.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_desc_disabled.png +0 -0
- data/app/assets/images/kirgudu_base/fancybox/blank.gif +0 -0
- data/app/assets/images/kirgudu_base/fancybox/fancybox_buttons.png +0 -0
- data/app/assets/images/kirgudu_base/fancybox/fancybox_loading.gif +0 -0
- data/app/assets/images/kirgudu_base/fancybox/fancybox_overlay.png +0 -0
- data/app/assets/images/kirgudu_base/fancybox/fancybox_sprite.png +0 -0
- data/app/assets/images/kirgudu_base/favicon.png +0 -0
- data/app/assets/images/kirgudu_base/general/clock.png +0 -0
- data/app/assets/images/kirgudu_base/general/clock2.png +0 -0
- data/app/assets/images/kirgudu_base/general/coffee.png +0 -0
- data/app/assets/images/kirgudu_base/general/coffee2.png +0 -0
- data/app/assets/images/kirgudu_base/general/flipchart.png +0 -0
- data/app/assets/images/kirgudu_base/general/flipchart2.png +0 -0
- data/app/assets/images/kirgudu_base/general/sun.png +0 -0
- data/app/assets/images/kirgudu_base/general/sun2.png +0 -0
- data/app/assets/images/kirgudu_base/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/kirgudu_base/glyphicons-halflings.png +0 -0
- data/app/assets/images/kirgudu_base/gradient1.png +0 -0
- data/app/assets/images/kirgudu_base/hue2.png +0 -0
- data/app/assets/images/kirgudu_base/ico_16_4_d.gif +0 -0
- data/app/assets/images/kirgudu_base/ico_18_1010.gif +0 -0
- data/app/assets/images/kirgudu_base/ico_18_112.gif +0 -0
- data/app/assets/images/kirgudu_base/ico_18_2020.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-contacts.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-employees.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-list.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-orders-green.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-orders.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-tenders.gif +0 -0
- data/app/assets/images/kirgudu_base/icons-sa7c41345d9.png +0 -0
- data/app/assets/images/kirgudu_base/login-corner.png +0 -0
- data/app/assets/images/kirgudu_base/login-corner2.png +0 -0
- data/app/assets/images/kirgudu_base/logo.png +0 -0
- data/app/assets/images/kirgudu_base/maps/m1.png +0 -0
- data/app/assets/images/kirgudu_base/maps/m2.png +0 -0
- data/app/assets/images/kirgudu_base/maps/m3.png +0 -0
- data/app/assets/images/kirgudu_base/meeting-schedule.gif +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/calendar.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/dashboard.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/forms.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/gallery.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/grid.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/maps.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/others.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/statistics.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/tables.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/widgets.png +0 -0
- data/app/assets/images/kirgudu_base/menu_top/profile-avatar.png +0 -0
- data/app/assets/images/kirgudu_base/menu_top/profile-messages.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar1.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar2.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar3.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar4.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar5.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar6.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar7.png +0 -0
- data/app/assets/images/kirgudu_base/news-icon-16.gif +0 -0
- data/app/assets/images/kirgudu_base/operator-def.png +0 -0
- data/app/assets/images/kirgudu_base/patterns/bg_dark.png +0 -0
- data/app/assets/images/kirgudu_base/patterns/bg_dark2.png +0 -0
- data/app/assets/images/kirgudu_base/patterns/bg_dark3.png +0 -0
- data/app/assets/images/kirgudu_base/patterns/whitey.png +0 -0
- data/app/assets/images/kirgudu_base/people-16-16-256.gif +0 -0
- data/app/assets/images/kirgudu_base/sales_24x24 (1).gif +0 -0
- data/app/assets/images/kirgudu_base/sample_avatar_big.jpg +0 -0
- data/app/assets/images/kirgudu_base/saturation2.png +0 -0
- data/app/assets/images/kirgudu_base/search.png +0 -0
- data/app/assets/images/kirgudu_base/toggle.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_fine-grain_10_e7e7e7_60x60.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_flat_0_ef4622_40x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_highlight-hard_100_e1e1e1_1x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_highlight-hard_100_eeeeee_1x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_highlight-hard_75_dddddd_1x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/kirgudu_base/ui-icons_525d66_256x240.png +0 -0
- data/app/assets/images/kirgudu_base/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/kirgudu_base/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/images/kirgudu_base/uploadify-cancel.png +0 -0
- data/app/assets/javascripts/kirgudu_base/ajax_form.js +52 -0
- data/app/assets/javascripts/kirgudu_base/application.js +15 -0
- data/app/assets/javascripts/kirgudu_base/avgrund.js +85 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-alert.js +90 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-button.js +96 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-carousel.js +176 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-collapse.js +158 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-colorpicker.js +520 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-datepicker.js +401 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-dropdown.js +150 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-modal.js +239 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-popover.js +103 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-scrollspy.js +151 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-tab.js +135 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-tooltip.js +275 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-transition.js +60 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-typeahead.js +300 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-wysihtml5.js +458 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap.js +6 -0
- data/app/assets/javascripts/kirgudu_base/character-limit.js +18 -0
- data/app/assets/javascripts/kirgudu_base/chosen.jquery.min.js +10 -0
- data/app/assets/javascripts/kirgudu_base/client_main.js +1017 -0
- data/app/assets/javascripts/kirgudu_base/delete.js +67 -0
- data/app/assets/javascripts/kirgudu_base/excanvas.compiled.js +35 -0
- data/app/assets/javascripts/kirgudu_base/fileinput.jquery.js +98 -0
- data/app/assets/javascripts/kirgudu_base/fullcalendar.js +5220 -0
- data/app/assets/javascripts/kirgudu_base/gmap3.min.js +39 -0
- data/app/assets/javascripts/kirgudu_base/highcharts.js +246 -0
- data/app/assets/javascripts/kirgudu_base/jdpicker.js +555 -0
- data/app/assets/javascripts/kirgudu_base/jnavigate.jquery.min.js +2 -0
- data/app/assets/javascripts/kirgudu_base/jquery-ui-1.8.23.custom.min.js +125 -0
- data/app/assets/javascripts/kirgudu_base/jquery-ui-1.8.23.custom.min_d9931121.js +125 -0
- data/app/assets/javascripts/kirgudu_base/jquery.blockUI.js +534 -0
- data/app/assets/javascripts/kirgudu_base/jquery.bookblock.js +533 -0
- data/app/assets/javascripts/kirgudu_base/jquery.cookie.js +94 -0
- data/app/assets/javascripts/kirgudu_base/jquery.dataTables.js +12092 -0
- data/app/assets/javascripts/kirgudu_base/jquery.endless-scroll.js +343 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox-buttons.js +121 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox-media.js +196 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox-thumbs.js +162 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox.js +1985 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.crosshair.js +167 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.js +2599 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.pie.js +751 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.resize.js +60 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.spider.js +314 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.stack.js +184 -0
- data/app/assets/javascripts/kirgudu_base/jquery.history.js +1 -0
- data/app/assets/javascripts/kirgudu_base/jquery.jcarousel.min.js +16 -0
- data/app/assets/javascripts/kirgudu_base/jquery.jeditable.js +543 -0
- data/app/assets/javascripts/kirgudu_base/jquery.js +2 -0
- data/app/assets/javascripts/kirgudu_base/jquery.json-2.3.min.js +23 -0
- data/app/assets/javascripts/kirgudu_base/jquery.maskedinput-1.3.js +258 -0
- data/app/assets/javascripts/kirgudu_base/jquery.mousewheel-min.js +12 -0
- data/app/assets/javascripts/kirgudu_base/jquery.peity.min.js +11 -0
- data/app/assets/javascripts/kirgudu_base/jquery.simplemodal-1.4.4.js +716 -0
- data/app/assets/javascripts/kirgudu_base/jquery.slides.min.js +7 -0
- data/app/assets/javascripts/kirgudu_base/jquery.sparkline.min.js +5 -0
- data/app/assets/javascripts/kirgudu_base/jquery.tagsinput.js +354 -0
- data/app/assets/javascripts/kirgudu_base/jquery.tools.min.js +17 -0
- data/app/assets/javascripts/kirgudu_base/jquery.touchdown.js +54 -0
- data/app/assets/javascripts/kirgudu_base/jquery.uniform.min.js +17 -0
- data/app/assets/javascripts/kirgudu_base/jquery.uploadify-3.1.js +975 -0
- data/app/assets/javascripts/kirgudu_base/jquery.uploadify.min.js +16 -0
- data/app/assets/javascripts/kirgudu_base/jquery.url-2.0.js +174 -0
- data/app/assets/javascripts/kirgudu_base/jquery.validate.min.js +4 -0
- data/app/assets/javascripts/kirgudu_base/jquerypp.custom.js +301 -0
- data/app/assets/javascripts/kirgudu_base/justgage.1.0.1.min.js +12 -0
- data/app/assets/javascripts/kirgudu_base/main.js +157 -0
- data/app/assets/javascripts/kirgudu_base/modernizr.custom.32549.js +815 -0
- data/app/assets/javascripts/kirgudu_base/mustache.js +532 -0
- data/app/assets/javascripts/kirgudu_base/popbox.js +57 -0
- data/app/assets/javascripts/kirgudu_base/raphael.2.1.0.min.js +10 -0
- data/app/assets/javascripts/kirgudu_base/scripts.js +1277 -0
- data/app/assets/javascripts/kirgudu_base/scripts_OLD.js +204 -0
- data/app/assets/javascripts/kirgudu_base/sub_select.js +50 -0
- data/app/assets/javascripts/kirgudu_base/swfobject.js +5 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shAutoloader.js +17 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushAS3.js +59 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushAppleScript.js +75 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushBash.js +59 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushCSharp.js +65 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushColdFusion.js +100 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushCpp.js +97 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushCss.js +91 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushDelphi.js +55 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushDiff.js +41 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushErlang.js +52 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushGroovy.js +67 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushJScript.js +52 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushJava.js +57 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushJavaFX.js +58 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPerl.js +72 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPhp.js +88 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPlain.js +33 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPowerShell.js +74 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPython.js +64 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushRuby.js +55 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushSass.js +94 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushScala.js +51 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushSql.js +66 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushVb.js +56 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushXml.js +69 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shCore.js +17 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shLegacy.js +17 -0
- data/app/assets/javascripts/kirgudu_base/textarea-autogrow.js +55 -0
- data/app/assets/javascripts/kirgudu_base/tiny_mce.js +1 -0
- data/app/assets/javascripts/kirgudu_base/watch.js +81 -0
- data/app/assets/javascripts/kirgudu_base/web/inputPlaceholder.js +82 -0
- data/app/assets/javascripts/kirgudu_base/web/js.js +91 -0
- data/app/assets/javascripts/kirgudu_base/web/navigate.js +20 -0
- data/app/assets/javascripts/kirgudu_base/web/watch.js +1706 -0
- data/app/assets/javascripts/kirgudu_base/wysihtml5-0.3.0.min.js +261 -0
- data/app/assets/stylesheets/kirgudu_base/bootstrap.css +4551 -0
- data/app/assets/stylesheets/kirgudu_base/chosen.css +397 -0
- data/app/assets/stylesheets/kirgudu_base/fullcalendar.css +655 -0
- data/app/assets/stylesheets/kirgudu_base/info-message.css +79 -0
- data/app/assets/stylesheets/kirgudu_base/jdpicker.css +200 -0
- data/app/assets/stylesheets/kirgudu_base/jquery-ui-1.8.23.custom.css +1235 -0
- data/app/assets/stylesheets/kirgudu_base/jquery.fancybox-buttons.css +96 -0
- data/app/assets/stylesheets/kirgudu_base/jquery.fancybox-thumbs.css +54 -0
- data/app/assets/stylesheets/kirgudu_base/jquery.fancybox.css +249 -0
- data/app/assets/stylesheets/kirgudu_base/jquery.tagsinput.css +7 -0
- data/app/assets/stylesheets/kirgudu_base/main.css +1368 -0
- data/app/assets/stylesheets/kirgudu_base/menu.css +159 -0
- data/app/assets/stylesheets/kirgudu_base/popbox.css +58 -0
- data/app/assets/stylesheets/kirgudu_base/responsive.css +2249 -0
- data/app/assets/stylesheets/kirgudu_base/switcher.css +80 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCore.css +226 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreDefault.css +328 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreDjango.css +331 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreEclipse.css +339 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreEmacs.css +324 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreFadeToGrey.css +328 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreMDUltra.css +324 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreMidnight.css +324 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreRDark.css +324 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeDefault.css +117 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeDjango.css +120 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeEclipse.css +128 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeEmacs.css +113 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeFadeToGrey.css +117 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeMDUltra.css +113 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeMidnight.css +113 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeRDark.css +113 -0
- data/app/assets/stylesheets/kirgudu_base/uploadify.css +92 -0
- data/app/controllers/kirgudu_base/admin_controller.rb +91 -0
- data/app/controllers/kirgudu_base/application_controller.rb +676 -0
- data/app/controllers/kirgudu_base/cabinet_controller.rb +93 -0
- data/app/controllers/kirgudu_base/facade_controller.rb +82 -0
- data/app/helpers/kirgudu_base/application_helper.rb +486 -0
- data/app/helpers/kirgudu_base/breadcrumbs_helper.rb +27 -0
- data/app/helpers/kirgudu_base/class_helper.rb +32 -0
- data/app/helpers/kirgudu_base/controllers/basic_actions.rb +625 -0
- data/app/helpers/kirgudu_base/controllers/container_items_management_actions.rb +118 -0
- data/app/helpers/kirgudu_base/controllers/container_items_sorting_actions.rb +64 -0
- data/app/helpers/kirgudu_base/controllers/dynamic_pages.rb +30 -0
- data/app/helpers/kirgudu_base/controllers/obligatory_filters.rb +29 -0
- data/app/helpers/kirgudu_base/controllers/transaction_wrapper.rb +138 -0
- data/app/helpers/kirgudu_base/form_builder.rb +474 -0
- data/app/helpers/kirgudu_base/gui_helper.rb +443 -0
- data/app/helpers/kirgudu_base/models/basic_management_urls.rb +104 -0
- data/app/helpers/kirgudu_base/models/data_filter.rb +236 -0
- data/app/helpers/kirgudu_base/models/exports.rb +167 -0
- data/app/helpers/kirgudu_base/models/filters.rb +32 -0
- data/app/helpers/kirgudu_base/models/form_properties.rb +108 -0
- data/app/helpers/kirgudu_base/models/form_property.rb +335 -0
- data/app/helpers/kirgudu_base/models/methods.rb +64 -0
- data/app/helpers/kirgudu_base/models/scopes.rb +157 -0
- data/app/helpers/kirgudu_base/models/sorting.rb +99 -0
- data/app/helpers/kirgudu_base/models/standard_actions.rb +50 -0
- data/app/helpers/kirgudu_base/models/uncloneable_properties.rb +21 -0
- data/app/helpers/kirgudu_base/old_form_builder.rb +340 -0
- data/app/helpers/kirgudu_base/url_helper.rb +18 -0
- data/app/models/kirgudu_base/base_model.rb +293 -0
- data/app/models/kirgudu_base/dynamic_pages/action_for.rb +78 -0
- data/app/models/kirgudu_base/dynamic_pages/action_for_builder.rb +46 -0
- data/app/models/kirgudu_base/dynamic_pages/data_source.rb +111 -0
- data/app/models/kirgudu_base/dynamic_pages/data_source_builder.rb +79 -0
- data/app/models/kirgudu_base/dynamic_pages/form.rb +99 -0
- data/app/models/kirgudu_base/dynamic_pages/form_builder.rb +85 -0
- data/app/models/kirgudu_base/dynamic_pages/input_type.rb +17 -0
- data/app/models/kirgudu_base/dynamic_pages/on_change.rb +40 -0
- data/app/models/kirgudu_base/dynamic_pages/on_change_builder.rb +38 -0
- data/app/models/kirgudu_base/dynamic_pages/page.rb +55 -0
- data/app/models/kirgudu_base/dynamic_pages/page_builder.rb +63 -0
- data/app/models/kirgudu_base/dynamic_pages/property.rb +185 -0
- data/app/models/kirgudu_base/dynamic_pages/property_builder.rb +123 -0
- data/app/models/kirgudu_base/template.rb +6 -0
- data/app/models/kirgudu_base/template_element.rb +6 -0
- data/app/views/layouts/kirgudu_base/application.html.erb +141 -0
- data/app/views/shared/kirgudu_base/_body_javascripts_files.html.erb +71 -0
- data/app/views/shared/kirgudu_base/_body_javascripts_scripts.html.erb +1099 -0
- data/app/views/shared/kirgudu_base/_breadcrumbs.html.erb +36 -0
- data/app/views/shared/kirgudu_base/_head_javascripts.html.erb +21 -0
- data/app/views/shared/kirgudu_base/_head_stylesheets.html.erb +21 -0
- data/app/views/shared/kirgudu_base/_index_page_filter.html.erb +43 -0
- data/app/views/shared/kirgudu_base/_left_menu_standard_actions.html.erb +57 -0
- data/app/views/shared/kirgudu_base/_services_top_line.html.erb +5 -0
- data/app/views/shared/kirgudu_base/_top_nav_bar.html.erb +58 -0
- data/app/views/shared/kirgudu_base/entry_edit_form_renderer.html.erb +70 -0
- data/app/views/shared/kirgudu_base/entry_index_renderer.html.erb +98 -0
- data/app/views/shared/kirgudu_base/entry_new_form_renderer.html.erb +68 -0
- data/app/views/shared/kirgudu_base/entry_not_found_renderer.html.erb +15 -0
- data/app/views/shared/kirgudu_base/entry_show_renderer.html.erb +28 -0
- data/app/views/shared/kirgudu_base/manage_images/managing_items_index.html.erb +34 -0
- data/app/views/shared/kirgudu_base/manage_images/managing_items_manage.html.erb +72 -0
- data/app/views/shared/kirgudu_base/manage_images/managing_items_sort_index.html.erb +33 -0
- data/app/views/shared/kirgudu_base/manage_items/managing_items_index.html.erb +42 -0
- data/app/views/shared/kirgudu_base/manage_items/managing_items_manage.html.erb +66 -0
- data/app/views/shared/kirgudu_base/manage_items/managing_items_sort_index.html.erb +33 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20131114161828_create_kirgudu_base_templates.rb +17 -0
- data/db/migrate/20131114165013_create_kirgudu_base_template_elements.rb +18 -0
- data/lib/kirgudu_base/engine.rb +6 -0
- data/lib/kirgudu_base/version.rb +4 -0
- data/lib/kirgudu_base.rb +5 -0
- data/lib/tasks/kirgudu_base_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +60 -0
- data/test/dummy/config/boot.rb +11 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +6 -0
- data/test/dummy/config/environments/development.rb +38 -0
- data/test/dummy/config/environments/production.rb +68 -0
- data/test/dummy/config/environments/test.rb +38 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +8 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +6 -0
- data/test/dummy/config/initializers/secret_token.rb +8 -0
- data/test/dummy/config/initializers/session_store.rb +9 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +15 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/fixtures/kirgudu_base/template_elements.yml +17 -0
- data/test/fixtures/kirgudu_base/templates.yml +15 -0
- data/test/integration/navigation_test.rb +11 -0
- data/test/kirgudu_base_test.rb +8 -0
- data/test/test_helper.rb +16 -0
- data/test/unit/kirgudu_base/template_element_test.rb +10 -0
- data/test/unit/kirgudu_base/template_test.rb +10 -0
- metadata +492 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
module KirguduBase
|
3
|
+
module UrlHelper
|
4
|
+
|
5
|
+
def with_subdomain(subdomain)
|
6
|
+
subdomain = (subdomain || "")
|
7
|
+
subdomain += "." unless subdomain.empty?
|
8
|
+
[subdomain, request.domain].join
|
9
|
+
end
|
10
|
+
|
11
|
+
def url_for(options = nil)
|
12
|
+
if options.kind_of?(Hash) && options.has_key?(:subdomain)
|
13
|
+
options[:host] = with_subdomain(options.delete(:subdomain))
|
14
|
+
end
|
15
|
+
super
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,293 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
module KirguduBase
|
3
|
+
class BaseModel < ::ActiveRecord::Base
|
4
|
+
|
5
|
+
self.abstract_class = true
|
6
|
+
|
7
|
+
################################### FILTERS ######################################
|
8
|
+
|
9
|
+
|
10
|
+
################################# INCLUSIONS #####################################
|
11
|
+
|
12
|
+
|
13
|
+
#include SharedZone::Extensions::ModelSorting
|
14
|
+
#extend SharedZone::Extensions::ModelSorting::ClassMethods
|
15
|
+
|
16
|
+
include ::KirguduBase::Models::Sorting
|
17
|
+
extend ::KirguduBase::Models::Sorting::ClassMethods
|
18
|
+
|
19
|
+
extend ::KirguduBase::Models::FormProperties
|
20
|
+
extend ::KirguduBase::Models::Filters
|
21
|
+
extend ::KirguduBase::Models::UncloneableProperties
|
22
|
+
|
23
|
+
|
24
|
+
unclonable_property :id, :updated_at, :created_at
|
25
|
+
|
26
|
+
|
27
|
+
################################# INSTANCE METHODS ######################################
|
28
|
+
|
29
|
+
def deletion_status_name
|
30
|
+
::ChupakabraTools::DeletionStatus[deletion_status_id] if self.respond_to?(:deletion_status_id)
|
31
|
+
end
|
32
|
+
|
33
|
+
def is_active_label
|
34
|
+
I18n.t(is_active ? 1 : 0, scope: "shared_zone.labels.yes_no") if self.respond_to?(:is_active)
|
35
|
+
end
|
36
|
+
|
37
|
+
def is_html_label
|
38
|
+
I18n.t(is_html ? 1 : 0, scope: "shared_zone.labels.yes_no") if self.respond_to?(:is_html)
|
39
|
+
end
|
40
|
+
|
41
|
+
def name_for_breadcrumbs
|
42
|
+
name
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_s
|
46
|
+
name
|
47
|
+
end
|
48
|
+
|
49
|
+
def clone
|
50
|
+
self.class.new(self.attributes.except(self.class.unclonable_properties_set))
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_i18n
|
54
|
+
self.class.to_i18n
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.to_i18n
|
58
|
+
::ChupakabraTools::ClassHelper.class_to_i18n(self)
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.generate_hash(data)
|
62
|
+
data = "" unless data
|
63
|
+
Digest::SHA1.hexdigest(data)
|
64
|
+
end
|
65
|
+
|
66
|
+
def generate_hash(data)
|
67
|
+
self.class.generate(data)
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
def self.belongs_to_module?(modul)
|
72
|
+
::ChupakabraTools::ClassHelper.class_belong_to_module(modul, self)
|
73
|
+
end
|
74
|
+
|
75
|
+
def belongs_to_module?(modul)
|
76
|
+
self.class.belongs_to_module?(modul)
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
def self.is_subclass?(parent_class)
|
81
|
+
::ChupakabraTools::ClassHelper.class_is_subclass_of(parent_class, self)
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
def is_subclass?(parent_class)
|
86
|
+
self.class.is_subclass?(parent_class)
|
87
|
+
end
|
88
|
+
|
89
|
+
############################## CREATED_AT and UPDATED_AT formatters #################################
|
90
|
+
|
91
|
+
def formatted_updated_at
|
92
|
+
if self.respond_to?(:updated_at)
|
93
|
+
#time_ago_in_words()
|
94
|
+
time_distance_in_words = distance_of_time_in_words(self.updated_at, Time.now, true)
|
95
|
+
time_dt_format = self.updated_at.strftime("%d.%m.%Y %H:%M")
|
96
|
+
|
97
|
+
"#{time_distance_in_words} (#{time_dt_format})"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def formatted_created_at
|
102
|
+
if self.respond_to?(:created_at)
|
103
|
+
#time_ago_in_words()
|
104
|
+
time_distance_in_words = distance_of_time_in_words(self.created_at, Time.now, true)
|
105
|
+
time_dt_format = self.created_at.strftime("%d.%m.%Y %H:%M")
|
106
|
+
|
107
|
+
"#{time_distance_in_words} (#{time_dt_format})"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
################################# METHODS MOVED FROM DataRetriever ######################################
|
112
|
+
|
113
|
+
def self.get_entries(controller, query, filters, options)
|
114
|
+
options ||= {}
|
115
|
+
options.symbolize_keys!
|
116
|
+
|
117
|
+
logger = options[:logger]
|
118
|
+
|
119
|
+
filters ||= {}
|
120
|
+
filters.stringify_keys!
|
121
|
+
|
122
|
+
logger.debug("Incoming Filters: #{filters.to_json}") if logger
|
123
|
+
|
124
|
+
unless options[:skip_filters] == true
|
125
|
+
if self.respond_to?(:data_filters_set)
|
126
|
+
logger.debug("Data Filters: #{self.data_filters_set}") if logger
|
127
|
+
self.data_filters_set.each do |df|
|
128
|
+
filter_value = options[df.name.to_s]
|
129
|
+
if filter_value && !filter_value.blank?
|
130
|
+
filter_name = df.filter_name.to_s
|
131
|
+
if filter_name.nil? || filter_name.to_s.blank?
|
132
|
+
filter_name = df.name
|
133
|
+
end
|
134
|
+
filters[filter_name] = filter_value
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
logger.debug("Sanitized filters: #{filters.to_json}") if logger
|
141
|
+
|
142
|
+
controller.fill_obligatory_filters(filters, options)
|
143
|
+
|
144
|
+
logger.debug("Applied filters: #{filters.to_json}") if logger
|
145
|
+
|
146
|
+
filters[:per_page] = options['per_page'] if options['per_page']
|
147
|
+
filters[:page] = options['page'] if options['page']
|
148
|
+
|
149
|
+
#raise filters.to_json
|
150
|
+
filters.symbolize_keys!
|
151
|
+
|
152
|
+
if query && !query.is_a?(::ActiveRecord::Relation)
|
153
|
+
raise "Query must be nil or ActiveRecord::Relation"
|
154
|
+
end
|
155
|
+
|
156
|
+
unless query
|
157
|
+
query = self
|
158
|
+
end
|
159
|
+
|
160
|
+
self.apply_filters_to_query(query, filters)
|
161
|
+
end
|
162
|
+
|
163
|
+
|
164
|
+
def self.get_entry_name(controller, id, options={})
|
165
|
+
options ||= {}
|
166
|
+
logger = options[:logger]
|
167
|
+
found_text_value = nil
|
168
|
+
entry = get_entry_by_id(controller, id, options)
|
169
|
+
found_text_value = entry.to_s if entry
|
170
|
+
found_text_value
|
171
|
+
end
|
172
|
+
|
173
|
+
def self.get_entry_by_id(controller, id, filters, options={})
|
174
|
+
options ||= {}
|
175
|
+
logger = options[:logger]
|
176
|
+
self.get_entries(controller, nil, filters, options).where(id: id).first
|
177
|
+
end
|
178
|
+
|
179
|
+
|
180
|
+
def self.get_entries_for_select(controller, source, filters, options)
|
181
|
+
options ||= {}
|
182
|
+
filters ||= {}
|
183
|
+
logger = options[:logger]
|
184
|
+
options[:logger] = nil
|
185
|
+
select_data = nil
|
186
|
+
|
187
|
+
logger.info("=======================::SharedZone::DataRetriever.GetEntriesForSelect=======================") if logger
|
188
|
+
logger.info("CONTROLLER: #{controller.class}") if logger
|
189
|
+
|
190
|
+
if source
|
191
|
+
id_property = nil
|
192
|
+
name_property = nil
|
193
|
+
|
194
|
+
logger.info("Process: SOURCE SUPPLIED") if logger
|
195
|
+
if source.is_a?(Hash)
|
196
|
+
logger.info("Process: SOURCE IS HASH") if logger
|
197
|
+
id_property = source[:id] || :id
|
198
|
+
name_property = source[:name] || :name
|
199
|
+
source = source[:klass]
|
200
|
+
end
|
201
|
+
|
202
|
+
if source < LLActiveRecord::Base || source.is_a?(LLActiveRecord::Relation)
|
203
|
+
id_property = :id unless id_property
|
204
|
+
name_property = :name unless name_property
|
205
|
+
|
206
|
+
logger.info("Process: SOURCE RESPOND TO :apply_filters_to_query") if logger
|
207
|
+
|
208
|
+
filters[:parent] = nil
|
209
|
+
filters[:parent_value] = nil
|
210
|
+
|
211
|
+
if options[:parent]
|
212
|
+
logger.info("Process: PARENT PROPERTY DEFINED #{options[:parent]}") if logger
|
213
|
+
if options[:parent_value]
|
214
|
+
logger.info("Process: PARENT VALUE DEFINED #{options[:parent_value]}") if logger
|
215
|
+
filters[options[:parent]] = options[:parent_value]
|
216
|
+
else
|
217
|
+
logger.info("Process: PARENT PROPERTY DEFINED #{options[:parent]}, BUT NOT VALUE SUPPLIED") if logger
|
218
|
+
return []
|
219
|
+
end
|
220
|
+
end
|
221
|
+
filters[:per_page] = 9999999
|
222
|
+
filters[:page] = 1
|
223
|
+
|
224
|
+
select_data = self.get_entries(controller, source, filters, options).map { |u| [u.send(name_property), u.send(id_property)] }
|
225
|
+
elsif source.is_a?(String)
|
226
|
+
source_data = I18n.t(source)
|
227
|
+
|
228
|
+
select_data = []
|
229
|
+
|
230
|
+
source_data.keys.each do |key|
|
231
|
+
select_data.push([source_data[key].to_s, key.to_s.to_i])
|
232
|
+
end
|
233
|
+
elsif source.is_a?(Array)
|
234
|
+
select_data = []
|
235
|
+
source.each do |e|
|
236
|
+
if e.is_a?(Array)
|
237
|
+
select_data.push(e)
|
238
|
+
elsif e.is_a?(Hash)
|
239
|
+
select_data.push([e[:name], e[:id]])
|
240
|
+
else
|
241
|
+
select_data.push([e.to_s, e])
|
242
|
+
end
|
243
|
+
end
|
244
|
+
elsif source.is_a?(Range)
|
245
|
+
select_data = []
|
246
|
+
#raise source.to_json
|
247
|
+
source.each do |e|
|
248
|
+
select_data.push([e.to_s, e])
|
249
|
+
end
|
250
|
+
elsif source < ::ChupakabraTools::ActiveEnumExtended
|
251
|
+
select_data = source.to_select
|
252
|
+
logger.info("Selected #{select_data.count} entries") if logger
|
253
|
+
else
|
254
|
+
logger.info("Process: UNEXPECTED TYPE OF SOURCE #{source.class}") if logger
|
255
|
+
end
|
256
|
+
else
|
257
|
+
logger.error("Process: SOURCE NOT SUPPLIED") if logger
|
258
|
+
end
|
259
|
+
|
260
|
+
logger.info("======================= END of::SharedZone::DataRetriever.GetEntriesForSelect=======================") if logger
|
261
|
+
select_data
|
262
|
+
end
|
263
|
+
|
264
|
+
def self.apply_filters_to_query(query, filters = {})
|
265
|
+
filters ||= {}
|
266
|
+
per_page = filters[:per_page] || ::WillPaginate.per_page
|
267
|
+
per_page = 99999 if per_page.nil? || per_page <= 0
|
268
|
+
order_by = filters[:order] || 'name asc'
|
269
|
+
page = nil
|
270
|
+
page = filters[:page].to_i if filters[:page]
|
271
|
+
if page && page < 1
|
272
|
+
page = 1
|
273
|
+
end
|
274
|
+
|
275
|
+
query = query.by_deletion_status(filters[:deletion_status_id]) if self.respond_to?(:by_deletion_status)
|
276
|
+
|
277
|
+
query = query.by_created_by(filters[:created_by]) if self.respond_to?(:by_created_by)
|
278
|
+
query = query.by_updated_by(filters[:updated_by]) if self.respond_to?(:by_updated_by)
|
279
|
+
|
280
|
+
query = query.by_created_at_start(filters[:created_at]) if self.respond_to?(:by_created_at_start)
|
281
|
+
query = query.by_created_at_finish(filters[:created_at]) if self.respond_to?(:by_created_at_finish)
|
282
|
+
|
283
|
+
query = query.by_updated_at_start(filters[:updated_at]) if self.respond_to?(:by_updated_at_start)
|
284
|
+
query = query.by_updated_at_start(filters[:updated_at]) if self.respond_to?(:by_updated_at_finish)
|
285
|
+
|
286
|
+
query
|
287
|
+
.order(order_by)
|
288
|
+
.page(page)
|
289
|
+
.per_page(per_page)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
@@ -0,0 +1,78 @@
|
|
1
|
+
class KirguduBase::DynamicPages::ActionFor
|
2
|
+
|
3
|
+
SUPPORTED_CONDITIONS =
|
4
|
+
[
|
5
|
+
:more, # >
|
6
|
+
:more_equal, # >=
|
7
|
+
:less, # <
|
8
|
+
:less_equal, # <=
|
9
|
+
:is, # =
|
10
|
+
:is_not, # !=
|
11
|
+
:between, # min < value < max
|
12
|
+
:not_between, # min >= value >= max
|
13
|
+
:include, # min <= value <= max - for intervals, and include? - for arrays
|
14
|
+
:not_include # min > value > max - for intervals, and not_include? - for arrays
|
15
|
+
]
|
16
|
+
|
17
|
+
SUPPORTED_ACTIONS = [
|
18
|
+
:nullify, # set null or empty
|
19
|
+
:default, # set default value
|
20
|
+
:retrieve, # retrieve data for property
|
21
|
+
:show, # show control
|
22
|
+
:hide, # hide control
|
23
|
+
:enable, # enable control
|
24
|
+
:disable # disable control
|
25
|
+
]
|
26
|
+
|
27
|
+
|
28
|
+
def initialize(options = {})
|
29
|
+
self.value = nil
|
30
|
+
self.actions = []
|
31
|
+
self.condition = :is
|
32
|
+
self.data_source = :nil
|
33
|
+
|
34
|
+
|
35
|
+
if options
|
36
|
+
options.symbolize_keys!
|
37
|
+
options.each_pair do |key, value|
|
38
|
+
self.send("#{key}=", value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
def value
|
45
|
+
@value
|
46
|
+
end
|
47
|
+
|
48
|
+
def value= val
|
49
|
+
@value = val
|
50
|
+
end
|
51
|
+
|
52
|
+
def action
|
53
|
+
@action
|
54
|
+
end
|
55
|
+
|
56
|
+
def action= value
|
57
|
+
@action = value
|
58
|
+
end
|
59
|
+
|
60
|
+
def condition
|
61
|
+
@condition
|
62
|
+
end
|
63
|
+
|
64
|
+
def condition= value
|
65
|
+
@condition = value
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
def data_source
|
70
|
+
@data_source
|
71
|
+
end
|
72
|
+
def data_source= value
|
73
|
+
@data_source = value
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class KirguduBase::DynamicPages::ActionForBuilder
|
2
|
+
|
3
|
+
def initialize(value, &block)
|
4
|
+
|
5
|
+
@value = value
|
6
|
+
@action = []
|
7
|
+
@condition = :is
|
8
|
+
@data_source = :nil
|
9
|
+
|
10
|
+
instance_eval(&block) if block_given?
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
def action(value)
|
15
|
+
if value.is_a?(Array)
|
16
|
+
not_suppoted_actions = []
|
17
|
+
value.each do |item|
|
18
|
+
not_suppoted_actions << item unless ::KirguduBase::DynamicPages::ActionFor::SUPPORTED_ACTIONS.include?(item)
|
19
|
+
end
|
20
|
+
raise "Actions ':#{not_suppoted_actions.map { |i| ":#{i}" }.join(", ")}' is not supported. Supported Actions are #{::KirguduBase::DynamicPages::ActionFor::SUPPORTED_ACTIONS.map { |i| ":#{i}" }.join(", ")}" if not_suppoted_actions.length > 0
|
21
|
+
else
|
22
|
+
raise "Action ':#{value}' is not supported. Supported Actions are #{::KirguduBase::DynamicPages::ActionFor::SUPPORTED_ACTIONS.map { |i| ":#{i}" }.join(", ")}" unless ::KirguduBase::DynamicPages::ActionFor::SUPPORTED_ACTIONS.include?(value)
|
23
|
+
end
|
24
|
+
@action = value
|
25
|
+
end
|
26
|
+
|
27
|
+
def condition(value)
|
28
|
+
raise "Condition ':#{value}' is not supported. Supported Conditions are #{::KirguduBase::DynamicPages::ActionFor::SUPPORTED_CONDITIONS.map { |i| ":#{i}" }.join(", ")}" unless ::KirguduBase::DynamicPages::ActionFor::SUPPORTED_CONDITIONS.include?(value)
|
29
|
+
@condition = value
|
30
|
+
end
|
31
|
+
|
32
|
+
def data_source(value)
|
33
|
+
@data_source = value
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
def to_action_for
|
38
|
+
::KirguduBase::DynamicPages::ActionFor.new(
|
39
|
+
vale: @value,
|
40
|
+
action: @action,
|
41
|
+
condition: @condition,
|
42
|
+
data_source: @data_source
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
class KirguduBase::DynamicPages::DataSource
|
2
|
+
|
3
|
+
SUPPORTED_DATA_FORMATS = [:xml, :json, :csv ]
|
4
|
+
SUPPORTED_DATASOURCE_TYPES = [:jquery, :rails, :local]
|
5
|
+
|
6
|
+
|
7
|
+
def initialize(options = {})
|
8
|
+
self.name = nil
|
9
|
+
self.model = nil
|
10
|
+
self.cross_domain = false
|
11
|
+
self.cache_locally = false
|
12
|
+
self.list_url = nil
|
13
|
+
self.entry_url = nil
|
14
|
+
self.data_format = :json
|
15
|
+
self.label_property = "name"
|
16
|
+
self.value_property = "id"
|
17
|
+
self.type = :local
|
18
|
+
|
19
|
+
if options
|
20
|
+
options.symbolize_keys!
|
21
|
+
options.each_pair do |key, value|
|
22
|
+
self.send("#{key}=", value)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def name
|
29
|
+
@name
|
30
|
+
end
|
31
|
+
|
32
|
+
def name= value
|
33
|
+
@name = value
|
34
|
+
end
|
35
|
+
|
36
|
+
def model
|
37
|
+
@model
|
38
|
+
end
|
39
|
+
|
40
|
+
def model= value
|
41
|
+
@model = value
|
42
|
+
end
|
43
|
+
|
44
|
+
def cross_domain
|
45
|
+
@cross_domain
|
46
|
+
end
|
47
|
+
|
48
|
+
def cross_domain= value
|
49
|
+
@cross_domain = value ? true : false
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def list_url
|
54
|
+
@list_url
|
55
|
+
end
|
56
|
+
|
57
|
+
def list_url= value
|
58
|
+
@list_url = value
|
59
|
+
end
|
60
|
+
|
61
|
+
def entry_url
|
62
|
+
@entry_url
|
63
|
+
end
|
64
|
+
|
65
|
+
def entry_url= value
|
66
|
+
@entry_url = value
|
67
|
+
end
|
68
|
+
|
69
|
+
def data_format
|
70
|
+
@data_format
|
71
|
+
end
|
72
|
+
|
73
|
+
def data_format= value
|
74
|
+
raise "Data Format ':#{value}' is not supported. Supported Data Formats are #{SUPPORTED_DATA_FORMATS.map{ |i| ":#{i}" }.join(", ")}" unless SUPPORTED_DATA_FORMATS.include?(value)
|
75
|
+
@data_format = value
|
76
|
+
end
|
77
|
+
|
78
|
+
def label_property
|
79
|
+
@label_property
|
80
|
+
end
|
81
|
+
def label_property= value
|
82
|
+
@label_property = value
|
83
|
+
end
|
84
|
+
|
85
|
+
def value_property
|
86
|
+
@value_property
|
87
|
+
end
|
88
|
+
|
89
|
+
def value_property= value
|
90
|
+
@value_property = value
|
91
|
+
end
|
92
|
+
|
93
|
+
def cache_locally
|
94
|
+
@cache_locally
|
95
|
+
end
|
96
|
+
|
97
|
+
def cache_locally= value
|
98
|
+
@cache_locally = value ? true : false
|
99
|
+
end
|
100
|
+
|
101
|
+
def type
|
102
|
+
@type
|
103
|
+
end
|
104
|
+
|
105
|
+
def type= value
|
106
|
+
raise "Datasource Type ':#{value}' is not supported. Supported Datasource Types are #{SUPPORTED_DATASOURCE_TYPES.map { |i| ":#{i}" }.join(", ")}" unless SUPPORTED_DATASOURCE_TYPES.include?(value)
|
107
|
+
@type = value
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
end
|