rails_admin 0.8.1 → 2.2.1

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 (313) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +17 -34
  3. data/LICENSE.md +1 -1
  4. data/README.md +34 -26
  5. data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
  6. data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
  7. data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  8. data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  9. data/app/assets/images/rails_admin/bullet_black.png +0 -0
  10. data/app/assets/images/rails_admin/bullet_white.png +0 -0
  11. data/app/assets/images/rails_admin/calendar.png +0 -0
  12. data/app/assets/images/rails_admin/clock.png +0 -0
  13. data/app/assets/images/rails_admin/magnifier.png +0 -0
  14. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
  15. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
  16. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
  17. data/app/assets/javascripts/rails_admin/custom/ui.js +1 -0
  18. data/app/assets/javascripts/rails_admin/jquery-ui.js.erb +8 -0
  19. data/app/assets/javascripts/rails_admin/jquery.migrate.js +3 -0
  20. data/app/assets/javascripts/rails_admin/ra.filter-box.js +148 -60
  21. data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +31 -26
  22. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +211 -110
  23. data/app/assets/javascripts/rails_admin/ra.i18n.js +28 -0
  24. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.js +59 -0
  25. data/app/assets/javascripts/rails_admin/ra.sidescroll.js +31 -0
  26. data/app/assets/javascripts/rails_admin/ra.widgets.js +379 -0
  27. data/app/assets/javascripts/rails_admin/rails_admin.js +5 -5
  28. data/app/assets/javascripts/rails_admin/ui.js +135 -0
  29. data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
  30. data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
  31. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  32. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  33. data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.scss +5 -5
  34. data/app/assets/stylesheets/rails_admin/ra.sidescroll.scss +29 -0
  35. data/app/assets/stylesheets/rails_admin/ra.widgets.scss +9 -1
  36. data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +2 -1
  37. data/app/controllers/rails_admin/application_controller.rb +14 -8
  38. data/app/controllers/rails_admin/main_controller.rb +9 -9
  39. data/app/helpers/rails_admin/application_helper.rb +26 -11
  40. data/app/helpers/rails_admin/form_builder.rb +20 -12
  41. data/app/helpers/rails_admin/main_helper.rb +8 -7
  42. data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_gap.html.haml +0 -0
  43. data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_next_page.html.haml +0 -0
  44. data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_page.html.haml +0 -0
  45. data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_paginator.html.haml +0 -0
  46. data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_prev_page.html.haml +0 -0
  47. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.haml +4 -0
  48. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.haml +4 -0
  49. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.haml +4 -0
  50. data/app/views/layouts/rails_admin/_head.html.haml +7 -0
  51. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +2 -2
  52. data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +2 -1
  53. data/app/views/layouts/rails_admin/application.html.haml +4 -10
  54. data/app/views/layouts/rails_admin/pjax.html.haml +1 -5
  55. data/app/views/rails_admin/main/_delete_notice.html.haml +14 -9
  56. data/app/views/rails_admin/main/_form_action_text.html.haml +7 -0
  57. data/app/views/rails_admin/main/_form_colorpicker.html.haml +1 -1
  58. data/app/views/rails_admin/main/_form_enumeration.html.haml +4 -3
  59. data/app/views/rails_admin/main/_form_file_upload.html.haml +5 -5
  60. data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +7 -6
  61. data/app/views/rails_admin/main/_form_filtering_select.html.haml +1 -1
  62. data/app/views/rails_admin/main/_form_multiple_file_upload.html.haml +16 -0
  63. data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +18 -3
  64. data/app/views/rails_admin/main/_form_simple_mde.haml +8 -0
  65. data/app/views/rails_admin/main/dashboard.html.haml +5 -6
  66. data/app/views/rails_admin/main/export.html.haml +45 -36
  67. data/app/views/rails_admin/main/history.html.haml +3 -3
  68. data/app/views/rails_admin/main/index.html.haml +37 -26
  69. data/app/views/rails_admin/main/show.html.haml +6 -7
  70. data/config/initializers/active_record_extensions.rb +3 -3
  71. data/config/initializers/haml.rb +4 -1
  72. data/config/locales/rails_admin.en.yml +5 -2
  73. data/lib/generators/rails_admin/templates/initializer.erb +6 -2
  74. data/lib/rails_admin/abstract_model.rb +9 -10
  75. data/lib/rails_admin/adapters/active_record/abstract_object.rb +9 -3
  76. data/lib/rails_admin/adapters/active_record/property.rb +1 -5
  77. data/lib/rails_admin/adapters/active_record.rb +83 -28
  78. data/lib/rails_admin/adapters/mongoid/abstract_object.rb +3 -3
  79. data/lib/rails_admin/adapters/mongoid/association.rb +18 -6
  80. data/lib/rails_admin/adapters/mongoid/bson.rb +29 -0
  81. data/lib/rails_admin/adapters/mongoid/extension.rb +4 -2
  82. data/lib/rails_admin/adapters/mongoid/property.rb +3 -3
  83. data/lib/rails_admin/adapters/mongoid.rb +40 -26
  84. data/lib/rails_admin/bootstrap-sass/compass_functions.rb +1 -1
  85. data/lib/rails_admin/bootstrap-sass/sass_functions.rb +1 -3
  86. data/lib/rails_admin/bootstrap-sass.rb +8 -6
  87. data/lib/rails_admin/config/actions/base.rb +20 -5
  88. data/lib/rails_admin/config/actions/bulk_delete.rb +2 -4
  89. data/lib/rails_admin/config/actions/dashboard.rb +9 -5
  90. data/lib/rails_admin/config/actions/edit.rb +1 -3
  91. data/lib/rails_admin/config/actions/export.rb +1 -1
  92. data/lib/rails_admin/config/actions/index.rb +5 -3
  93. data/lib/rails_admin/config/actions/new.rb +4 -5
  94. data/lib/rails_admin/config/actions.rb +1 -1
  95. data/lib/rails_admin/config/configurable.rb +25 -18
  96. data/lib/rails_admin/config/fields/association.rb +11 -3
  97. data/lib/rails_admin/config/fields/base.rb +20 -27
  98. data/lib/rails_admin/config/fields/factories/action_text.rb +12 -0
  99. data/lib/rails_admin/config/fields/factories/active_storage.rb +30 -0
  100. data/lib/rails_admin/config/fields/factories/carrierwave.rb +4 -2
  101. data/lib/rails_admin/config/fields/factories/dragonfly.rb +1 -1
  102. data/lib/rails_admin/config/fields/factories/shrine.rb +27 -0
  103. data/lib/rails_admin/config/fields/types/action_text.rb +30 -0
  104. data/lib/rails_admin/config/fields/types/active_record_enum.rb +19 -2
  105. data/lib/rails_admin/config/fields/types/active_storage.rb +49 -0
  106. data/lib/rails_admin/config/fields/types/all.rb +7 -1
  107. data/lib/rails_admin/config/fields/types/belongs_to_association.rb +8 -0
  108. data/lib/rails_admin/config/fields/types/bson_object_id.rb +1 -15
  109. data/lib/rails_admin/config/fields/types/ck_editor.rb +7 -7
  110. data/lib/rails_admin/config/fields/types/code_mirror.rb +10 -12
  111. data/lib/rails_admin/config/fields/types/color.rb +2 -2
  112. data/lib/rails_admin/config/fields/types/datetime.rb +6 -3
  113. data/lib/rails_admin/config/fields/types/file_upload.rb +12 -4
  114. data/lib/rails_admin/config/fields/types/froala.rb +9 -11
  115. data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -1
  116. data/lib/rails_admin/config/fields/types/hidden.rb +2 -2
  117. data/lib/rails_admin/config/fields/types/json.rb +9 -1
  118. data/lib/rails_admin/config/fields/types/multiple_active_storage.rb +53 -0
  119. data/lib/rails_admin/config/fields/types/multiple_carrierwave.rb +56 -0
  120. data/lib/rails_admin/config/fields/types/multiple_file_upload.rb +125 -0
  121. data/lib/rails_admin/config/fields/types/password.rb +5 -1
  122. data/lib/rails_admin/config/fields/types/polymorphic_association.rb +12 -1
  123. data/lib/rails_admin/config/fields/types/serialized.rb +2 -2
  124. data/lib/rails_admin/config/fields/types/shrine.rb +54 -0
  125. data/lib/rails_admin/config/fields/types/simple_mde.rb +36 -0
  126. data/lib/rails_admin/config/fields/types/string.rb +8 -7
  127. data/lib/rails_admin/config/fields/types/string_like.rb +19 -0
  128. data/lib/rails_admin/config/fields/types/text.rb +2 -20
  129. data/lib/rails_admin/config/fields/types/wysihtml5.rb +14 -10
  130. data/lib/rails_admin/config/fields/types.rb +1 -1
  131. data/lib/rails_admin/config/fields.rb +3 -1
  132. data/lib/rails_admin/config/has_fields.rb +1 -1
  133. data/lib/rails_admin/config/has_groups.rb +1 -1
  134. data/lib/rails_admin/config/hideable.rb +1 -1
  135. data/lib/rails_admin/config/inspectable.rb +39 -0
  136. data/lib/rails_admin/config/lazy_model.rb +48 -8
  137. data/lib/rails_admin/config/model.rb +10 -22
  138. data/lib/rails_admin/config/proxyable/proxy.rb +7 -9
  139. data/lib/rails_admin/config/proxyable.rb +13 -1
  140. data/lib/rails_admin/config/sections/base.rb +4 -17
  141. data/lib/rails_admin/config/sections/list.rb +37 -0
  142. data/lib/rails_admin/config.rb +46 -25
  143. data/lib/rails_admin/engine.rb +37 -4
  144. data/lib/rails_admin/extension.rb +16 -4
  145. data/lib/rails_admin/extensions/cancancan/authorization_adapter.rb +23 -7
  146. data/lib/rails_admin/extensions/cancancan.rb +1 -1
  147. data/lib/rails_admin/extensions/controller_extension.rb +6 -0
  148. data/lib/rails_admin/extensions/history/auditing_adapter.rb +2 -2
  149. data/lib/rails_admin/extensions/history/history.rb +2 -2
  150. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +59 -17
  151. data/lib/rails_admin/extensions/pundit/authorization_adapter.rb +11 -3
  152. data/lib/rails_admin/support/csv_converter.rb +20 -14
  153. data/lib/rails_admin/support/datetime.rb +7 -6
  154. data/lib/rails_admin/support/i18n.rb +7 -5
  155. data/lib/rails_admin/version.rb +2 -2
  156. data/lib/rails_admin.rb +23 -1
  157. data/lib/tasks/rails_admin.rake +16 -7
  158. data/vendor/assets/fonts/rails_admin/FontAwesome.otf +0 -0
  159. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.eot +0 -0
  160. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.svg +2671 -0
  161. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.ttf +0 -0
  162. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff +0 -0
  163. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff2 +0 -0
  164. data/vendor/assets/images/rails_admin/bootstrap/glyphicons-halflings-white.png +0 -0
  165. data/vendor/assets/images/rails_admin/bootstrap/glyphicons-halflings.png +0 -0
  166. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
  167. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
  168. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
  169. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
  170. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
  171. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
  172. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
  173. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
  174. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
  175. data/{app → vendor}/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
  176. data/{app → vendor}/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
  177. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
  178. data/vendor/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
  179. data/vendor/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
  180. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
  181. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
  182. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
  183. data/vendor/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
  184. data/{app → vendor}/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
  185. data/{app → vendor}/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
  186. data/{app → vendor}/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
  187. data/vendor/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
  188. data/vendor/assets/images/rails_admin/colorpicker/select.png +0 -0
  189. data/{app → vendor}/assets/images/rails_admin/colorpicker/select2.png +0 -0
  190. data/vendor/assets/images/rails_admin/colorpicker/slider.png +0 -0
  191. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js +50 -28
  192. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js +10 -7
  193. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-button.js +35 -20
  194. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-carousel.js +48 -25
  195. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-collapse.js +70 -28
  196. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-dropdown.js +56 -42
  197. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-modal.js +118 -40
  198. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-popover.js +26 -16
  199. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-scrollspy.js +29 -27
  200. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-tab.js +46 -19
  201. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-tooltip.js +280 -60
  202. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js +5 -5
  203. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-typeahead.js +0 -0
  204. data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap.js +0 -0
  205. data/vendor/assets/javascripts/rails_admin/bootstrap-datetimepicker.js +317 -150
  206. data/{app → vendor}/assets/javascripts/rails_admin/jquery.colorpicker.js +0 -0
  207. data/{app → vendor}/assets/javascripts/rails_admin/jquery.pjax.js +316 -161
  208. data/vendor/assets/javascripts/rails_admin/moment-with-locales.js +16528 -8420
  209. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_alerts.scss +0 -0
  210. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_badges.scss +0 -0
  211. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_breadcrumbs.scss +0 -0
  212. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_button-groups.scss +0 -0
  213. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_buttons.scss +0 -0
  214. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_carousel.scss +0 -0
  215. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_close.scss +0 -0
  216. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_code.scss +0 -0
  217. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_component-animations.scss +0 -0
  218. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_dropdowns.scss +0 -0
  219. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_forms.scss +0 -0
  220. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_glyphicons.scss +0 -0
  221. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_grid.scss +0 -0
  222. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_input-groups.scss +0 -0
  223. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_jumbotron.scss +0 -0
  224. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_labels.scss +0 -0
  225. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_list-group.scss +0 -0
  226. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_media.scss +0 -0
  227. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_mixins.scss +0 -0
  228. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_modals.scss +0 -0
  229. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_navbar.scss +0 -0
  230. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_navs.scss +0 -0
  231. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_normalize.scss +0 -0
  232. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_pager.scss +0 -0
  233. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_pagination.scss +0 -0
  234. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_panels.scss +0 -0
  235. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_popovers.scss +0 -0
  236. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_print.scss +0 -0
  237. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_progress-bars.scss +0 -0
  238. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_responsive-embed.scss +0 -0
  239. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_responsive-utilities.scss +0 -0
  240. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_scaffolding.scss +0 -0
  241. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_tables.scss +0 -0
  242. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_theme.scss +0 -0
  243. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_thumbnails.scss +0 -0
  244. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_tooltip.scss +0 -0
  245. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_type.scss +0 -0
  246. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_utilities.scss +0 -0
  247. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_variables.scss +0 -0
  248. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_wells.scss +0 -0
  249. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/bootstrap.scss +0 -0
  250. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_alerts.scss +0 -0
  251. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_background-variant.scss +0 -0
  252. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_border-radius.scss +0 -0
  253. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_buttons.scss +0 -0
  254. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_center-block.scss +0 -0
  255. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_clearfix.scss +0 -0
  256. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_forms.scss +0 -0
  257. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_gradients.scss +0 -0
  258. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_grid-framework.scss +0 -0
  259. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_grid.scss +0 -0
  260. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_hide-text.scss +0 -0
  261. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_image.scss +0 -0
  262. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_labels.scss +0 -0
  263. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_list-group.scss +0 -0
  264. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-divider.scss +0 -0
  265. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-vertical-align.scss +0 -0
  266. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_opacity.scss +0 -0
  267. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_pagination.scss +0 -0
  268. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_panels.scss +0 -0
  269. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_progress-bar.scss +0 -0
  270. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_reset-filter.scss +0 -0
  271. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_resize.scss +0 -0
  272. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_responsive-visibility.scss +0 -0
  273. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_size.scss +0 -0
  274. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_tab-focus.scss +0 -0
  275. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_table-row.scss +0 -0
  276. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_text-emphasis.scss +0 -0
  277. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_text-overflow.scss +0 -0
  278. data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_vendor-prefixes.scss +0 -0
  279. data/vendor/assets/stylesheets/rails_admin/font-awesome.scss +2342 -0
  280. data/{app → vendor}/assets/stylesheets/rails_admin/jquery.colorpicker.scss +0 -0
  281. metadata +214 -199
  282. data/app/assets/images/rails_admin/bootstrap/glyphicons-halflings-white.png +0 -0
  283. data/app/assets/images/rails_admin/bootstrap/glyphicons-halflings.png +0 -0
  284. data/app/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
  285. data/app/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
  286. data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
  287. data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
  288. data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
  289. data/app/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
  290. data/app/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
  291. data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
  292. data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
  293. data/app/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
  294. data/app/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
  295. data/app/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
  296. data/app/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
  297. data/app/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
  298. data/app/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
  299. data/app/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
  300. data/app/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
  301. data/app/assets/images/rails_admin/colorpicker/select.png +0 -0
  302. data/app/assets/images/rails_admin/colorpicker/slider.png +0 -0
  303. data/app/assets/javascripts/rails_admin/custom/ui.coffee +0 -1
  304. data/app/assets/javascripts/rails_admin/jquery.remotipart.fixed.js +0 -72
  305. data/app/assets/javascripts/rails_admin/ra.i18n.coffee +0 -8
  306. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +0 -52
  307. data/app/assets/javascripts/rails_admin/ra.widgets.coffee +0 -308
  308. data/app/assets/javascripts/rails_admin/ui.coffee +0 -102
  309. data/config/initializers/devise_patch.rb +0 -9
  310. data/lib/rails_admin/config/fields/factories/refile.rb +0 -25
  311. data/lib/rails_admin/config/fields/types/refile.rb +0 -27
  312. data/lib/rails_admin/extensions/cancan/authorization_adapter.rb +0 -57
  313. data/lib/rails_admin/extensions/cancan.rb +0 -3
@@ -1 +0,0 @@
1
- #= override this file in your application to add custom behaviour
@@ -1,72 +0,0 @@
1
- //= require jquery.iframe-transport.js
2
- //= require_self
3
-
4
-
5
- // This file is frozen in RailsAdmin to cope with https://github.com/JangoSteve/remotipart/pull/50
6
-
7
- (function($) {
8
-
9
- var remotipart;
10
-
11
- $.remotipart = remotipart = {
12
-
13
- setup: function(form) {
14
- form
15
- // Allow setup part of $.rails.handleRemote to setup remote settings before canceling default remote handler
16
- // This is required in order to change the remote settings using the form details
17
- .one('ajax:beforeSend.remotipart', function(e, xhr, settings){
18
- // Delete the beforeSend bindings, since we're about to re-submit via ajaxSubmit with the beforeSubmit
19
- // hook that was just setup and triggered via the default `$.rails.handleRemote`
20
- // delete settings.beforeSend;
21
- delete settings.beforeSend;
22
-
23
- settings.iframe = true;
24
- settings.files = $($.rails.fileInputSelector, form);
25
- settings.data = form.serializeArray();
26
- settings.processData = false;
27
-
28
- // Modify some settings to integrate JS request with rails helpers and middleware
29
- if (settings.dataType === undefined) { settings.dataType = 'script *'; }
30
- settings.data.push({name: 'remotipart_submitted', value: true});
31
-
32
- // Allow remotipartSubmit to be cancelled if needed
33
- if ($.rails.fire(form, 'ajax:remotipartSubmit', [xhr, settings])) {
34
- // Second verse, same as the first
35
- $.rails.ajax(settings);
36
- }
37
-
38
- //Run cleanup
39
- remotipart.teardown(form);
40
-
41
- // Cancel the jQuery UJS request
42
- return false;
43
- })
44
-
45
- // Keep track that we just set this particular form with Remotipart bindings
46
- // Note: The `true` value will get over-written with the `settings.dataType` from the `ajax:beforeSend` handler
47
- .data('remotipartSubmitted', true);
48
- },
49
-
50
- teardown: function(form) {
51
- form
52
- .unbind('ajax:beforeSend.remotipart')
53
- .removeData('remotipartSubmitted')
54
- }
55
- };
56
-
57
- $(document).on('ajax:aborted:file', 'form', function(){
58
- var form = $(this);
59
-
60
- remotipart.setup(form);
61
-
62
- // If browser does not support submit bubbling, then this live-binding will be called before direct
63
- // bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
64
- if (!$.support.submitBubbles && $().jquery < '1.7' && $.rails.callFormSubmitBindings(form) === false) return $.rails.stopEverything(e);
65
-
66
- // Manually call jquery-ujs remote call so that it can setup form and settings as usual,
67
- // and trigger the `ajax:beforeSend` callback to which remotipart binds functionality.
68
- $.rails.handleRemote(form);
69
- return false;
70
- });
71
-
72
- })(jQuery);
@@ -1,8 +0,0 @@
1
- @RailsAdmin ||= {}
2
- @RailsAdmin.I18n = class Locale
3
- @init: (@locale, @translations)->
4
- moment.locale(@locale)
5
-
6
- @t:(key) ->
7
- humanize = key.charAt(0).toUpperCase() + key.replace(/_/g, " ").slice(1)
8
- @translations[key] || humanize
@@ -1,52 +0,0 @@
1
- $ = jQuery
2
-
3
- $(document).ready ->
4
- window.nestedFormEvents.insertFields = (content, assoc, link) ->
5
- tab_content = $(link).closest(".controls").siblings(".tab-content")
6
- tab_content.append content
7
- tab_content.children().last()
8
-
9
- $(document).on 'nested:fieldAdded', 'form', (content) ->
10
- field = content.field.addClass('tab-pane').attr('id', 'unique-id-' + (new Date().getTime()))
11
- new_tab = $('<li><a data-toggle="tab" href="#' + field.attr('id') + '">' + field.children('.object-infos').data('object-label') + '</a></li>')
12
- parent_group = field.closest('.control-group')
13
- controls = parent_group.children('.controls')
14
- one_to_one = controls.data('nestedone') != undefined
15
- nav = controls.children('.nav')
16
- content = parent_group.children('.tab-content')
17
- toggler = controls.find('.toggler')
18
- nav.append(new_tab)
19
- $(window.document).trigger('rails_admin.dom_ready', [field, parent_group]) # fire dom_ready for new player in town
20
- new_tab.children('a').tab('show') # activate added tab
21
- nav.select(':hidden').show('slow') unless one_to_one # show nav if hidden
22
- content.select(':hidden').show('slow') # show tabs content if hidden
23
- # toggler 'on' if inactive
24
- toggler.addClass('active').removeClass('disabled').children('i').addClass('icon-chevron-down').removeClass('icon-chevron-right')
25
-
26
- # Convert the "add nested field" button to just showing the title of the new model
27
- controls.find('.add_nested_fields').removeClass('add_nested_fields').html(field.children('.object-infos').data('object-label')) if one_to_one
28
-
29
- $(document).on 'nested:fieldRemoved', 'form', (content) ->
30
- field = content.field
31
- nav = field.closest(".control-group").children('.controls').children('.nav')
32
- current_li = nav.children('li').has('a[href=#' + field.attr('id') + ']')
33
- parent_group = field.closest(".control-group")
34
- controls = parent_group.children('.controls')
35
- one_to_one = controls.data('nestedone') != undefined
36
- toggler = controls.find('.toggler')
37
-
38
- # try to activate another tab
39
- (if current_li.next().length then current_li.next() else current_li.prev()).children('a:first').tab('show')
40
-
41
- current_li.remove()
42
-
43
- if nav.children().length == 0 # removed last tab
44
- nav.select(':visible').hide('slow') # hide nav. No use anymore.
45
- # toggler 'off' if active
46
- toggler.removeClass('active').addClass('disabled').children('i').removeClass('icon-chevron-down').addClass('icon-chevron-right')
47
-
48
- if one_to_one
49
- # Converts the title button to an "add nested field" button
50
- add_button = toggler.next()
51
- add_button.addClass('add_nested_fields').html(add_button.data('add-label'))
52
-
@@ -1,308 +0,0 @@
1
- $(document).on 'rails_admin.dom_ready', (e, content) ->
2
-
3
- content = if content then content else $('form')
4
-
5
- if content.length # don't waste time otherwise
6
-
7
- # colorpicker
8
-
9
- content.find('[data-color]').each ->
10
- that = this
11
- $(this).ColorPicker
12
- color: $(that).val()
13
- onShow: (el) ->
14
- $(el).fadeIn(500)
15
- false
16
- onHide: (el) ->
17
- $(el).fadeOut(500)
18
- false
19
- onChange: (hsb, hex, rgb) ->
20
- $(that).val(hex)
21
- $(that).css('backgroundColor', '#' + hex)
22
-
23
- # datetime picker
24
- $.fn.datetimepicker.defaults.icons =
25
- time: 'fa fa-clock-o'
26
- date: 'fa fa-calendar'
27
- up: 'fa fa-chevron-up'
28
- down: 'fa fa-chevron-down'
29
- previous: 'fa fa-angle-double-left'
30
- next: 'fa fa-angle-double-right'
31
- today: 'fa fa-dot-circle-o'
32
- clear: 'fa fa-trash'
33
- close: 'fa fa-times'
34
-
35
- content.find('[data-datetimepicker]').each ->
36
- options = $(this).data('options')
37
- $.extend(options, {locale: RailsAdmin.I18n.locale})
38
- $(this).datetimepicker options
39
-
40
- # enumeration
41
-
42
- content.find('[data-enumeration]').each ->
43
- if $(this).is('[multiple]')
44
- $(this).filteringMultiselect $(this).data('options')
45
- else
46
- $(this).filteringSelect $(this).data('options')
47
-
48
- # fileupload
49
-
50
- content.find('[data-fileupload]').each ->
51
- input = this
52
- $(this).on 'click', ".delete input[type='checkbox']", ->
53
- $(input).children('.toggle').toggle('slow')
54
-
55
- # fileupload-preview
56
-
57
- content.find('[data-fileupload]').change ->
58
- input = this
59
- image_container = $("#" + input.id).parent().children(".preview")
60
- unless image_container.length
61
- image_container = $("#" + input.id).parent().prepend($('<img />').addClass('preview').addClass('img-thumbnail')).find('img.preview')
62
- image_container.parent().find('img:not(.preview)').hide()
63
- ext = $("#" + input.id).val().split('.').pop().toLowerCase()
64
- if input.files and input.files[0] and $.inArray(ext, ['gif','png','jpg','jpeg','bmp']) != -1
65
- reader = new FileReader()
66
- reader.onload = (e) ->
67
- image_container.attr "src", e.target.result
68
- reader.readAsDataURL input.files[0]
69
- image_container.show()
70
- else
71
- image_container.hide()
72
-
73
- # filtering-multiselect
74
-
75
- content.find('[data-filteringmultiselect]').each ->
76
- $(this).filteringMultiselect $(this).data('options')
77
- if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
78
- $(this).siblings('.btn').remove()
79
- else
80
- $(this).parents('.control-group').first().remoteForm()
81
-
82
- # filtering-select
83
-
84
- content.find('[data-filteringselect]').each ->
85
- $(this).filteringSelect $(this).data('options')
86
- if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
87
- $(this).siblings('.btn').remove()
88
- else
89
- $(this).parents('.control-group').first().remoteForm()
90
-
91
- # nested-many
92
-
93
- content.find('[data-nestedmany]').each ->
94
- field = $(this).parents('.control-group').first()
95
- nav = field.find('> .controls > .nav')
96
- tab_content = field.find('> .tab-content')
97
- toggler = field.find('> .controls > .btn-group > .toggler')
98
- # add each nested field to a tab-pane and reference it in the nav
99
- tab_content.children('.fields:not(.tab-pane)').addClass('tab-pane').each ->
100
- $(this).attr('id', 'unique-id-' + (new Date().getTime()) + Math.floor(Math.random()*100000)) # some elements are created on the same ms
101
- nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
102
- # only if no tab is set to active
103
- if nav.find("> li.active").length == 0
104
- # init first tab, toggler and tab_content/tabs visibility
105
- nav.find("> li > a[data-toggle='tab']:first").tab('show')
106
- if nav.children().length == 0
107
- nav.hide()
108
- tab_content.hide()
109
- toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
110
- else
111
- if toggler.hasClass('active')
112
- nav.show()
113
- tab_content.show()
114
- toggler.children('i').addClass('icon-chevron-down')
115
- else
116
- nav.hide()
117
- tab_content.hide()
118
- toggler.children('i').addClass('icon-chevron-right')
119
-
120
- # nested-one
121
-
122
- content.find('[data-nestedone]').each ->
123
- field = $(this).parents('.control-group').first()
124
- nav = field.find("> .controls > .nav")
125
- tab_content = field.find("> .tab-content")
126
- toggler = field.find('> .controls > .btn-group > .toggler')
127
- tab_content.children(".fields:not(.tab-pane)").addClass('tab-pane active').each ->
128
- # Convert the "add nested field" button to just showing the title of the new model
129
- field.find('> .controls .add_nested_fields').removeClass('add_nested_fields').html( $(this).children('.object-infos').data('object-label') )
130
- nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
131
- first_tab = nav.find("> li > a[data-toggle='tab']:first")
132
- first_tab.tab('show')
133
- field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html())
134
- nav.hide()
135
- if nav.children().length == 0
136
- nav.hide()
137
- tab_content.hide()
138
- toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
139
- else
140
- if toggler.hasClass('active')
141
- toggler.children('i').addClass('icon-chevron-down')
142
- tab_content.show()
143
- else
144
- toggler.children('i').addClass('icon-chevron-right')
145
- tab_content.hide()
146
-
147
- # polymorphic-association
148
-
149
- content.find('[data-polymorphic]').each ->
150
- type_select = $(this)
151
- field = type_select.parents('.control-group').first()
152
- object_select = field.find('select').last()
153
- urls = type_select.data('urls')
154
- type_select.on 'change', (e) ->
155
- if $(this).val() is ''
156
- object_select.html('<option value=""></option>')
157
- else
158
- $.ajax
159
- url: urls[type_select.val()]
160
- data:
161
- compact: true
162
- all: true
163
- beforeSend: (xhr) ->
164
- xhr.setRequestHeader("Accept", "application/json")
165
- success: (data, status, xhr) ->
166
- html = $('<option></option>')
167
- $(data).each (i, el) ->
168
- option = $('<option></option>')
169
- option.attr('value', el.id)
170
- option.text(el.label)
171
- html = html.add(option)
172
- object_select.html(html)
173
-
174
- # ckeditor
175
-
176
- goCkeditors = ->
177
- content.find('[data-richtext=ckeditor]').not('.ckeditored').each (index, domEle) ->
178
- try
179
- if instance = window.CKEDITOR.instances[this.id]
180
- instance.destroy(true)
181
- window.CKEDITOR.replace(this, $(this).data('options'))
182
- $(this).addClass('ckeditored')
183
-
184
- $editors = content.find('[data-richtext=ckeditor]').not('.ckeditored')
185
- if $editors.length
186
- if not window.CKEDITOR
187
- options = $editors.first().data('options')
188
- window.CKEDITOR_BASEPATH = options['base_location']
189
- $.getScript options['jspath'], (script, textStatus, jqXHR) =>
190
- goCkeditors()
191
- else
192
- goCkeditors()
193
-
194
- #codemirror
195
-
196
- goCodeMirrors = (array) =>
197
- array.each (index, domEle) ->
198
- options = $(this).data('options')
199
- textarea = this
200
- $.getScript options['locations']['mode'], (script, textStatus, jqXHR) ->
201
- $('head').append('<link href="' + options['locations']['theme'] + '" rel="stylesheet" media="all" type="text\/css">')
202
- CodeMirror.fromTextArea(textarea,options['options'])
203
- $(textarea).addClass('codemirrored')
204
-
205
- array = content.find('[data-richtext=codemirror]').not('.codemirrored')
206
- if array.length
207
- @array = array
208
- if not window.CodeMirror
209
- options = $(array[0]).data('options')
210
- $('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
211
- $.getScript options['jspath'], (script, textStatus, jqXHR) =>
212
- goCodeMirrors(@array)
213
- else
214
- goCodeMirrors(@array)
215
-
216
- # bootstrap_wysihtml5
217
-
218
- goBootstrapWysihtml5s = (array, config_options) =>
219
- array.each ->
220
- $(@).addClass('bootstrap-wysihtml5ed')
221
- $(@).closest('.controls').addClass('well')
222
- $(@).wysihtml5(config_options)
223
-
224
- array = content.find('[data-richtext=bootstrap-wysihtml5]').not('.bootstrap-wysihtml5ed')
225
- if array.length
226
- @array = array
227
- options = $(array[0]).data('options')
228
- config_options = $.parseJSON(options['config_options'])
229
- if not window.wysihtml5
230
- $('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
231
- $.getScript options['jspath'], (script, textStatus, jqXHR) =>
232
- goBootstrapWysihtml5s(@array, config_options)
233
- else
234
- goBootstrapWysihtml5s(@array, config_options)
235
-
236
- # froala_wysiwyg
237
-
238
- goFroalaWysiwygs = (array) =>
239
- array.each ->
240
- options = $(@).data('options')
241
- config_options = $.parseJSON(options['config_options'])
242
- if config_options
243
- if !config_options['inlineMode']
244
- config_options['inlineMode'] = false
245
- else
246
- config_options = { inlineMode: false }
247
-
248
- uploadEnabled =
249
- if config_options['imageUploadURL']
250
- config_options['imageUploadParams'] =
251
- authenticity_token: $('meta[name=csrf-token]').attr('content')
252
-
253
- $(@).addClass('froala-wysiwyged')
254
- $(@).editable(config_options)
255
- if uploadEnabled
256
- $(@).on 'editable.imageError', (e, editor, error) ->
257
- alert("error uploading image: " + error.message);
258
- # Custom error message returned from the server.
259
- if error.code == 0
260
-
261
- # Bad link.
262
- else if error.code == 1
263
-
264
- # No link in upload response.
265
- else if error.code == 2
266
-
267
- # Error during image upload.
268
- else if error.code == 3
269
-
270
- # Parsing response failed.
271
- else if error.code == 4
272
-
273
- # Image too large.
274
- else if error.code == 5
275
-
276
- # Invalid image type.
277
- else if error.code == 6
278
-
279
- # Image can be uploaded only to same domain in IE 8 and IE 9.
280
- else if error.code == 7
281
-
282
- else
283
-
284
- return
285
-
286
- .on('editable.afterRemoveImage', (e, editor, $img) ->
287
- # Set the image source to the image delete params.
288
- editor.options.imageDeleteParams =
289
- src: $img.attr('src')
290
- authenticity_token: $('meta[name=csrf-token]').attr('content')
291
- # Make the delete request.
292
- editor.deleteImage $img
293
- return
294
- ).on('editable.imageDeleteSuccess', (e, editor, data) ->
295
- # handle success
296
- ).on 'editable.imageDeleteError', (e, editor, error) ->
297
- # handle error
298
- alert("error deleting image: " + error.message);
299
-
300
- array = content.find('[data-richtext=froala-wysiwyg]').not('.froala-wysiwyged')
301
- if array.length
302
- options = $(array[0]).data('options')
303
- if not $.isFunction($.fn.editable)
304
- $('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
305
- $.getScript options['jspath'], (script, textStatus, jqXHR) =>
306
- goFroalaWysiwygs(array)
307
- else
308
- goFroalaWysiwygs(array)
@@ -1,102 +0,0 @@
1
- $ = jQuery
2
-
3
- $(document).on "click", "#list input.toggle", ->
4
- $("#list [name='bulk_ids[]']").prop "checked", $(this).is(":checked")
5
-
6
- $(document).on 'click', '.pjax', (event) ->
7
- if event.which > 1 || event.metaKey || event.ctrlKey
8
- return
9
- else if $.support.pjax
10
- event.preventDefault()
11
- $.pjax
12
- container: $(this).data('pjax-container') || '[data-pjax-container]'
13
- url: $(this).data('href') || $(this).attr('href')
14
- timeout: 2000
15
- else if $(this).data('href') # not a native #href, need some help
16
- window.location = $(this).data('href')
17
-
18
- $(document).on 'submit', '.pjax-form', (event) ->
19
- if $.support.pjax
20
- event.preventDefault()
21
- $.pjax
22
- container: $(this).data('pjax-container') || '[data-pjax-container]'
23
- url: this.action + (if (this.action.indexOf('?') != -1) then '&' else '?') + $(this).serialize()
24
- timeout: 2000
25
-
26
- $(document)
27
- .on 'pjax:start', ->
28
- $('#loading').show()
29
- .on 'pjax:end', ->
30
- $('#loading').hide()
31
-
32
- $(document).on 'click', '[data-target]', ->
33
- if !$(this).hasClass('disabled')
34
- if $(this).has('i.icon-chevron-down').length
35
- $(this).removeClass('active').children('i').toggleClass('icon-chevron-down icon-chevron-right')
36
- $($(this).data('target')).select(':visible').hide('slow')
37
- else
38
- if $(this).has('i.icon-chevron-right').length
39
- $(this).addClass('active').children('i').toggleClass('icon-chevron-down icon-chevron-right')
40
- $($(this).data('target')).select(':hidden').show('slow')
41
-
42
- $(document).on 'click', '.form-horizontal legend', ->
43
- if $(this).has('i.icon-chevron-down').length
44
- $(this).siblings('.control-group:visible').hide('slow')
45
- $(this).children('i').toggleClass('icon-chevron-down icon-chevron-right')
46
- else
47
- if $(this).has('i.icon-chevron-right').length
48
- $(this).siblings('.control-group:hidden').show('slow')
49
- $(this).children('i').toggleClass('icon-chevron-down icon-chevron-right')
50
-
51
- $(document).on 'click', 'form .tab-content .tab-pane a.remove_nested_one_fields', ->
52
- $(this).children('input[type="hidden"]').val($(this).hasClass('active')).
53
- siblings('i').toggleClass('icon-check icon-trash')
54
-
55
- $(document).ready ->
56
- $(document).trigger('rails_admin.dom_ready')
57
-
58
- $(document).on 'pjax:end', ->
59
- $(document).trigger('rails_admin.dom_ready')
60
-
61
- $(document).on 'rails_admin.dom_ready', ->
62
- $('.animate-width-to').each ->
63
- length = $(this).data("animate-length")
64
- width = $(this).data("animate-width-to")
65
- $(this).animate(width: width, length, 'easeOutQuad')
66
-
67
- $('.form-horizontal legend').has('i.icon-chevron-right').each ->
68
- $(this).siblings('.control-group').hide()
69
-
70
- $(".table").tooltip selector: "th[rel=tooltip]"
71
-
72
- # Workaround for jquery-ujs formnovalidate issue:
73
- # https://github.com/rails/jquery-ujs/issues/316
74
- $('[formnovalidate]').on 'click', ->
75
- $(this).closest('form').attr('novalidate', true)
76
-
77
- $(document).on 'click', '#fields_to_export label input#check_all', () ->
78
- elems = $('#fields_to_export label input')
79
- if $('#fields_to_export label input#check_all').is ':checked'
80
- $(elems).prop('checked', true)
81
- else
82
- $(elems).prop('checked',false)
83
-
84
- # when the user hits the back button, the inline JS <script> that
85
- # highlights the current model in the left menu doesn't get run by
86
- # pjax, so this code runs it:
87
- # https://github.com/defunkt/jquery-pjax/issues/241#issuecomment-13251065
88
- $(document).on 'pjax:popstate', () ->
89
- $(document).one 'pjax:end', (event) ->
90
- $(event.target).find('script').each () ->
91
- $.globalEval(this.text || this.textContent || this.innerHTML || '')
92
- return
93
- return
94
- return
95
-
96
- #Remove all filter and then refresh
97
- $(document).on 'click', "#remove_filter",(event) ->
98
- event.preventDefault()
99
- $("#filters_box").html("")
100
- $("hr.filters_box").hide()
101
- $(this).parent().siblings("input[type='search']").val("")
102
- $(this).parents("form").submit()
@@ -1,9 +0,0 @@
1
- if defined?(::Devise)
2
- module Devise
3
- class FailureApp
4
- def scope
5
- @scope ||= warden_options[:scope] || Devise.default_scope
6
- end
7
- end
8
- end
9
- end
@@ -1,25 +0,0 @@
1
- require 'rails_admin/config/fields'
2
- require 'rails_admin/config/fields/types'
3
- require 'rails_admin/config/fields/types/file_upload'
4
-
5
- RailsAdmin::Config::Fields.register_factory do |parent, properties, fields|
6
- extensions = [:id, :filename, :size, :content_type]
7
- model = parent.abstract_model.model
8
- if (properties.name.to_s =~ /^(.+)_id$/) && defined?(::Refile) && model.ancestors.map(&:to_s).include?("Refile::Attachment(#{attachment_name = Regexp.last_match[1].to_sym})")
9
- field = RailsAdmin::Config::Fields::Types.load(:refile).new(parent, attachment_name, properties)
10
- children_fields = []
11
- extensions.each do |ext|
12
- children_column_name = "#{attachment_name}_#{ext}".to_sym
13
- next unless child_properties = parent.abstract_model.properties.detect { |p| p.name.to_s == children_column_name.to_s }
14
- children_field = fields.detect { |f| f.name == children_column_name } || RailsAdmin::Config::Fields.default_factory.call(parent, child_properties, fields)
15
- children_field.hide
16
- children_field.filterable(false)
17
- children_fields << children_field.name
18
- end
19
- field.children_fields(children_fields)
20
- fields << field
21
- true
22
- else
23
- false
24
- end
25
- end
@@ -1,27 +0,0 @@
1
- require 'rails_admin/config/fields/base'
2
- require 'rails_admin/config/fields/types/file_upload'
3
-
4
- module RailsAdmin
5
- module Config
6
- module Fields
7
- module Types
8
- class Refile < RailsAdmin::Config::Fields::Types::FileUpload
9
- RailsAdmin::Config::Fields::Types.register(self)
10
-
11
- register_instance_option :thumb_method do
12
- [:limit, 100, 100]
13
- end
14
-
15
- register_instance_option :delete_method do
16
- "remove_#{name}"
17
- end
18
-
19
- def resource_url(thumb = [])
20
- return nil unless value
21
- Object.const_get(:Refile).attachment_url(bindings[:object], name, *thumb)
22
- end
23
- end
24
- end
25
- end
26
- end
27
- end