carnival 0.0.55 → 0.0.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/carnival/admin.js +3 -3
- data/app/assets/javascripts/carnival/data_tables_functions.js +18 -2
- data/app/assets/javascripts/carnival/external/{jquery.noty.js → noty/jquery.noty.js} +45 -117
- data/app/assets/javascripts/carnival/external/{jquery.noty.layout.bottom.js → noty/layouts/bottom.js} +1 -1
- data/app/assets/javascripts/carnival/external/noty/layouts/bottomCenter.js +41 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/bottomLeft.js +43 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/bottomRight.js +43 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/center.js +56 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/centerLeft.js +61 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/centerRight.js +61 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/inline.js +31 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/top.js +34 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/topCenter.js +41 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/topLeft.js +43 -0
- data/app/assets/javascripts/carnival/external/noty/layouts/topRight.js +43 -0
- data/app/assets/javascripts/carnival/external/noty/packaged/jquery.noty.packaged.js +1180 -0
- data/app/assets/javascripts/carnival/external/noty/packaged/jquery.noty.packaged.min.js +1 -0
- data/app/assets/javascripts/carnival/external/noty/promise.js +432 -0
- data/app/assets/javascripts/carnival/external/{jquery.noty.theme.default.js → noty/themes/default.js} +3 -3
- data/app/assets/javascripts/carnival/vizir_admin.js +0 -30
- data/app/assets/stylesheets/carnival/admin.css +0 -1
- data/app/assets/stylesheets/carnival/jquery.noty.css +17 -104
- data/app/assets/stylesheets/carnival/main.css +31 -3
- data/app/controllers/carnival/base_admin_controller.rb +15 -4
- data/app/datatable/carnival/generic_datatable.rb +23 -11
- data/app/helpers/carnival/base_admin_helper.rb +20 -3
- data/app/inputs/admin_enum_input.rb +5 -3
- data/app/inputs/admin_relationship_select_input.rb +17 -5
- data/app/models/carnival/admin_user.rb +2 -1
- data/app/models/carnival/field.rb +37 -1
- data/app/models/carnival/field.rb.orig +157 -0
- data/app/models/carnival/model_helper.rb +19 -3
- data/app/presenters/carnival/base_admin_presenter.rb +38 -6
- data/app/view_objects/carnival/nested_form_options.rb +135 -0
- data/app/views/carnival/base_admin/edit.html.haml +1 -1
- data/app/views/carnival/base_admin/index.html.haml +3 -3
- data/app/views/carnival/base_admin/load_dependent_select_options.html.haml +5 -0
- data/app/views/carnival/base_admin/new.html.haml +1 -1
- data/app/views/carnival/base_admin/show.html.haml +5 -2
- data/app/views/carnival/shared/_item_buttons.html.haml +1 -1
- data/app/views/carnival/shared/form/_field.html.haml +9 -1
- data/app/views/carnival/shared/form/_field.html.haml.orig +29 -0
- data/app/views/carnival/shared/form/_form.html.haml +64 -3
- data/app/views/carnival/shared/form/_inner_form.html.haml +1 -35
- data/app/views/carnival/shared/form/_nested_form.html.haml +20 -0
- data/app/views/carnival/shared/form/_nested_form_options.html.haml +29 -0
- data/app/views/carnival/shared/show/_show_as_list.html.haml +4 -0
- data/app/views/layouts/carnival/_menu.html.haml +6 -5
- data/config/locales/carnival.pt-br.yml +10 -6
- data/lib/carnival.rb +4 -0
- data/lib/carnival/config.rb +3 -1
- data/lib/carnival/routes.rb +2 -1
- data/lib/carnival/version.rb +1 -1
- data/lib/carnival/version.rb.orig +7 -0
- data/lib/generators/carnival/templates/carnival_initializer.rb +59 -48
- data/test/dummy/app/controllers/admin/people_controller.rb +1 -1
- data/test/dummy/app/controllers/admin/states_controller.rb +1 -1
- data/test/dummy/app/models/admin/city.rb +1 -0
- data/test/dummy/app/models/admin/state.rb +1 -0
- data/test/dummy/app/presenters/admin/person_presenter.rb +4 -2
- data/test/dummy/app/presenters/admin/state_presenter.rb +15 -5
- data/test/dummy/config/initializers/carnival_initializer.rb +7 -2
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/seeds.rb +15 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/bullet.log +366 -1094
- data/test/dummy/log/development.log +20675 -53911
- data/test/dummy/log/test.log +785 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/01c1d1cbb942f60130f0aa01d50c98d2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/02b691bcf7570e21acab45d320ac92cf +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/049c6f2079e2e93f96fd228df8c265ba +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0d9971c4a3b5017a7d2122508b66bb12 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0f7b5da581fb3730800607447951008a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{07e2c1c7f749a9d38b1649aec1d98730 → 1205c92fa474a4de8d08f2774c450103} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/141987f5d019e60604cd75d2e340942f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/147e4215ac96fd8b8d373567ae00ed47 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/1634e1287a9914e738e710919b7cd6e4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/16c6027bc506317d8266573d0ae1b510 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/16e4094498947b5f36bfbb490b94d025 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2109e2acf993625dc0a3f05e7e0af523 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/21e89993e0f6f1b465e0de70e76b77f3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2684dad966b304ec2aee0149dc77c657 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2908a36318747c72030e94441a2579c4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{d3b5d5784361e5eb827fbcdb0332258f → 2a85e7b776e55125671b84c4ed5a9f56} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/30c8c2e6ca355103a267133f6b45b0ce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/31177aaa32db75be241353c5819450b4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/31a6581dfe5a788b2b450403959a97c5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/32daf8a3bfd9da8ab261f5002f66389f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/33dfbc7bdde795abfd1031ceaa315dc8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{197f549b9c46ec6679bddac8e4065948 → 36ac7d3c94b129447c85c4abea55a674} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/39d34c0caaa6f36d684fac1898a7f88f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3a2fdd82041ab4b5ce8a082ec9b270fb +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{aaf9dac7bb02577a8005e39ca9225482 → 3aa40071fc24bbafb6d0d4d36b91be70} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3ac0f4fad0d3e6d3d13d4ed2189dcabe +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3d8100b6e405407290dcf994ef05e0b7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3f89739d959e11df6c20fa6ea13c1044 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3fd8a2a00bb4ebd69a3ecac257dbe536 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4423cb4765f66f187ffcb3be911c3600 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/44dd8eb9e41f4103d9f40dfd6b4ae2ae +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/45b86c586ed942b09cec2190b3c45c5a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/47ce692a80d5b075614c2489d7e3a142 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/499338aa610d84045d1a0f081960c6fc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4a7a4dcd9fea9bd2e287771c51f96631 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4bd7e9214a07840040d269fdbf523e97 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4c36f4196d9df171251bea6f3b587fe3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4e4b1f24c5e69f2f305f6d6483a1605c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5090d7ea741c7f63994eb7b62e757f8f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/536648929c703c8c5e964b502b2095ff +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{b632a78e3341b622d2afbcb5312f9da0 → 55d16ecf7bea794f8130ad57090cf849} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/565023fdd3960225e817ec043b2d9474 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/577f4d9c0b4703cbfffd7159a232e60e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5a4d2d875f1d8ab987ab653f896d1c39 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5b0d5ead11b1996d8c04250256d5f1d4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5c8a4c90b3525681a2173b93b9d55293 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5e7998a2046d512312e432aef40d3e22 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5eacf8d05b2a79f57d54ee047a51e223 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5ff6c7a42ff7a4d062640d9211b42275 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/604d964a22a33e7a1dc917eb10328fb6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/611bcab6d1ba6d887fc27c1b9f6f2ac4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6808736d34ec24fb10203097ff009a4d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6b57b684590d7c01cfa80052144dd2df +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6c257cb7126b2e5bda4c42d414e39786 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6ce5945ed85a31ec875a9973b5a3d3bc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6d806eaa317f200bbf2832a0abf1c1cc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6e6e4eaedc6398f0557ca2fe922c970d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/706dcf8ec253808fea35ae06a4b408b1 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{3636240cbc1f10d05a7e27f44c330bf9 → 7a5d26a333ef57f4cb3f6148d201aabd} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/7cfe3fa955d677396ed9e22193559a64 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/7e154ca951644e8aa1a2c6221f08db4f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/822d6436044fe88b0b3fbc6f3458ff88 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8576d7c22dbd8222ab27a6c47f56a65c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/88144c375f9e329812d0302be96e0eab +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8a4b32386b5d8554473df478badd6ef9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8bc60f31f479cd0263d897aa45b88750 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{5d4c2ae09c50a0b53500e334aa699c8a → 8bee3d374e40eec902852521ab7bb59e} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/918ab452d9c4634682ff94ffbd89e16f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9406ab6f0dd16a8cd5802c3c74df86ce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9455de99a5c68705427bbec9e50865ce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/958dd41e5252627471b2b65116401512 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9658141bfa282274f1da9155c32ae206 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/996ac001c901711cabb64b7e1940c54a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9aec27b5fa2afdfa28068452ece0e6f0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9db7e75f3fa621ef08ade7ffda96e39f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9dc853d92b5d774afadacc451965059c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a125dd8e84a82fc90705bd3710fb93c2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a1c5386d742fb4d01bea977ed28f4a96 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a2ea0bd40e08492898f032af3756ebf9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a30288f737d428b0feb2a78b3aab9c69 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a40d723f9a6ad5b541009b8f05ce6533 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a908448dd851cae431aa2b4bde9b5a98 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/aa5708f6fbe7528d49c127a7f89a2511 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ad7b50123ad008ac0730bbbdf76a6bfe +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/b271e3537645a42480b3ba7bca2342f4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{662125e0a3b8f685abafe02e03c6f442 → b9089c33a95ef4a20cce25cc95ce5d25} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ba891185d4fda83f4c16e6bb8139359b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bea8fc4b9fc9ae163aa3e82041be2542 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{6f6ec88ead28d25410be2a6f62ec79b1 → c5e6bcf3743cc436e9c5e728e7968918} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c72101732682999b6ca050f007fc6467 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c8927e934e7960fc7907b6fc02ea7f08 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c980544b5828a643ecaa8e784897c2c2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ca0e1997bc6c40f955a42ee777299750 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cc2c3f8b87c5b787305412a3076058db +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{6ad4d1acfed3cffae46c712b7c08af08 → d0f105bf22b1327c9d92c8695d4eb9cd} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d16461dfcae4b782f721ebd81e4f8740 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{5dff23c7dbd41b1db43fea8c8d933e94 → d30e267e67b877123ca48b32ba67d0b3} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d81122f6f2520c8f0785425936756e20 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dbf160a6439a8d0b792ff46cf0a612f6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dc829340258cc36c0df423725df54649 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dcedf863f6acc3e1f21ec11434a77bf7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dd326f3f4fd1c7fd075b58d6cb623a25 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/de060f82711b4b5c465f17b140eb2a61 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e0352d0f97751491adbe6a94832772af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e1d6efce94e71965434d2dde64fd8410 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e4298973f799acdce289752c24bfddf2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e4900a6e69f874e98b87c7c7b23f7f5a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e62e56f99e228e3467663224450f0a9b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e9c81ca91323dab8977ffd8a459cab06 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{c3f8745dd91cb1b9a0c076a692369c4a → ea4b1e470711396062a4dba82f0823e6} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/eccab0d41d08e156ccd2f36f85949356 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f035bed7351cb6f6e2bf1250125d3d4b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f1e75c209067b23f5c0c7bf2006c43d0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f31e05a23db2e9dfc9207658cda7b799 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{3fdb709b3417757576eff80c0ec26b75 → f4428df54ac764385fa3d1c156fd8430} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f5c9348795319821f3309d4e03bb9fdb +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f631443b06d6b36e666344dbaf0b64f0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f71bbedf97979d3cfe44077a64d3e98a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{8e22d55d0b7b958a3904e7428269df65 → f795ed856980e9033fa3603aa61bac8d} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7ab949c8c6b7ef3f2b743ebd98f9f59 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/fc4b3bb94f52c27dfb87395841a7cb62 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/fc79e1609ba401a4408c71182ef89b3e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/fd1e0a44b82fc47f26c7adec9d918911 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/fe9a0ccc2a407c74780c85e66882e888 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ff3b0a569330823bd5599af14ee70cc8 +0 -0
- metadata +239 -222
- data/app/assets/stylesheets/carnival/noty_theme_default.css +0 -185
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/22e50c67b95bf23b653e7a6768d38749 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2a4d4d7ea99972ea41453ec4e6bad058 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/58ce7bbd3c0d5ae2c59e5fcd6692d8ce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/7e60927c780355f751c11cc4581b0c51 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/84e6a879569ca7546a93558488a6ff70 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d2ea65cc83e604dee36a5316b567e3e2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d554039ac665d1a72c5af06725134a59 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/eed84a44f4e3915a39ea98ce25dc2570 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
@@ -25,36 +25,6 @@ function openPopUp(url){
|
|
25
25
|
$.colorbox({href:url, opacity:0.5, width:"90%"});
|
26
26
|
}
|
27
27
|
|
28
|
-
function notyError(msg){
|
29
|
-
noty({
|
30
|
-
'text': msg,
|
31
|
-
'layout': 'bottom',
|
32
|
-
'type': 'error',
|
33
|
-
'animateOpen': {'height': 'toggle'},
|
34
|
-
'animateClose': {'height': 'toggle'},
|
35
|
-
'speed': 500,
|
36
|
-
'timeout': 5000,
|
37
|
-
'closeButton': false,
|
38
|
-
'closeOnSelfClick': true,
|
39
|
-
'closeOnSelfOver': true
|
40
|
-
});
|
41
|
-
}
|
42
|
-
|
43
|
-
function notySuccess(msg){
|
44
|
-
noty({
|
45
|
-
'text': msg,
|
46
|
-
'layout': 'bottom',
|
47
|
-
'type': 'success',
|
48
|
-
'animateOpen': {'height': 'toggle'},
|
49
|
-
'animateClose': {'height': 'toggle'},
|
50
|
-
'speed': 500,
|
51
|
-
'timeout': 5000,
|
52
|
-
'closeButton': false,
|
53
|
-
'closeOnSelfClick': true,
|
54
|
-
'closeOnSelfOver': true
|
55
|
-
});
|
56
|
-
}
|
57
|
-
|
58
28
|
function markActive(){
|
59
29
|
$('.dropdown_main_menu_sublevel a.actived').closest('.dropdown_main_menu_sublevel').show();
|
60
30
|
}
|
@@ -1,104 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
19
|
-
|
20
|
-
/* noty modal */
|
21
|
-
.noty_modal {
|
22
|
-
position: fixed;
|
23
|
-
width: 100%;
|
24
|
-
height: 100%;
|
25
|
-
background-color: #000;
|
26
|
-
z-index: 10000;
|
27
|
-
opacity: 0.6;
|
28
|
-
display: none;
|
29
|
-
left: 0;
|
30
|
-
top: 0;
|
31
|
-
}
|
32
|
-
|
33
|
-
/* noty container for noty_layout_topLeft & noty_layout_topRight */
|
34
|
-
ul.noty_cont {
|
35
|
-
position: fixed;
|
36
|
-
z-index: 10000000;
|
37
|
-
margin: 0px;
|
38
|
-
padding: 0px;
|
39
|
-
list-style: none;
|
40
|
-
width: 300px;
|
41
|
-
}
|
42
|
-
ul.noty_cont li {
|
43
|
-
position: relative;
|
44
|
-
float: left;
|
45
|
-
clear: both;
|
46
|
-
list-style: none;
|
47
|
-
padding: 0px;
|
48
|
-
margin: 10px 0 0 0;
|
49
|
-
width: 300px; /* Fix for: http://bugs.jquery.com/ticket/2278 */
|
50
|
-
}
|
51
|
-
ul.noty_cont.noty_layout_topLeft {left:20px; top:20px;}
|
52
|
-
ul.noty_cont.noty_layout_topRight {right:40px; top:20px;}
|
53
|
-
ul.noty_cont.noty_layout_bottomLeft {left:20px; bottom:20px}
|
54
|
-
ul.noty_cont.noty_layout_bottomRight {right:40px; bottom:20px}
|
55
|
-
ul.noty_cont.noty_layout_topRight li {float:right}
|
56
|
-
|
57
|
-
/* LAYOUTS */
|
58
|
-
|
59
|
-
/* noty_layout_top */
|
60
|
-
.noty_bar.noty_layout_top {
|
61
|
-
top: 0;
|
62
|
-
left: 0;
|
63
|
-
width: 100%;
|
64
|
-
-webkit-border-radius: 0px;
|
65
|
-
-moz-border-radius: 0px;
|
66
|
-
border-radius: 0px;
|
67
|
-
}
|
68
|
-
|
69
|
-
/* noty_layout_bottom */
|
70
|
-
.noty_bar.noty_layout_bottom {
|
71
|
-
bottom: 0;
|
72
|
-
left: 0;
|
73
|
-
width: 100%;
|
74
|
-
-webkit-border-radius: 0px;
|
75
|
-
-moz-border-radius: 0px;
|
76
|
-
border-radius: 0px;
|
77
|
-
}
|
78
|
-
|
79
|
-
/* noty_layout_center */
|
80
|
-
.noty_bar.noty_layout_center {
|
81
|
-
top: 40%;
|
82
|
-
}
|
83
|
-
|
84
|
-
/* noty_layout_topLeft & noty_layout_topRight */
|
85
|
-
.noty_bar.noty_layout_topLeft,
|
86
|
-
.noty_bar.noty_layout_topRight,
|
87
|
-
.noty_bar.noty_layout_bottomLeft,
|
88
|
-
.noty_bar.noty_layout_bottomRight {
|
89
|
-
width: 100%;
|
90
|
-
clear: both;
|
91
|
-
position: relative;
|
92
|
-
}
|
93
|
-
|
94
|
-
.noty_bar.noty_layout_topLeft .noty_message,
|
95
|
-
.noty_bar.noty_layout_topRight .noty_message,
|
96
|
-
.noty_bar.noty_layout_bottomLeft .noty_message,
|
97
|
-
.noty_bar.noty_layout_bottomRight .noty_message {
|
98
|
-
text-align: left;
|
99
|
-
}
|
100
|
-
|
101
|
-
/* noty_layout_topCenter */
|
102
|
-
.noty_bar.noty_layout_topCenter {
|
103
|
-
top: 20px;
|
104
|
-
}
|
1
|
+
ul#noty_bottom_layout_container{
|
2
|
+
left:0 !important;
|
3
|
+
width:100% !important;
|
4
|
+
}
|
5
|
+
|
6
|
+
ul#noty_bottom_layout_container li{
|
7
|
+
border-radius: 0px !important;
|
8
|
+
background-image: none !important;
|
9
|
+
height: 60px !important;
|
10
|
+
color:#FFFFFF !important;
|
11
|
+
padding-top: 20px !important;
|
12
|
+
}
|
13
|
+
|
14
|
+
ul#noty_bottom_layout_container li .noty_text{
|
15
|
+
font-size: 26px !important;
|
16
|
+
text-shadow: 1px 1px #000;
|
17
|
+
}
|
@@ -2310,10 +2310,10 @@ table input{
|
|
2310
2310
|
}
|
2311
2311
|
|
2312
2312
|
.nested-form-list-item{
|
2313
|
-
border
|
2313
|
+
border: 1px solid #ccc;
|
2314
2314
|
float: left;
|
2315
2315
|
margin-bottom: 10px;
|
2316
|
-
padding
|
2316
|
+
padding: 10px;
|
2317
2317
|
width: 95%;
|
2318
2318
|
}
|
2319
2319
|
.nested-form-list-item-actions{
|
@@ -2328,4 +2328,32 @@ table input{
|
|
2328
2328
|
|
2329
2329
|
.existing-options span{
|
2330
2330
|
float: left;
|
2331
|
-
}
|
2331
|
+
}
|
2332
|
+
|
2333
|
+
.carnival-form-options-hide{
|
2334
|
+
display: none
|
2335
|
+
}
|
2336
|
+
|
2337
|
+
.carnival-select-options{
|
2338
|
+
width: 100%;
|
2339
|
+
margin-left: 20px;
|
2340
|
+
position: relative;
|
2341
|
+
float: left;
|
2342
|
+
}
|
2343
|
+
|
2344
|
+
.carnival-select-tag{
|
2345
|
+
width: 50%;
|
2346
|
+
float: left;
|
2347
|
+
position: relative;
|
2348
|
+
margin-right: 10px;
|
2349
|
+
}
|
2350
|
+
|
2351
|
+
.carnival-select-action{
|
2352
|
+
width: 50%;
|
2353
|
+
float: left;
|
2354
|
+
position: relative;
|
2355
|
+
}
|
2356
|
+
.carnival-form-options{
|
2357
|
+
margin-left: 20px;
|
2358
|
+
float: left;
|
2359
|
+
}
|
@@ -20,16 +20,20 @@ module Carnival
|
|
20
20
|
|
21
21
|
respond_to do |format|
|
22
22
|
format.html do |render|
|
23
|
-
render 'index'
|
23
|
+
render 'index' and return
|
24
24
|
end
|
25
25
|
format.json do |render|
|
26
|
-
|
26
|
+
if params[:list_scope]
|
27
|
+
render(json: @datatable.as_list) and return
|
28
|
+
else
|
29
|
+
render(json: @datatable) and return
|
30
|
+
end
|
27
31
|
end
|
28
32
|
format.csv do
|
29
|
-
render text: @datatable.as_csv.encode("utf-16le")
|
33
|
+
render text: @datatable.as_csv.encode("utf-16le") and return
|
30
34
|
end
|
31
35
|
format.pdf do
|
32
|
-
render :pdf => t("#{@datatable.model.to_s.underscore}.lista") , :template => 'carnival/index.pdf.haml', :show_as_html => params[:debug].present?
|
36
|
+
render :pdf => t("#{@datatable.model.to_s.underscore}.lista") , :template => 'carnival/index.pdf.haml', :show_as_html => params[:debug].present? and return
|
33
37
|
end
|
34
38
|
end
|
35
39
|
end
|
@@ -90,6 +94,13 @@ module Carnival
|
|
90
94
|
render 'layouts/shared/render_popup' and return
|
91
95
|
end
|
92
96
|
|
97
|
+
def load_dependent_select_options
|
98
|
+
presenter = params[:presenter].constantize.send(:new, :controller => self)
|
99
|
+
model = presenter.relation_model(params[:field].gsub("_id", "").to_sym)
|
100
|
+
@options = model.list_for_select(add_empty_option: true, query: ["#{params[:dependency_field]} = ?", params[:dependency_value]])
|
101
|
+
render layout: nil
|
102
|
+
end
|
103
|
+
|
93
104
|
private
|
94
105
|
|
95
106
|
def instantiate_model(presenter)
|
@@ -49,6 +49,27 @@ module Carnival
|
|
49
49
|
fetch_records
|
50
50
|
end
|
51
51
|
|
52
|
+
def as_list(options = {})
|
53
|
+
items = []
|
54
|
+
model_object = params[:model_class_name].classify.constantize.send(:new)
|
55
|
+
if !params[:model_id].empty?
|
56
|
+
model_object = params[:model_class_name].classify.constantize.send(:find, params[:model_id])
|
57
|
+
end
|
58
|
+
if params[:carnival_list_scope]
|
59
|
+
items = @model.where(params[:carnival_list_scope])
|
60
|
+
else
|
61
|
+
items = @model.all
|
62
|
+
end
|
63
|
+
|
64
|
+
just_class_name = params[:model_class_name].demodulize.classify.underscore
|
65
|
+
controller = params[:controller_name].constantize.new
|
66
|
+
model_presenter = params[:presenter_name].constantize.new controller: controller
|
67
|
+
field = model_presenter.fields[params[:field_name].to_sym]
|
68
|
+
opt = Carnival::NestedFormOptions.new model_object, model_presenter, field, items
|
69
|
+
html = render_to_string :partial => 'carnival/shared/form/nested_form_options.html.haml', :locals => { opt_obj: opt }
|
70
|
+
return :template => html.to_s, :items => items
|
71
|
+
end
|
72
|
+
|
52
73
|
def filters
|
53
74
|
@filters
|
54
75
|
end
|
@@ -165,17 +186,8 @@ module Carnival
|
|
165
186
|
end
|
166
187
|
|
167
188
|
def sort_direction
|
168
|
-
|
169
|
-
|
170
|
-
sort_dir = params[:sSortDir_0]
|
171
|
-
sort_dir == "desc" ? "desc" : "asc"
|
172
|
-
end
|
173
|
-
|
174
|
-
if sort_dir == 'desc'
|
175
|
-
return 'desc'
|
176
|
-
else
|
177
|
-
return 'asc'
|
178
|
-
end
|
189
|
+
return 'desc' if params[:sSortDir_0] == 'desc'
|
190
|
+
'asc'
|
179
191
|
end
|
180
192
|
end
|
181
193
|
end
|
@@ -11,9 +11,9 @@ module Carnival
|
|
11
11
|
@type = type
|
12
12
|
end
|
13
13
|
javascript = "noty({'text':'#{@messages}',
|
14
|
-
'layout':'bottom','type':'#{@type}',
|
15
|
-
'
|
16
|
-
'
|
14
|
+
'layout':'bottom','type':'#{@type}',
|
15
|
+
'animation': {'close':{'height':'toggle'}, 'open':{'height':'toggle'},'speed':500},'timeout':4000,
|
16
|
+
'closeWith':['click', 'hover']});"
|
17
17
|
return javascript if defined?(@type)
|
18
18
|
''
|
19
19
|
end
|
@@ -55,6 +55,23 @@ module Carnival
|
|
55
55
|
:other
|
56
56
|
end
|
57
57
|
|
58
|
+
def menu_link link
|
59
|
+
link.strip!
|
60
|
+
if link.to_s.end_with?('_path') or link.to_s.end_with?('_url')
|
61
|
+
return eval link
|
62
|
+
elsif link.index(/_path.+/) #path with arguments
|
63
|
+
return eval link
|
64
|
+
end
|
65
|
+
|
66
|
+
link
|
67
|
+
end
|
68
|
+
|
69
|
+
def show_as_list(presenter, field)
|
70
|
+
current_type = field_type(presenter,field)
|
71
|
+
return false if current_type != :relation
|
72
|
+
return presenter.fields[field.to_sym].show_as_list
|
73
|
+
end
|
74
|
+
|
58
75
|
def field_to_show(presenter, field, record, show_only_value=false)
|
59
76
|
current_type = field_type(presenter,field)
|
60
77
|
if current_type == :relation
|
@@ -1,12 +1,14 @@
|
|
1
1
|
class AdminEnumInput < SimpleForm::Inputs::CollectionSelectInput
|
2
2
|
def input
|
3
3
|
super
|
4
|
+
input_html_options[:class] << ' chosen'
|
5
|
+
|
4
6
|
@builder.collection_select(
|
5
7
|
attribute_name, @builder.object.class.const_get(attribute_name.to_s.upcase),
|
6
8
|
:first, :last,
|
7
|
-
prompt: I18n.t("#{@builder.object.class.to_s.gsub(/^.*::/, '').downcase}.lista_#{attribute_name}.selecione",
|
8
|
-
default: I18n.t("messages.select")),
|
9
|
-
|
9
|
+
{prompt: I18n.t("#{@builder.object.class.to_s.gsub(/^.*::/, '').downcase}.lista_#{attribute_name}.selecione",
|
10
|
+
default: I18n.t("messages.select"))},
|
11
|
+
input_html_options
|
10
12
|
)
|
11
13
|
end
|
12
14
|
end
|
@@ -1,13 +1,25 @@
|
|
1
1
|
class AdminRelationshipSelectInput < SimpleForm::Inputs::CollectionSelectInput
|
2
2
|
def input
|
3
3
|
super
|
4
|
+
input_html_options[:class] << ' chosen'
|
5
|
+
if input_html_options[:data][:depends_on].nil?
|
6
|
+
collection = @builder.object.class.name.constantize.reflect_on_association(attribute_name.to_sym).klass.name.constantize.list_for_select
|
7
|
+
else
|
8
|
+
depends_on = @builder.object.class.name.constantize.reflect_on_association(input_html_options[:data][:depends_on]).foreign_key
|
9
|
+
depends_on_value = @builder.object.send(depends_on.to_s)
|
10
|
+
if depends_on_value.present?
|
11
|
+
collection = @builder.object.class.name.constantize.reflect_on_association(attribute_name.to_sym).klass.name.constantize.list_for_select(add_empty_option: true, query: ["#{depends_on} = ?", depends_on_value])
|
12
|
+
else
|
13
|
+
collection = []
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
4
17
|
@builder.collection_select(
|
5
|
-
"#{attribute_name}
|
6
|
-
|
18
|
+
"#{@builder.object.class.name.constantize.reflections[attribute_name.to_sym].foreign_key}",
|
19
|
+
collection,
|
7
20
|
:first, :last,
|
8
|
-
prompt: I18n.t("#{@builder.object.class.to_s.gsub(/^.*::/, '').downcase}.lista_#{attribute_name}.selecione",
|
9
|
-
|
10
|
-
input_html: {:class=> 'chosen'}
|
21
|
+
{prompt: I18n.t("#{@builder.object.class.to_s.gsub(/^.*::/, '').downcase}.lista_#{attribute_name}.selecione", default: I18n.t("messages.select"))},
|
22
|
+
input_html_options
|
11
23
|
)
|
12
24
|
end
|
13
25
|
end
|
@@ -61,6 +61,10 @@ module Carnival
|
|
61
61
|
return :asc
|
62
62
|
end
|
63
63
|
|
64
|
+
def depends_on
|
65
|
+
@params[:depends_on]
|
66
|
+
end
|
67
|
+
|
64
68
|
def nested_form?
|
65
69
|
@params[:nested_form]
|
66
70
|
end
|
@@ -70,12 +74,29 @@ module Carnival
|
|
70
74
|
end
|
71
75
|
|
72
76
|
def nested_form_modes? (mode)
|
77
|
+
associate = get_associate_nested_form_mode
|
78
|
+
return true if associate.present? && mode == :associate
|
73
79
|
return @params[:nested_form_modes].include?(mode) unless @params[:nested_form_modes].nil?
|
74
80
|
return false
|
75
81
|
end
|
76
82
|
|
83
|
+
def nested_form_scope
|
84
|
+
return nil if !nested_form_modes? :associate
|
85
|
+
associate_mode = get_associate_nested_form_mode
|
86
|
+
return nil if associate_mode.is_a? Symbol
|
87
|
+
return associate_mode[:scope] if associate_mode[:scope].present?
|
88
|
+
end
|
89
|
+
|
77
90
|
def sortable?
|
78
|
-
@params[:sortable]
|
91
|
+
return true if @params[:sortable]
|
92
|
+
return true if @params[:sortable].class == Hash
|
93
|
+
return false
|
94
|
+
end
|
95
|
+
|
96
|
+
def sortable_params
|
97
|
+
return false if !sortable?
|
98
|
+
return @params[:sortable].to_json if @params[:sortable].class == Hash
|
99
|
+
return true
|
79
100
|
end
|
80
101
|
|
81
102
|
def searchable?
|
@@ -86,6 +107,10 @@ module Carnival
|
|
86
107
|
@params[:advanced_search]
|
87
108
|
end
|
88
109
|
|
110
|
+
def show_as_list
|
111
|
+
@params[:show_as_list]
|
112
|
+
end
|
113
|
+
|
89
114
|
def advanced_search_operator
|
90
115
|
return @params[:advanced_search][:operator] if advanced_searchable? and @params[:advanced_search][:operator].present?
|
91
116
|
:like
|
@@ -111,5 +136,16 @@ module Carnival
|
|
111
136
|
@size = @params[:position][:size]
|
112
137
|
end
|
113
138
|
end
|
139
|
+
|
140
|
+
def get_associate_nested_form_mode
|
141
|
+
@params[:nested_form_modes].each do |mode|
|
142
|
+
if mode.is_a? Hash
|
143
|
+
return mode[:associate] if mode[:associate].present?
|
144
|
+
elsif mode.is_a? Symbol
|
145
|
+
return mode if mode == :associate
|
146
|
+
end
|
147
|
+
end
|
148
|
+
nil
|
149
|
+
end
|
114
150
|
end
|
115
151
|
end
|