rails_admin 0.4.9 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails_admin might be problematic. Click here for more details.

Files changed (281) hide show
  1. data.tar.gz.sig +0 -0
  2. data/Gemfile +10 -9
  3. data/README.md +9 -0
  4. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +3 -3
  5. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +1 -1
  6. data/app/assets/javascripts/rails_admin/ra.remote-form.js +1 -1
  7. data/app/assets/javascripts/rails_admin/ra.widgets.coffee +28 -26
  8. data/app/helpers/rails_admin/application_helper.rb +2 -2
  9. data/app/views/rails_admin/main/_form_ck_editor.html.haml +10 -0
  10. data/app/views/rails_admin/main/_form_code_mirror.html.haml +9 -0
  11. data/app/views/rails_admin/main/_form_text.html.haml +1 -31
  12. data/app/views/rails_admin/main/_form_wysihtml5.html.haml +8 -0
  13. data/lib/generators/rails_admin/install_generator.rb +40 -31
  14. data/lib/generators/rails_admin/templates/initializer.erb +2 -2
  15. data/lib/rails_admin/abstract_model.rb +1 -1
  16. data/lib/rails_admin/adapters/active_record.rb +21 -17
  17. data/lib/rails_admin/adapters/active_record/abstract_object.rb +1 -1
  18. data/lib/rails_admin/adapters/mongoid.rb +1 -0
  19. data/lib/rails_admin/config.rb +2 -2
  20. data/lib/rails_admin/config/configurable.rb +13 -5
  21. data/lib/rails_admin/config/fields/base.rb +1 -25
  22. data/lib/rails_admin/config/fields/factories/enum.rb +8 -1
  23. data/lib/rails_admin/config/fields/types/all.rb +4 -1
  24. data/lib/rails_admin/config/fields/types/ck_editor.rb +45 -0
  25. data/lib/rails_admin/config/fields/types/code_mirror.rb +55 -0
  26. data/lib/rails_admin/config/fields/types/serialized.rb +1 -1
  27. data/lib/rails_admin/config/fields/types/text.rb +12 -66
  28. data/lib/rails_admin/config/fields/types/wysihtml5.rb +44 -0
  29. data/lib/rails_admin/config/model.rb +1 -1
  30. data/lib/rails_admin/extensions/history/history.rb +4 -2
  31. data/lib/rails_admin/version.rb +2 -2
  32. data/spec/controllers/rails_admin/main_controller_spec.rb +21 -0
  33. data/spec/dummy_app/Gemfile +11 -10
  34. data/spec/dummy_app/app/active_record/another_field_test.rb +0 -1
  35. data/spec/dummy_app/app/active_record/ball.rb +0 -2
  36. data/spec/dummy_app/app/active_record/category.rb +0 -2
  37. data/spec/dummy_app/app/active_record/cms/basic_page.rb +0 -2
  38. data/spec/dummy_app/app/active_record/comment.rb +0 -2
  39. data/spec/dummy_app/app/active_record/comment/confirmed.rb +1 -1
  40. data/spec/dummy_app/app/active_record/division.rb +0 -2
  41. data/spec/dummy_app/app/active_record/draft.rb +0 -2
  42. data/spec/dummy_app/app/active_record/fan.rb +0 -2
  43. data/spec/dummy_app/app/active_record/field_test.rb +0 -5
  44. data/spec/dummy_app/app/active_record/image.rb +0 -2
  45. data/spec/dummy_app/app/active_record/league.rb +1 -3
  46. data/spec/dummy_app/app/active_record/nested_field_test.rb +0 -2
  47. data/spec/dummy_app/app/active_record/player.rb +0 -3
  48. data/spec/dummy_app/app/active_record/team.rb +1 -4
  49. data/spec/dummy_app/app/active_record/user.rb +0 -4
  50. data/spec/dummy_app/app/mongoid/another_field_test.rb +0 -1
  51. data/spec/dummy_app/app/mongoid/ball.rb +0 -2
  52. data/spec/dummy_app/app/mongoid/category.rb +0 -2
  53. data/spec/dummy_app/app/mongoid/cms/basic_page.rb +0 -2
  54. data/spec/dummy_app/app/mongoid/comment.rb +0 -2
  55. data/spec/dummy_app/app/mongoid/division.rb +0 -2
  56. data/spec/dummy_app/app/mongoid/draft.rb +0 -2
  57. data/spec/dummy_app/app/mongoid/fan.rb +0 -2
  58. data/spec/dummy_app/app/mongoid/field_test.rb +1 -5
  59. data/spec/dummy_app/app/mongoid/image.rb +0 -2
  60. data/spec/dummy_app/app/mongoid/league.rb +0 -2
  61. data/spec/dummy_app/app/mongoid/nested_field_test.rb +0 -2
  62. data/spec/dummy_app/app/mongoid/player.rb +1 -3
  63. data/spec/dummy_app/app/mongoid/team.rb +0 -2
  64. data/spec/dummy_app/app/mongoid/user.rb +1 -2
  65. data/spec/dummy_app/config/application.rb +0 -7
  66. data/spec/dummy_app/config/environments/development.rb +1 -7
  67. data/spec/dummy_app/config/environments/test.rb +2 -4
  68. data/spec/dummy_app/config/initializers/secret_token.rb +1 -0
  69. data/spec/dummy_app/config/routes.rb +2 -2
  70. data/spec/dummy_app/db/test.sqlite3 +0 -0
  71. data/spec/dummy_app/db/test.sqlite3-journal +0 -0
  72. data/spec/dummy_app/log/test.log +1423 -0
  73. data/spec/dummy_app/tmp/cache/assets/test/sass/0759f2828afb668a39de3ede4887b369780cdb28/jquery-ui-1.8.7.custom.scssc +0 -0
  74. data/spec/dummy_app/tmp/cache/assets/test/sass/1de49575831c79805eaa5ca759c4aae181c38254/mixins.scssc +0 -0
  75. data/spec/dummy_app/tmp/cache/assets/test/sass/1de49575831c79805eaa5ca759c4aae181c38254/theming.scssc +0 -0
  76. data/spec/dummy_app/tmp/cache/assets/test/sass/1de49575831c79805eaa5ca759c4aae181c38254/variables.scssc +0 -0
  77. data/spec/dummy_app/tmp/cache/assets/test/sass/50e4466efc3255401f37f709f5f338668408ef71/mixins.scssc +0 -0
  78. data/spec/dummy_app/tmp/cache/assets/test/sass/50e4466efc3255401f37f709f5f338668408ef71/theming.scssc +0 -0
  79. data/spec/dummy_app/tmp/cache/assets/test/sass/50e4466efc3255401f37f709f5f338668408ef71/variables.scssc +0 -0
  80. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/jquery.colorpicker.scssc +0 -0
  81. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/jquery.ui.timepicker.scssc +0 -0
  82. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/ra.calendar-additions.scssc +0 -0
  83. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/ra.filtering-multiselect.scssc +0 -0
  84. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/ra.widgets.scssc +0 -0
  85. data/spec/dummy_app/tmp/cache/assets/test/sass/60ddb7b14935cbd11f83ec188b4bb1d618ec996f/rails_admin.scss.erbc +0 -0
  86. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_accordion.scssc +0 -0
  87. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_alerts.scssc +0 -0
  88. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_breadcrumbs.scssc +0 -0
  89. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_button-groups.scssc +0 -0
  90. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_buttons.scssc +0 -0
  91. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_carousel.scssc +0 -0
  92. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_close.scssc +0 -0
  93. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_component-animations.scssc +0 -0
  94. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_dropdowns.scssc +0 -0
  95. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_forms.scssc +0 -0
  96. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_grid.scssc +0 -0
  97. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_hero-unit.scssc +0 -0
  98. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_labels-badges.scssc +0 -0
  99. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_layouts.scssc +0 -0
  100. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_mixins.scssc +0 -0
  101. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_modals.scssc +0 -0
  102. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_navbar.scssc +0 -0
  103. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_navs.scssc +0 -0
  104. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_pager.scssc +0 -0
  105. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_pagination.scssc +0 -0
  106. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_popovers.scssc +0 -0
  107. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_progress-bars.scssc +0 -0
  108. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_reset.scssc +0 -0
  109. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_scaffolding.scssc +0 -0
  110. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_tables.scssc +0 -0
  111. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_thumbnails.scssc +0 -0
  112. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_tooltip.scssc +0 -0
  113. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_type.scssc +0 -0
  114. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_utilities.scssc +0 -0
  115. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_variables.scssc +0 -0
  116. data/spec/dummy_app/tmp/cache/assets/test/sass/6f29b1fe98624195dbac940d9b40236b6dc877d3/_wells.scssc +0 -0
  117. data/spec/dummy_app/tmp/cache/assets/test/sass/7e38bdfe3aa21a76da53ed64003686502baf8110/font-awesome.css.erbc +0 -0
  118. data/spec/dummy_app/tmp/cache/assets/test/sass/e307626ae1f1da10c3b3073e0db008ce0a7bb251/mixins.scssc +0 -0
  119. data/spec/dummy_app/tmp/cache/assets/test/sass/e307626ae1f1da10c3b3073e0db008ce0a7bb251/theming.scssc +0 -0
  120. data/spec/dummy_app/tmp/cache/assets/test/sass/e307626ae1f1da10c3b3073e0db008ce0a7bb251/variables.scssc +0 -0
  121. data/spec/dummy_app/tmp/cache/assets/test/sprockets/039a5bf66d220fc450725c31951c0003 +0 -0
  122. data/spec/dummy_app/tmp/cache/assets/test/sprockets/04fc3904edb99236187355cbb911f89e +0 -0
  123. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0602c18d49d9162a4115f24689044530 +0 -0
  124. data/spec/dummy_app/tmp/cache/assets/test/sprockets/07a77b4186e7385aa93ee9817d30976d +0 -0
  125. data/spec/dummy_app/tmp/cache/assets/test/sprockets/09b197beb54130b951fd00df7b3e2ebb +0 -0
  126. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0c53bdcb904e01bc3006dea06a984620 +0 -0
  127. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0cf66ef0545ef4a25158b64a8a63acc0 +0 -0
  128. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0dcf1b67fc7a00043acda5614e28621a +0 -0
  129. data/spec/dummy_app/tmp/cache/assets/test/sprockets/0ed5cf232eb4a060d90fa60242ec82eb +0 -0
  130. data/spec/dummy_app/tmp/cache/assets/test/sprockets/104cf49747acce2cd760bde221916757 +0 -0
  131. data/spec/dummy_app/tmp/cache/assets/test/sprockets/11336ccd98408f1d60bc4f137dd6d513 +0 -0
  132. data/spec/dummy_app/tmp/cache/assets/test/sprockets/129ab684736012c224b424a9202c4077 +0 -0
  133. data/spec/dummy_app/tmp/cache/assets/test/sprockets/13c5851787eee7ea1dbb6771daf38754 +0 -0
  134. data/spec/dummy_app/tmp/cache/assets/test/sprockets/148bf2b1fa2b1c501e534d8019e35550 +0 -0
  135. data/spec/dummy_app/tmp/cache/assets/test/sprockets/17805e3468eb563f81855f6ac93ac7de +0 -0
  136. data/spec/dummy_app/tmp/cache/assets/test/sprockets/196f8e4aff622708f7a2060b98fa730a +0 -0
  137. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1a1d73dd5f0ac320b3a8952b0e6669f5 +0 -0
  138. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1a5c2589d7a73ca326745770ec8c3a68 +0 -0
  139. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1b1d3f4fa8e1243fb66271b20233d01b +0 -0
  140. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1ca1a15643004e8daee77e762149bfe6 +0 -0
  141. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1cb0bbe35ef01a226fef698f0a9277d2 +0 -0
  142. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1d635e9b0475899eec5bce058b6d48b4 +0 -0
  143. data/spec/dummy_app/tmp/cache/assets/test/sprockets/1e097efcd1115a58473612106f20aad2 +0 -0
  144. data/spec/dummy_app/tmp/cache/assets/test/sprockets/2047e1449cbcbd8331c15e05c33f006a +0 -0
  145. data/spec/dummy_app/tmp/cache/assets/test/sprockets/2740e776eb74b1103220f4a3bf76e55d +0 -0
  146. data/spec/dummy_app/tmp/cache/assets/test/sprockets/281a64929dab11d3635bdd9ff39fe31c +0 -0
  147. data/spec/dummy_app/tmp/cache/assets/test/sprockets/28549a2080576826cd4de9ce7ed8d69f +0 -0
  148. data/spec/dummy_app/tmp/cache/assets/test/sprockets/2e1c59996da5739b76e5ed290e16e4b8 +0 -0
  149. data/spec/dummy_app/tmp/cache/assets/test/sprockets/308e53bfc20ae7fe1c148e8cd4795184 +0 -0
  150. data/spec/dummy_app/tmp/cache/assets/test/sprockets/30d3cccc8e819bfc42faebbae2132106 +0 -0
  151. data/spec/dummy_app/tmp/cache/assets/test/sprockets/349b83b5f7fc156a7865362b50c8a747 +0 -0
  152. data/spec/dummy_app/tmp/cache/assets/test/sprockets/352b668d5a833880cd46e68e87b61f83 +0 -0
  153. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3a44eeaaf1973955ec1385900f16e9b0 +0 -0
  154. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3b9145cad8e6cc05febf5b7ebfdc09b5 +0 -0
  155. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3ba0f5b2e3e94b6513f5136fa20e5a24 +0 -0
  156. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3bb982191028c492bec814ca36dda349 +0 -0
  157. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3e529508d6168a92db8f1706328dbd6b +0 -0
  158. data/spec/dummy_app/tmp/cache/assets/test/sprockets/3fea6c96d559fd56c796222c89bf4a55 +0 -0
  159. data/spec/dummy_app/tmp/cache/assets/test/sprockets/410492703e63dffa68a29af838226cc6 +0 -0
  160. data/spec/dummy_app/tmp/cache/assets/test/sprockets/433362a2fd8b9b7a80331d20cdfd84b6 +0 -0
  161. data/spec/dummy_app/tmp/cache/assets/test/sprockets/445343e680a88785242a2aa99d907216 +0 -0
  162. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4499a6f31ad672fb69537267becff285 +0 -0
  163. data/spec/dummy_app/tmp/cache/assets/test/sprockets/455dc61be5289cb0a50fc650c4a27b01 +0 -0
  164. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4563ab77d6c769264c70b904c4ca2b37 +0 -0
  165. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4c501e79458ca87b9b7964a3656cad68 +0 -0
  166. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4f49294c06a799e1c063a1ccf100860c +0 -0
  167. data/spec/dummy_app/tmp/cache/assets/test/sprockets/4fd99da81590fb27074904dd2d4b0afe +0 -0
  168. data/spec/dummy_app/tmp/cache/assets/test/sprockets/54a5de7c79d8407342c31af3d5eb31f6 +0 -0
  169. data/spec/dummy_app/tmp/cache/assets/test/sprockets/5507d3ba3736f304240090662413733a +0 -0
  170. data/spec/dummy_app/tmp/cache/assets/test/sprockets/585bed8595e5e9d8e5e1a680ac20f005 +0 -0
  171. data/spec/dummy_app/tmp/cache/assets/test/sprockets/5c0be9a39a450f2b191275d281ff50d8 +0 -0
  172. data/spec/dummy_app/tmp/cache/assets/test/sprockets/5eab397d2a4b6ca7b0084107e4acc0d9 +0 -0
  173. data/spec/dummy_app/tmp/cache/assets/test/sprockets/5eae694e8713be9376531ee73716b107 +0 -0
  174. data/spec/dummy_app/tmp/cache/assets/test/sprockets/6012dbf768041ff3d9566cd00e6ad0e6 +0 -0
  175. data/spec/dummy_app/tmp/cache/assets/test/sprockets/61077cb42651197ce0d00d267f8cb157 +0 -0
  176. data/spec/dummy_app/tmp/cache/assets/test/sprockets/627a45561b3d1ecbd1a1f4850208503a +0 -0
  177. data/spec/dummy_app/tmp/cache/assets/test/sprockets/642ea63365a0f33fb982cde355dbd952 +0 -0
  178. data/spec/dummy_app/tmp/cache/assets/test/sprockets/67c296751ce247c30402dd43b035c05b +0 -0
  179. data/spec/dummy_app/tmp/cache/assets/test/sprockets/689332efdfbf2cfa06d02d26a47d4332 +0 -0
  180. data/spec/dummy_app/tmp/cache/assets/test/sprockets/694afe79cc6e42a3e5436d282997ea79 +0 -0
  181. data/spec/dummy_app/tmp/cache/assets/test/sprockets/6c5729b427f229cad24067bfec82441d +0 -0
  182. data/spec/dummy_app/tmp/cache/assets/test/sprockets/6f0a4a833a1ce47d77ebbd71ae021a4d +0 -0
  183. data/spec/dummy_app/tmp/cache/assets/test/sprockets/702016a19f9bf693eec6930878077e4e +0 -0
  184. data/spec/dummy_app/tmp/cache/assets/test/sprockets/724ce3ff0aeb1174d3a8fddfe1335a79 +0 -0
  185. data/spec/dummy_app/tmp/cache/assets/test/sprockets/726abc48daa7878021ee1c34360918af +0 -0
  186. data/spec/dummy_app/tmp/cache/assets/test/sprockets/749c6e08a7826fd22d279405af87aaf1 +0 -0
  187. data/spec/dummy_app/tmp/cache/assets/test/sprockets/77ad5664cd45382abab39f19d032133d +0 -0
  188. data/spec/dummy_app/tmp/cache/assets/test/sprockets/785692dac9a319d2706bd96d7fb5999c +0 -0
  189. data/spec/dummy_app/tmp/cache/assets/test/sprockets/7cfceeccc9c61c03ad54298ce2472f45 +0 -0
  190. data/spec/dummy_app/tmp/cache/assets/test/sprockets/7e73c94fd43e4f8b82acfa085d8d5476 +0 -0
  191. data/spec/dummy_app/tmp/cache/assets/test/sprockets/801e4f782d10f5498b68113e6b2ac139 +0 -0
  192. data/spec/dummy_app/tmp/cache/assets/test/sprockets/822dbfd89b2b1243844e7c3a0ba001a7 +0 -0
  193. data/spec/dummy_app/tmp/cache/assets/test/sprockets/842ea8c5f8b0fdb4ef7472b189a76174 +0 -0
  194. data/spec/dummy_app/tmp/cache/assets/test/sprockets/84a6a7978131f4f8c46fe9c480634aab +0 -0
  195. data/spec/dummy_app/tmp/cache/assets/test/sprockets/84cb05237234ff279ad6c78ef3e8e823 +0 -0
  196. data/spec/dummy_app/tmp/cache/assets/test/sprockets/84f51912f02a7a1ff255ae491b3cc711 +0 -0
  197. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8605a56363a1d23fad98fbc6d9b3b047 +0 -0
  198. data/spec/dummy_app/tmp/cache/assets/test/sprockets/86120a9bdcdfa970f8dadae131a2e95e +0 -0
  199. data/spec/dummy_app/tmp/cache/assets/test/sprockets/88c829469780275b9c1714e2166e1ba4 +0 -0
  200. data/spec/dummy_app/tmp/cache/assets/test/sprockets/89ffe73975976a0200a923aa2e1e42fb +0 -0
  201. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8b0a8bf59842e1d4aaa787eff38e207f +0 -0
  202. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8b78cef60b108a16787f32ea26a792d0 +0 -0
  203. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8ddbd7ab77689f8ebb25c59de8152b5e +0 -0
  204. data/spec/dummy_app/tmp/cache/assets/test/sprockets/8f9bc2d4514893616bed6d6bf75dded1 +0 -0
  205. data/spec/dummy_app/tmp/cache/assets/test/sprockets/91cb85d19bf8e4ebba27ccf6ea318d9f +0 -0
  206. data/spec/dummy_app/tmp/cache/assets/test/sprockets/922df3fedca77782061a6d4a6029e7f1 +0 -0
  207. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9509bd192a75365a34a00b01e04b5ab4 +0 -0
  208. data/spec/dummy_app/tmp/cache/assets/test/sprockets/97cd44fc8e2b4f6acb0d912be738c90f +0 -0
  209. data/spec/dummy_app/tmp/cache/assets/test/sprockets/98a7dfb33d5879f166f1bf20c031e836 +0 -0
  210. data/spec/dummy_app/tmp/cache/assets/test/sprockets/98d49f7e1c1d73b97ac2937069e8f312 +0 -0
  211. data/spec/dummy_app/tmp/cache/assets/test/sprockets/99c1629b9f2827a9840fe8d230e2c5df +0 -0
  212. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9a451dac641c38ce41d5c1b73fb8de2a +0 -0
  213. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9ba5e11e725ed4a76f73bc3c43070fc9 +0 -0
  214. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9c332bf94ad0e3614abadfaf3aaf60b2 +0 -0
  215. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9cf969e4845d5a4d718d2e8bfd77101d +0 -0
  216. data/spec/dummy_app/tmp/cache/assets/test/sprockets/9f9d40e0ca625e92215807c7d36eeb45 +0 -0
  217. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a0d2eb8c9feccca7df34d40b8614a939 +0 -0
  218. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a1657b7bdf73ec95be9f0514ee2254a2 +0 -0
  219. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a1c38b062b4789cba43cfce569d89a4e +0 -0
  220. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a2346449005dbaa9093d8ba7ed2a5d47 +0 -0
  221. data/spec/dummy_app/tmp/cache/assets/test/sprockets/a86a829dee3d408be1e17d970ee388fa +0 -0
  222. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ab554675ca375fa03f104b42bd948fe5 +0 -0
  223. data/spec/dummy_app/tmp/cache/assets/test/sprockets/aded07271baf96cd6d24924ad93ec73d +0 -0
  224. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ae325bc4588e222725187e5daf205589 +0 -0
  225. data/spec/dummy_app/tmp/cache/assets/test/sprockets/af529b87b946c6e64306fcce7453083e +0 -0
  226. data/spec/dummy_app/tmp/cache/assets/test/sprockets/b4760047e80466e8355e67301426c1d1 +0 -0
  227. data/spec/dummy_app/tmp/cache/assets/test/sprockets/b845c9c605c0ac49de3fbbb504e230f7 +0 -0
  228. data/spec/dummy_app/tmp/cache/assets/test/sprockets/b85362aec4168f3dc8d2a98060ee48eb +0 -0
  229. data/spec/dummy_app/tmp/cache/assets/test/sprockets/bab7336757583f60e7daf1487188ed18 +0 -0
  230. data/spec/dummy_app/tmp/cache/assets/test/sprockets/bd0a6ea6e12c15771e7f2523a3aadc63 +0 -0
  231. data/spec/dummy_app/tmp/cache/assets/test/sprockets/be49600855e45c34cba5d2d6746e2358 +0 -0
  232. data/spec/dummy_app/tmp/cache/assets/test/sprockets/be9c7f67a4c4bccb12ebfde75deadf78 +0 -0
  233. data/spec/dummy_app/tmp/cache/assets/test/sprockets/bff19a6530ebd8793f533e767a24e36e +0 -0
  234. data/spec/dummy_app/tmp/cache/assets/test/sprockets/c3be8bc6957ae7e95fb42e95b69a28c4 +0 -0
  235. data/spec/dummy_app/tmp/cache/assets/test/sprockets/c5787e2ae92280dbccc527e55b11635e +0 -0
  236. data/spec/dummy_app/tmp/cache/assets/test/sprockets/c5d9cd7fa2cb7bfe369963b0196f7ff4 +0 -0
  237. data/spec/dummy_app/tmp/cache/assets/test/sprockets/cfbcfcb1da5d394fb109e81d39e78159 +0 -0
  238. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d07f5793bd18b01f933ddca0fe37250e +0 -0
  239. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d0a719959de8c62c5bd015cce560bc8a +0 -0
  240. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d4c23978dcf23280699067752b4d380d +0 -0
  241. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d4e3f96df2204b35a7e8350ecc41cdc7 +0 -0
  242. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d5d70fe44f0d681894cd75826cdaea12 +0 -0
  243. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d6a6297cee0fca1e5e0838f582d80ab2 +0 -0
  244. data/spec/dummy_app/tmp/cache/assets/test/sprockets/d9266b8e42d3f777dc223da809274b31 +0 -0
  245. data/spec/dummy_app/tmp/cache/assets/test/sprockets/db583f90e8ee3ef1d2f254872519e9c6 +0 -0
  246. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e4cc8214b21af79b430cd379aafeb4ce +0 -0
  247. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e4e7c80687aa50a6e2e4b7c79a145a0c +0 -0
  248. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e53e14c5fb50eb16744db14274a7eda8 +0 -0
  249. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e600b47ff99e3ad76cb108e6c312c5b5 +0 -0
  250. data/spec/dummy_app/tmp/cache/assets/test/sprockets/e8f7215dd1531e59847951a7383271c5 +0 -0
  251. data/spec/dummy_app/tmp/cache/assets/test/sprockets/eb6ed96d57beb3fd8059dc280a7c2cd7 +0 -0
  252. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ed5e8a35a505b86b4bf715b78391a870 +0 -0
  253. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ee5e4d214ffc908f50e0a637eed3b7b1 +0 -0
  254. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ef0431217a4bac4852ecc9987fd2629e +0 -0
  255. data/spec/dummy_app/tmp/cache/assets/test/sprockets/f28c745f4469bda7feb0e7b30c6a49ae +0 -0
  256. data/spec/dummy_app/tmp/cache/assets/test/sprockets/f43162a23f1a30e5baf49f543f72487d +0 -0
  257. data/spec/dummy_app/tmp/cache/assets/test/sprockets/f62c80206996d477a114b40987636c55 +0 -0
  258. data/spec/dummy_app/tmp/cache/assets/test/sprockets/f72d29b2f2b71e9f9f690a806f572e21 +0 -0
  259. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fa8aef4c90e0b7f97618ed51c78eb38a +0 -0
  260. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fb7856209a606e83084889ae67f02673 +0 -0
  261. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fb7a84e10813b0033c09263a0abf0fa3 +0 -0
  262. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fb94af8a31614a8efe49c2714a8f894e +0 -0
  263. data/spec/dummy_app/tmp/cache/assets/test/sprockets/fea0b3135fde8d44c3aaf052a21d28f8 +0 -0
  264. data/spec/dummy_app/tmp/cache/assets/test/sprockets/ff4c93f7f26410e737809fc8772ddc5c +0 -0
  265. data/spec/integration/authorization/cancan_spec.rb +8 -16
  266. data/spec/integration/basic/export/rails_admin_basic_export_spec.rb +1 -1
  267. data/spec/integration/config/edit/rails_admin_config_edit_spec.rb +9 -34
  268. data/spec/integration/config/show/rails_admin_config_show_spec.rb +1 -1
  269. data/spec/integration/rails_admin_spec.rb +2 -2
  270. data/spec/rails_admin/abstract_model_spec.rb +1 -1
  271. data/spec/rails_admin/adapters/active_record/abstract_object_spec.rb +5 -5
  272. data/spec/rails_admin/adapters/active_record_spec.rb +11 -9
  273. data/spec/rails_admin/adapters/mongoid_spec.rb +1 -1
  274. data/spec/rails_admin/config/fields/base_spec.rb +1 -48
  275. data/spec/rails_admin/config/fields/types/{text_spec.rb → ck_editor_spec.rb} +6 -3
  276. metadata +418 -46
  277. metadata.gz.sig +3 -2
  278. data/spec/dummy_app/app/active_record/cms/unscoped_page.rb +0 -3
  279. data/spec/dummy_app/app/mongoid/cms/unscoped_page.rb +0 -5
  280. data/spec/dummy_app/config/initializers/strong_parameters.rb +0 -2
  281. data/spec/dummy_app/db/migrate/20111103174459_create_unscoped_pages.rb +0 -9
data.tar.gz.sig CHANGED
Binary file
data/Gemfile CHANGED
@@ -10,15 +10,15 @@ group :active_record do
10
10
  gem 'activerecord-jdbcpostgresql-adapter', '>= 1.2'
11
11
  gem 'jdbc-postgres', '>= 9.2'
12
12
  else
13
- gem 'activerecord-jdbcsqlite3-adapter', '>= 1.2'
13
+ gem 'activerecord-jdbcsqlite3-adapter', '>= 1.3.0.beta1'
14
14
  gem 'jdbc-sqlite3', '>= 3.7'
15
15
  end
16
16
  end
17
17
 
18
18
  platforms :ruby, :mswin, :mingw do
19
19
  case ENV['CI_DB_ADAPTER']
20
- when 'mysql'
21
- gem 'mysql', '~> 2.8.1'
20
+ when 'mysql2'
21
+ gem 'mysql2', '~> 0.3.11'
22
22
  when 'postgresql'
23
23
  gem 'pg', '>= 0.14'
24
24
  else
@@ -28,9 +28,10 @@ group :active_record do
28
28
  end
29
29
 
30
30
  group :mongoid do
31
- gem 'mongoid', '>= 3.0'
31
+ gem 'mongoid', github: 'mongoid/mongoid'
32
32
  gem 'mongoid-paperclip', '>= 0.0.8', :require => 'mongoid_paperclip'
33
- gem 'carrierwave-mongoid', '>= 0.4', :require => 'carrierwave/mongoid'
33
+ gem 'mongoid-grid_fs', github: 'ahoward/mongoid-grid_fs'
34
+ gem 'carrierwave-mongoid', github: 'jnicklas/carrierwave-mongoid', :require => 'carrierwave/mongoid'
34
35
  end
35
36
 
36
37
  group :development do
@@ -40,12 +41,13 @@ end
40
41
 
41
42
  group :test do
42
43
  gem 'cancan', '>= 1.6'
43
- gem 'capybara', '~> 1.1'
44
+ gem 'capybara', '~> 2.0'
44
45
  gem 'carrierwave', '>= 0.8'
45
46
  gem 'coveralls', :require => false
46
- gem 'database_cleaner', '>= 0.8'
47
- gem 'devise', '>= 2.1'
47
+ gem 'database_cleaner', '~> 1.0'
48
+ gem 'devise', '~> 3.0.0.rc'
48
49
  gem 'dragonfly', '>= 0.9'
50
+ gem 'rack-cache', :require => 'rack/cache'
49
51
  gem 'factory_girl', '>= 4.2'
50
52
  gem 'generator_spec', '>= 0.8'
51
53
  gem 'launchy', '>= 2.2'
@@ -53,7 +55,6 @@ group :test do
53
55
  gem 'paperclip', '>= 3.4'
54
56
  gem 'rspec-rails', '>= 2.11'
55
57
  gem 'simplecov', :require => false
56
- gem 'strong_parameters', '>= 0.1.6'
57
58
  gem 'timecop', '>= 0.5'
58
59
  end
59
60
 
data/README.md CHANGED
@@ -18,6 +18,15 @@
18
18
  RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.
19
19
 
20
20
  ## Announcements
21
+ ### Support for AcitveModel::MassAssignmentSecurity has been dropped
22
+
23
+ RailsAdmin no longer controls field visibility regarding attr_accessible status, nor uses role on mass assignment.
24
+ See discussion [here](https://github.com/sferik/rails_admin/issues/1443#issuecomment-17132073).
25
+
26
+ ### Richtext editor DSL(for CKEditor, CodeMirror, bootstrap-wysihtml5) has been changed
27
+
28
+ They are configured by field type, not through Text field's extra options. For detail, see [CKEditor](https://github.com/sferik/rails_admin/wiki/CKEditor), [CodeMirror](https://github.com/sferik/rails_admin/wiki/CodeMirror), [Wysihtml5](https://github.com/sferik/rails_admin/wiki/Wysihtml5) in Wiki.
29
+
21
30
  ### [Action required] Security issue
22
31
  `RailsAdmin::Config::Fields::Types::Serialized#parse_input` was unsafe, because it was using the infamous `YAML#load`.
23
32
 
@@ -72,7 +72,7 @@
72
72
  // remove invalid value, as it didn't match anything
73
73
  $(this).val(null);
74
74
  select.html($('<option value="" selected="selected"></option>'));
75
- input.data("autocomplete").term = "";
75
+ input.data("ui-autocomplete").term = "";
76
76
  $(self.element.parents('.controls')[0]).find('.update').addClass('disabled');
77
77
  return false;
78
78
  }
@@ -91,9 +91,9 @@
91
91
  if(select.attr('placeholder'))
92
92
  input.attr('placeholder', select.attr('placeholder'))
93
93
 
94
- input.data("autocomplete")._renderItem = function(ul, item) {
94
+ input.data("ui-autocomplete")._renderItem = function(ul, item) {
95
95
  return $("<li></li>")
96
- .data("item.autocomplete", item)
96
+ .data("ui-autocomplete-item", item)
97
97
  .append( $( "<a></a>" ).html( item.label || item.id ) )
98
98
  .appendTo(ul);
99
99
  };
@@ -15,7 +15,7 @@ $(document).on 'nested:fieldAdded', 'form', (content) ->
15
15
  content = parent_group.children('.tab-content')
16
16
  toggler = controls.find('.toggler')
17
17
  nav.append(new_tab)
18
- $(window.document).trigger('rails_admin.dom_ready') # fire dom_ready for new player in town
18
+ $(window.document).trigger('rails_admin.dom_ready', [field, parent_group]) # fire dom_ready for new player in town
19
19
  new_tab.children('a').tab('show') # activate added tab
20
20
  nav.select(':hidden').show('slow') # show nav if hidden
21
21
  content.select(':hidden').show('slow') # show tabs content if hidden
@@ -84,7 +84,7 @@
84
84
  return false;
85
85
  }).html(saveButtonText);
86
86
 
87
- $(document).trigger('rails_admin.dom_ready')
87
+ $(document).trigger('rails_admin.dom_ready', [form])
88
88
 
89
89
  form.bind("ajax:complete", function(xhr, data, status) {
90
90
  if (status == 'error') {
@@ -1,10 +1,12 @@
1
- $(document).on 'rails_admin.dom_ready', ->
1
+ $(document).on 'rails_admin.dom_ready', (e, content) ->
2
2
 
3
- if $('form').length # don't waste time otherwise
3
+ content = if content then content else $('form')
4
+
5
+ if content.length # don't waste time otherwise
4
6
 
5
7
  # colorpicker
6
8
 
7
- $('form [data-color]').each ->
9
+ content.find('[data-color]').each ->
8
10
  that = this
9
11
  $(this).ColorPicker
10
12
  color: $(that).val()
@@ -20,12 +22,12 @@ $(document).on 'rails_admin.dom_ready', ->
20
22
 
21
23
  # datetime
22
24
 
23
- $('form [data-datetimepicker]').each ->
25
+ content.find('[data-datetimepicker]').each ->
24
26
  $(this).datetimepicker $(this).data('options')
25
27
 
26
28
  # enumeration
27
29
 
28
- $('form [data-enumeration]').each ->
30
+ content.find('[data-enumeration]').each ->
29
31
  if $(this).is('[multiple]')
30
32
  $(this).filteringMultiselect $(this).data('options')
31
33
  else
@@ -33,14 +35,14 @@ $(document).on 'rails_admin.dom_ready', ->
33
35
 
34
36
  # fileupload
35
37
 
36
- $('form [data-fileupload]').each ->
38
+ content.find('[data-fileupload]').each ->
37
39
  input = this
38
40
  $(this).on 'click', ".delete input[type='checkbox']", ->
39
41
  $(input).children('.toggle').toggle('slow')
40
42
 
41
43
  # fileupload-preview
42
44
 
43
- $('form [data-fileupload]').change ->
45
+ content.find('[data-fileupload]').change ->
44
46
  input = this
45
47
  image_container = $("#" + input.id).parent().children(".preview")
46
48
  unless image_container.length
@@ -58,7 +60,7 @@ $(document).on 'rails_admin.dom_ready', ->
58
60
 
59
61
  # filtering-multiselect
60
62
 
61
- $('form [data-filteringmultiselect]').each ->
63
+ content.find('[data-filteringmultiselect]').each ->
62
64
  $(this).filteringMultiselect $(this).data('options')
63
65
  if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
64
66
  $(this).parents('.control-group').find('.btn').remove()
@@ -67,7 +69,7 @@ $(document).on 'rails_admin.dom_ready', ->
67
69
 
68
70
  # filtering-select
69
71
 
70
- $('form [data-filteringselect]').each ->
72
+ content.find('[data-filteringselect]').each ->
71
73
  $(this).filteringSelect $(this).data('options')
72
74
  if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
73
75
  $(this).parents('.control-group').find('.btn').remove()
@@ -76,55 +78,55 @@ $(document).on 'rails_admin.dom_ready', ->
76
78
 
77
79
  # nested-many
78
80
 
79
- $('form [data-nestedmany]').each ->
81
+ content.find('[data-nestedmany]').each ->
80
82
  field = $(this).parents('.control-group').first()
81
83
  nav = field.find('> .controls > .nav')
82
- content = field.find('> .tab-content')
84
+ tab_content = field.find('> .tab-content')
83
85
  toggler = field.find('> .controls > .btn-group > .toggler')
84
86
  # add each nested field to a tab-pane and reference it in the nav
85
- content.children('.fields:not(.tab-pane)').addClass('tab-pane').each ->
87
+ tab_content.children('.fields:not(.tab-pane)').addClass('tab-pane').each ->
86
88
  $(this).attr('id', 'unique-id-' + (new Date().getTime()) + Math.floor(Math.random()*100000)) # some elements are created on the same ms
87
89
  nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
88
90
  # only if no tab is set to active
89
91
  if nav.find("> li.active").length == 0
90
- # init first tab, toggler and content/tabs visibility
92
+ # init first tab, toggler and tab_content/tabs visibility
91
93
  nav.find("> li > a[data-toggle='tab']:first").tab('show')
92
94
  if nav.children().length == 0
93
95
  nav.hide()
94
- content.hide()
96
+ tab_content.hide()
95
97
  toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
96
98
  else
97
99
  if toggler.hasClass('active')
98
100
  nav.show()
99
- content.show()
101
+ tab_content.show()
100
102
  toggler.children('i').addClass('icon-chevron-down')
101
103
  else
102
104
  nav.hide()
103
- content.hide()
105
+ tab_content.hide()
104
106
  toggler.children('i').addClass('icon-chevron-right')
105
107
 
106
108
  # nested-one
107
109
 
108
- $('form [data-nestedone]').each ->
110
+ content.find('[data-nestedone]').each ->
109
111
  field = $(this).parents('.control-group').first()
110
112
  nav = field.find("> .controls > .nav")
111
- content = field.find("> .tab-content")
113
+ tab_content = field.find("> .tab-content")
112
114
  toggler = field.find('> .controls > .toggler')
113
- content.children(".fields:not(.tab-pane)").addClass('tab-pane active').each ->
115
+ tab_content.children(".fields:not(.tab-pane)").addClass('tab-pane active').each ->
114
116
  nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
115
117
  first_tab = nav.find("> li > a[data-toggle='tab']:first")
116
118
  first_tab.tab('show')
117
119
  field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html())
118
120
  if toggler.hasClass('active')
119
121
  toggler.children('i').addClass('icon-chevron-down')
120
- content.show()
122
+ tab_content.show()
121
123
  else
122
124
  toggler.children('i').addClass('icon-chevron-right')
123
- content.hide()
125
+ tab_content.hide()
124
126
 
125
127
  # polymorphic-association
126
128
 
127
- $('form [data-polymorphic]').each ->
129
+ content.find('[data-polymorphic]').each ->
128
130
  type_select = $(this)
129
131
  field = type_select.parents('.control-group').first()
130
132
  object_select = field.find('select').last()
@@ -149,14 +151,14 @@ $(document).on 'rails_admin.dom_ready', ->
149
151
  # ckeditor
150
152
 
151
153
  goCkeditors = ->
152
- $('form [data-richtext=ckeditor]').not('.ckeditored').each (index, domEle) ->
154
+ content.find('[data-richtext=ckeditor]').not('.ckeditored').each (index, domEle) ->
153
155
  try
154
156
  if instance = window.CKEDITOR.instances[this.id]
155
157
  instance.destroy(true)
156
158
  window.CKEDITOR.replace(this, $(this).data('options'))
157
159
  $(this).addClass('ckeditored')
158
160
 
159
- $editors = $('form [data-richtext=ckeditor]').not('.ckeditored')
161
+ $editors = content.find('[data-richtext=ckeditor]').not('.ckeditored')
160
162
  if $editors.length
161
163
  if not window.CKEDITOR
162
164
  options = $editors.first().data('options')
@@ -177,7 +179,7 @@ $(document).on 'rails_admin.dom_ready', ->
177
179
  CodeMirror.fromTextArea(textarea,{mode:options['options']['mode'],theme:options['options']['theme']})
178
180
  $(textarea).addClass('codemirrored')
179
181
 
180
- array = $('form [data-richtext=codemirror]').not('.codemirrored')
182
+ array = content.find('[data-richtext=codemirror]').not('.codemirrored')
181
183
  if array.length
182
184
  @array = array
183
185
  if not window.CodeMirror
@@ -196,7 +198,7 @@ $(document).on 'rails_admin.dom_ready', ->
196
198
  $(@).closest('.controls').addClass('well')
197
199
  $(@).wysihtml5(config_options)
198
200
 
199
- array = $('form [data-richtext=bootstrap-wysihtml5]').not('.bootstrap-wysihtml5ed')
201
+ array = content.find('[data-richtext=bootstrap-wysihtml5]').not('.bootstrap-wysihtml5ed')
200
202
  if array.length
201
203
  @array = array
202
204
  options = $(array[0]).data('options')
@@ -44,8 +44,8 @@ module RailsAdmin
44
44
  action = RailsAdmin::Config::Actions.find(action.to_sym) if (action.is_a?(Symbol) || action.is_a?(String))
45
45
 
46
46
  I18n.t("admin.actions.#{action.i18n_key}.#{label}",
47
- :model_label => model_config.try(:label),
48
- :model_label_plural => model_config.try(:label_plural),
47
+ :model_label => model_config && model_config.label,
48
+ :model_label_plural => model_config && model_config.label_plural,
49
49
  :object_label => model_config && object.try(model_config.object_label_method)
50
50
  )
51
51
  end
@@ -0,0 +1,10 @@
1
+ :ruby
2
+ js_data = {
3
+ :jspath => field.location ? field.location : field.base_location + "ckeditor.js",
4
+ :base_location => field.base_location,
5
+ :options => {
6
+ :customConfig => field.config_js ? field.config_js : field.base_location + "config.js"
7
+ }
8
+ }
9
+
10
+ = form.text_area field.method_name, field.html_attributes.reverse_merge(:data => { :richtext => 'ckeditor', :options => js_data.to_json }).reverse_merge((hdv = field.html_default_value).nil? ? { :value => field.formatted_value } : { :value => hdv })
@@ -0,0 +1,9 @@
1
+ :ruby
2
+ js_data = {
3
+ :csspath => field.css_location,
4
+ :jspath => field.js_location,
5
+ :options => field.config,
6
+ :locations => field.assets
7
+ }
8
+
9
+ = form.text_area field.method_name, field.html_attributes.reverse_merge(:data => { :richtext => 'codemirror', :options => js_data.to_json }).reverse_merge((hdv = field.html_default_value).nil? ? { :value => field.formatted_value } : { :value => hdv })
@@ -1,31 +1 @@
1
- :ruby
2
- if field.ckeditor
3
- richtext = 'ckeditor'
4
- js_data = {
5
- :jspath => field.ckeditor_location ? field.ckeditor_location : field.ckeditor_base_location + "ckeditor.js",
6
- :base_location => field.ckeditor_base_location,
7
- :options => {
8
- :customConfig => field.ckeditor_config_js ? field.ckeditor_config_js : field.ckeditor_base_location + "config.js"
9
- }
10
- }
11
- elsif field.codemirror
12
- richtext = 'codemirror'
13
- js_data = {
14
- :csspath => field.codemirror_css_location,
15
- :jspath => field.codemirror_js_location,
16
- :options => field.codemirror_config,
17
- :locations => field.codemirror_assets
18
- }
19
- elsif field.bootstrap_wysihtml5
20
- richtext = 'bootstrap-wysihtml5'
21
- js_data = {
22
- :csspath => field.bootstrap_wysihtml5_css_location,
23
- :jspath => field.bootstrap_wysihtml5_js_location,
24
- :config_options => field.bootstrap_wysihtml5_config_options.to_json
25
- }
26
- else
27
- richtext = false
28
- js_data = {}
29
- end
30
-
31
- = form.text_area field.method_name, field.html_attributes.reverse_merge(:data => { :richtext => richtext, :options => js_data.to_json }).reverse_merge((hdv = field.html_default_value).nil? ? { :value => field.formatted_value } : { :value => hdv })
1
+ = form.text_area field.method_name, field.html_attributes.reverse_merge(:data => { :richtext => false, :options => {}.to_json }).reverse_merge((hdv = field.html_default_value).nil? ? { :value => field.formatted_value } : { :value => hdv })
@@ -0,0 +1,8 @@
1
+ :ruby
2
+ js_data = {
3
+ :csspath => field.css_location,
4
+ :jspath => field.js_location,
5
+ :config_options => field.config_options.to_json
6
+ }
7
+
8
+ = form.text_area field.method_name, field.html_attributes.reverse_merge(:data => { :richtext => 'bootstrap-wysihtml5', :options => js_data.to_json }).reverse_merge((hdv = field.html_default_value).nil? ? { :value => field.formatted_value } : { :value => hdv })
@@ -12,6 +12,8 @@ module RailsAdmin
12
12
  include Generators::Utils::InstanceMethods
13
13
  extend Generators::Utils::ClassMethods
14
14
 
15
+ class_option :skip_devise, :type => :boolean, :aliases => '-D',
16
+ :desc => "Skip installation and setup of devise gem."
15
17
  argument :_model_name, :type => :string, :required => false, :desc => "Devise user model name"
16
18
  argument :_namespace, :type => :string, :required => false, :desc => "RailsAdmin url namespace"
17
19
  desc "RailsAdmin installation generator"
@@ -22,46 +24,53 @@ module RailsAdmin
22
24
 
23
25
  display "Hello, RailsAdmin installer will help you set things up!", :blue
24
26
  display "I need to work with Devise, let's look at a few things first:"
25
- display "Checking for a current installation of devise..."
26
- unless defined?(Devise)
27
- display "Adding devise gem to your Gemfile:"
28
- append_file "Gemfile", "\n", :force => true
29
- gem 'devise'
30
- Bundler.with_clean_env do
31
- run "bundle install"
32
- end
33
- else
34
- display "Found it!"
35
- end
36
- unless File.exists?(Rails.root.join("config/initializers/devise.rb"))
37
- display "Looks like you don't have devise installed! We'll install it for you:"
38
- generate "devise:install"
27
+ if options[:skip_devise]
28
+ display "Skipping devise installation..."
39
29
  else
40
- display "Looks like you've already installed it, good!"
30
+ display "Checking for a current installation of devise..."
31
+ unless defined?(Devise)
32
+ display "Adding devise gem to your Gemfile:"
33
+ append_file "Gemfile", "\n", :force => true
34
+ gem 'devise'
35
+ Bundler.with_clean_env do
36
+ run "bundle install"
37
+ end
38
+ else
39
+ display "Found it!"
40
+ end
41
+ unless File.exists?(Rails.root.join("config/initializers/devise.rb"))
42
+ display "Looks like you don't have devise installed! We'll install it for you:"
43
+ generate "devise:install"
44
+ else
45
+ display "Looks like you've already installed it, good!"
46
+ end
41
47
  end
42
48
 
43
49
  namespace = ask_for("Where do you want to mount rails_admin?", "admin", _namespace)
44
50
  gsub_file "config/routes.rb", /mount RailsAdmin::Engine => \'\/.+\', :as => \'rails_admin\'/, ''
45
51
  route("mount RailsAdmin::Engine => '/#{namespace}', :as => 'rails_admin'")
46
52
 
47
- unless routes.index("devise_for")
48
- model_name = ask_for("What would you like the user model to be called?", "user", _model_name)
49
- display "Now setting up devise with user model name '#{model_name}':"
50
- generate "devise", model_name
51
- else
52
- display "And you already set it up, good! We just need to know about your user model name..."
53
- guess = routes.match(/devise_for +:(\w+)/)[1].try(:singularize)
54
- display("We found '#{guess}' (should be one of 'user', 'admin', etc.)")
55
- model_name = ask_for("Correct Devise model name if needed.", guess, _model_name)
56
- unless guess == model_name
53
+ unless options[:skip_devise]
54
+ unless routes.index("devise_for")
55
+ model_name = ask_for("What would you like the user model to be called?", "user", _model_name)
57
56
  display "Now setting up devise with user model name '#{model_name}':"
58
57
  generate "devise", model_name
59
58
  else
60
- display "Ok, Devise looks already set up with user model name '#{model_name}':"
59
+ display "And you already set it up, good! We just need to know about your user model name..."
60
+ guess = routes.match(/devise_for +:(\w+)/)[1].try(:singularize)
61
+ display("We found '#{guess}' (should be one of 'user', 'admin', etc.)")
62
+ model_name = ask_for("Correct Devise model name if needed.", guess, _model_name)
63
+ unless guess == model_name
64
+ display "Now setting up devise with user model name '#{model_name}':"
65
+ generate "devise", model_name
66
+ else
67
+ display "Ok, Devise looks already set up with user model name '#{model_name}':"
68
+ end
61
69
  end
62
70
  end
63
71
  display "Now you'll need an initializer..."
64
- @model_name = model_name
72
+ @current_user_method = model_name ? "current_#{model_name.to_s.underscore}" : ""
73
+ @model_name = model_name || '<your user class>'
65
74
  unless initializer
66
75
  template "initializer.erb", "config/initializers/rails_admin.rb"
67
76
  else
@@ -70,11 +79,11 @@ module RailsAdmin
70
79
  config_tag = initializer.match(/RailsAdmin\.config.+\|(.+)\|/)[1] rescue nil
71
80
  if config_tag
72
81
  if initializer.index(::Regexp.new("#{config_tag}\.current_user_method.?\{.+?\}"))
73
- display "current_user_method found and updated with 'current_#{model_name}'", :green
74
- gsub_file Rails.root.join("config/initializers/rails_admin.rb"), ::Regexp.new("#{config_tag}\.current_user_method.?\{.+?\}"), "#{config_tag}.current_user_method { current_#{model_name} }"
82
+ display "current_user_method found and updated with '#{@current_user_method}'", :green
83
+ gsub_file Rails.root.join("config/initializers/rails_admin.rb"), ::Regexp.new("#{config_tag}\.current_user_method.?\{.+?\}"), "#{config_tag}.current_user_method { #{@current_user_method} }"
75
84
  else
76
- display "current_user_method not found. Added one with 'current_#{model_name}'!", :yellow
77
- insert_into_file Rails.root.join("config/initializers/rails_admin.rb"), "\n\n #{config_tag}.current_user_method { current_#{model_name} } #auto-generated", :after => /^RailsAdmin\.config.+$/
85
+ display "current_user_method not found. Added one with '#{@current_user_method}'!", :yellow
86
+ insert_into_file Rails.root.join("config/initializers/rails_admin.rb"), "\n\n #{config_tag}.current_user_method { #{@current_user_method} } #auto-generated", :after => /^RailsAdmin\.config.+$/
78
87
  end
79
88
  else
80
89
  display "Couldn't parse your config file: current_user_method couldn't be updated", :red