carnival 0.0.55 → 0.0.56

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/carnival/admin.js +3 -3
  3. data/app/assets/javascripts/carnival/data_tables_functions.js +18 -2
  4. data/app/assets/javascripts/carnival/external/{jquery.noty.js → noty/jquery.noty.js} +45 -117
  5. data/app/assets/javascripts/carnival/external/{jquery.noty.layout.bottom.js → noty/layouts/bottom.js} +1 -1
  6. data/app/assets/javascripts/carnival/external/noty/layouts/bottomCenter.js +41 -0
  7. data/app/assets/javascripts/carnival/external/noty/layouts/bottomLeft.js +43 -0
  8. data/app/assets/javascripts/carnival/external/noty/layouts/bottomRight.js +43 -0
  9. data/app/assets/javascripts/carnival/external/noty/layouts/center.js +56 -0
  10. data/app/assets/javascripts/carnival/external/noty/layouts/centerLeft.js +61 -0
  11. data/app/assets/javascripts/carnival/external/noty/layouts/centerRight.js +61 -0
  12. data/app/assets/javascripts/carnival/external/noty/layouts/inline.js +31 -0
  13. data/app/assets/javascripts/carnival/external/noty/layouts/top.js +34 -0
  14. data/app/assets/javascripts/carnival/external/noty/layouts/topCenter.js +41 -0
  15. data/app/assets/javascripts/carnival/external/noty/layouts/topLeft.js +43 -0
  16. data/app/assets/javascripts/carnival/external/noty/layouts/topRight.js +43 -0
  17. data/app/assets/javascripts/carnival/external/noty/packaged/jquery.noty.packaged.js +1180 -0
  18. data/app/assets/javascripts/carnival/external/noty/packaged/jquery.noty.packaged.min.js +1 -0
  19. data/app/assets/javascripts/carnival/external/noty/promise.js +432 -0
  20. data/app/assets/javascripts/carnival/external/{jquery.noty.theme.default.js → noty/themes/default.js} +3 -3
  21. data/app/assets/javascripts/carnival/vizir_admin.js +0 -30
  22. data/app/assets/stylesheets/carnival/admin.css +0 -1
  23. data/app/assets/stylesheets/carnival/jquery.noty.css +17 -104
  24. data/app/assets/stylesheets/carnival/main.css +31 -3
  25. data/app/controllers/carnival/base_admin_controller.rb +15 -4
  26. data/app/datatable/carnival/generic_datatable.rb +23 -11
  27. data/app/helpers/carnival/base_admin_helper.rb +20 -3
  28. data/app/inputs/admin_enum_input.rb +5 -3
  29. data/app/inputs/admin_relationship_select_input.rb +17 -5
  30. data/app/models/carnival/admin_user.rb +2 -1
  31. data/app/models/carnival/field.rb +37 -1
  32. data/app/models/carnival/field.rb.orig +157 -0
  33. data/app/models/carnival/model_helper.rb +19 -3
  34. data/app/presenters/carnival/base_admin_presenter.rb +38 -6
  35. data/app/view_objects/carnival/nested_form_options.rb +135 -0
  36. data/app/views/carnival/base_admin/edit.html.haml +1 -1
  37. data/app/views/carnival/base_admin/index.html.haml +3 -3
  38. data/app/views/carnival/base_admin/load_dependent_select_options.html.haml +5 -0
  39. data/app/views/carnival/base_admin/new.html.haml +1 -1
  40. data/app/views/carnival/base_admin/show.html.haml +5 -2
  41. data/app/views/carnival/shared/_item_buttons.html.haml +1 -1
  42. data/app/views/carnival/shared/form/_field.html.haml +9 -1
  43. data/app/views/carnival/shared/form/_field.html.haml.orig +29 -0
  44. data/app/views/carnival/shared/form/_form.html.haml +64 -3
  45. data/app/views/carnival/shared/form/_inner_form.html.haml +1 -35
  46. data/app/views/carnival/shared/form/_nested_form.html.haml +20 -0
  47. data/app/views/carnival/shared/form/_nested_form_options.html.haml +29 -0
  48. data/app/views/carnival/shared/show/_show_as_list.html.haml +4 -0
  49. data/app/views/layouts/carnival/_menu.html.haml +6 -5
  50. data/config/locales/carnival.pt-br.yml +10 -6
  51. data/lib/carnival.rb +4 -0
  52. data/lib/carnival/config.rb +3 -1
  53. data/lib/carnival/routes.rb +2 -1
  54. data/lib/carnival/version.rb +1 -1
  55. data/lib/carnival/version.rb.orig +7 -0
  56. data/lib/generators/carnival/templates/carnival_initializer.rb +59 -48
  57. data/test/dummy/app/controllers/admin/people_controller.rb +1 -1
  58. data/test/dummy/app/controllers/admin/states_controller.rb +1 -1
  59. data/test/dummy/app/models/admin/city.rb +1 -0
  60. data/test/dummy/app/models/admin/state.rb +1 -0
  61. data/test/dummy/app/presenters/admin/person_presenter.rb +4 -2
  62. data/test/dummy/app/presenters/admin/state_presenter.rb +15 -5
  63. data/test/dummy/config/initializers/carnival_initializer.rb +7 -2
  64. data/test/dummy/db/development.sqlite3 +0 -0
  65. data/test/dummy/db/seeds.rb +15 -1
  66. data/test/dummy/db/test.sqlite3 +0 -0
  67. data/test/dummy/log/bullet.log +366 -1094
  68. data/test/dummy/log/development.log +20675 -53911
  69. data/test/dummy/log/test.log +785 -0
  70. data/test/dummy/tmp/cache/assets/development/sprockets/01c1d1cbb942f60130f0aa01d50c98d2 +0 -0
  71. data/test/dummy/tmp/cache/assets/development/sprockets/02b691bcf7570e21acab45d320ac92cf +0 -0
  72. data/test/dummy/tmp/cache/assets/development/sprockets/049c6f2079e2e93f96fd228df8c265ba +0 -0
  73. data/test/dummy/tmp/cache/assets/development/sprockets/0d9971c4a3b5017a7d2122508b66bb12 +0 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/0f7b5da581fb3730800607447951008a +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/{07e2c1c7f749a9d38b1649aec1d98730 → 1205c92fa474a4de8d08f2774c450103} +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/141987f5d019e60604cd75d2e340942f +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/147e4215ac96fd8b8d373567ae00ed47 +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/1634e1287a9914e738e710919b7cd6e4 +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/16c6027bc506317d8266573d0ae1b510 +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/16e4094498947b5f36bfbb490b94d025 +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/2109e2acf993625dc0a3f05e7e0af523 +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/21e89993e0f6f1b465e0de70e76b77f3 +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/2684dad966b304ec2aee0149dc77c657 +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/2908a36318747c72030e94441a2579c4 +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/{d3b5d5784361e5eb827fbcdb0332258f → 2a85e7b776e55125671b84c4ed5a9f56} +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/30c8c2e6ca355103a267133f6b45b0ce +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/31177aaa32db75be241353c5819450b4 +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/31a6581dfe5a788b2b450403959a97c5 +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/32daf8a3bfd9da8ab261f5002f66389f +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/33dfbc7bdde795abfd1031ceaa315dc8 +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/{197f549b9c46ec6679bddac8e4065948 → 36ac7d3c94b129447c85c4abea55a674} +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/39d34c0caaa6f36d684fac1898a7f88f +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/3a2fdd82041ab4b5ce8a082ec9b270fb +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/{aaf9dac7bb02577a8005e39ca9225482 → 3aa40071fc24bbafb6d0d4d36b91be70} +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/3ac0f4fad0d3e6d3d13d4ed2189dcabe +0 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/3d8100b6e405407290dcf994ef05e0b7 +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/3f89739d959e11df6c20fa6ea13c1044 +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/3fd8a2a00bb4ebd69a3ecac257dbe536 +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/4423cb4765f66f187ffcb3be911c3600 +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/44dd8eb9e41f4103d9f40dfd6b4ae2ae +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/45b86c586ed942b09cec2190b3c45c5a +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/47ce692a80d5b075614c2489d7e3a142 +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/499338aa610d84045d1a0f081960c6fc +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/4a7a4dcd9fea9bd2e287771c51f96631 +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/4bd7e9214a07840040d269fdbf523e97 +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/4c36f4196d9df171251bea6f3b587fe3 +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/4e4b1f24c5e69f2f305f6d6483a1605c +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/5090d7ea741c7f63994eb7b62e757f8f +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/536648929c703c8c5e964b502b2095ff +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/{b632a78e3341b622d2afbcb5312f9da0 → 55d16ecf7bea794f8130ad57090cf849} +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/565023fdd3960225e817ec043b2d9474 +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/577f4d9c0b4703cbfffd7159a232e60e +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/5a4d2d875f1d8ab987ab653f896d1c39 +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/5b0d5ead11b1996d8c04250256d5f1d4 +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/5c8a4c90b3525681a2173b93b9d55293 +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/5e7998a2046d512312e432aef40d3e22 +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/5eacf8d05b2a79f57d54ee047a51e223 +0 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/5ff6c7a42ff7a4d062640d9211b42275 +0 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/604d964a22a33e7a1dc917eb10328fb6 +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/611bcab6d1ba6d887fc27c1b9f6f2ac4 +0 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/6808736d34ec24fb10203097ff009a4d +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/6b57b684590d7c01cfa80052144dd2df +0 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/6c257cb7126b2e5bda4c42d414e39786 +0 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/6ce5945ed85a31ec875a9973b5a3d3bc +0 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/6d806eaa317f200bbf2832a0abf1c1cc +0 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/6e6e4eaedc6398f0557ca2fe922c970d +0 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/706dcf8ec253808fea35ae06a4b408b1 +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/{3636240cbc1f10d05a7e27f44c330bf9 → 7a5d26a333ef57f4cb3f6148d201aabd} +0 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/7cfe3fa955d677396ed9e22193559a64 +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/7e154ca951644e8aa1a2c6221f08db4f +0 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/822d6436044fe88b0b3fbc6f3458ff88 +0 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/8576d7c22dbd8222ab27a6c47f56a65c +0 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/88144c375f9e329812d0302be96e0eab +0 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/8a4b32386b5d8554473df478badd6ef9 +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/8bc60f31f479cd0263d897aa45b88750 +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/{5d4c2ae09c50a0b53500e334aa699c8a → 8bee3d374e40eec902852521ab7bb59e} +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/918ab452d9c4634682ff94ffbd89e16f +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/9406ab6f0dd16a8cd5802c3c74df86ce +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/9455de99a5c68705427bbec9e50865ce +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/958dd41e5252627471b2b65116401512 +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/9658141bfa282274f1da9155c32ae206 +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/996ac001c901711cabb64b7e1940c54a +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/9aec27b5fa2afdfa28068452ece0e6f0 +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/9db7e75f3fa621ef08ade7ffda96e39f +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/9dc853d92b5d774afadacc451965059c +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/a125dd8e84a82fc90705bd3710fb93c2 +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/a1c5386d742fb4d01bea977ed28f4a96 +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/a2ea0bd40e08492898f032af3756ebf9 +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/a30288f737d428b0feb2a78b3aab9c69 +0 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/a40d723f9a6ad5b541009b8f05ce6533 +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/a908448dd851cae431aa2b4bde9b5a98 +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/aa5708f6fbe7528d49c127a7f89a2511 +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/ad7b50123ad008ac0730bbbdf76a6bfe +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/b271e3537645a42480b3ba7bca2342f4 +0 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/{662125e0a3b8f685abafe02e03c6f442 → b9089c33a95ef4a20cce25cc95ce5d25} +0 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/ba891185d4fda83f4c16e6bb8139359b +0 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/bea8fc4b9fc9ae163aa3e82041be2542 +0 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/{6f6ec88ead28d25410be2a6f62ec79b1 → c5e6bcf3743cc436e9c5e728e7968918} +0 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/c72101732682999b6ca050f007fc6467 +0 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/c8927e934e7960fc7907b6fc02ea7f08 +0 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/c980544b5828a643ecaa8e784897c2c2 +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/ca0e1997bc6c40f955a42ee777299750 +0 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/cc2c3f8b87c5b787305412a3076058db +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/{6ad4d1acfed3cffae46c712b7c08af08 → d0f105bf22b1327c9d92c8695d4eb9cd} +0 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/d16461dfcae4b782f721ebd81e4f8740 +0 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/{5dff23c7dbd41b1db43fea8c8d933e94 → d30e267e67b877123ca48b32ba67d0b3} +0 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/d81122f6f2520c8f0785425936756e20 +0 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/dbf160a6439a8d0b792ff46cf0a612f6 +0 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/dc829340258cc36c0df423725df54649 +0 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/dcedf863f6acc3e1f21ec11434a77bf7 +0 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/dd326f3f4fd1c7fd075b58d6cb623a25 +0 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/de060f82711b4b5c465f17b140eb2a61 +0 -0
  173. data/test/dummy/tmp/cache/assets/development/sprockets/e0352d0f97751491adbe6a94832772af +0 -0
  174. data/test/dummy/tmp/cache/assets/development/sprockets/e1d6efce94e71965434d2dde64fd8410 +0 -0
  175. data/test/dummy/tmp/cache/assets/development/sprockets/e4298973f799acdce289752c24bfddf2 +0 -0
  176. data/test/dummy/tmp/cache/assets/development/sprockets/e4900a6e69f874e98b87c7c7b23f7f5a +0 -0
  177. data/test/dummy/tmp/cache/assets/development/sprockets/e62e56f99e228e3467663224450f0a9b +0 -0
  178. data/test/dummy/tmp/cache/assets/development/sprockets/e9c81ca91323dab8977ffd8a459cab06 +0 -0
  179. data/test/dummy/tmp/cache/assets/development/sprockets/{c3f8745dd91cb1b9a0c076a692369c4a → ea4b1e470711396062a4dba82f0823e6} +0 -0
  180. data/test/dummy/tmp/cache/assets/development/sprockets/eccab0d41d08e156ccd2f36f85949356 +0 -0
  181. data/test/dummy/tmp/cache/assets/development/sprockets/f035bed7351cb6f6e2bf1250125d3d4b +0 -0
  182. data/test/dummy/tmp/cache/assets/development/sprockets/f1e75c209067b23f5c0c7bf2006c43d0 +0 -0
  183. data/test/dummy/tmp/cache/assets/development/sprockets/f31e05a23db2e9dfc9207658cda7b799 +0 -0
  184. data/test/dummy/tmp/cache/assets/development/sprockets/{3fdb709b3417757576eff80c0ec26b75 → f4428df54ac764385fa3d1c156fd8430} +0 -0
  185. data/test/dummy/tmp/cache/assets/development/sprockets/f5c9348795319821f3309d4e03bb9fdb +0 -0
  186. data/test/dummy/tmp/cache/assets/development/sprockets/f631443b06d6b36e666344dbaf0b64f0 +0 -0
  187. data/test/dummy/tmp/cache/assets/development/sprockets/f71bbedf97979d3cfe44077a64d3e98a +0 -0
  188. data/test/dummy/tmp/cache/assets/development/sprockets/{8e22d55d0b7b958a3904e7428269df65 → f795ed856980e9033fa3603aa61bac8d} +0 -0
  189. data/test/dummy/tmp/cache/assets/development/sprockets/f7ab949c8c6b7ef3f2b743ebd98f9f59 +0 -0
  190. data/test/dummy/tmp/cache/assets/development/sprockets/fc4b3bb94f52c27dfb87395841a7cb62 +0 -0
  191. data/test/dummy/tmp/cache/assets/development/sprockets/fc79e1609ba401a4408c71182ef89b3e +0 -0
  192. data/test/dummy/tmp/cache/assets/development/sprockets/fd1e0a44b82fc47f26c7adec9d918911 +0 -0
  193. data/test/dummy/tmp/cache/assets/development/sprockets/fe9a0ccc2a407c74780c85e66882e888 +0 -0
  194. data/test/dummy/tmp/cache/assets/development/sprockets/ff3b0a569330823bd5599af14ee70cc8 +0 -0
  195. metadata +239 -222
  196. data/app/assets/stylesheets/carnival/noty_theme_default.css +0 -185
  197. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  198. data/test/dummy/tmp/cache/assets/development/sprockets/22e50c67b95bf23b653e7a6768d38749 +0 -0
  199. data/test/dummy/tmp/cache/assets/development/sprockets/2a4d4d7ea99972ea41453ec4e6bad058 +0 -0
  200. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  201. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  202. data/test/dummy/tmp/cache/assets/development/sprockets/58ce7bbd3c0d5ae2c59e5fcd6692d8ce +0 -0
  203. data/test/dummy/tmp/cache/assets/development/sprockets/7e60927c780355f751c11cc4581b0c51 +0 -0
  204. data/test/dummy/tmp/cache/assets/development/sprockets/84e6a879569ca7546a93558488a6ff70 +0 -0
  205. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  206. data/test/dummy/tmp/cache/assets/development/sprockets/d2ea65cc83e604dee36a5316b567e3e2 +0 -0
  207. data/test/dummy/tmp/cache/assets/development/sprockets/d554039ac665d1a72c5af06725134a59 +0 -0
  208. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  209. data/test/dummy/tmp/cache/assets/development/sprockets/eed84a44f4e3915a39ea98ce25dc2570 +0 -0
  210. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
@@ -0,0 +1,5 @@
1
+ - @options.each do |option|
2
+ - if option[0].to_s.empty? and option[1].to_s.empty?
3
+ %option= I18n.t("messages.select")
4
+ - else
5
+ %option{value: option[0]}= option[1]
@@ -1,6 +1,6 @@
1
1
  - index_path = caminho_modelo(:index)
2
2
  .gray_border.with_margin_bottom
3
- %h1= t("#{@model_presenter.model_name}.editar.novo")
3
+ %h1= t("#{@model_presenter.model_name}.new", default: t('carnival.new'))
4
4
  .action_back
5
5
  - # TODO add buttons to the form in presenter
6
6
  = link_to t('back'), index_path, class: 'back_link' if @model_presenter
@@ -1,7 +1,7 @@
1
1
  - index_path = caminho_modelo(:index)
2
2
  - item = instance_variable_get("@#{@model_presenter.model_name}")
3
3
  .gray_border.with_margin_bottom
4
- %h1= t("#{@model_presenter.model_name}.exibir")
4
+ %h1= t("#{@model_presenter.model_name}.show", default: t('carnival.show'))
5
5
  .action_back
6
6
  = link_to t('back'), index_path, class: 'back_link'
7
7
 
@@ -12,5 +12,8 @@
12
12
  .wrapper_show{class: "col-md-#{field.size}"}
13
13
  %label="#{t("activerecord.attributes.#{@model_presenter.full_model_name}.#{field.name}")}:"
14
14
  .value
15
- = field_to_show @model_presenter,field.name,item
15
+ - if show_as_list @model_presenter,field.name
16
+ = render 'carnival/shared/show/show_as_list', items: item.send(field.name.to_s)
17
+ - else
18
+ = field_to_show @model_presenter,field.name,item
16
19
 
@@ -1,3 +1,3 @@
1
1
  - presenter.actions_for_record.each do |key, action|
2
- = render action.partial, :path => action.path(:id => record.id), :label => t("#{presenter.model_name}.#{action.name}")
2
+ = render action.partial, :path => action.path(:id => record.id), :label => t("#{presenter.model_name}.#{action.name}", default: t("carnival.#{action.name}"))
3
3
 
@@ -4,5 +4,13 @@
4
4
  - options[:as] = :admin_relationship_select if current_type == :relation
5
5
  - options[:as] = :admin_date if current_type == :date
6
6
  - options[:as] = field.as if field.as.present?
7
-
7
+ - options[:input_html] = {}
8
+ - options[:input_html][:class] = "field-#{field.name}"
9
+ - options[:input_html][:data] = {}
10
+ - if field.depends_on.present?
11
+ - options[:input_html][:data][:depends_on] = field.depends_on
12
+ :javascript
13
+ $(".field-#{field.depends_on}").change(function(event, element){
14
+ updateDependentFormSelectHtml(element.selected, $(this).attr("name").match( /\[(.*)\]/)[1], $($(".field-#{field.name}").first()).attr("name").match( /\[(.*)\]/)[1]);
15
+ });
8
16
  = f.input field.name, options
@@ -0,0 +1,29 @@
1
+ - options = {wrapper_html: {class: "col-md-#{field.size}"}}
2
+ - current_type = field_type(model_presenter,field.name)
3
+ <<<<<<< HEAD
4
+ - if current_type == :has_one_relation
5
+ = ''
6
+ - else
7
+ - options[:as] = :admin_enum if current_type == :enum
8
+ - if current_type == :relation
9
+ - options[:as] = :admin_relationship_select
10
+ - options[:as] = :admin_date if current_type == :date
11
+ - options[:as] = field.as if field.as.present?
12
+
13
+ = f.input field.name, options
14
+ =======
15
+ - options[:as] = :admin_enum if current_type == :enum
16
+ - options[:as] = :admin_relationship_select if current_type == :relation
17
+ - options[:as] = :admin_date if current_type == :date
18
+ - options[:as] = field.as if field.as.present?
19
+ - options[:input_html] = {}
20
+ - options[:input_html][:class] = "field-#{field.name}"
21
+ - options[:input_html][:data] = {}
22
+ - if field.depends_on.present?
23
+ - options[:input_html][:data][:depends_on] = field.depends_on
24
+ :javascript
25
+ $(".field-#{field.depends_on}").change(function(event, element){
26
+ updateDependentFormSelectHtml(element.selected, $(this).attr("name").match( /\[(.*)\]/)[1], $($(".field-#{field.name}").first()).attr("name").match( /\[(.*)\]/)[1]);
27
+ });
28
+ = f.input field.name, options
29
+ >>>>>>> master
@@ -29,7 +29,6 @@
29
29
  newForm = newForm.replace(/([_a-zA-Z]+\[[_a-zA-Z]+_attributes\]\[)\d+(\]\[[_a-zA-Z]+\])/g, "$1" + last_index + "$2");
30
30
  $(selector).append(newForm);
31
31
  $(selector).find("select").chosen();
32
- $(selector).find(".chosen-container").css({width:$(".chosen-container").parent().css("width")})
33
32
  }
34
33
 
35
34
  function getFormName(element){
@@ -39,8 +38,7 @@
39
38
  }
40
39
 
41
40
  function removeNestedFormElement(element){
42
- $(element).parent().parent().hide();
43
- $(element).parent().parent().find(".destroy").val(true);
41
+ $(element).parent().parent().remove();
44
42
  }
45
43
 
46
44
  function toggleNestedForm(element){
@@ -55,3 +53,66 @@
55
53
  function renderSelectOptions(selector){
56
54
  $(selector).show();
57
55
  }
56
+ function removeRelationOption(id, selectId){
57
+ $('#'+id+'_options').hide();
58
+ $('#'+id).attr('checked', false);
59
+ $('#'+id+'_select_option').prop('disabled', false);
60
+ $('#'+selectId).trigger("chosen:updated");
61
+ }
62
+
63
+ function addOption(selectId){
64
+ var option = $('#'+selectId).val();
65
+ if(option == -1)
66
+ return;
67
+ $('#'+option+'_options').show();
68
+ $('#'+option).prop('checked', true);
69
+ $('#'+option+'_select_option').prop('disabled', true);
70
+ $('#'+selectId).val(-1);
71
+ $('#'+selectId).trigger("chosen:updated");
72
+ }
73
+
74
+ function getNestedFormOptions(params){
75
+ $('#nested_form_options_'+params['field_name']).html();
76
+ var elemId = params['scope_html_id'];
77
+ var scopeValue = $('#'+elemId).val();
78
+
79
+ var key = params['scope_name'];
80
+ params['carnival_list_scope'] = {};
81
+ params['carnival_list_scope'][key] = scopeValue;
82
+
83
+ $.ajax({
84
+ url: params['url'],
85
+ data: params,
86
+ success: function(data){
87
+ $('#nested_form_options_'+params['field_name']).html(data.template);
88
+ var $select = $('#nested_form_options_'+params['field_name']).find('select');
89
+ updateNestedFormSelectHtml($select, params['has_new_action']);
90
+ }
91
+ });
92
+ }
93
+
94
+ function updateDependentFormSelectHtml(value, field, dependentField){
95
+ if(value != ""){
96
+ $.ajax("#{model_presenter.load_dependent_select_options_path}/#{model_presenter.presenter_name}/" + dependentField + "/" + field + "/" + value)
97
+ .done(function(data){
98
+ var selector = ".field-" + dependentField.replace("_id", "");
99
+ $(selector).html(data);
100
+ $(selector).trigger("chosen:updated");
101
+ })
102
+ .error(function(err, data){
103
+ console.log("updateDependentFormSelectHtml ajax error " + err);
104
+ });
105
+ }
106
+ }
107
+
108
+ function updateNestedFormSelectHtml($select, hasNewAction){
109
+ $select.css({width: $select.parent().css("width")})
110
+ if(!hasNewAction)
111
+ return;
112
+ $select.chosen(
113
+ {
114
+ create_option_text: 'Criar',
115
+ create_option: function(){createNewForm('.nested-form-list.'+params['field_name'], params['field_name'])}
116
+ });
117
+ }
118
+
@@ -8,41 +8,7 @@
8
8
  - line.each do |field|
9
9
  - nested_in = nil unless nested_in
10
10
  - if field.nested_form?
11
- .nested-form{:class => field.name}
12
-
13
- %h3.nested-form-title
14
- = t("activerecord.attributes.#{@model_presenter.full_model_name}.#{field.name}")
15
- .nested-form-actions
16
- = link_to_function t("nested_form.close"), "toggleNestedForm(this);"
17
-
18
- - if field.nested_form_modes?(:new)
19
- = " | "
20
- = link_to_function t("nested_form.new"), "createNewForm('.nested-form-list.#{field.name}', '#{field.name}')"
21
-
22
- - if field.nested_form_modes?(:associate)
23
- = " | "
24
- = link_to_function t("nested_form.existing_option"), "renderSelectOptions('.existing-options.#{field.name}')"
25
-
26
- - if field.nested_form_modes?(:associate)
27
- .existing-options{:class => field.name}
28
- %h4.existing-options-title
29
- = t("nested_form.existing_option_title")
30
- - field_presenter = model_presenter.presenter_to_field(field, nil)
31
- = f.collection_check_boxes "#{field.name.singularize.to_sym}_ids".to_sym, field_presenter.model_class.list_for_checkbox, :first, :last
32
-
33
- - if field.nested_form_modes?(:new)
34
- %ul.nested-form-list{:class => field.name}
35
- %h4.nested-form-subtitle
36
- = t("nested_form.new_subtitle")
37
- - model_object.send(field.name).build
38
- = f.simple_fields_for field.name.to_sym do |inner_form|
39
- %li.nested-form-list-item{:class => "#{inner_form.object.id.nil? and inner_form.object.errors.size == 0 ? 'form-new-association' : 'form-existent-association'}" }
40
- .nested-form-list-item-actions
41
- = link_to_function t("remove"), "removeNestedFormElement(this);" if field.nested_form_allow_destroy?
42
- = inner_form.input :id, :as => :hidden
43
- = inner_form.input :_destroy, :as => :hidden, :input_html => {:class => "destroy"} if field.nested_form_allow_destroy?
44
- - nested_presenter = model_presenter.presenter_to_field(field, inner_form.object)
45
- = render '/carnival/shared/form/inner_form', button: t('update'), model_object: inner_form.object, model_presenter: nested_presenter, :nested_in => model_object, :f => inner_form, :action => action
11
+ = render "/carnival/shared/form/nested_form", f: f, field: field, model_presenter: model_presenter, model_object: model_object, action: action
46
12
  - else
47
13
  - if model_presenter.must_render_field?(nested_in, field, model_object)
48
14
  = render "/carnival/shared/form/field", f: f, field: field, model_presenter: model_presenter
@@ -0,0 +1,20 @@
1
+ .nested-form{:class => field.name}
2
+ %label.nested-form-title
3
+ = t("activerecord.attributes.#{@model_presenter.full_model_name}.#{field.name}")
4
+
5
+ - opt = Carnival::NestedFormOptions.new model_object, model_presenter, field
6
+ .nested_form_options_div{id: "nested_form_options_#{field.name}"}
7
+ = render '/carnival/shared/form/nested_form_options', opt_obj: opt
8
+
9
+ - if field.nested_form_modes?(:new)
10
+ %ul.nested-form-list{:class => field.name}
11
+ - model_presenter.build_relation_field(field, model_object)
12
+ = f.simple_fields_for field.name.to_sym do |inner_form|
13
+ - if inner_form.object.id.nil? and inner_form.object.errors.size == 0
14
+ %li.nested-form-list-item{:class => "#{inner_form.object.id.nil? and inner_form.object.errors.size == 0 ? 'form-new-association' : 'form-existent-association'}" }
15
+ .nested-form-list-item-actions
16
+ = link_to_function t("remove"), "removeNestedFormElement(this);" if field.nested_form_allow_destroy?
17
+ = inner_form.input :id, :as => :hidden
18
+ = inner_form.input :_destroy, :as => :hidden, :input_html => {:class => "destroy"} if field.nested_form_allow_destroy?
19
+ - nested_presenter = model_presenter.presenter_to_field(field, inner_form.object)
20
+ = render '/carnival/shared/form/inner_form', button: t('update'), model_object: inner_form.object, model_presenter: nested_presenter, :nested_in => model_object, :f => inner_form, :action => action
@@ -0,0 +1,29 @@
1
+ .carnival-select-options
2
+ - if opt_obj.field.nested_form_modes?(:associate)
3
+ - scope_html_id = opt_obj.scope_html_id
4
+
5
+ .carnival-select-tag
6
+ = select_tag opt_obj.select_tag_id, options_for_select(opt_obj.select_options), {:onchange => 'addOption("'+opt_obj.select_tag_id+'")'}
7
+ .carnival-select-action
8
+ - if opt_obj.has_new_action?
9
+ = link_to_function t("nested_form.new"), "createNewForm('.nested-form-list.#{opt_obj.field_name}', '#{opt_obj.field_name}')"
10
+
11
+ - if scope_html_id.present?
12
+ :javascript
13
+ $('##{opt_obj.scope_html_id}').change(function(){#{opt_obj.scopeJSFunction}});
14
+ $(document).ready(function(){
15
+ updateNestedFormSelectHtml($('##{opt_obj.select_tag_id}'), #{opt_obj.has_new_action?});
16
+ });
17
+
18
+ - else
19
+ = link_to_function t("nested_form.new"), "createNewForm('.nested-form-list.#{opt_obj.field_name}', '#{opt_obj.field_name}')"
20
+
21
+ .carnival-form-options
22
+ - checkbox_id = opt_obj.option_id OpenStruct.new(id: '')
23
+ = check_box_tag opt_obj.option_name, '',true, id: checkbox_id, style: "display: none;"
24
+ - opt_obj.available_options.each do |item|
25
+ - checkbox_id = opt_obj.option_id item
26
+ .carnival-form-options{id: "#{checkbox_id}_options", class: opt_obj.option_css_class(item) }
27
+ %span
28
+ = check_box_tag opt_obj.option_name, item.id, opt_obj.model_has_this_item?(item.id), id: checkbox_id, onclick: 'removeRelationOption("'+checkbox_id+'", "'+opt_obj.select_tag_id+'")'
29
+ = item.to_label
@@ -0,0 +1,4 @@
1
+ %ul
2
+ - items.each do |item|
3
+ %li
4
+ = item.to_label
@@ -18,11 +18,12 @@
18
18
  - menus.delete :admin
19
19
  - menus.each do |key, menu|
20
20
  %li{:class =>menu[:class]}
21
- = link_to t(menu[:label]), menu[:link], {:class => " btn_usuario sublevel"}
22
- %ul.dropdown_main_menu_sublevel
23
- - menu[:subs].each do |sub|
24
- %li
25
- = link_to t(sub[:label]), sub[:link], {:class => "#{set_resource_actived_if_current(sub[:link])} #{sub[:class]}"}
21
+ = link_to t(menu[:label]), menu_link(menu[:link]), {:class => " btn_usuario sublevel"} unless menu[:link].nil?
22
+ - if menu[:subs].present?
23
+ %ul.dropdown_main_menu_sublevel
24
+ - menu[:subs].each do |sub|
25
+ %li
26
+ = link_to t(sub[:label]), menu_link(sub[:link]), {:class => "#{set_resource_actived_if_current(sub[:link])} #{sub[:class]}"}
26
27
 
27
28
  %li.minify
28
29
  %span="Minimizar"
@@ -1,11 +1,20 @@
1
1
  pt-BR:
2
+
3
+ carnival:
4
+ show: Visualizar
5
+ new: Novo
6
+ edit: Editar
7
+ destroy: Apagar
8
+
2
9
  nested_form:
3
10
  open: Abrir
4
11
  close: Fechar
5
- new: Criar
12
+ new: Criar Novo
13
+ add_option: Adicionar
6
14
  new_subtitle: Novos
7
15
  existing_option: Opções Existentes
8
16
  existing_option_title: Opções
17
+ choose_an_option: Escolha uma opção
9
18
 
10
19
  menu:
11
20
  dashboard: Dashboard
@@ -83,7 +92,6 @@ pt-BR:
83
92
  last_year: Ano passado
84
93
 
85
94
 
86
-
87
95
  # formatos de data e hora
88
96
  date:
89
97
  formats:
@@ -193,10 +201,6 @@ pt-BR:
193
201
 
194
202
  admin_user:
195
203
  name: Nome
196
- show: Visualizar
197
- destroy: Apagar
198
- edit: Editando usuário administrador
199
- new: Novo usuário administrador
200
204
  lista: Usuários administradores
201
205
  admin: Administrador
202
206
  account_name: Contaform
@@ -10,4 +10,8 @@ require "carnival/config"
10
10
  require "carnival/routes"
11
11
  require "carnival/version"
12
12
  module Carnival
13
+
14
+ def self.configure
15
+ yield(Carnival::Config)
16
+ end
13
17
  end
@@ -1,12 +1,14 @@
1
1
  module Carnival
2
2
 
3
3
  class Config
4
- mattr_accessor :menu, :devise_config, :omniauth, :omniauth_providers, :custom_css_files, :custom_javascript_files
4
+ mattr_accessor :menu, :devise_config, :omniauth, :omniauth_providers, :custom_css_files, :custom_javascript_files, :ar_admin_user_class, :root_action
5
5
  @@menu
6
6
  @@devise_config
7
7
  @@omniauth
8
8
  @@omniauth_providers
9
9
  @@custom_css_files = []
10
10
  @@custom_javascript_files = []
11
+ @@ar_admin_user_class = ActiveRecord::Base
12
+ @@root_action = "carnival/admin_users#index"
11
13
  end
12
14
  end
@@ -2,6 +2,7 @@ module ActionDispatch::Routing
2
2
  class Mapper
3
3
  def mount_carnival_at(mount_location)
4
4
  scope mount_location do
5
+ get "carnival-base/load_dependent_select_options/:presenter/:field/:dependency_field/:dependency_value" => 'carnival/base_admin#load_dependent_select_options', as: :load_dependent_select_options
5
6
  get "admin_user_notification/read/:id" => 'carnival/admin_user_notifications#read', as: :carnival_read_admin_user_notification
6
7
  resources :admin_user_notifications, controller: "carnival/admin_user_notifications", :as => :carnival_admin_user_notifications
7
8
  resources :admin_users, controller: "carnival/admin_users", :as => :carnival_admin_users
@@ -10,7 +11,7 @@ module ActionDispatch::Routing
10
11
  else
11
12
  devise_for :admin_users, :class_name => "Carnival::AdminUser", :path => "sessions", :controllers => { :sessions => "carnival/sessions"}
12
13
  end
13
- root to: "carnival/admin_users#index", :as => :admin_root
14
+ root to: Carnival::Config.root_action, :as => :admin_root
14
15
  end
15
16
  end
16
17
  end
@@ -1,3 +1,3 @@
1
1
  module Carnival
2
- VERSION = "0.0.55"
2
+ VERSION = "0.0.56"
3
3
  end
@@ -0,0 +1,7 @@
1
+ module Carnival
2
+ <<<<<<< HEAD
3
+ VERSION = "0.1.0"
4
+ =======
5
+ VERSION = "0.0.57"
6
+ >>>>>>> master
7
+ end
@@ -1,52 +1,63 @@
1
- Carnival::Config.menu = {
2
- :admin => {
3
- :label => "aaa",
4
- :class => "ssss",
5
- :link => "ddd",
6
- :subs => [
7
- {
8
- :label => "menu.testes",
9
- :class => "tst",
10
- :link => "/admin/testes"
11
- },
12
- {
13
- :label => "55555",
14
- :class => "66666",
15
- :link => "777777"
16
- }
17
- ]
18
- },
19
- :locations => {
20
- :label => "menu.locations",
21
- :class => "",
22
- :link => "#",
23
- :subs => [
24
- {
25
- :label => "menu.countries",
26
- :class => "countries",
27
- :link => "/admin/countries"
28
- },
29
- {
30
- :label => "menu.states",
31
- :class => "states",
32
- :link => "/admin/states"
33
- },
34
- {
35
- :label => "menu.cities",
36
- :class => "cities",
37
- :link => "/admin/cities"
38
- }
39
- ]
40
- }
41
- }
42
- Carnival::Config.devise_config = :registerable, :recoverable, :rememberable, :trackable, :validatable,
43
- :omniauthable
1
+ Carnival.configure |config| do
2
+ config.menu =
3
+ {
4
+ :admin => {
5
+ :label => "aaa",
6
+ :class => "ssss",
7
+ :link => "ddd",
8
+ :subs => [
9
+ {
10
+ :label => "menu.testes",
11
+ :class => "tst",
12
+ :link => "/admin/testes"
13
+ },
14
+ {
15
+ :label => "55555",
16
+ :class => "66666",
17
+ :link => "777777"
18
+ }
19
+ ]
20
+ },
21
+ :locations => {
22
+ :label => "menu.locations",
23
+ :class => "",
24
+ :link => "#",
25
+ :subs => [
26
+ {
27
+ :label => "menu.countries",
28
+ :class => "countries",
29
+ :link => "/admin/countries"
30
+ },
31
+ {
32
+ :label => "menu.states",
33
+ :class => "states",
34
+ :link => "/admin/states"
35
+ },
36
+ {
37
+ :label => "menu.cities",
38
+ :class => "cities",
39
+ :link => "/admin/cities"
40
+ }
41
+ ]
42
+ }
43
+ }
44
+ config.devise_config = :registerable, :recoverable, :rememberable, :trackable, :validatable,
45
+ :omniauthable
44
46
 
45
- Carnival::Config.omniauth_providers = [:facebook, :google_oauth2]
47
+ config.omniauth_providers = [:facebook, :google_oauth2]
46
48
 
47
- Carnival::Config.omniauth = {facebook: ["324810390938005", "3c16625e74189a3708cc586dc050a6b2"],
48
- google_oauth2: ['431077382019-mumumjahr5cn6cooubtskc6ohael7923.apps.googleusercontent.com', 'ilH4B-KXN3tqG6qF9gGN1F_J']}
49
+ config.omniauth = {facebook: ["324810390938005", "3c16625e74189a3708cc586dc050a6b2"],
50
+ google_oauth2: ['431077382019-mumumjahr5cn6cooubtskc6ohael7923.apps.googleusercontent.com', 'ilH4B-KXN3tqG6qF9gGN1F_J']}
49
51
 
50
- Carnival::Config.custom_css_files = ["samplefile.css"]
52
+ # Custom CSS Files
53
+ # config.custom_css_files = ["samplefile.css"]
51
54
 
52
- Carnival::Config.custom_javascript_files = ["samplefile.js"]
55
+ # Custom Javascript Files
56
+ # config.custom_javascript_files = ["samplefile.js"]
57
+
58
+ # Determine the super class of AdminUser
59
+ #config.ar_admin_user_class = ActiveRecord::Base
60
+
61
+ # Determine root action
62
+ #config.root_action = 'carnival/admin_users#index'
63
+ end