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,236 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
module KirguduBase
|
4
|
+
module Models
|
5
|
+
class DataFilter
|
6
|
+
|
7
|
+
def initialize(name, options = {})
|
8
|
+
options ||= {}
|
9
|
+
|
10
|
+
|
11
|
+
self.name = name # ** SETTING NAME **
|
12
|
+
self.css_span = options[:span].to_s if options[:span] # ** SETTING SPAN **
|
13
|
+
self.css_class = options[:class].to_s if options[:class] # ** SETTING CLASS **
|
14
|
+
self.input_type = options[:input_type] || :text_edit # ** SETTING INPUT TYPE **
|
15
|
+
self.filter_name = options[:filter_name] # ** SETTING INPUT TYPE **
|
16
|
+
self.placeholder = options[:placeholder] # ** SETTING PLACEHOLDER **
|
17
|
+
self.label = options[:label] # ** SETTING LABEL **
|
18
|
+
self.parent = options[:parent] # ** SETTING PARENT **
|
19
|
+
self.source = options[:source] # ** SETTING SOURCE **
|
20
|
+
self.source_url = options[:source_url] # ** SETTING SOURCE URL **
|
21
|
+
|
22
|
+
|
23
|
+
# ******************* SETTING MASS ASSIGNMENT *****************************
|
24
|
+
if options[:mass_assignment].is_a?(Array)
|
25
|
+
options[:mass_assignment].each do |ma_val|
|
26
|
+
unless [:create, :update, :in_place].include?(ma_val)
|
27
|
+
raise "FORM PROPERTY ERROR\r\nForm Property: \"#{name}\".\r\nValue \"#{ma_val}\" is not allowed for array of values of \"mass_assignment\" option"
|
28
|
+
end
|
29
|
+
if options[:mass_assignment].include?(ma_val)
|
30
|
+
raise "FORM PROPERTY ERROR\r\nForm Property: \"#{name}\".\r\nDuplicate value \"#{ma_val}\" in array of values of \"mass_assignment\" option"
|
31
|
+
end
|
32
|
+
self.mass_assignment.push(ma_val)
|
33
|
+
end
|
34
|
+
else
|
35
|
+
if options[:mass_assignment] == :all
|
36
|
+
[:create, :update, :in_place].each do |ma|
|
37
|
+
self.mass_assignment.push(ma)
|
38
|
+
end
|
39
|
+
elsif options[:mass_assignment] == :none
|
40
|
+
|
41
|
+
elsif [:create, :update, :in_place].include?(options[:mass_assignment])
|
42
|
+
self.mass_assignment.push(options[:mass_assignment])
|
43
|
+
else
|
44
|
+
if options[:mass_assignment]
|
45
|
+
raise "FORM PROPERTY ERROR\r\nForm Property \"#{name}\".\r\nValue \"#{options[:mass_assignment]}\" is not allowed for \"mass_assignment\" option"
|
46
|
+
else
|
47
|
+
options[:mass_assignment] = [:create, :update, :in_place]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
#validateing property by input_type
|
53
|
+
case self.input_type
|
54
|
+
when :chosen_select
|
55
|
+
validate_chosen_select
|
56
|
+
when :autocomplete_with_id
|
57
|
+
validate_autocomplete_with_id
|
58
|
+
when :switcher
|
59
|
+
|
60
|
+
when :date_picker
|
61
|
+
|
62
|
+
when :time_picker
|
63
|
+
|
64
|
+
when :image_selector
|
65
|
+
|
66
|
+
when :check_box
|
67
|
+
|
68
|
+
when :radio_button
|
69
|
+
|
70
|
+
when :link
|
71
|
+
|
72
|
+
when :elastic_text_area
|
73
|
+
|
74
|
+
when :text_area
|
75
|
+
|
76
|
+
when :text_edit
|
77
|
+
|
78
|
+
else
|
79
|
+
raise "Data Filter: '#{self.name}'\r\nINPUT TYPE #{self.input_type} is not supported at the moment"
|
80
|
+
end
|
81
|
+
validate_attribute_class # validating class attribute
|
82
|
+
validate_attribute_span # validating span attribute
|
83
|
+
end
|
84
|
+
|
85
|
+
|
86
|
+
def name
|
87
|
+
@name
|
88
|
+
end
|
89
|
+
|
90
|
+
def filter_name
|
91
|
+
@filter_name
|
92
|
+
end
|
93
|
+
|
94
|
+
def css_span
|
95
|
+
@css_span
|
96
|
+
end
|
97
|
+
|
98
|
+
def css_class
|
99
|
+
@css_class
|
100
|
+
end
|
101
|
+
|
102
|
+
def input_type
|
103
|
+
@input_type
|
104
|
+
end
|
105
|
+
|
106
|
+
def label
|
107
|
+
@label
|
108
|
+
end
|
109
|
+
|
110
|
+
def placeholder
|
111
|
+
@placeholder
|
112
|
+
end
|
113
|
+
|
114
|
+
def parent
|
115
|
+
@parent
|
116
|
+
end
|
117
|
+
|
118
|
+
def source
|
119
|
+
@source
|
120
|
+
end
|
121
|
+
|
122
|
+
def source_url
|
123
|
+
@source_url
|
124
|
+
end
|
125
|
+
|
126
|
+
def on_change
|
127
|
+
@on_change
|
128
|
+
end
|
129
|
+
|
130
|
+
private
|
131
|
+
|
132
|
+
def name= value
|
133
|
+
@name = value
|
134
|
+
end
|
135
|
+
|
136
|
+
def filter_name= value
|
137
|
+
@filter_name = value
|
138
|
+
end
|
139
|
+
|
140
|
+
def css_span= value
|
141
|
+
@css_span = value
|
142
|
+
end
|
143
|
+
|
144
|
+
def css_class= value
|
145
|
+
@css_class = value
|
146
|
+
end
|
147
|
+
|
148
|
+
def input_type= value
|
149
|
+
@input_type = value
|
150
|
+
end
|
151
|
+
|
152
|
+
def placeholder= value
|
153
|
+
@placeholder = value
|
154
|
+
end
|
155
|
+
|
156
|
+
def parent= value
|
157
|
+
@parent = value
|
158
|
+
end
|
159
|
+
|
160
|
+
def source= value
|
161
|
+
@source = value
|
162
|
+
end
|
163
|
+
|
164
|
+
def source_url= value
|
165
|
+
@source_url = value
|
166
|
+
end
|
167
|
+
|
168
|
+
def on_change= value
|
169
|
+
@on_change = value
|
170
|
+
end
|
171
|
+
|
172
|
+
def label= value
|
173
|
+
@label = value
|
174
|
+
end
|
175
|
+
|
176
|
+
##################################### DATA FILTER VALIDATIONS FOR CONTROL #####################
|
177
|
+
def validate_autocomplete_with_id
|
178
|
+
validate_attribute_placeholder #validating placeholder presence
|
179
|
+
validate_attribute_onchange #validatting onchange attribute
|
180
|
+
validate_attribute_source
|
181
|
+
end
|
182
|
+
|
183
|
+
def validate_chosen_select
|
184
|
+
validate_attribute_placeholder #validating placeholder presence
|
185
|
+
validate_attribute_onchange #validatting onchange attribute
|
186
|
+
end
|
187
|
+
|
188
|
+
##################################### DATA FILTER ATTRIBUTE VALIDATIONS #####################
|
189
|
+
def validate_attribute_onchange
|
190
|
+
if self.on_change
|
191
|
+
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
def validate_attribute_class
|
196
|
+
if self.css_class
|
197
|
+
unless self.css_class.is_a?(String)
|
198
|
+
raise "Data Filter: '#{self.name}'\r\nCLASS attribute is not a String'"
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
def validate_attribute_span
|
204
|
+
if self.css_span
|
205
|
+
unless self.css_span.is_a?(String)
|
206
|
+
raise "Data Filter: '#{self.name}'\r\nSPAN attribute is not a String'"
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
def validate_attribute_placeholder
|
212
|
+
if self.placeholder.nil? || self.placeholder.blank?
|
213
|
+
raise "Data Filter '#{self.name}'\r\nPLACEHOLDER missed"
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
def validate_attribute_source_url
|
218
|
+
unless self.source_url
|
219
|
+
raise "Data Filter: '#{self.name}'\r\nSOURCE_URL attribute missed"
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
def validate_attribute_source
|
224
|
+
unless self.source
|
225
|
+
raise "Data Filter: '#{self.name}'\r\nSOURCE attribute missed"
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
def validate_attribute_text_value_property()
|
230
|
+
unless self.text_value_property
|
231
|
+
raise "Data Filter: '#{self.name}'\r\nTEXT_VALUE_PROPERTY attribute missed"
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
module KirguduBase
|
4
|
+
module Models
|
5
|
+
module Exports
|
6
|
+
def export_type(*args)
|
7
|
+
|
8
|
+
options = args.extract_options!
|
9
|
+
raise "Filter Property must be defined #{options.to_json}" if name.nil?
|
10
|
+
|
11
|
+
args.each do |arg|
|
12
|
+
export_options = {}
|
13
|
+
export_options[:name] = arg.to_s.downcase
|
14
|
+
export_options[:include] = options[:include]
|
15
|
+
get_data_filters_set.push(export_options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def export_types_set
|
20
|
+
filters = get_data_filters_set
|
21
|
+
filters.each do |filter|
|
22
|
+
validate_data_filter(filter)
|
23
|
+
end
|
24
|
+
filters
|
25
|
+
end
|
26
|
+
|
27
|
+
def get_data_filters_set
|
28
|
+
if defined?(@export_types_set) == false || @export_types_set.nil? || !@export_types_set.is_a?(Array)
|
29
|
+
@export_types_set = []
|
30
|
+
end
|
31
|
+
@export_types_set
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
##################################### FORM PROPERTY VALIDATIONS #####################
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def validate_data_filters(properties)
|
40
|
+
if Rails.env == 'development'
|
41
|
+
if properties && properties.is_a?(Array)
|
42
|
+
properties.each do |p|
|
43
|
+
validate_data_filter(p)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def validate_data_filter(property)
|
50
|
+
|
51
|
+
entry = self.new
|
52
|
+
|
53
|
+
#validateing property by input_type
|
54
|
+
property_input_type = property[:input_type] || :text_field
|
55
|
+
|
56
|
+
if property_input_type == :chosen_select
|
57
|
+
validate_data_filter_chosen_select(property, entry)
|
58
|
+
elsif property_input_type == :autocomplete_with_id
|
59
|
+
validate_data_filter_autocomplete_with_id(property, entry)
|
60
|
+
elsif property_input_type == :switcher
|
61
|
+
|
62
|
+
elsif property_input_type == :date_picker
|
63
|
+
|
64
|
+
elsif property_input_type == :time_picker
|
65
|
+
|
66
|
+
elsif property_input_type == :image_selector
|
67
|
+
|
68
|
+
elsif property_input_type == :check_box
|
69
|
+
|
70
|
+
elsif property_input_type == :radio_button
|
71
|
+
|
72
|
+
elsif property_input_type == :link
|
73
|
+
|
74
|
+
elsif property_input_type == :elastic_text_area
|
75
|
+
|
76
|
+
|
77
|
+
elsif property_input_type == :text_area
|
78
|
+
|
79
|
+
elsif property_input_type == :text_field
|
80
|
+
|
81
|
+
else
|
82
|
+
raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nINPUT TYPE #{property_input_type} is not supported at the moment"
|
83
|
+
end
|
84
|
+
|
85
|
+
# validating class attribute
|
86
|
+
validate_data_filter_attribute_class(property, entry)
|
87
|
+
# validating span attribute
|
88
|
+
validate_data_filter_attribute_span(property, entry)
|
89
|
+
end
|
90
|
+
|
91
|
+
def validate_data_filter_autocomplete_with_id(property, entry)
|
92
|
+
#validateting text_value_property attribute
|
93
|
+
validate_data_filter_attribute_text_value_property(property, entry)
|
94
|
+
#validating placeholder presense
|
95
|
+
validate_data_filter_attribute_placeholder(property, entry)
|
96
|
+
#validatting onchange attribute
|
97
|
+
validate_data_filter_attribute_onchange(property, entry)
|
98
|
+
|
99
|
+
|
100
|
+
validate_data_filter_attribute_source(property, entry)
|
101
|
+
end
|
102
|
+
|
103
|
+
def validate_data_filter_chosen_select(property, entry)
|
104
|
+
#validateting text_value_property attribute
|
105
|
+
validate_data_filter_attribute_text_value_property(property, entry)
|
106
|
+
#validating placeholder presense
|
107
|
+
validate_data_filter_attribute_placeholder(property, entry)
|
108
|
+
#validatting onchange attribute
|
109
|
+
validate_data_filter_attribute_onchange(property, entry)
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
##################################### FORM PROPERTY ATTRIBUTE VALIDATIONS #####################
|
115
|
+
|
116
|
+
def validate_data_filter_attribute_onchange(property, entry)
|
117
|
+
if property[:onchange]
|
118
|
+
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def validate_data_filter_attribute_class(property, entry)
|
123
|
+
if property[:class]
|
124
|
+
unless property[:class].is_a?(String)
|
125
|
+
raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nCLASS attribute is not a String'"
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def validate_data_filter_attribute_span(property, entry)
|
131
|
+
if property[:span]
|
132
|
+
unless property[:span].is_a?(String)
|
133
|
+
raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nSPAN attribute is not a String'"
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
def validate_data_filter_attribute_placeholder(property, entry)
|
139
|
+
if property[:placeholder].nil? || property[:placeholder].blank?
|
140
|
+
raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nPLACEHOLDER missed"
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
def validate_data_filter_attribute_text_value_property(property, entry)
|
145
|
+
unless property[:text_value_property]
|
146
|
+
raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nTEXT_VALUE_PROPERTY attribute missed"
|
147
|
+
end
|
148
|
+
|
149
|
+
unless entry.respond_to?(property[:text_value_property])
|
150
|
+
raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nTEXT_VALUE_PROPERTY '#{property[:text_value_property]}' method not found for this class"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
def validate_data_filter_attribute_source_url(property, entry)
|
155
|
+
unless property[:source_url]
|
156
|
+
raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nSOURCE_URL attribute missed"
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
def validate_data_filter_attribute_source(property, entry)
|
161
|
+
unless property[:source]
|
162
|
+
raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nSOURCE attribute missed"
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
|
4
|
+
module KirguduBase
|
5
|
+
module Models
|
6
|
+
module Filters
|
7
|
+
|
8
|
+
def data_filter(name, options = {})
|
9
|
+
options ||= {}
|
10
|
+
raise "Filter Property must be defined #{options.to_json}" if name.nil?
|
11
|
+
|
12
|
+
#data_filter = ::ChupakabraTools::Extensions::Helpers::Models::Filters::DataFilter.new(name, options)
|
13
|
+
#get_data_filters_set.push(data_filter)
|
14
|
+
end
|
15
|
+
|
16
|
+
def data_filters_set
|
17
|
+
get_data_filters_set
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
def get_data_filters_set
|
23
|
+
if defined?(@data_filters_set) == false || @data_filters_set.nil? || !@data_filters_set.is_a?(Array)
|
24
|
+
@data_filters_set = []
|
25
|
+
end
|
26
|
+
@data_filters_set
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
|
4
|
+
module KirguduBase
|
5
|
+
module Models
|
6
|
+
module FormProperties
|
7
|
+
################################### METHODS FOR DECLARATION IN CLASS ######################
|
8
|
+
|
9
|
+
def form_property(name, options = {})
|
10
|
+
|
11
|
+
#property = ::ChupakabraTools::Extensions::Helpers::Models::FormProperty.new(name, self, options)
|
12
|
+
#
|
13
|
+
#form_properties_set.push(property)
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
def form_properties_set
|
18
|
+
if defined?(@form_properties_set) == false || @form_properties_set.nil? || !@form_properties_set.is_a?(Array)
|
19
|
+
@form_properties_set = []
|
20
|
+
end
|
21
|
+
@form_properties_set
|
22
|
+
end
|
23
|
+
|
24
|
+
def filter_params_for_form_properties(params, action)
|
25
|
+
filtered_params = {}
|
26
|
+
if params && params.is_a?(Hash)
|
27
|
+
form_properties_set.select do |frm_prpt|
|
28
|
+
case frm_prpt[:mass_assignment]
|
29
|
+
when :new
|
30
|
+
|
31
|
+
when :update
|
32
|
+
else
|
33
|
+
filtered_params.push(frm_prpt)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
filtered_params
|
38
|
+
end
|
39
|
+
|
40
|
+
################################### METHODS USED IN RUNTIME FLOW ######################
|
41
|
+
|
42
|
+
|
43
|
+
def form_properties_set_for_new_form
|
44
|
+
return_properties = []
|
45
|
+
form_properties_set.each do |prop|
|
46
|
+
if prop.only
|
47
|
+
if prop.only.is_a?(Array)
|
48
|
+
return_properties.push(prop) if prop.only.include?(:new)
|
49
|
+
else
|
50
|
+
return_properties.push(prop) if prop.only == :new
|
51
|
+
end
|
52
|
+
else
|
53
|
+
return_properties.push(prop)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
return_properties
|
57
|
+
end
|
58
|
+
|
59
|
+
def index_property(name, options={})
|
60
|
+
opts = {}.merge(options)
|
61
|
+
|
62
|
+
opts[:name] = name
|
63
|
+
index_properties_set.push(opts)
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
def form_properties_set_for_edit_form
|
68
|
+
return_properties = []
|
69
|
+
form_properties_set.each do |prop|
|
70
|
+
if prop.only
|
71
|
+
if prop.only.is_a?(Array)
|
72
|
+
return_properties.push(prop) if prop.only.include?(:edit)
|
73
|
+
else
|
74
|
+
return_properties.push(prop) if prop.only == :edit
|
75
|
+
end
|
76
|
+
else
|
77
|
+
return_properties.push(prop)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
return_properties
|
81
|
+
end
|
82
|
+
|
83
|
+
def form_properties_set_for_show_page
|
84
|
+
return_properties = []
|
85
|
+
form_properties_set.each do |prop|
|
86
|
+
if prop.only
|
87
|
+
if prop.only.is_a?(Array)
|
88
|
+
return_properties.push(prop) if prop.only.include?(:show)
|
89
|
+
else
|
90
|
+
return_properties.push(prop) if prop.only == :show
|
91
|
+
end
|
92
|
+
else
|
93
|
+
return_properties.push(prop)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
return_properties
|
97
|
+
end
|
98
|
+
|
99
|
+
def index_properties_set
|
100
|
+
if defined?(@index_properties_set) == false || @index_properties_set.nil? || !@index_properties_set.is_a?(Array)
|
101
|
+
@index_properties_set = []
|
102
|
+
end
|
103
|
+
@index_properties_set
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|