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,27 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
module KirguduBase
|
4
|
+
module BreadcrumbsHelper
|
5
|
+
def self.included(base)
|
6
|
+
base.class_eval do
|
7
|
+
include InstanceMethods
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
module InstanceMethods
|
12
|
+
|
13
|
+
def add_new_breadcrumb(name, path = nil)
|
14
|
+
self.breadcrumbs << {label: name, url: path}
|
15
|
+
end
|
16
|
+
|
17
|
+
def breadcrumbs
|
18
|
+
@breadcrumbs ||= []
|
19
|
+
end
|
20
|
+
|
21
|
+
def breadcrumbs_length
|
22
|
+
self.breadcrumbs.length
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module KirguduBase
|
2
|
+
module ClassHelper
|
3
|
+
def self.get_class_hierarchy_for_controller(klass)
|
4
|
+
classes_2_inspect = []
|
5
|
+
if klass
|
6
|
+
classes_2_inspect.push(klass)
|
7
|
+
sc = klass
|
8
|
+
while (true) do
|
9
|
+
sc = sc.superclass
|
10
|
+
classes_2_inspect.push(sc)
|
11
|
+
if sc == ApplicationController || sc.nil?
|
12
|
+
break
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
classes_2_inspect
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.get_obligatory_filters_for_controller_class(klass)
|
20
|
+
|
21
|
+
found_obligatory_filters=[]
|
22
|
+
self.get_class_hierarchy_for_class(klass).each do |cl|
|
23
|
+
if cl.respond_to?(:obligatory_filters_set)
|
24
|
+
cl.obligatory_filters_set.each do |filter|
|
25
|
+
found_obligatory_filters.push(filter)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
found_obligatory_filters
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,625 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
module KirguduBase
|
4
|
+
module Controllers
|
5
|
+
module BasicActions
|
6
|
+
|
7
|
+
def index
|
8
|
+
#raise self.entry_class
|
9
|
+
raise "No defined \"entry_class\" method for controller #{self.class}" if !self.respond_to?(:entry_class) && self.entry_class.nil?
|
10
|
+
#raise "Current User NULL" if @current_user.nil?
|
11
|
+
|
12
|
+
unless self.class.respond_to?(:get_kb_page)
|
13
|
+
raise "Method :get_kb_page must be implemented for controller '#{self.class}'"
|
14
|
+
end
|
15
|
+
|
16
|
+
@page = self.class.get_kb_page(:index)
|
17
|
+
|
18
|
+
unless @page
|
19
|
+
respond_to do |format|
|
20
|
+
format.html { render_html1 get_view_path_for_page_404 }
|
21
|
+
format.json { render json: :not_found }
|
22
|
+
end
|
23
|
+
return
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
filters = {}.merge(params)
|
28
|
+
options = {}
|
29
|
+
options[:logger] = string_logger
|
30
|
+
|
31
|
+
#logger.info "OPTIONS FOR SEARCH: #{options.to_s}"
|
32
|
+
|
33
|
+
@entries_list = self.entry_class.get_entries(self, nil, filters, options)
|
34
|
+
|
35
|
+
load_data_from_datasources_for_filters
|
36
|
+
|
37
|
+
#raise "index page error"
|
38
|
+
|
39
|
+
respond_to do |format|
|
40
|
+
format.html { render_html1 get_view_path_for_page_index }
|
41
|
+
format.json { render_json_nav(@entries_list) }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def show
|
47
|
+
|
48
|
+
unless self.class.respond_to?(:get_kb_page)
|
49
|
+
raise "Method :get_kb_page must be implemented for controller '#{self.class}'"
|
50
|
+
end
|
51
|
+
|
52
|
+
@page = self.class.get_kb_page(:show)
|
53
|
+
|
54
|
+
unless @page
|
55
|
+
respond_to do |format|
|
56
|
+
format.html { render_html1 get_view_path_for_page_404 }
|
57
|
+
format.json { render json: :not_found }
|
58
|
+
end
|
59
|
+
return
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
@entry = self.entry_class.get_entry_by_id(self, params[:id], nil, {logger: string_logger})
|
64
|
+
|
65
|
+
unless @entry
|
66
|
+
respond_to do |format|
|
67
|
+
flash[:error] = I18n.t("#{self.to_i18n}.messages.not_found", id: params[:id])
|
68
|
+
format.html { render_html1 get_not_found_view_path, locals: {entry: @entry} }
|
69
|
+
format.json { render json: @entry.errors, status: :unprocessable_entity }
|
70
|
+
end
|
71
|
+
return
|
72
|
+
end
|
73
|
+
|
74
|
+
# loading data for select-like controls
|
75
|
+
load_data_from_datasources_for_form(:show, @entry)
|
76
|
+
|
77
|
+
respond_to do |format|
|
78
|
+
format.html { render_html1 get_view_path_for_page_show, locals: {entry: @entry} }
|
79
|
+
format.json { render json: @entry }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
def new
|
85
|
+
|
86
|
+
unless self.class.respond_to?(:get_kb_page)
|
87
|
+
raise "Method :get_kb_page must be implemented for controller '#{self.class}'"
|
88
|
+
end
|
89
|
+
|
90
|
+
@page = self.class.get_kb_page(:new)
|
91
|
+
|
92
|
+
unless @page
|
93
|
+
respond_to do |format|
|
94
|
+
format.html { render_html1 get_view_path_for_page_404 }
|
95
|
+
format.json { render json: :not_found }
|
96
|
+
end
|
97
|
+
return
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
@entry = entry_class.new
|
102
|
+
load_data_from_datasources_for_form(:new, @entry)
|
103
|
+
|
104
|
+
respond_to do |format|
|
105
|
+
format.html { render_html1 get_view_path_for_page_new, locals: {entry: @entry} }
|
106
|
+
format.json { render json: @entry }
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
def create
|
112
|
+
|
113
|
+
unless self.class.respond_to?(:get_kb_page)
|
114
|
+
raise "Method :get_kb_page must be implemented for controller '#{self.class}'"
|
115
|
+
end
|
116
|
+
|
117
|
+
@page = self.class.get_kb_page(:new)
|
118
|
+
|
119
|
+
unless @page
|
120
|
+
respond_to do |format|
|
121
|
+
format.html { render_html1 get_view_path_for_page_404 }
|
122
|
+
format.json { render json: :not_found }
|
123
|
+
end
|
124
|
+
return
|
125
|
+
end
|
126
|
+
|
127
|
+
|
128
|
+
@entry = self.entry_class.new(params[:"#{self.entry_class.to_s.underscore.gsub('/', '_')}"])
|
129
|
+
|
130
|
+
transaction_is_ok = true
|
131
|
+
|
132
|
+
filter_params = {}.merge(params)
|
133
|
+
|
134
|
+
process_transaction_out_filters(@entry, :before_create, filter_params, {logger: self.string_logger})
|
135
|
+
|
136
|
+
ActiveRecord::Base.transaction do
|
137
|
+
#raise "In Transaction Before Create"
|
138
|
+
transaction_is_ok &= process_transaction_in_filters(@entry, :before_create, filter_params, {logger: self.string_logger})
|
139
|
+
if transaction_is_ok
|
140
|
+
if @entry.save
|
141
|
+
transaction_is_ok &= process_transaction_in_filters(@entry, :after_create, filter_params, {logger: self.string_logger})
|
142
|
+
else
|
143
|
+
transaction_is_ok = false
|
144
|
+
end
|
145
|
+
end
|
146
|
+
if transaction_is_ok == false
|
147
|
+
raise ActiveRecord::Rollback
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
process_transaction_out_filters(@entry, :after_create, filter_params, {logger: self.string_logger})
|
152
|
+
|
153
|
+
respond_to do |format|
|
154
|
+
if transaction_is_ok == true
|
155
|
+
flash[:success] = I18n.t("#{self.to_i18n}.messages.entry_created", entry_name: @entry.to_s)
|
156
|
+
format.html { render_redirect url_for(action: 'show', id: @entry) }
|
157
|
+
format.json { render json: @entry, status: :created, location: @entry }
|
158
|
+
else
|
159
|
+
# loading data for select-like controls
|
160
|
+
load_data_from_datasources_for_form(:new, @entry)
|
161
|
+
flash[:error] = I18n.t("#{self.to_i18n}.messages.create_error")
|
162
|
+
format.html { render_html1 get_view_path_for_page_new, locals: {entry: @entry} }
|
163
|
+
format.json { render json: @entry.errors, status: :unprocessable_entity }
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
|
169
|
+
def edit
|
170
|
+
|
171
|
+
unless self.class.respond_to?(:get_kb_page)
|
172
|
+
raise "Method :get_kb_page must be implemented for controller '#{self.class}'"
|
173
|
+
end
|
174
|
+
|
175
|
+
@page = self.class.get_kb_page(:edit)
|
176
|
+
|
177
|
+
unless @page
|
178
|
+
respond_to do |format|
|
179
|
+
format.html { render_html1 get_view_path_for_page_404 }
|
180
|
+
format.json { render json: :not_found }
|
181
|
+
end
|
182
|
+
return
|
183
|
+
end
|
184
|
+
|
185
|
+
@entry = self.entry_class.get_entry_by_id(self, params[:id], nil, {logger: string_logger})
|
186
|
+
|
187
|
+
unless @entry
|
188
|
+
respond_to do |format|
|
189
|
+
flash[:error] = I18n.t("#{self.to_i18n}.messages.not_found", id: params[:id])
|
190
|
+
format.html { render_html1 get_not_found_view_path, locals: {entry: @entry} }
|
191
|
+
format.json { render json: @entry.errors, status: :unprocessable_entity }
|
192
|
+
end
|
193
|
+
return
|
194
|
+
end
|
195
|
+
# loading data for select-like controls
|
196
|
+
load_data_from_datasources_for_form(:edit, @entry)
|
197
|
+
|
198
|
+
respond_to do |format|
|
199
|
+
format.html { render_html1 get_view_path_for_page_edit, locals: {entry: @entry} }
|
200
|
+
format.json { render json: @entry }
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
|
205
|
+
def update
|
206
|
+
|
207
|
+
unless self.class.respond_to?(:get_kb_page)
|
208
|
+
raise "Method :get_kb_page must be implemented for controller '#{self.class}'"
|
209
|
+
end
|
210
|
+
|
211
|
+
@page = self.class.get_kb_page(:edit)
|
212
|
+
|
213
|
+
unless @page
|
214
|
+
respond_to do |format|
|
215
|
+
format.html { render_html1 get_view_path_for_page_404 }
|
216
|
+
format.json { render json: :not_found }
|
217
|
+
end
|
218
|
+
return
|
219
|
+
end
|
220
|
+
|
221
|
+
|
222
|
+
@entry = self.entry_class.get_entry_by_id(self, params[:id], nil, {logger: string_logger})
|
223
|
+
|
224
|
+
# Render NOT FOUND Form
|
225
|
+
unless @entry
|
226
|
+
respond_to do |format|
|
227
|
+
flash[:error] = I18n.t("#{self.to_i18n}.messages.not_found", id: params[:id])
|
228
|
+
format.html { render_html1 get_not_found_view_path, locals: {entry: @entry} }
|
229
|
+
format.json { render json: @entry.errors, status: :unprocessable_entity }
|
230
|
+
end
|
231
|
+
return
|
232
|
+
end
|
233
|
+
|
234
|
+
respond_to do |format|
|
235
|
+
flash[:success] = I18n.t("#{self.to_i18n}.messages.manufacturer_updated", entry_name: @entry.to_s)
|
236
|
+
if @entry.update_attributes(params[:"#{entry_class.to_s.underscore.gsub('/', '_')}"])
|
237
|
+
format.html { render_redirect url_for(action: 'show', id: @entry) }
|
238
|
+
format.json { head :no_content }
|
239
|
+
else
|
240
|
+
# loading data for select-like controls
|
241
|
+
load_data_from_datasources_for_form(:edit, @entry)
|
242
|
+
flash[:error] = I18n.t("#{self.to_i18n}.messages.update_error")
|
243
|
+
format.html { render_html1 get_view_path_for_page_edit, locals: {entry: @entry} }
|
244
|
+
format.json { render json: @entry.errors, status: :unprocessable_entity }
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
#************************************************************************************************************
|
255
|
+
# ONLY JQUERY METHODS
|
256
|
+
#************************************************************************************************************
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
def edit_inplace
|
261
|
+
|
262
|
+
unless self.class.respond_to?(:get_kb_page)
|
263
|
+
render text: '<span style = "color: red;"><b>ERROR OCCURRED!!!</b></span>'
|
264
|
+
return
|
265
|
+
end
|
266
|
+
|
267
|
+
@page = self.class.get_kb_page(:update)
|
268
|
+
|
269
|
+
unless @page
|
270
|
+
render text: '<span style = "color: red;"><b>ERROR OCCURRED!!!</b></span>'
|
271
|
+
return
|
272
|
+
end
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
item = self.entry_class.get_entry_by_id(self, params[:id], nil, {logger: string_logger})
|
277
|
+
if item
|
278
|
+
result_string = ''
|
279
|
+
begin
|
280
|
+
unless item[params[:field_name]] == params[:value]
|
281
|
+
item[params[:field_name]] = params[:value]
|
282
|
+
item.updated_at = Time.now
|
283
|
+
item.updater = @current_user
|
284
|
+
unless item.save
|
285
|
+
result_string = '<span style = "color: red;"><b>FAILED TO SAVE!!!</b></span>'
|
286
|
+
end
|
287
|
+
end
|
288
|
+
rescue
|
289
|
+
result_string = '<span style = "color: red;"><b>ERROR OCCURRED!!!</b></span>'
|
290
|
+
end
|
291
|
+
if result_string.blank?
|
292
|
+
begin
|
293
|
+
result_string = item.send(params[:field_name])
|
294
|
+
rescue
|
295
|
+
result_string = '<span style = "color: red;"><b>ERROR OCCURRED!!!</b></span>'
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
render text: result_string
|
300
|
+
else
|
301
|
+
render text: '<span style = "color: red;"><b>NOT FOUND!!!</b></span>'
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
305
|
+
|
306
|
+
def export
|
307
|
+
raise "No defined \"entry_class\" method for controller #{self.class}" if !self.respond_to?(:entry_class) || self.entry_class.nil?
|
308
|
+
raise "Current User NULL" if @current_user.nil?
|
309
|
+
|
310
|
+
filters = {}.merge(params)
|
311
|
+
options = {}
|
312
|
+
options[:logger] = string_logger
|
313
|
+
|
314
|
+
#logger.info "OPTIONS FOR SEARCH: #{options.to_s}"
|
315
|
+
|
316
|
+
@entries_list = self.entry_class.get_entries(self, nil, filters, options)
|
317
|
+
|
318
|
+
export_type = params[:type]
|
319
|
+
|
320
|
+
unless export_type
|
321
|
+
|
322
|
+
end
|
323
|
+
|
324
|
+
export_options = {}
|
325
|
+
|
326
|
+
self.entry_class.export_types_set.each do |exp|
|
327
|
+
if exp[:name] == export_type
|
328
|
+
#export_options[:include] =
|
329
|
+
#render text: @entries_list.to_json
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
if params[:type]
|
334
|
+
case params[:type]
|
335
|
+
when "json"
|
336
|
+
|
337
|
+
when "xml"
|
338
|
+
render text: @entries_list.to_xml
|
339
|
+
end
|
340
|
+
else
|
341
|
+
respond_to do |format|
|
342
|
+
format.json { render json: @entries_list }
|
343
|
+
format.json { render xml: @entries_list }
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
def import
|
349
|
+
import_type = params[:type]
|
350
|
+
|
351
|
+
end
|
352
|
+
|
353
|
+
|
354
|
+
#************************************************************************************************************
|
355
|
+
# PRIVATE METHODS
|
356
|
+
#************************************************************************************************************
|
357
|
+
|
358
|
+
private
|
359
|
+
|
360
|
+
# ********************** GETTING VIEW'S PATH METHODS *******************************
|
361
|
+
def get_view_path_for_page_new
|
362
|
+
view_path = "/shared/entry_new_form_renderer"
|
363
|
+
|
364
|
+
if self.respond_to?(:views_paths_new)
|
365
|
+
view_path = self.views_paths_new
|
366
|
+
end
|
367
|
+
view_path
|
368
|
+
end
|
369
|
+
|
370
|
+
def get_view_path_for_page_edit
|
371
|
+
view_path = "/shared/entry_edit_form_renderer"
|
372
|
+
|
373
|
+
if self.respond_to?(:views_paths_edit)
|
374
|
+
view_path = self.views_paths_edit
|
375
|
+
end
|
376
|
+
view_path
|
377
|
+
end
|
378
|
+
|
379
|
+
def get_view_path_for_page_index
|
380
|
+
view_path = "/shared/entry_index_renderer"
|
381
|
+
|
382
|
+
if self.respond_to?(:views_paths_index)
|
383
|
+
view_path = self.views_paths_index
|
384
|
+
end
|
385
|
+
view_path
|
386
|
+
end
|
387
|
+
|
388
|
+
|
389
|
+
def get_view_path_for_page_show
|
390
|
+
view_path = "/shared/entry_show_renderer"
|
391
|
+
|
392
|
+
if self.respond_to?(:views_paths_show)
|
393
|
+
view_path = self.views_paths_show
|
394
|
+
end
|
395
|
+
view_path
|
396
|
+
end
|
397
|
+
|
398
|
+
def get_not_found_view_path
|
399
|
+
view_path = "/shared/entry_not_found_renderer"
|
400
|
+
|
401
|
+
if self.respond_to?(:views_paths_entry_not_found)
|
402
|
+
view_path = self.views_paths_entry_not_found
|
403
|
+
end
|
404
|
+
view_path
|
405
|
+
end
|
406
|
+
|
407
|
+
|
408
|
+
def get_view_path_for_page_404
|
409
|
+
view_path = "/shared/404"
|
410
|
+
|
411
|
+
if self.respond_to?(:views_paths_404_page)
|
412
|
+
view_path = self.views_paths_404_page
|
413
|
+
end
|
414
|
+
view_path
|
415
|
+
end
|
416
|
+
|
417
|
+
|
418
|
+
#********************************* DATA FOR SELECTS ***********************************
|
419
|
+
|
420
|
+
def load_data_from_datasources_for_form(aktion, entry)
|
421
|
+
@entry_data_sources = {}
|
422
|
+
|
423
|
+
class_properties_for_form = []
|
424
|
+
|
425
|
+
#string_logger.info("*********************** LOADING DATA FOR SELECTS *****************************")
|
426
|
+
|
427
|
+
if aktion == :new || aktion == :create
|
428
|
+
class_properties_for_form = self.entry_class.form_properties_set_for_new_form
|
429
|
+
elsif aktion == :edit || aktion == :update
|
430
|
+
class_properties_for_form = self.entry_class.form_properties_set_for_edit_form
|
431
|
+
end
|
432
|
+
|
433
|
+
class_properties_for_form.each do |property|
|
434
|
+
if property.input_type == :chosen_select || property.input_type == :select
|
435
|
+
#string_logger.info("ChosenSelect for Property : #{property[:name]}")
|
436
|
+
@entry_data_sources[property.name] = load_data_for_select(property, entry)
|
437
|
+
end
|
438
|
+
end
|
439
|
+
|
440
|
+
#string_logger.info("ENTRY DATA SOURCES: #{@entry_data_sources.to_json}")
|
441
|
+
#string_logger.info("************************************************************************")
|
442
|
+
end
|
443
|
+
|
444
|
+
def load_data_from_datasources_for_filters
|
445
|
+
@data_sources_for_filters = {}
|
446
|
+
|
447
|
+
class_properties_for_form = []
|
448
|
+
|
449
|
+
#string_logger.info("*********************** LOADING DATA FOR SELECTS *****************************")
|
450
|
+
if self.entry_class.respond_to?(:data_filters_set)
|
451
|
+
self.entry_class.data_filters_set.each do |filter|
|
452
|
+
if filter.input_type == :chosen_select || filter.input_type == :select
|
453
|
+
#string_logger.info("ChosenSelect for Property : #{property[:name]}")
|
454
|
+
@data_sources_for_filters[filter.name] = load_data_for_select(filter, nil)
|
455
|
+
end
|
456
|
+
end
|
457
|
+
end
|
458
|
+
end
|
459
|
+
|
460
|
+
|
461
|
+
def load_data_for_select(property, entry)
|
462
|
+
#if property.predefined_values
|
463
|
+
# return property.predefined_values
|
464
|
+
#end
|
465
|
+
|
466
|
+
|
467
|
+
parent_value = nil
|
468
|
+
parent_value = entry[property.parent] if entry
|
469
|
+
|
470
|
+
|
471
|
+
get_entries_for_select(property.source, parent_value: parent_value, logger: string_logger)
|
472
|
+
end
|
473
|
+
|
474
|
+
def get_entries_for_select(source, options={})
|
475
|
+
|
476
|
+
options ||= {}
|
477
|
+
logger = options[:logger]
|
478
|
+
options[:logger] = nil
|
479
|
+
select_data = nil
|
480
|
+
|
481
|
+
if source
|
482
|
+
id_property = nil
|
483
|
+
name_property = nil
|
484
|
+
|
485
|
+
logger.info("Process: SOURCE SUPPLIED") if logger
|
486
|
+
if source.is_a?(Hash)
|
487
|
+
logger.info("Process: SOURCE IS HASH") if logger
|
488
|
+
id_property = source[:id] || :id
|
489
|
+
name_property = source[:name] || :name
|
490
|
+
source = source[:klass]
|
491
|
+
end
|
492
|
+
|
493
|
+
if source.is_a?(String)
|
494
|
+
source_data = I18n.t(source)
|
495
|
+
|
496
|
+
select_data = []
|
497
|
+
|
498
|
+
source_data.keys.each do |key|
|
499
|
+
select_data.push([source_data[key].to_s, key.to_s.to_i])
|
500
|
+
end
|
501
|
+
elsif source.is_a?(Array)
|
502
|
+
select_data = []
|
503
|
+
source.each do |e|
|
504
|
+
if e.is_a?(Array)
|
505
|
+
select_data.push(e)
|
506
|
+
elsif e.is_a?(Hash)
|
507
|
+
select_data.push([e[:name], e[:id]])
|
508
|
+
else
|
509
|
+
select_data.push([e.to_s, e])
|
510
|
+
end
|
511
|
+
end
|
512
|
+
elsif source.is_a?(Range)
|
513
|
+
select_data = []
|
514
|
+
#raise source.to_json
|
515
|
+
source.each do |e|
|
516
|
+
select_data.push([e.to_s, e])
|
517
|
+
end
|
518
|
+
elsif source < ::ChupakabraTools::ActiveEnumExtended
|
519
|
+
select_data = source.to_select
|
520
|
+
logger.info("Selected #{select_data.count} entries") if logger
|
521
|
+
elsif source < ActiveRecord::Base || source < ActiveRecord::Relation
|
522
|
+
id_property = :id unless id_property
|
523
|
+
name_property = :name unless name_property
|
524
|
+
|
525
|
+
logger.info("Process: SOURCE RESPOND TO :apply_filters_to_query") if logger
|
526
|
+
filters = {}.merge(options)
|
527
|
+
|
528
|
+
filters[:parent] = nil
|
529
|
+
filters[:parent_value] = nil
|
530
|
+
|
531
|
+
if options[:parent]
|
532
|
+
logger.info("Process: PARENT PROPERTY DEFINED #{options[:parent]}") if logger
|
533
|
+
if options[:parent_value]
|
534
|
+
logger.info("Process: PARENT VALUE DEFINED #{options[:parent_value]}") if logger
|
535
|
+
filters[options[:parent]] = options[:parent_value]
|
536
|
+
else
|
537
|
+
logger.info("Process: PARENT PROPERTY DEFINED #{options[:parent]}, BUT NOT VALUE SUPPLIED") if logger
|
538
|
+
return []
|
539
|
+
end
|
540
|
+
end
|
541
|
+
filters[:per_page] = 9999999
|
542
|
+
filters[:page] = 1
|
543
|
+
|
544
|
+
select_data = source.get_entries(self, nil, filters, options).select([name_property, id_property]).map { |u| [u.send(name_property), u.send(id_property)] }
|
545
|
+
else
|
546
|
+
logger.info("Process: UNEXPECTED TYPE OF SOURCE #{source.class}") if logger
|
547
|
+
end
|
548
|
+
else
|
549
|
+
logger.error("Process: SOURCE NOT SUPPLIED") if logger
|
550
|
+
end
|
551
|
+
select_data
|
552
|
+
end
|
553
|
+
|
554
|
+
#********************** /DATA FOR SELECTS ***********************
|
555
|
+
|
556
|
+
#********************** TRANSACTION FILTERS ************************
|
557
|
+
def process_filters(entry, filter_name, filter_params, available_filters, options)
|
558
|
+
options ||= {}
|
559
|
+
logger = options[:logger]
|
560
|
+
|
561
|
+
transaction_is_ok = true
|
562
|
+
logger.debug "#{filter_name} filters start", options if logger
|
563
|
+
logger.depth_up if logger
|
564
|
+
available_filters.each do |filter|
|
565
|
+
logger.debug("Execute Filter Method #{filter[:method]}") if logger
|
566
|
+
if self.send(filter[:method], entry, filter_params, options) == false
|
567
|
+
transaction_is_ok |= false
|
568
|
+
end
|
569
|
+
end
|
570
|
+
logger.depth_down if logger
|
571
|
+
logger.debug "#{filter_name} filters end", options if logger
|
572
|
+
|
573
|
+
transaction_is_ok
|
574
|
+
end
|
575
|
+
|
576
|
+
|
577
|
+
def process_transaction_in_filters(entry, filter_name, filter_params, options= {})
|
578
|
+
found_filters = []
|
579
|
+
::KirguduBase::ClassHelper.get_class_hierarchy_for_controller(self.class).each do |klass|
|
580
|
+
if klass.respond_to?(:in_transaction_filters_collection)
|
581
|
+
klass.in_transaction_filters_collection(filter_name).each do |action|
|
582
|
+
found_filters.push(action)
|
583
|
+
end
|
584
|
+
end
|
585
|
+
end
|
586
|
+
#raise "In transaction Found filters: #{found_filters.count}"
|
587
|
+
process_filters(entry, filter_name, filter_params, found_filters, options)
|
588
|
+
end
|
589
|
+
|
590
|
+
def process_transaction_out_filters(entry, filter_name, filter_params, options = {})
|
591
|
+
found_filters = []
|
592
|
+
::KirguduBase::ClassHelper.get_class_hierarchy_for_controller(self.class).each do |klass|
|
593
|
+
if klass.respond_to?(:out_transaction_filters_collection)
|
594
|
+
klass.out_transaction_filters_collection(filter_name).each do |action|
|
595
|
+
found_filters.push(action)
|
596
|
+
end
|
597
|
+
end
|
598
|
+
end
|
599
|
+
process_filters(entry, filter_name, filter_params, found_filters, options)
|
600
|
+
end
|
601
|
+
|
602
|
+
#************************ /TRANSACTION FILTERS ************************
|
603
|
+
|
604
|
+
|
605
|
+
def sanitize_params_for_mass_assignment(klass, prms)
|
606
|
+
|
607
|
+
unless klass && klass < ActiveRecord::Base
|
608
|
+
raise "Class '#{klass}' must be an ActiveRecord::Base descendant"
|
609
|
+
end
|
610
|
+
|
611
|
+
options = {}
|
612
|
+
if prms || prms.is_a?(Hash)
|
613
|
+
prms.keys.each do |key|
|
614
|
+
if klass.accessible_attributes.contains(key)
|
615
|
+
options[key] = prms[key]
|
616
|
+
end
|
617
|
+
end
|
618
|
+
end
|
619
|
+
end
|
620
|
+
|
621
|
+
|
622
|
+
end
|
623
|
+
end
|
624
|
+
end
|
625
|
+
|