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,113 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
.syntaxhighlighter {
|
18
|
+
background-color: #0f192a !important;
|
19
|
+
}
|
20
|
+
.syntaxhighlighter .line.alt1 {
|
21
|
+
background-color: #0f192a !important;
|
22
|
+
}
|
23
|
+
.syntaxhighlighter .line.alt2 {
|
24
|
+
background-color: #0f192a !important;
|
25
|
+
}
|
26
|
+
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
27
|
+
background-color: #253e5a !important;
|
28
|
+
}
|
29
|
+
.syntaxhighlighter .line.highlighted.number {
|
30
|
+
color: #38566f !important;
|
31
|
+
}
|
32
|
+
.syntaxhighlighter table caption {
|
33
|
+
color: #d1edff !important;
|
34
|
+
}
|
35
|
+
.syntaxhighlighter .gutter {
|
36
|
+
color: #afafaf !important;
|
37
|
+
}
|
38
|
+
.syntaxhighlighter .gutter .line {
|
39
|
+
border-right: 3px solid #435a5f !important;
|
40
|
+
}
|
41
|
+
.syntaxhighlighter .gutter .line.highlighted {
|
42
|
+
background-color: #435a5f !important;
|
43
|
+
color: #0f192a !important;
|
44
|
+
}
|
45
|
+
.syntaxhighlighter.printing .line .content {
|
46
|
+
border: none !important;
|
47
|
+
}
|
48
|
+
.syntaxhighlighter.collapsed {
|
49
|
+
overflow: visible !important;
|
50
|
+
}
|
51
|
+
.syntaxhighlighter.collapsed .toolbar {
|
52
|
+
color: #428bdd !important;
|
53
|
+
background: black !important;
|
54
|
+
border: 1px solid #435a5f !important;
|
55
|
+
}
|
56
|
+
.syntaxhighlighter.collapsed .toolbar a {
|
57
|
+
color: #428bdd !important;
|
58
|
+
}
|
59
|
+
.syntaxhighlighter.collapsed .toolbar a:hover {
|
60
|
+
color: #1dc116 !important;
|
61
|
+
}
|
62
|
+
.syntaxhighlighter .toolbar {
|
63
|
+
color: #d1edff !important;
|
64
|
+
background: #435a5f !important;
|
65
|
+
border: none !important;
|
66
|
+
}
|
67
|
+
.syntaxhighlighter .toolbar a {
|
68
|
+
color: #d1edff !important;
|
69
|
+
}
|
70
|
+
.syntaxhighlighter .toolbar a:hover {
|
71
|
+
color: #8aa6c1 !important;
|
72
|
+
}
|
73
|
+
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
74
|
+
color: #d1edff !important;
|
75
|
+
}
|
76
|
+
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
77
|
+
color: #428bdd !important;
|
78
|
+
}
|
79
|
+
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
80
|
+
color: #1dc116 !important;
|
81
|
+
}
|
82
|
+
.syntaxhighlighter .keyword {
|
83
|
+
color: #b43d3d !important;
|
84
|
+
}
|
85
|
+
.syntaxhighlighter .preprocessor {
|
86
|
+
color: #8aa6c1 !important;
|
87
|
+
}
|
88
|
+
.syntaxhighlighter .variable {
|
89
|
+
color: #ffaa3e !important;
|
90
|
+
}
|
91
|
+
.syntaxhighlighter .value {
|
92
|
+
color: #f7e741 !important;
|
93
|
+
}
|
94
|
+
.syntaxhighlighter .functions {
|
95
|
+
color: #ffaa3e !important;
|
96
|
+
}
|
97
|
+
.syntaxhighlighter .constants {
|
98
|
+
color: #e0e8ff !important;
|
99
|
+
}
|
100
|
+
.syntaxhighlighter .script {
|
101
|
+
font-weight: bold !important;
|
102
|
+
color: #b43d3d !important;
|
103
|
+
background-color: none !important;
|
104
|
+
}
|
105
|
+
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
106
|
+
color: #f8bb00 !important;
|
107
|
+
}
|
108
|
+
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
109
|
+
color: white !important;
|
110
|
+
}
|
111
|
+
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
112
|
+
color: #ffaa3e !important;
|
113
|
+
}
|
@@ -0,0 +1,113 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
.syntaxhighlighter {
|
18
|
+
background-color: #1b2426 !important;
|
19
|
+
}
|
20
|
+
.syntaxhighlighter .line.alt1 {
|
21
|
+
background-color: #1b2426 !important;
|
22
|
+
}
|
23
|
+
.syntaxhighlighter .line.alt2 {
|
24
|
+
background-color: #1b2426 !important;
|
25
|
+
}
|
26
|
+
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
27
|
+
background-color: #323e41 !important;
|
28
|
+
}
|
29
|
+
.syntaxhighlighter .line.highlighted.number {
|
30
|
+
color: #b9bdb6 !important;
|
31
|
+
}
|
32
|
+
.syntaxhighlighter table caption {
|
33
|
+
color: #b9bdb6 !important;
|
34
|
+
}
|
35
|
+
.syntaxhighlighter .gutter {
|
36
|
+
color: #afafaf !important;
|
37
|
+
}
|
38
|
+
.syntaxhighlighter .gutter .line {
|
39
|
+
border-right: 3px solid #435a5f !important;
|
40
|
+
}
|
41
|
+
.syntaxhighlighter .gutter .line.highlighted {
|
42
|
+
background-color: #435a5f !important;
|
43
|
+
color: #1b2426 !important;
|
44
|
+
}
|
45
|
+
.syntaxhighlighter.printing .line .content {
|
46
|
+
border: none !important;
|
47
|
+
}
|
48
|
+
.syntaxhighlighter.collapsed {
|
49
|
+
overflow: visible !important;
|
50
|
+
}
|
51
|
+
.syntaxhighlighter.collapsed .toolbar {
|
52
|
+
color: #5ba1cf !important;
|
53
|
+
background: black !important;
|
54
|
+
border: 1px solid #435a5f !important;
|
55
|
+
}
|
56
|
+
.syntaxhighlighter.collapsed .toolbar a {
|
57
|
+
color: #5ba1cf !important;
|
58
|
+
}
|
59
|
+
.syntaxhighlighter.collapsed .toolbar a:hover {
|
60
|
+
color: #5ce638 !important;
|
61
|
+
}
|
62
|
+
.syntaxhighlighter .toolbar {
|
63
|
+
color: white !important;
|
64
|
+
background: #435a5f !important;
|
65
|
+
border: none !important;
|
66
|
+
}
|
67
|
+
.syntaxhighlighter .toolbar a {
|
68
|
+
color: white !important;
|
69
|
+
}
|
70
|
+
.syntaxhighlighter .toolbar a:hover {
|
71
|
+
color: #e0e8ff !important;
|
72
|
+
}
|
73
|
+
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
74
|
+
color: #b9bdb6 !important;
|
75
|
+
}
|
76
|
+
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
77
|
+
color: #878a85 !important;
|
78
|
+
}
|
79
|
+
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
80
|
+
color: #5ce638 !important;
|
81
|
+
}
|
82
|
+
.syntaxhighlighter .keyword {
|
83
|
+
color: #5ba1cf !important;
|
84
|
+
}
|
85
|
+
.syntaxhighlighter .preprocessor {
|
86
|
+
color: #435a5f !important;
|
87
|
+
}
|
88
|
+
.syntaxhighlighter .variable {
|
89
|
+
color: #ffaa3e !important;
|
90
|
+
}
|
91
|
+
.syntaxhighlighter .value {
|
92
|
+
color: #009900 !important;
|
93
|
+
}
|
94
|
+
.syntaxhighlighter .functions {
|
95
|
+
color: #ffaa3e !important;
|
96
|
+
}
|
97
|
+
.syntaxhighlighter .constants {
|
98
|
+
color: #e0e8ff !important;
|
99
|
+
}
|
100
|
+
.syntaxhighlighter .script {
|
101
|
+
font-weight: bold !important;
|
102
|
+
color: #5ba1cf !important;
|
103
|
+
background-color: none !important;
|
104
|
+
}
|
105
|
+
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
106
|
+
color: #e0e8ff !important;
|
107
|
+
}
|
108
|
+
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
109
|
+
color: white !important;
|
110
|
+
}
|
111
|
+
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
112
|
+
color: #ffaa3e !important;
|
113
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
/*
|
2
|
+
Uploadify v3.1.0
|
3
|
+
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
|
4
|
+
Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
5
|
+
*/
|
6
|
+
|
7
|
+
.uploadify {
|
8
|
+
position: relative;
|
9
|
+
margin-bottom: 1em;
|
10
|
+
}
|
11
|
+
.uploadify-button {
|
12
|
+
background-color: #505050;
|
13
|
+
background-image: linear-gradient(bottom, #505050 0%, #707070 100%);
|
14
|
+
background-image: -o-linear-gradient(bottom, #505050 0%, #707070 100%);
|
15
|
+
background-image: -moz-linear-gradient(bottom, #505050 0%, #707070 100%);
|
16
|
+
background-image: -webkit-linear-gradient(bottom, #505050 0%, #707070 100%);
|
17
|
+
background-image: -ms-linear-gradient(bottom, #505050 0%, #707070 100%);
|
18
|
+
background-image: -webkit-gradient(
|
19
|
+
linear,
|
20
|
+
left bottom,
|
21
|
+
left top,
|
22
|
+
color-stop(0, #505050),
|
23
|
+
color-stop(1, #707070)
|
24
|
+
);
|
25
|
+
background-position: center top;
|
26
|
+
background-repeat: no-repeat;
|
27
|
+
-webkit-border-radius: 30px;
|
28
|
+
-moz-border-radius: 30px;
|
29
|
+
border-radius: 30px;
|
30
|
+
border: 2px solid #808080;
|
31
|
+
color: #FFF;
|
32
|
+
font: bold 12px Arial, Helvetica, sans-serif;
|
33
|
+
text-align: center;
|
34
|
+
text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
|
35
|
+
width: 100%;
|
36
|
+
}
|
37
|
+
.uploadify:hover .uploadify-button {
|
38
|
+
background-color: #606060;
|
39
|
+
background-image: linear-gradient(top, #606060 0%, #808080 100%);
|
40
|
+
background-image: -o-linear-gradient(top, #606060 0%, #808080 100%);
|
41
|
+
background-image: -moz-linear-gradient(top, #606060 0%, #808080 100%);
|
42
|
+
background-image: -webkit-linear-gradient(top, #606060 0%, #808080 100%);
|
43
|
+
background-image: -ms-linear-gradient(top, #606060 0%, #808080 100%);
|
44
|
+
background-image: -webkit-gradient(
|
45
|
+
linear,
|
46
|
+
left bottom,
|
47
|
+
left top,
|
48
|
+
color-stop(0, #606060),
|
49
|
+
color-stop(1, #808080)
|
50
|
+
);
|
51
|
+
background-position: center bottom;
|
52
|
+
}
|
53
|
+
.uploadify-button.disabled {
|
54
|
+
background-color: #D0D0D0;
|
55
|
+
color: #808080;
|
56
|
+
}
|
57
|
+
.uploadify-queue {
|
58
|
+
margin-bottom: 1em;
|
59
|
+
}
|
60
|
+
.uploadify-queue-item {
|
61
|
+
background-color: #F5F5F5;
|
62
|
+
-webkit-border-radius: 3px;
|
63
|
+
-moz-border-radius: 3px;
|
64
|
+
border-radius: 3px;
|
65
|
+
font: 11px Verdana, Geneva, sans-serif;
|
66
|
+
margin-top: 5px;
|
67
|
+
max-width: 350px;
|
68
|
+
padding: 10px;
|
69
|
+
}
|
70
|
+
.uploadify-error {
|
71
|
+
background-color: #FDE5DD !important;
|
72
|
+
}
|
73
|
+
.uploadify-queue-item .cancel a {
|
74
|
+
background: url('/assets/uploadify-cancel.png') 0 0 no-repeat;
|
75
|
+
float: right;
|
76
|
+
height: 16px;
|
77
|
+
text-indent: -9999px;
|
78
|
+
width: 16px;
|
79
|
+
}
|
80
|
+
.uploadify-queue-item.completed {
|
81
|
+
background-color: #E5E5E5;
|
82
|
+
}
|
83
|
+
.uploadify-progress {
|
84
|
+
background-color: #E5E5E5;
|
85
|
+
margin-top: 10px;
|
86
|
+
width: 100%;
|
87
|
+
}
|
88
|
+
.uploadify-progress-bar {
|
89
|
+
background-color: #0099FF;
|
90
|
+
height: 3px;
|
91
|
+
width: 1px;
|
92
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
|
4
|
+
module KirguduBase
|
5
|
+
|
6
|
+
class AdminController < ::KirguduBase::ApplicationController
|
7
|
+
|
8
|
+
before_filter :authenticate_user
|
9
|
+
|
10
|
+
layout "/layouts/application"
|
11
|
+
|
12
|
+
|
13
|
+
def render *args
|
14
|
+
self.create_breadcrumbs
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
def left_menu_path
|
20
|
+
"/admin/kirgudu_base/left_menu"
|
21
|
+
end
|
22
|
+
|
23
|
+
def current_entry
|
24
|
+
@entry
|
25
|
+
end
|
26
|
+
|
27
|
+
def base_entry
|
28
|
+
@current_portal
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
include KirguduBase::GuiHelper
|
33
|
+
|
34
|
+
#before_filter :update_url_with_ajax_referer_url
|
35
|
+
|
36
|
+
def create_breadcrumbs
|
37
|
+
|
38
|
+
if self.class == ::Admin::DashboardController
|
39
|
+
add_new_breadcrumb(I18n.t("#{::Admin::DashboardController.to_i18n}.index.title"))
|
40
|
+
return
|
41
|
+
end
|
42
|
+
|
43
|
+
add_new_breadcrumb(
|
44
|
+
I18n.t("#{::Admin::DashboardController.to_i18n}.index.title"),
|
45
|
+
::Admin::DashboardController.to_url_for
|
46
|
+
)
|
47
|
+
|
48
|
+
if self.action_name == "index"
|
49
|
+
add_new_breadcrumb(I18n.t("#{self.to_i18n}.index.title"))
|
50
|
+
else
|
51
|
+
add_new_breadcrumb(
|
52
|
+
I18n.t("#{self.to_i18n}.index.title"),
|
53
|
+
url_for(controller: ::ChupakabraTools::ClassHelper.controller_underscore(self), action: "index")
|
54
|
+
)
|
55
|
+
|
56
|
+
if ['new', 'create'].include?(self.action_name)
|
57
|
+
add_new_breadcrumb(I18n.t("#{self.to_i18n}.new.title"))
|
58
|
+
elsif ['edit', 'update', 'show'].include?(self.action_name)
|
59
|
+
entry = self.current_entry
|
60
|
+
|
61
|
+
if entry && entry.respond_to?(:name_for_breadcrumbs)
|
62
|
+
add_new_breadcrumb(entry.name_for_breadcrumbs)
|
63
|
+
else
|
64
|
+
add_new_breadcrumb(entry.id)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
protected
|
71
|
+
|
72
|
+
rescue_from ActiveRecord::RecordNotFound do
|
73
|
+
flash[:error] = I18n.t("#{self.to_i18n}.entry_not_found", entry_id: params[:id])
|
74
|
+
respond_to do |format|
|
75
|
+
format.html { render_redirect url_for(action: 'index') }
|
76
|
+
format.json { render_json_not_found(message: flash[:error]) }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
private
|
81
|
+
|
82
|
+
def before_entry_create(entry, filter_params, options)
|
83
|
+
entry.creator = @current_user
|
84
|
+
entry.updater = @current_user
|
85
|
+
end
|
86
|
+
|
87
|
+
def before_entry_update(entry, filter_params, options)
|
88
|
+
entry.updater = @current_user
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,676 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
module KirguduBase
|
3
|
+
class ApplicationController < ActionController::Base
|
4
|
+
|
5
|
+
|
6
|
+
include ::KirguduBase::UrlHelper
|
7
|
+
include ::KirguduBase::BreadcrumbsHelper
|
8
|
+
include ::KirguduBase::ApplicationHelper
|
9
|
+
|
10
|
+
#extend ::KirguduBase::Controllers::ObligatoryFilters::ClassMethods
|
11
|
+
extend ::KirguduBase::Controllers::TransactionWrapper::ClassMethods
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
before_filter :global_values_register
|
16
|
+
|
17
|
+
after_filter :rails_log_after # filter: last - 1
|
18
|
+
after_filter :request_finished # filter: last
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
in_transaction_before_create :before_entry_create
|
23
|
+
in_transaction_before_update :before_entry_update
|
24
|
+
|
25
|
+
|
26
|
+
def global_values_register
|
27
|
+
|
28
|
+
default_host_to_set = request.host
|
29
|
+
default_host_to_set += ":#{request.port}" if request.port && request.port != 80
|
30
|
+
|
31
|
+
Rails.application.routes.default_url_options[:host] = default_host_to_set
|
32
|
+
|
33
|
+
|
34
|
+
I18n.locale = :ru
|
35
|
+
@string_logger.info("\tHOST: #{request.host}") if @string_logger
|
36
|
+
@string_logger.info("\tLOCALE: #{I18n.locale}") if @string_logger
|
37
|
+
@current_user = get_current_user
|
38
|
+
@string_logger.info("\tUSER#{@current_user}") if @string_logger
|
39
|
+
|
40
|
+
#@settings_manager = ::SystemZone::Settings::SettingsManager.new
|
41
|
+
#
|
42
|
+
WillPaginate.per_page = 20
|
43
|
+
#will_paginate_count = @settings_manager.get('will_paginate')
|
44
|
+
#WillPaginate.per_page = will_paginate_count if will_paginate_count
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
def authenticate_user
|
50
|
+
|
51
|
+
@string_logger.info "########## AUTHENTICATING USER #############" if @string_logger
|
52
|
+
|
53
|
+
unless @current_user
|
54
|
+
session[:user_id] = nil
|
55
|
+
#session[:return_to] = request.url
|
56
|
+
#params[:back_url] = request.path
|
57
|
+
respond_to do |format|
|
58
|
+
#format.js { render partial: "sessions/login", layout: false}
|
59
|
+
format.html{
|
60
|
+
#redirect_to url_for(controller: ::KirguduBase::AuthenticationsController.to_route_path, action: :login), flash: {alert: I18n.t("admin.security.authentications.messages.please_login")}
|
61
|
+
#redirect_to "http://caribbeancafe.ru"
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
def set_content_type
|
79
|
+
content_type = case params[:format]
|
80
|
+
when "json"
|
81
|
+
"application/json"
|
82
|
+
when "xml"
|
83
|
+
"text/xml"
|
84
|
+
end
|
85
|
+
headers["Content-Type"] = content_type
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
#########################################################################################################################
|
90
|
+
###################################### Breadcrumbs ###############################################
|
91
|
+
#########################################################################################################################
|
92
|
+
|
93
|
+
|
94
|
+
def render *args
|
95
|
+
self.create_breadcrumbs
|
96
|
+
super
|
97
|
+
end
|
98
|
+
|
99
|
+
|
100
|
+
def create_breadcrumbs
|
101
|
+
if self.class.respond_to?(:dashboard_controller_class_name)
|
102
|
+
if self.class.to_s == self.class.dashboard_controller_class_name.to_s
|
103
|
+
add_new_breadcrumb(I18n.t("#{self.class.dashboard_controller_class_name.to_i18n}.index.title"))
|
104
|
+
else
|
105
|
+
add_new_breadcrumb(I18n.t("#{self.class.dashboard_controller_class_name.to_i18n}.index.title"), self.class.dashboard_controller_class_name.to_route_path)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
#########################################################################################################################
|
112
|
+
############################# I18n String Generator Methods #####################################
|
113
|
+
#########################################################################################################################
|
114
|
+
|
115
|
+
def self.to_i18n
|
116
|
+
::ChupakabraTools::ClassHelper.controller_class_to_i18n(self)
|
117
|
+
end
|
118
|
+
|
119
|
+
def to_i18n
|
120
|
+
self.class.to_i18n
|
121
|
+
end
|
122
|
+
|
123
|
+
#########################################################################################################################
|
124
|
+
############################### Routes Generator Methods ########################################
|
125
|
+
#########################################################################################################################
|
126
|
+
|
127
|
+
def self.to_route_path
|
128
|
+
::ChupakabraTools::ClassHelper.controller_full_path_underscore(self)
|
129
|
+
end
|
130
|
+
|
131
|
+
def to_route_path
|
132
|
+
self.class.to_route_path
|
133
|
+
end
|
134
|
+
|
135
|
+
#########################################################################################################################
|
136
|
+
############################### Routes Generator Methods ########################################
|
137
|
+
#########################################################################################################################
|
138
|
+
|
139
|
+
#include ActionView::Helpers
|
140
|
+
#include ActionDispatch::Routing
|
141
|
+
#include Rails.application.routes.url_helpers
|
142
|
+
|
143
|
+
def self.to_url_for(action = nil, options = {})
|
144
|
+
options ||= {}
|
145
|
+
options[:only_path] = true
|
146
|
+
options[:controller] = self.to_route_path
|
147
|
+
options[:action] = action || :index
|
148
|
+
Rails.application.routes.url_helpers.url_for(options)
|
149
|
+
end
|
150
|
+
|
151
|
+
def to_url_for(action = nil, options = {})
|
152
|
+
self.class.to_url_for(action, options)
|
153
|
+
end
|
154
|
+
|
155
|
+
|
156
|
+
#########################################################################################################################
|
157
|
+
############################### Obligatory Filters Methods ########################################
|
158
|
+
#########################################################################################################################
|
159
|
+
|
160
|
+
# stale
|
161
|
+
def fill_obligatory_filters(filters, options)
|
162
|
+
fill_obligatory_filters_for_query(filters, options)
|
163
|
+
end
|
164
|
+
|
165
|
+
def fill_obligatory_filters_for_query(filters, options)
|
166
|
+
options ||= {}
|
167
|
+
logger = options[:logger]
|
168
|
+
logger.info("Fill Obligatory Filters: Controller Class: #{self.class}") if logger
|
169
|
+
self.class.get_obligatory_filters.each do |ob_fi|
|
170
|
+
#logger.info("Fill Obligatory Filters: filter_name: #{obligatory_filter[:name]}") if logger
|
171
|
+
#logger.info("Fill Obligatory Filters: method_name: #{obligatory_filter[:source_method]}") if logger
|
172
|
+
execute_flag = true
|
173
|
+
|
174
|
+
if ob_fi[:source_method].nil?
|
175
|
+
raise "Controller: #{self.class}\r\nObligatory Filter: #{ob_fi[:name]}\r\nERROR: 'source_method' not defined for obligatory filter '#{ob_fi[:name]}'"
|
176
|
+
end
|
177
|
+
|
178
|
+
unless ob_fi[:only].nil?
|
179
|
+
execute_flag = false
|
180
|
+
if ob_fi[:only].is_a?(String) || ob_fi[:only].is_a?(Symbol)
|
181
|
+
if ob_fi[:only].to_s == self.action
|
182
|
+
execute_flag = true
|
183
|
+
end
|
184
|
+
elsif ob_fi.is_a?(Array)
|
185
|
+
ob_fi[:only].each do |ofo|
|
186
|
+
if ofo.to_s == self.action
|
187
|
+
execute_flag = true
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
unless ob_fi[:skip].nil?
|
194
|
+
if ob_fi[:skip].is_a?(String) || ob_fi[:skip].is_a?(Symbol)
|
195
|
+
if ob_fi[:skip].to_s == self.action
|
196
|
+
execute_flag = false
|
197
|
+
end
|
198
|
+
elsif ob_fi.is_a?(Array)
|
199
|
+
ob_fi[:skip].each do |ofo|
|
200
|
+
if ofo.to_s == self.action
|
201
|
+
execute_flag = false
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
filters[ob_fi[:name]] = self.send(ob_fi[:source_method]) if execute_flag == true
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
def self.get_class_hierarchy
|
212
|
+
classes_2_inspect = []
|
213
|
+
classes_2_inspect.push(self)
|
214
|
+
sc = self
|
215
|
+
while true do
|
216
|
+
sc = sc.superclass
|
217
|
+
classes_2_inspect.push(sc)
|
218
|
+
if sc == ApplicationController
|
219
|
+
break
|
220
|
+
end
|
221
|
+
end
|
222
|
+
classes_2_inspect
|
223
|
+
end
|
224
|
+
|
225
|
+
def self.get_obligatory_filters
|
226
|
+
|
227
|
+
found_obligatory_filters=[]
|
228
|
+
self.get_class_hierarchy.each do |cl|
|
229
|
+
if cl.respond_to?(:obligatory_filters_set)
|
230
|
+
cl.obligatory_filters_set.each do |filter|
|
231
|
+
found_obligatory_filters.push(filter)
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
found_obligatory_filters
|
236
|
+
end
|
237
|
+
|
238
|
+
|
239
|
+
def self.obligatory_filter(name, options = {})
|
240
|
+
options ||= {}
|
241
|
+
raise "Filter Property must be defined #{options.to_json}" if name.nil?
|
242
|
+
|
243
|
+
opts = {}.merge(options)
|
244
|
+
|
245
|
+
opts[:name] = name
|
246
|
+
obligatory_filters_set.push(opts)
|
247
|
+
end
|
248
|
+
|
249
|
+
|
250
|
+
def self.obligatory_filters_set
|
251
|
+
if defined?(@obligatory_filters_set) == false || @obligatory_filters_set.nil? || !@obligatory_filters_set.is_a?(Array)
|
252
|
+
@obligatory_filters_set = []
|
253
|
+
end
|
254
|
+
@obligatory_filters_set
|
255
|
+
end
|
256
|
+
|
257
|
+
|
258
|
+
#########################################################################################################################
|
259
|
+
###################################### Locale Methods #############################################
|
260
|
+
#########################################################################################################################
|
261
|
+
|
262
|
+
|
263
|
+
def set_i18n_locale_from_params
|
264
|
+
if params[:locale]
|
265
|
+
if I18n.available_locales.include?(params[:locale].to_sym)
|
266
|
+
I18n.locale = params[:locale]
|
267
|
+
session[:locale] = params[:locale]
|
268
|
+
cookies.permanent[:locale_set] = params[:locale]
|
269
|
+
else
|
270
|
+
if session[:locale]
|
271
|
+
#params[:locale] = session[:locale]
|
272
|
+
#I18n.locale = session[:locale]
|
273
|
+
#locale_redirect(session[:locale])
|
274
|
+
#redirect_to request.url #, notice: "Translation \"#{params[:locale]}\" not available."
|
275
|
+
#@string_logger.error flash.now[:notice]
|
276
|
+
redirect_to url_for(locale: session[:locale])
|
277
|
+
elsif cookies[:locale_set]
|
278
|
+
session[:locale] = cookies[:locale_set]
|
279
|
+
params[:locale] = cookies[:locale_set]
|
280
|
+
I18n.locale = cookies[:locale_set]
|
281
|
+
#locale_redirect(session[:locale])
|
282
|
+
else
|
283
|
+
locale = get_best_locale
|
284
|
+
params[:locale] = locale
|
285
|
+
session[:locale] = locale
|
286
|
+
cookies.permanent[:locale_set] = locale
|
287
|
+
I18n.locale = locale
|
288
|
+
#locale_redirect(I18n.locale)
|
289
|
+
end
|
290
|
+
end
|
291
|
+
elsif session[:locale]
|
292
|
+
redirect_to url_for(locale: session[:locale])
|
293
|
+
elsif cookies[:locale_set]
|
294
|
+
redirect_to url_for(locale: cookies[:locale_set])
|
295
|
+
else
|
296
|
+
redirect_to url_for(locale: get_best_locale)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
#def default_url_options
|
301
|
+
# {locale: I18n.locale}
|
302
|
+
#end
|
303
|
+
|
304
|
+
def check_locale_parameter
|
305
|
+
if session[:locale]
|
306
|
+
#if params[:locale]
|
307
|
+
if I18n.available_locales.include?(params[:locale].to_sym)
|
308
|
+
if params[:locale] != session[:locale]
|
309
|
+
session[:locale] = params[:locale]
|
310
|
+
I18n.locale = params[:locale]
|
311
|
+
else
|
312
|
+
I18n.locale = session[:locale]
|
313
|
+
end
|
314
|
+
else
|
315
|
+
I18n.locale = session[:locale]
|
316
|
+
#redirect_to home_path, notice: :wrong_locale #"Translation \"#{params[:locale]}\" not available yet."
|
317
|
+
end
|
318
|
+
else
|
319
|
+
I18n.locale = session[:locale]
|
320
|
+
#redirect_to request.url, locale: I18n.locale
|
321
|
+
end
|
322
|
+
#else
|
323
|
+
# session[:locale] = I18n.locale
|
324
|
+
#end
|
325
|
+
end
|
326
|
+
|
327
|
+
|
328
|
+
def prepare_breadcrumbs
|
329
|
+
#string_logger.info("BREADCRUMBS: #{breadcrumbs}")
|
330
|
+
end
|
331
|
+
|
332
|
+
def prepare_applications_data
|
333
|
+
|
334
|
+
end
|
335
|
+
|
336
|
+
def string_logger
|
337
|
+
@string_logger
|
338
|
+
end
|
339
|
+
|
340
|
+
protected
|
341
|
+
|
342
|
+
def update_url_with_ajax_referer_url
|
343
|
+
if params[:current_url]
|
344
|
+
begin
|
345
|
+
p_current_url = URI.parse(params[:current_url])
|
346
|
+
p_query = CGI.parse(p_current_url.query)
|
347
|
+
|
348
|
+
#string_logger.info("Current URL: #{p_current_url}")
|
349
|
+
#string_logger.info("Current URL QUERY : #{p_query}")
|
350
|
+
|
351
|
+
params[:page] = p_query["page"].first if p_query["page"]
|
352
|
+
params[:status_id] = p_query["status_id"].first if p_query["status_id"]
|
353
|
+
params[:website_id] = p_query["website_id"].first if p_query["website_id"] and params[:website_id].nil?
|
354
|
+
|
355
|
+
#string_logger.info("Params After Loading from Current URL: #{params}")
|
356
|
+
end
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
|
361
|
+
def get_best_locale
|
362
|
+
locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first.to_sym
|
363
|
+
if I18n.available_locales.include?(locale)
|
364
|
+
locale
|
365
|
+
else
|
366
|
+
I18n.default_locale
|
367
|
+
end
|
368
|
+
end
|
369
|
+
|
370
|
+
# method for Ability
|
371
|
+
def current_user
|
372
|
+
@current_user
|
373
|
+
end
|
374
|
+
|
375
|
+
|
376
|
+
#def current_client
|
377
|
+
# @current_client
|
378
|
+
#end
|
379
|
+
|
380
|
+
|
381
|
+
def system_logging_init
|
382
|
+
#@logging_options = Hash.new
|
383
|
+
#
|
384
|
+
#@logging_options[:status] = @settings_manager.get("SystemZone::Logging::Status")
|
385
|
+
#unless @logging_options[:status]
|
386
|
+
# @logging_options[:status] = false
|
387
|
+
#end
|
388
|
+
#@logging_options[:level] = @settings_manager.get("SystemZone::Logging::Level")
|
389
|
+
#unless @logging_options[:level]
|
390
|
+
# @logging_options[:level] = ::SystemZone::Logging::Event::LEVEL_SYSTEM
|
391
|
+
#end
|
392
|
+
#
|
393
|
+
#if @logging_options[:status] == true
|
394
|
+
# @logging_request = ::SystemZone::Logging::Request.new
|
395
|
+
# @logging_request.ip = request.remote_ip
|
396
|
+
# @logging_request.serve_id = 1 #FIX: change in future to identify servers
|
397
|
+
# @logging_request.session_id = request.session[:session_id] ? request.session[:session_id] : ''
|
398
|
+
# @logging_request.controller_name = controller_path
|
399
|
+
# @logging_request.action_name = self.action_name
|
400
|
+
# @logging_request.http_method = request.method
|
401
|
+
# @logging_request.params = params.to_json
|
402
|
+
# @logging_request.agent = request.env["HTTP_USER_AGENT"]
|
403
|
+
# @logging_request.os = http_request_retrieve_operating_system(request.env["HTTP_USER_AGENT"])
|
404
|
+
# #@logging_request.screen = request.env["HTTP_USER_AGENT"]
|
405
|
+
# @logging_request.referer_url = request.referer
|
406
|
+
# @logging_request.url = request.referer
|
407
|
+
# @logging_request.user_id = @current_user.id if @current_user && @current_user.id
|
408
|
+
# @logging_request.client_id = current_client.id if current_client && current_client.id
|
409
|
+
# @logging_request.save
|
410
|
+
#end
|
411
|
+
|
412
|
+
end
|
413
|
+
|
414
|
+
def system_logging_write_event(source, level_id, message)
|
415
|
+
#if @logging_options[:status] == true && @logging_request && (level_id == ::SystemZone::Logging::Event::LEVEL_SYSTEM || level_id <= @logging_options[:level])
|
416
|
+
# current_event = ::SystemZone::Logging::Event.new
|
417
|
+
# current_event.request = @logging_request
|
418
|
+
# current_event.source = source && !source.blank? ? source : self.action_name
|
419
|
+
# current_event.level_id = level_id
|
420
|
+
# current_event.message = message
|
421
|
+
# current_event.save
|
422
|
+
#end
|
423
|
+
end
|
424
|
+
|
425
|
+
|
426
|
+
def fake_counter_iterate(counter_name)
|
427
|
+
#counter_data = {}
|
428
|
+
#counter_data[:total_name] = "Fake::Counter::Total::#{counter_name}"
|
429
|
+
#counter_data[:quantity_per_period_name] = "Fake::Counter::#{counter_name}::QuantityPerPeriod"
|
430
|
+
#counter_data[:period_type_name] = "Fake::Counter::#{counter_name}::PeriodType"
|
431
|
+
#counter_data[:initial_seed_name] = "Fake::Counter::#{counter_name}::InitialSeed"
|
432
|
+
#
|
433
|
+
#counter_data[:local_timezone] = ActiveSupport::TimeZone.new("Moscow")
|
434
|
+
#counter_data[:local_today] = Time.now.in_time_zone(counter_data[:local_timezone]).to_date
|
435
|
+
#counter_data[:local_now] = Time.now.in_time_zone(counter_data[:local_timezone])
|
436
|
+
#
|
437
|
+
##getting or setting number_of_orders_per_period
|
438
|
+
#counter_data[:total] = @settings_manager.get(counter_data[:total_name])
|
439
|
+
#unless counter_data[:total]
|
440
|
+
# counter_data[:total] = 846
|
441
|
+
# create_option(counter_data[:total_name], counter_data[:total], value_type: "integer")
|
442
|
+
#end
|
443
|
+
#
|
444
|
+
##getting or setting number_of_orders_per_period
|
445
|
+
#counter_data[:quantity_per_period] = @settings_manager.get(counter_data[:quantity_per_period_name])
|
446
|
+
#counter_data[:quantity_per_period] = 63 unless counter_data[:quantity_per_period]
|
447
|
+
##getting or setting counter_data[:period_type]
|
448
|
+
#counter_data[:period_type] = @settings_manager.get(counter_data[:period_type_name])
|
449
|
+
#counter_data[:period_type] = "day" unless counter_data[:period_type]
|
450
|
+
##getting or setting counter_data[:initial_seed]
|
451
|
+
#counter_data[:initial_seed] = @settings_manager.get(counter_data[:initial_seed_name])
|
452
|
+
#counter_data[:initial_seed] = 7 unless counter_data[:initial_seed]
|
453
|
+
#
|
454
|
+
#
|
455
|
+
## searchiung for period_counter in OrderCounter
|
456
|
+
#period_counter = get_period_counter(counter_data[:local_now], counter_data[:period_type])
|
457
|
+
#
|
458
|
+
#
|
459
|
+
## string_logger.info("*****************************************************************")
|
460
|
+
## string_logger.info("Total Counter (before): #{total_counter}") if total_counter
|
461
|
+
## string_logger.info("Day Counter (before): #{day_counter}") if day_counter
|
462
|
+
#
|
463
|
+
#ActiveRecord::Base.transaction do
|
464
|
+
# unless period_counter
|
465
|
+
# # period_counter not found so New period_counter created
|
466
|
+
# period_counter = ::SystemZone::Fakes::Counter.new
|
467
|
+
# # calculating period_start and period_end Time
|
468
|
+
# if counter_data[:period_type] == "day"
|
469
|
+
# period_counter.start_at = counter_data[:local_now].beginning_of_day
|
470
|
+
# period_counter.finish_at = counter_data[:local_now].end_of_day
|
471
|
+
# elsif counter_data[:period_type] == "week"
|
472
|
+
# period_counter.start_at = counter_data[:local_now].beginning_of_week
|
473
|
+
# period_counter.finish_at = counter_data[:local_now].end_of_week
|
474
|
+
# elsif counter_data[:period_type] == "month"
|
475
|
+
# period_counter.start_at = counter_data[:local_now].beginning_of_month
|
476
|
+
# period_counter.finish_at = counter_data[:local_now].end_of_month
|
477
|
+
# elsif counter_data[:period_type] == "year"
|
478
|
+
# period_counter.start_at = counter_data[:local_now].beginning_of_year
|
479
|
+
# period_counter.finish_at = counter_data[:local_now].end_of_year
|
480
|
+
# else
|
481
|
+
# period_counter.start_at = counter_data[:local_now].beginning_of_day
|
482
|
+
# period_counter.finish_at = counter_data[:local_now].end_of_day
|
483
|
+
# end
|
484
|
+
# # initializing period_counter values
|
485
|
+
# period_counter.fake_initial = rand(counter_data[:initial_seed])
|
486
|
+
# period_counter.fake_max = counter_data[:quantity_per_period]
|
487
|
+
# period_counter.fake_value = period_counter.fake_initial
|
488
|
+
# period_counter.real_value = period_counter.fake_initial
|
489
|
+
# # calculate period in seconds for current period
|
490
|
+
# period_in_seconds = (period_counter.period_end - period_counter.period_start).round
|
491
|
+
# # calculate iteration period in seconds keeping in mind that we have fake_value_initial
|
492
|
+
# iteration_period_in_seconds = (period_in_seconds / (counter_data[:quantity_per_period] - period_counter.fake_value_initial)).round
|
493
|
+
# # calculating number of iteration from period start to now
|
494
|
+
# number_of_iteration_by_now = ((counter_data[:local_now] - period_counter.period_start).round/iteration_period_in_seconds).round
|
495
|
+
# #adding number_of_iteration_by_now to fake_value
|
496
|
+
# period_counter.fake_value += number_of_iteration_by_now
|
497
|
+
# period_counter.real_value += number_of_iteration_by_now
|
498
|
+
# # initializing next_iteration_date
|
499
|
+
# next_iteration_date = period_counter.period_start + number_of_iteration_by_now * iteration_period_in_seconds
|
500
|
+
# # increasing number_of_iteration_by_now by 1 while next_iteration_date < counter_data[:local_now]
|
501
|
+
# begin
|
502
|
+
# number_of_iteration_by_now += 1
|
503
|
+
# #period_counter.fake_value += 1
|
504
|
+
# #period_counter.real_value += 1
|
505
|
+
# next_iteration_date = period_counter.period_start + number_of_iteration_by_now * iteration_period_in_seconds
|
506
|
+
# end while next_iteration_date < counter_data[:local_now]
|
507
|
+
# #setting net_iteration_date
|
508
|
+
# period_counter.next_iteration_date = next_iteration_date
|
509
|
+
# counter_data[:total] += period_counter.real_value
|
510
|
+
# set_option_value(counter_data[:total_name], counter_data[:total])
|
511
|
+
# end
|
512
|
+
# if period_counter.next_iteration_date < counter_data[:local_now]
|
513
|
+
# #string_logger.info("*****************************************************************")
|
514
|
+
# #string_logger.info("*****************************************************************")
|
515
|
+
# #string_logger.info("Increasing Current OrderCounter")
|
516
|
+
# #string_logger.info("*****************************************************************")
|
517
|
+
# #string_logger.info("Fake Value: #{period_counter.fake_value}")
|
518
|
+
# #string_logger.info("Real Value: #{period_counter.real_value}")
|
519
|
+
# # calculate period in seconds for current period
|
520
|
+
# period_in_seconds = (period_counter.period_end - period_counter.period_start).round
|
521
|
+
# #string_logger.info("Period (in seconds): #{period_in_seconds}")
|
522
|
+
# # calculate iteration period in seconds keeping in mind that we have fake_value_initial
|
523
|
+
# iteration_period_in_seconds = (period_in_seconds / (counter_data[:quantity_per_period] - period_counter.fake_value_initial)).round
|
524
|
+
# #string_logger.info("Iteration Period (in seconds): #{iteration_period_in_seconds}")
|
525
|
+
# # calculating number of iteration from period start to now
|
526
|
+
# number_of_iteration_by_now = ((counter_data[:local_now] - period_counter.period_start).round/iteration_period_in_seconds).round
|
527
|
+
# #string_logger.info("Number of Iterations by Now: #{number_of_iteration_by_now}")
|
528
|
+
# #adding difference between number_of_iteration_by_now and fake_value to fake_value
|
529
|
+
# iteration_difference_by_now = number_of_iteration_by_now - period_counter.fake_value
|
530
|
+
# #string_logger.info("Iterations To Add (difference): #{iteration_difference_by_now}")
|
531
|
+
# if iteration_difference_by_now > 0
|
532
|
+
# period_counter.fake_value += iteration_difference_by_now
|
533
|
+
# period_counter.real_value += iteration_difference_by_now
|
534
|
+
# #increasing total counter
|
535
|
+
# counter_data[:total] += iteration_difference_by_now
|
536
|
+
# set_option_value(counter_data[:total_name], counter_data[:total])
|
537
|
+
#
|
538
|
+
# #string_logger.info("Fake Value (with difference): #{period_counter.fake_value}")
|
539
|
+
# #string_logger.info("Real Value (with difference): #{period_counter.real_value}")
|
540
|
+
# # initializing next_iteration_date
|
541
|
+
# next_iteration_date = period_counter.period_start + number_of_iteration_by_now * iteration_period_in_seconds
|
542
|
+
# #string_logger.info("Next Iteration Date: #{next_iteration_date.in_time_zone(counter_data[:local_timezone])}")
|
543
|
+
# # increasing number_of_iteration_by_now by 1 while next_iteration_date < counter_data[:local_now]
|
544
|
+
# begin
|
545
|
+
# #string_logger.info("Iterrating for next iteration date")
|
546
|
+
# number_of_iteration_by_now += 1
|
547
|
+
# #period_counter.fake_value += 1
|
548
|
+
# #period_counter.real_value += 1
|
549
|
+
# next_iteration_date = period_counter.period_start + number_of_iteration_by_now * iteration_period_in_seconds
|
550
|
+
# end while next_iteration_date < counter_data[:local_now]
|
551
|
+
# #setting net_iteration_date
|
552
|
+
# period_counter.next_iteration_date = next_iteration_date
|
553
|
+
# #string_logger.info("*****************************************************************")
|
554
|
+
# #string_logger.info("*****************************************************************")
|
555
|
+
# end
|
556
|
+
# end
|
557
|
+
# #saving period_counter
|
558
|
+
# period_counter.save
|
559
|
+
#end # end of transaction
|
560
|
+
#
|
561
|
+
#counter_result = {}
|
562
|
+
#counter_result[:total] = counter_data[:total]
|
563
|
+
#counter_result[:by_period] = period_counter.fake_value
|
564
|
+
#
|
565
|
+
## string_logger.info("Total Counter: #{counter_result[:total]}")
|
566
|
+
## string_logger.info("Day Counter: #{counter_result[:by_period]}")
|
567
|
+
#counter_result
|
568
|
+
end
|
569
|
+
|
570
|
+
|
571
|
+
#rescue_from ActiveRecord::RecordNotFound , :with => :e404
|
572
|
+
|
573
|
+
# rescue_from ActiveRecord::RecordInvalid , :with => :e404
|
574
|
+
|
575
|
+
#rescue_from ActionController::RoutingError , :with => :e404
|
576
|
+
|
577
|
+
#rescue_from ActiveRecord::ActiveRecordError , :with => :e404
|
578
|
+
|
579
|
+
#rescue_from ArgumentError , :with => :e404
|
580
|
+
|
581
|
+
#rescue_from Exception, :with => :e404
|
582
|
+
|
583
|
+
|
584
|
+
def e404
|
585
|
+
respond_to do |format|
|
586
|
+
format.html { render :template => 'layouts/404', :status => 404 }
|
587
|
+
format.all { render :nothing => true, :status => "404" }
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
591
|
+
#rescue_from ActiveRecord::RecordNotFound , :with => :e404
|
592
|
+
|
593
|
+
# rescue_from ActiveRecord::RecordInvalid , :with => :e404
|
594
|
+
|
595
|
+
#rescue_from ActionController::RoutingError , :with => :e404
|
596
|
+
|
597
|
+
#rescue_from ActiveRecord::ActiveRecordError , :with => :e404
|
598
|
+
|
599
|
+
#rescue_from Ar
|
600
|
+
#gumentError , :with => :e404
|
601
|
+
|
602
|
+
#rescue_from Exception, :with => :e404
|
603
|
+
|
604
|
+
|
605
|
+
rescue_from CanCan::AccessDenied do |exception|
|
606
|
+
respond_to do |format|
|
607
|
+
format.html { render :template => '/shared/access_denied.html.erb', :status => 404 }
|
608
|
+
format.all { render :nothing => true, :status => "404" }
|
609
|
+
end
|
610
|
+
end
|
611
|
+
|
612
|
+
|
613
|
+
# ***********************************************************************************************
|
614
|
+
# ************************************** PRIVATE METHODS ****************************************
|
615
|
+
# ***********************************************************************************************
|
616
|
+
private
|
617
|
+
def get_current_user
|
618
|
+
if session[:user_id]
|
619
|
+
::SecurityZone::User.where(id: session[:user_id]).first
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
|
624
|
+
def debugger_before_action
|
625
|
+
#string_logger.info("Params: #{params.to_json}")
|
626
|
+
if @logging_options[:status] == true
|
627
|
+
|
628
|
+
end
|
629
|
+
end
|
630
|
+
|
631
|
+
def debugger_after_action
|
632
|
+
if @logging_options[:status] == true
|
633
|
+
system_logging_write_event("", ::SystemZone::Logging::Event::LEVEL_DEBUG, response.body)
|
634
|
+
system_logging_write_event("", ::SystemZone::Logging::Event::LEVEL_TIME, response.body)
|
635
|
+
end
|
636
|
+
end
|
637
|
+
|
638
|
+
def rails_log_before
|
639
|
+
@string_logger.debug("BEGIN #{self.class}.#{self.action_name}") if @string_logger
|
640
|
+
@string_logger.depth_up if @string_logger
|
641
|
+
@string_logger.debug("\tPARAMS: #{params.to_json}") if @string_logger
|
642
|
+
@string_logger.debug("\tREQUEST FORMAT: #{request.format}") if @string_logger
|
643
|
+
@string_logger.debug(" ") if @string_logger
|
644
|
+
|
645
|
+
|
646
|
+
end
|
647
|
+
|
648
|
+
def rails_log_after
|
649
|
+
@string_logger.depth_down if @string_logger
|
650
|
+
@string_logger.debug ("END") if @string_logger
|
651
|
+
@string_logger.debug "*********************************************************************************" if @string_logger
|
652
|
+
end
|
653
|
+
|
654
|
+
|
655
|
+
def request_started
|
656
|
+
@string_logger = ::ChupakabraTools::Logging::StringLogger.new
|
657
|
+
end
|
658
|
+
|
659
|
+
def request_finished
|
660
|
+
#string_logger.log_data.each do |d|
|
661
|
+
# logger.info(d[:data])
|
662
|
+
#end
|
663
|
+
end
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
def before_entry_create(entry, filter_params, options)
|
668
|
+
|
669
|
+
end
|
670
|
+
|
671
|
+
def before_entry_update(entry, filter_params, options)
|
672
|
+
|
673
|
+
end
|
674
|
+
|
675
|
+
end
|
676
|
+
end
|