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,47 +1,55 @@
1
1
  - params = request.params.except(:action, :controller, :utf8, :page, :per_page, :format, :authenticity_token)
2
2
  - visible_fields = @model_config.export.with(view: self, object: @abstract_model.model.new, controller: self.controller).visible_fields
3
3
 
4
- = form_tag export_path(params.merge(all: true)), method: 'post', class: 'form-horizontal denser' do
4
+ = form_tag export_path(params.merge(all: true)), method: 'post', class: 'form-horizontal' do
5
5
 
6
6
  %input{name: "send_data", type: "hidden", value: "true"}/
7
7
  %fieldset{id: 'fields_to_export'}
8
8
  %legend
9
9
  %i.icon-chevron-down
10
10
  = t('admin.export.select')
11
- .form-group.control-group.col-sm-12
12
- .controls
13
- .col-sm-12
14
- %label.col-sm-12.checkbox{for: 'check_all'}
15
- = check_box_tag 'all', 'all', true, { id: 'check_all' }
16
- = t('admin.export.select_all_fields')
17
- .form-group.control-group.col-sm-12
18
- %label.col-sm-12.well.control-label{rel: 'tooltip', :'data-original-title' => t('admin.export.click_to_reverse_selection'), onclick: 'jQuery(this).siblings(".controls").find("input").click()'}= t('admin.export.fields_from', name: @model_config.label_plural.downcase)
19
- .col-sm-11.col-sm-offset-1.controls
20
- - visible_fields.select{ |f| !f.association? || f.association.polymorphic? }.each do |field|
21
- - list = field.virtual? ? 'methods' : 'only'
22
- - if field.association? && field.association.polymorphic?
23
- %label.checkbox.col-sm-3{for: "schema_#{list}_#{field.method_name}"}
24
- = check_box_tag "schema[#{list}][]", field.method_name, true, { id: "schema_#{list}_#{field.method_name}" }
25
- = field.label + " [id]"
26
- - polymorphic_type_column_name = @abstract_model.properties.detect {|p| field.association.foreign_type == p.name }.name
27
- %label.checkbox.col-sm-3{for: "schema_#{list}_#{polymorphic_type_column_name}"}
28
- = check_box_tag "schema[#{list}][]", polymorphic_type_column_name, true, { id: "schema_#{list}_#{polymorphic_type_column_name}" }
29
- = capitalize_first_letter(field.label) + " [type]"
30
- - else
31
- %label.checkbox.col-sm-3{for: "schema_#{list}_#{field.name}"}
32
- = check_box_tag "schema[#{list}][]", field.name, true, { id: "schema_#{list}_#{field.name}" }
33
- = capitalize_first_letter(field.label)
11
+ .form-group.control-group
12
+ .col-sm-12
13
+ .checkbox
14
+ %label{for: 'check_all'}
15
+ = check_box_tag 'all', 'all', true, { id: 'check_all' }
16
+ %b= t('admin.export.select_all_fields')
17
+ .form-group.control-group
18
+ .col-sm-12
19
+ .well.well-sm.reverse-selection{rel: 'tooltip', title: t('admin.export.click_to_reverse_selection'), style: 'margin: 0; cursor: pointer;'}
20
+ %b= t('admin.export.fields_from', name: @model_config.label_plural.downcase)
21
+ .controls
22
+ .row
23
+ - visible_fields.select{ |f| !f.association? || f.association.polymorphic? }.each do |field|
24
+ - list = field.virtual? ? 'methods' : 'only'
25
+ .checkbox.col-sm-3
26
+ - if field.association? && field.association.polymorphic?
27
+ %label{for: "schema_#{list}_#{field.method_name}"}
28
+ = check_box_tag "schema[#{list}][]", field.method_name, true, { id: "schema_#{list}_#{field.method_name}" }
29
+ = field.label + " [id]"
30
+ - polymorphic_type_column_name = @abstract_model.properties.detect {|p| field.association.foreign_type == p.name }.name
31
+ %label{for: "schema_#{list}_#{polymorphic_type_column_name}"}
32
+ = check_box_tag "schema[#{list}][]", polymorphic_type_column_name, true, { id: "schema_#{list}_#{polymorphic_type_column_name}" }
33
+ = capitalize_first_letter(field.label) + " [type]"
34
+ - else
35
+ %label{for: "schema_#{list}_#{field.name}"}
36
+ = check_box_tag "schema[#{list}][]", field.name, true, { id: "schema_#{list}_#{field.name}" }
37
+ = capitalize_first_letter(field.label)
34
38
 
35
39
  - visible_fields.select{ |f| f.association? && !f.association.polymorphic? }.each do |field|
36
40
  - fields = field.associated_model_config.export.with(controller: self.controller, view: self, object: (associated_model = field.associated_model_config.abstract_model.model).new).visible_fields.select{ |f| !f.association? }
37
- .form-group.control-group.col-sm-12
38
- %label.col-sm-12.well.control-label{rel: 'tooltip', :'data-original-title' => t('admin.export.click_to_reverse_selection'), onclick: 'jQuery(this).siblings(".controls").find("input").click()'}= t('admin.export.fields_from_associated', name: field.label.downcase)
39
- .col-sm-11.col-sm-offset-1.controls
40
- - fields.each do |associated_model_field|
41
- - list = associated_model_field.virtual? ? 'methods' : 'only'
42
- %label.checkbox.col-sm-3{for: "schema_include_#{field.name}_#{list}_#{associated_model_field.name}"}
43
- = check_box_tag "schema[include][#{field.name}][#{list}][]", associated_model_field.name, true, { id: "schema_include_#{field.name}_#{list}_#{associated_model_field.name}" }
44
- = capitalize_first_letter(associated_model_field.label)
41
+ .form-group.control-group
42
+ .col-sm-12
43
+ .well.well-sm.reverse-selection{rel: 'tooltip', title: t('admin.export.click_to_reverse_selection'), style: 'margin: 0; cursor: pointer;'}
44
+ %b= t('admin.export.fields_from_associated', name: field.label.downcase)
45
+ .controls
46
+ .row
47
+ - fields.each do |associated_model_field|
48
+ - list = associated_model_field.virtual? ? 'methods' : 'only'
49
+ .checkbox.col-sm-3
50
+ %label{for: "schema_include_#{field.name}_#{list}_#{associated_model_field.name}"}
51
+ = check_box_tag "schema[include][#{field.name}][#{list}][]", associated_model_field.name, true, { id: "schema_include_#{field.name}_#{list}_#{associated_model_field.name}" }
52
+ = capitalize_first_letter(associated_model_field.label)
45
53
 
46
54
  %fieldset
47
55
  %legend
@@ -52,20 +60,21 @@
52
60
  %label.col-sm-2.control-label{for: "csv_options_encoding_to"}= t('admin.export.csv.encoding_to')
53
61
  .col-sm-10.controls
54
62
  -# from http://books.google.com/support/partner/bin/answer.py?answer=30990 :
55
- = select_tag 'csv_options[encoding_to]', options_for_select(RailsAdmin::CSVConverter::TARGET_ENCODINGS), include_blank: true
63
+ = select_tag 'csv_options[encoding_to]', options_for_select(Encoding.name_list.sort), include_blank: true, placeholder: t('admin.misc.search'), :'data-enumeration' => true
56
64
  %p.help-block= t('admin.export.csv.encoding_to_help', name: guessed_encoding)
57
65
 
58
66
  .form-group.control-group
59
67
  %label.col-sm-2.control-label{for: "csv_options_skip_header"}= t('admin.export.csv.skip_header')
60
68
  .col-sm-10.controls
61
- %label.checkbox
62
- = check_box_tag 'csv_options[skip_header]', 'true'
69
+ .checkbox
70
+ %label{style: 'display: block;' }
71
+ = check_box_tag 'csv_options[skip_header]', 'true'
63
72
  %p.help-block= t('admin.export.csv.skip_header_help')
64
73
 
65
74
  .form-group.control-group
66
75
  %label.col-sm-2.control-label{for: "csv_options_generator_col_sep"}= t('admin.export.csv.col_sep')
67
76
  .col-sm-10.controls
68
- = select_tag 'csv_options[generator][col_sep]', options_for_select({ '' => t('admin.export.csv.default_col_sep'), "<comma> ','" => ',', "<semicolon> ';'" => ';', '<tabs>' => "'\t'" })
77
+ = select_tag 'csv_options[generator][col_sep]', options_for_select({ '' => t('admin.export.csv.default_col_sep'), "<comma> ','" => ',', "<semicolon> ';'" => ';', '<tabs>' => "'\t'" }), placeholder: t('admin.misc.search'), :'data-enumeration' => true
69
78
  %p.help-block= t('admin.export.csv.col_sep_help', value: t('admin.export.csv.default_col_sep'))
70
79
 
71
80
  .form-group.form-actions
@@ -10,7 +10,7 @@
10
10
  .input-group
11
11
  %input.form-control.input-small{name: "query", type: "search", value: query, placeholder: "#{t("admin.misc.filter")}", class: 'input-small'}
12
12
  %span.input-group-btn
13
- %button.btn.btn-primary{type: "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
13
+ %button.btn.btn-primary{type: 'submit', :'data-disable-with' => '<i class="icon-white icon-refresh"></i> '.html_safe + t('admin.misc.refresh')}
14
14
  %i.icon-white.icon-refresh
15
15
  = t("admin.misc.refresh")
16
16
  %table#history.table.table-striped.table-condensed
@@ -32,7 +32,7 @@
32
32
  - @history.each_with_index do |object, index|
33
33
  %tr
34
34
  - unless object.created_at.nil?
35
- %td= l(object.created_at, format: :long, default: l(object.created_at, format: :long, locale: :en))
35
+ %td= l(object.created_at, format: :long, default: l(object.created_at, format: :long))
36
36
  %td= object.username
37
37
  - if @general
38
38
  - if o = @abstract_model.get(object.item)
@@ -46,6 +46,6 @@
46
46
  %td= object.message.in?(['delete', 'new']) ? t("admin.actions.#{object.message}.done").capitalize : object.message
47
47
 
48
48
  - unless params[:all] || !@history.respond_to?(:current_page)
49
- = paginate(@history, theme: 'twitter-bootstrap', remote: true)
49
+ = paginate(@history, theme: 'ra-twitter-bootstrap', remote: true)
50
50
  = link_to(t("admin.misc.show_all"), send(path_method, params.merge(all: true)), class: "show-all btn pjax") unless (tc = @history.total_count) <= @history.size || tc > 100
51
51
 
@@ -10,14 +10,18 @@
10
10
  export_action = nil unless export_action && authorized?(export_action.authorization_key, @abstract_model)
11
11
  description = RailsAdmin.config(@abstract_model.model_name).description
12
12
  properties = @model_config.list.with(controller: self.controller, view: self, object: @abstract_model.model.new).visible_fields
13
+ checkboxes = @model_config.list.checkboxes?
13
14
  # columns paginate
14
- sets = get_column_sets(properties)
15
- properties = sets[params[:set].to_i] || []
16
- other_left = ((params[:set].to_i - 1) >= 0) && sets[params[:set].to_i - 1].present?
17
- other_right = sets[params[:set].to_i + 1].present?
15
+ unless (frozen_columns = @model_config.list.sidescroll_frozen_columns)
16
+ sets = get_column_sets(properties)
17
+ properties = sets[params[:set].to_i] || []
18
+ other_left = ((params[:set].to_i - 1) >= 0) && sets[params[:set].to_i - 1].present?
19
+ other_right = sets[params[:set].to_i + 1].present?
20
+ end
18
21
 
19
22
  - content_for :contextual_tabs do
20
- = bulk_menu
23
+ - if checkboxes
24
+ = bulk_menu
21
25
  - if filterable_fields.present?
22
26
  %li.dropdown{style: 'float:right'}
23
27
  %a.dropdown-toggle{href: '#', :'data-toggle' => "dropdown"}
@@ -31,12 +35,7 @@
31
35
  - else
32
36
  - ''
33
37
  %li
34
- %a{href: '#', :"data-field-label" => field.label, :"data-field-name" => field.name, :"data-field-options" => field_options.html_safe, :"data-field-type" => field.type, :"data-field-value" => "", :"data-field-datetimepicker-format" => (field.try(:parser) && field.parser.to_momentjs)}= capitalize_first_letter(field.label)
35
-
36
- :javascript
37
- jQuery(function($) {
38
- #{ordered_filter_string}
39
- });
38
+ %a{href: '#', :"data-field-label" => field.label, :"data-field-name" => field.name, :"data-field-operator" => field.default_filter_operator, :"data-field-options" => field_options.html_safe, :"data-field-required" => field.required.to_s, :"data-field-type" => field.type, :"data-field-value" => "", :"data-field-datetimepicker-format" => (field.try(:parser) && field.parser.to_momentjs)}= capitalize_first_letter(field.label)
40
39
 
41
40
  %style
42
41
  - properties.select{ |p| p.column_width.present? }.each do |property|
@@ -46,15 +45,15 @@
46
45
  #list
47
46
  = form_tag(index_path(params.except(*%w[page f query])), method: :get, class: "pjax-form form-inline") do
48
47
  .well
49
- %span#filters_box
48
+ %span#filters_box{data: {options: ordered_filter_options.to_json}}
50
49
  %hr.filters_box{style: "display:#{ordered_filters.empty? ? 'none' : 'block'}"}
51
50
  .input-group
52
51
  %input.form-control.input-small{name: "query", type: "search", value: query, placeholder: t("admin.misc.filter")}
53
52
  %span.input-group-btn
54
- %button.btn.btn-primary{type: "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
53
+ %button.btn.btn-primary{type: 'submit', :'data-disable-with' => '<i class="icon-white icon-refresh"></i> '.html_safe + t('admin.misc.refresh')}
55
54
  %i.icon-white.icon-refresh
56
- = t("admin.misc.refresh")
57
- %button#remove_filter.btn.btn-info{title: "Reset filters"}
55
+ = t('admin.misc.refresh')
56
+ %button#remove_filter.btn.btn-info{title: t('admin.misc.reset_filters')}
58
57
  %i.icon-white.icon-remove
59
58
  - if export_action
60
59
  %span{style: 'float:right'}= link_to wording_for(:link, export_action), export_path(params.except('set').except('page')), class: 'btn btn-info'
@@ -66,7 +65,7 @@
66
65
  %li{class: "#{'active' if scope.to_s == params[:scope] || (params[:scope].blank? && index == 0)}"}
67
66
  %a{href: index_path(params.merge(scope: scope, page: nil)), class: 'pjax'}= I18n.t("admin.scopes.#{@abstract_model.to_param}.#{scope}", default: I18n.t("admin.scopes.#{scope}", default: scope.to_s.titleize))
68
67
 
69
- = form_tag bulk_action_path(model_name: @abstract_model.to_param), method: :post, id: "bulk_form", class: "form" do
68
+ = form_tag bulk_action_path(model_name: @abstract_model.to_param), method: :post, id: "bulk_form", class: ["form", frozen_columns ? 'ra-sidescroll' : nil], data: (frozen_columns ? {ra_sidescroll: frozen_columns} : {}) do
70
69
  = hidden_field_tag :bulk_action
71
70
  - if description.present?
72
71
  %p
@@ -75,8 +74,11 @@
75
74
  %table.table.table-condensed.table-striped
76
75
  %thead
77
76
  %tr
78
- %th.shrink
79
- %input.toggle{type: "checkbox"}
77
+ - if checkboxes
78
+ %th.shrink
79
+ %input.toggle{type: "checkbox"}
80
+ - if frozen_columns
81
+ %th.last.shrink
80
82
  - if other_left
81
83
  %th.other.left.shrink= "..."
82
84
  - properties.each do |property|
@@ -87,12 +89,16 @@
87
89
  %th{class: "#{property.sortable && "header pjax" || nil} #{sort_direction if property.sortable && sort_direction} #{property.css_class} #{property.type_css_class}", :'data-href' => (property.sortable && sort_location), rel: "tooltip", title: "#{property.hint}"}= capitalize_first_letter(property.label)
88
90
  - if other_right
89
91
  %th.other.right.shrink= "..."
90
- %th.last.shrink
92
+ - unless frozen_columns
93
+ %th.last.shrink
91
94
  %tbody
92
95
  - @objects.each do |object|
93
- %tr{class: "#{@abstract_model.param_key}_row"}
94
- %td
95
- = check_box_tag "bulk_ids[]", object.id, false
96
+ %tr{class: "#{@abstract_model.param_key}_row #{@model_config.list.with(object: object).row_css_class}"}
97
+ - if checkboxes
98
+ %td= check_box_tag "bulk_ids[]", object.id, false
99
+ - if frozen_columns
100
+ %td.last.links
101
+ %ul.inline.list-inline= menu_for :member, @abstract_model, object, true
96
102
  - if @other_left_link ||= other_left && index_path(params.except('set').merge(params[:set].to_i != 1 ? {set: (params[:set].to_i - 1)} : {}))
97
103
  %td.other.left= link_to "...", @other_left_link, class: 'pjax'
98
104
  - properties.map{ |property| property.bind(:object, object) }.each do |property|
@@ -100,13 +106,18 @@
100
106
  %td{class: "#{property.css_class} #{property.type_css_class}", title: strip_tags(value.to_s)}= value
101
107
  - if @other_right_link ||= other_right && index_path(params.merge(set: (params[:set].to_i + 1)))
102
108
  %td.other.right= link_to "...", @other_right_link, class: 'pjax'
103
- %td.last.links
104
- %ul.inline.list-inline= menu_for :member, @abstract_model, object, true
109
+ - unless frozen_columns
110
+ %td.last.links
111
+ %ul.inline.list-inline= menu_for :member, @abstract_model, object, true
112
+
113
+ - if @model_config.list.limited_pagination
114
+ .row
115
+ .col-md-6= paginate(@objects, theme: 'ra-twitter-bootstrap/without_count', total_pages: Float::INFINITY, remote: true)
105
116
 
106
- - if @objects.respond_to?(:total_count)
117
+ - elsif @objects.respond_to?(:total_count)
107
118
  - total_count = @objects.total_count.to_i
108
119
  .row
109
- .col-md-6= paginate(@objects, theme: 'twitter-bootstrap', remote: true)
120
+ .col-md-6= paginate(@objects, theme: 'ra-twitter-bootstrap', remote: true)
110
121
  .row
111
122
  .col-md-6= link_to(t("admin.misc.show_all"), index_path(params.merge(all: true)), class: "show-all btn btn-default clearfix pjax") unless total_count > 100 || total_count <= @objects.to_a.size
112
123
  .clearfix.total-count= "#{total_count} #{@model_config.pluralize(total_count).downcase}"
@@ -1,6 +1,6 @@
1
1
  - @model_config.show.with(object: @object, view: self, controller: self.controller).visible_groups.each do |fieldset|
2
2
  - unless (fields = fieldset.with(object: @object, view: self, controller: self.controller).visible_fields).empty?
3
- - if !(values = fields.map{ |f| f.formatted_value.presence }).compact.empty? || !RailsAdmin::config.compact_show_view
3
+ - unless (fields = fields.reject{ |f| RailsAdmin::config.compact_show_view && (f.formatted_value.nil? || f.formatted_value == '') }).empty?
4
4
  .fieldset
5
5
  %h4
6
6
  = fieldset.label
@@ -8,9 +8,8 @@
8
8
  %p= fieldset.help
9
9
  %dl
10
10
  - fields.each_with_index do |field, index|
11
- - unless values[index].nil? && RailsAdmin::config.compact_show_view
12
- %dt
13
- %span.label.label-info{class: "#{field.type_css_class} #{field.css_class}"}
14
- = field.label
15
- %dd.well
16
- = field.pretty_value
11
+ %dt
12
+ %span.label.label-info{class: "#{field.type_css_class} #{field.css_class}"}
13
+ = field.label
14
+ %dd.well
15
+ = field.pretty_value
@@ -1,4 +1,4 @@
1
- if defined?(::ActiveRecord)
1
+ ActiveSupport.on_load(:active_record) do
2
2
  module ActiveRecord
3
3
  class Base
4
4
  def self.rails_admin(&block)
@@ -6,11 +6,11 @@ if defined?(::ActiveRecord)
6
6
  end
7
7
 
8
8
  def rails_admin_default_object_label_method
9
- self.new_record? ? "new #{self.class}" : "#{self.class} ##{id}"
9
+ new_record? ? "new #{self.class}" : "#{self.class} ##{id}"
10
10
  end
11
11
 
12
12
  def safe_send(value)
13
- if self.has_attribute?(value)
13
+ if has_attribute?(value)
14
14
  read_attribute(value)
15
15
  else
16
16
  send(value)
@@ -1,2 +1,5 @@
1
1
  require 'haml'
2
- Haml::Template.options[:ugly] = true
2
+ require 'haml/template'
3
+ if Haml::Options.buffer_option_keys.include?(:ugly)
4
+ Haml::Template.options[:ugly] = true
5
+ end
@@ -29,21 +29,24 @@ en:
29
29
  misc:
30
30
  search: "Search"
31
31
  filter: "Filter"
32
+ reset_filters: "Reset filters"
32
33
  refresh: "Refresh"
33
34
  show_all: "Show all"
34
35
  add_filter: "Add filter"
35
36
  bulk_menu_title: "Selected items"
36
37
  remove: "Remove"
37
38
  add_new: "Add new"
38
- chosen: "Chosen %{name}"
39
39
  chose_all: "Choose all"
40
40
  clear_all: "Clear all"
41
41
  up: "Up"
42
42
  down: "Down"
43
43
  navigation: "Navigation"
44
+ root_navigation: "Actions"
44
45
  navigation_static_label: "Links"
45
46
  log_out: "Log out"
47
+ time_ago: "%{time} ago"
46
48
  ago: "ago"
49
+ more: "Plus %{count} more %{models_name}"
47
50
  flash:
48
51
  successful: "%{name} successfully %{action}"
49
52
  error: "%{name} failed to be %{action}"
@@ -52,7 +55,7 @@ en:
52
55
  object_not_found: "%{model} with id '%{id}' could not be found"
53
56
  table_headers:
54
57
  model_name: "Model name"
55
- last_used: "Last used"
58
+ last_created: "Last created"
56
59
  records: "Records"
57
60
  username: "User"
58
61
  changes: "Changes"
@@ -8,8 +8,8 @@ RailsAdmin.config do |config|
8
8
  # end
9
9
  # config.current_user_method(&:current_user)
10
10
 
11
- ## == Cancan ==
12
- # config.authorize_with :cancan
11
+ ## == CancanCan ==
12
+ # config.authorize_with :cancancan
13
13
 
14
14
  ## == Pundit ==
15
15
  # config.authorize_with :pundit
@@ -19,6 +19,10 @@ RailsAdmin.config do |config|
19
19
 
20
20
  ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
21
21
 
22
+ ## == Gravatar integration ==
23
+ ## To disable Gravatar integration in Navigation Bar set to false
24
+ # config.show_gravatar = true
25
+
22
26
  config.actions do
23
27
  dashboard # mandatory
24
28
  index # mandatory
@@ -46,7 +46,7 @@ module RailsAdmin
46
46
  def initialize(model_or_model_name)
47
47
  @model_name = model_or_model_name.to_s
48
48
  ancestors = model.ancestors.collect(&:to_s)
49
- if ancestors.include?('ActiveRecord::Base') && !model.abstract_class?
49
+ if ancestors.include?('ActiveRecord::Base') && !model.abstract_class? && model.table_exists?
50
50
  initialize_active_record
51
51
  elsif ancestors.include?('Mongoid::Document')
52
52
  initialize_mongoid
@@ -87,12 +87,11 @@ module RailsAdmin
87
87
  case association.type
88
88
  when :has_one
89
89
  if child = object.send(association.name)
90
- yield(association, child)
90
+ yield(association, [child])
91
91
  end
92
92
  when :has_many
93
- object.send(association.name).each do |child| # rubocop:disable ShadowingOuterLocalVariable
94
- yield(association, child)
95
- end
93
+ children = object.send(association.name)
94
+ yield(association, Array.new(children))
96
95
  end
97
96
  end
98
97
  end
@@ -147,7 +146,7 @@ module RailsAdmin
147
146
  end
148
147
 
149
148
  def build_statement_for_type
150
- fail('You must override build_statement_for_type in your StatementBuilder')
149
+ raise('You must override build_statement_for_type in your StatementBuilder')
151
150
  end
152
151
 
153
152
  def build_statement_for_integer_decimal_or_float
@@ -179,17 +178,17 @@ module RailsAdmin
179
178
 
180
179
  def build_statement_for_datetime_or_timestamp
181
180
  start_date, end_date = get_filtering_duration
182
- start_date = start_date.to_time.try(:beginning_of_day) if start_date
183
- end_date = end_date.to_time.try(:end_of_day) if end_date
181
+ start_date = start_date.try(:beginning_of_day) if start_date
182
+ end_date = end_date.try(:end_of_day) if end_date
184
183
  range_filter(start_date, end_date)
185
184
  end
186
185
 
187
186
  def unary_operators
188
- fail('You must override unary_operators in your StatementBuilder')
187
+ raise('You must override unary_operators in your StatementBuilder')
189
188
  end
190
189
 
191
190
  def range_filter(_min, _max)
192
- fail('You must override range_filter in your StatementBuilder')
191
+ raise('You must override range_filter in your StatementBuilder')
193
192
  end
194
193
 
195
194
  class FilteringDuration
@@ -20,11 +20,17 @@ module RailsAdmin
20
20
  end
21
21
 
22
22
  def save(options = {validate: true})
23
- object.save(options)
23
+ object.save(**options)
24
24
  end
25
25
 
26
- def method_missing(name, *args, &block)
27
- object.send(name, *args, &block)
26
+ if RUBY_VERSION >= '2.7'
27
+ def method_missing(method_name, *args, **kwargs, &block)
28
+ object.send(method_name, *args, **kwargs, &block)
29
+ end
30
+ else
31
+ def method_missing(method_name, *args, &block)
32
+ object.send(method_name, *args, &block)
33
+ end
28
34
  end
29
35
  end
30
36
  end
@@ -48,11 +48,7 @@ module RailsAdmin
48
48
  private
49
49
 
50
50
  def serialized?
51
- if Rails.version < '4.2'
52
- model.serialized_attributes[property.name.to_s]
53
- else
54
- model.type_for_attribute(property.name).class == ::ActiveRecord::Type::Serialized
55
- end
51
+ model.type_for_attribute(property.name).class == ::ActiveRecord::Type::Serialized
56
52
  end
57
53
  end
58
54
  end