rails_admin 2.1.0 → 3.0.0.beta

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 (343) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -11
  3. data/README.md +37 -31
  4. data/Rakefile +2 -2
  5. data/app/assets/javascripts/rails_admin.js +21 -0
  6. data/app/assets/stylesheets/rails_admin/custom/mixins.scss +1 -1
  7. data/app/assets/stylesheets/rails_admin/custom/variables.scss +1 -1
  8. data/app/assets/stylesheets/rails_admin.scss.erb +76 -0
  9. data/app/controllers/rails_admin/application_controller.rb +4 -3
  10. data/app/controllers/rails_admin/main_controller.rb +43 -24
  11. data/app/helpers/rails_admin/application_helper.rb +69 -52
  12. data/app/helpers/rails_admin/form_builder.rb +7 -4
  13. data/app/helpers/rails_admin/main_helper.rb +27 -43
  14. data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.erb +5 -0
  15. data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.erb +9 -0
  16. data/app/views/kaminari/ra-twitter-bootstrap/_page.html.erb +9 -0
  17. data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.erb +13 -0
  18. data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.erb +9 -0
  19. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.erb +9 -0
  20. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.erb +6 -0
  21. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.erb +9 -0
  22. data/app/views/layouts/rails_admin/_head.html.erb +17 -0
  23. data/app/views/layouts/rails_admin/_navigation.html.erb +21 -0
  24. data/app/views/layouts/rails_admin/_secondary_navigation.html.erb +24 -0
  25. data/app/views/layouts/rails_admin/_sidebar_navigation.html.erb +9 -0
  26. data/app/views/layouts/rails_admin/application.html.erb +27 -0
  27. data/app/views/layouts/rails_admin/modal.js.erb +7 -0
  28. data/app/views/layouts/rails_admin/pjax.html.erb +20 -0
  29. data/app/views/rails_admin/main/_dashboard_history.html.erb +45 -0
  30. data/app/views/rails_admin/main/_delete_notice.html.erb +35 -0
  31. data/app/views/rails_admin/main/_form_action_text.html.erb +7 -0
  32. data/app/views/rails_admin/main/_form_boolean.html.erb +16 -0
  33. data/app/views/rails_admin/main/{_form_ck_editor.html.haml → _form_ck_editor.html.erb} +3 -3
  34. data/app/views/rails_admin/main/_form_code_mirror.html.erb +9 -0
  35. data/app/views/rails_admin/main/_form_colorpicker.html.erb +1 -0
  36. data/app/views/rails_admin/main/_form_datetime.html.erb +9 -0
  37. data/app/views/rails_admin/main/_form_enumeration.html.erb +21 -0
  38. data/app/views/rails_admin/main/_form_field.html.erb +1 -0
  39. data/app/views/rails_admin/main/_form_file_upload.html.erb +17 -0
  40. data/app/views/rails_admin/main/{_form_filtering_multiselect.html.haml → _form_filtering_multiselect.html.erb} +11 -11
  41. data/app/views/rails_admin/main/{_form_filtering_select.html.haml → _form_filtering_select.html.erb} +13 -12
  42. data/app/views/rails_admin/main/_form_froala.html.erb +8 -0
  43. data/app/views/rails_admin/main/_form_multiple_file_upload.html.erb +20 -0
  44. data/app/views/rails_admin/main/_form_nested_many.html.erb +21 -0
  45. data/app/views/rails_admin/main/_form_nested_one.html.erb +21 -0
  46. data/app/views/rails_admin/main/_form_polymorphic_association.html.erb +27 -0
  47. data/app/views/rails_admin/main/_form_simple_mde.html.erb +8 -0
  48. data/app/views/rails_admin/main/_form_text.html.erb +1 -0
  49. data/app/views/rails_admin/main/_form_wysihtml5.html.erb +8 -0
  50. data/app/views/rails_admin/main/_submit_buttons.html.erb +25 -0
  51. data/app/views/rails_admin/main/bulk_delete.html.erb +19 -0
  52. data/app/views/rails_admin/main/dashboard.html.erb +64 -0
  53. data/app/views/rails_admin/main/delete.html.erb +21 -0
  54. data/app/views/rails_admin/main/edit.html.erb +3 -0
  55. data/app/views/rails_admin/main/export.html.erb +146 -0
  56. data/app/views/rails_admin/main/history.html.erb +78 -0
  57. data/app/views/rails_admin/main/index.html.erb +193 -0
  58. data/app/views/rails_admin/main/new.html.erb +3 -0
  59. data/app/views/rails_admin/main/show.html.erb +28 -0
  60. data/config/initializers/active_record_extensions.rb +3 -1
  61. data/config/initializers/mongoid_extensions.rb +1 -1
  62. data/config/locales/rails_admin.en.yml +6 -1
  63. data/lib/generators/rails_admin/install_generator.rb +51 -3
  64. data/lib/generators/rails_admin/templates/environment.js +6 -0
  65. data/lib/generators/rails_admin/templates/initializer.erb +2 -1
  66. data/lib/generators/rails_admin/templates/rails_admin.js.erb +2 -0
  67. data/lib/generators/rails_admin/templates/rails_admin.scss +1 -0
  68. data/lib/generators/rails_admin/templates/webpack.config.js +32 -0
  69. data/lib/rails_admin/abstract_model.rb +24 -10
  70. data/lib/rails_admin/adapters/active_record/association.rb +20 -1
  71. data/lib/rails_admin/adapters/active_record/object_extension.rb +29 -0
  72. data/lib/rails_admin/adapters/active_record/property.rb +1 -1
  73. data/lib/rails_admin/adapters/active_record.rb +27 -23
  74. data/lib/rails_admin/adapters/mongoid/association.rb +38 -9
  75. data/lib/rails_admin/adapters/mongoid/bson.rb +4 -5
  76. data/lib/rails_admin/adapters/mongoid/extension.rb +3 -1
  77. data/lib/rails_admin/adapters/mongoid/object_extension.rb +32 -0
  78. data/lib/rails_admin/adapters/mongoid/property.rb +2 -2
  79. data/lib/rails_admin/adapters/mongoid.rb +27 -19
  80. data/lib/rails_admin/config/actions/base.rb +7 -2
  81. data/lib/rails_admin/config/actions/bulk_delete.rb +2 -2
  82. data/lib/rails_admin/config/actions/dashboard.rb +4 -3
  83. data/lib/rails_admin/config/actions/delete.rb +5 -9
  84. data/lib/rails_admin/config/actions/edit.rb +7 -7
  85. data/lib/rails_admin/config/actions/export.rb +2 -2
  86. data/lib/rails_admin/config/actions/history_index.rb +2 -2
  87. data/lib/rails_admin/config/actions/history_show.rb +2 -2
  88. data/lib/rails_admin/config/actions/index.rb +5 -7
  89. data/lib/rails_admin/config/actions/new.rb +9 -9
  90. data/lib/rails_admin/config/actions/show.rb +1 -1
  91. data/lib/rails_admin/config/actions/show_in_app.rb +6 -2
  92. data/lib/rails_admin/config/actions.rb +4 -4
  93. data/lib/rails_admin/config/configurable.rb +2 -2
  94. data/lib/rails_admin/config/fields/association.rb +15 -12
  95. data/lib/rails_admin/config/fields/base.rb +44 -24
  96. data/lib/rails_admin/config/fields/factories/active_storage.rb +1 -0
  97. data/lib/rails_admin/config/fields/factories/association.rb +6 -8
  98. data/lib/rails_admin/config/fields/factories/carrierwave.rb +2 -1
  99. data/lib/rails_admin/config/fields/factories/devise.rb +2 -1
  100. data/lib/rails_admin/config/fields/factories/dragonfly.rb +2 -1
  101. data/lib/rails_admin/config/fields/factories/paperclip.rb +2 -1
  102. data/lib/rails_admin/config/fields/factories/shrine.rb +1 -1
  103. data/lib/rails_admin/config/fields/group.rb +1 -2
  104. data/lib/rails_admin/config/fields/types/active_record_enum.rb +2 -0
  105. data/lib/rails_admin/config/fields/types/active_storage.rb +9 -7
  106. data/lib/rails_admin/config/fields/types/all.rb +1 -0
  107. data/lib/rails_admin/config/fields/types/belongs_to_association.rb +4 -12
  108. data/lib/rails_admin/config/fields/types/boolean.rb +32 -8
  109. data/lib/rails_admin/config/fields/types/carrierwave.rb +1 -0
  110. data/lib/rails_admin/config/fields/types/citext.rb +13 -0
  111. data/lib/rails_admin/config/fields/types/color.rb +6 -2
  112. data/lib/rails_admin/config/fields/types/date.rb +5 -8
  113. data/lib/rails_admin/config/fields/types/datetime.rb +18 -21
  114. data/lib/rails_admin/config/fields/types/decimal.rb +9 -2
  115. data/lib/rails_admin/config/fields/types/dragonfly.rb +3 -1
  116. data/lib/rails_admin/config/fields/types/enum.rb +1 -1
  117. data/lib/rails_admin/config/fields/types/file_upload.rb +4 -3
  118. data/lib/rails_admin/config/fields/types/float.rb +9 -2
  119. data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -5
  120. data/lib/rails_admin/config/fields/types/has_one_association.rb +1 -13
  121. data/lib/rails_admin/config/fields/types/integer.rb +2 -6
  122. data/lib/rails_admin/config/fields/types/multiple_active_storage.rb +8 -6
  123. data/lib/rails_admin/config/fields/types/multiple_carrierwave.rb +1 -0
  124. data/lib/rails_admin/config/fields/types/multiple_file_upload.rb +4 -3
  125. data/lib/rails_admin/config/fields/types/numeric.rb +18 -0
  126. data/lib/rails_admin/config/fields/types/polymorphic_association.rb +3 -2
  127. data/lib/rails_admin/config/fields/types/string.rb +1 -1
  128. data/lib/rails_admin/config/fields/types/time.rb +1 -4
  129. data/lib/rails_admin/config/fields/types/timestamp.rb +0 -4
  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 +5 -6
  133. data/lib/rails_admin/config/hideable.rb +1 -1
  134. data/lib/rails_admin/config/inspectable.rb +1 -3
  135. data/lib/rails_admin/config/model.rb +10 -10
  136. data/lib/rails_admin/config/sections/base.rb +2 -3
  137. data/lib/rails_admin/config/sections/list.rb +4 -15
  138. data/lib/rails_admin/config/sections.rb +1 -1
  139. data/lib/rails_admin/config.rb +73 -38
  140. data/lib/rails_admin/engine.rb +36 -23
  141. data/lib/rails_admin/extension.rb +6 -14
  142. data/lib/rails_admin/extensions/cancancan/authorization_adapter.rb +4 -2
  143. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +13 -8
  144. data/lib/rails_admin/extensions/pundit/authorization_adapter.rb +6 -7
  145. data/lib/rails_admin/support/csv_converter.rb +12 -13
  146. data/lib/rails_admin/support/datetime.rb +40 -74
  147. data/lib/rails_admin/support/esmodule_preprocessor.rb +32 -0
  148. data/lib/rails_admin/support/hash_helper.rb +6 -5
  149. data/lib/rails_admin/version.rb +7 -3
  150. data/lib/rails_admin.rb +1 -4
  151. data/lib/tasks/rails_admin.rake +3 -3
  152. data/package.json +28 -0
  153. data/src/rails_admin/base.js +21 -0
  154. data/src/rails_admin/filter-box.js +405 -0
  155. data/src/rails_admin/filtering-multiselect.js +394 -0
  156. data/src/rails_admin/filtering-select.js +302 -0
  157. data/src/rails_admin/i18n.js +19 -0
  158. data/src/rails_admin/nested-form-hooks.js +100 -0
  159. data/src/rails_admin/remote-form.js +190 -0
  160. data/src/rails_admin/sidescroll.js +20 -0
  161. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/README.txt +0 -0
  162. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/mixins.scss +0 -0
  163. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/theming.scss +93 -34
  164. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/variables.scss +0 -0
  165. data/src/rails_admin/styles/base.scss +64 -0
  166. data/src/rails_admin/styles/filtering-multiselect.scss +53 -0
  167. data/src/rails_admin/styles/filtering-select.scss +70 -0
  168. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/mixins.scss +0 -0
  169. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/theming.scss +23 -21
  170. data/src/rails_admin/styles/themes/cerulean/variables.scss +830 -0
  171. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/mixins.scss +1 -1
  172. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/theming.scss +0 -0
  173. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/variables.scss +1 -1
  174. data/src/rails_admin/styles/widgets.scss +35 -0
  175. data/src/rails_admin/ui.js +172 -0
  176. data/src/rails_admin/vendor/jquery.pjax.js +899 -0
  177. data/src/rails_admin/vendor/jquery_nested_form.js +122 -0
  178. data/src/rails_admin/widgets.js +512 -0
  179. data/vendor/assets/fonts/rails_admin/fa-solid-900.eot +0 -0
  180. data/vendor/assets/fonts/rails_admin/fa-solid-900.svg +5034 -0
  181. data/vendor/assets/fonts/rails_admin/fa-solid-900.ttf +0 -0
  182. data/vendor/assets/fonts/rails_admin/fa-solid-900.woff +0 -0
  183. data/vendor/assets/fonts/rails_admin/fa-solid-900.woff2 +0 -0
  184. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js +50 -28
  185. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js +10 -7
  186. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-button.js +35 -20
  187. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-carousel.js +48 -25
  188. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-collapse.js +70 -28
  189. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-dropdown.js +56 -42
  190. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-modal.js +118 -40
  191. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-popover.js +26 -16
  192. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-scrollspy.js +29 -27
  193. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-tab.js +46 -19
  194. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-tooltip.js +280 -60
  195. data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js +5 -5
  196. data/vendor/assets/javascripts/rails_admin/bootstrap-datetimepicker.js +317 -150
  197. data/vendor/assets/javascripts/rails_admin/jquery-ui/data.js +41 -0
  198. data/vendor/assets/javascripts/rails_admin/jquery-ui/effect.js +1637 -0
  199. data/vendor/assets/javascripts/rails_admin/jquery-ui/ie.js +17 -0
  200. data/vendor/assets/javascripts/rails_admin/jquery-ui/keycode.js +47 -0
  201. data/vendor/assets/javascripts/rails_admin/jquery-ui/position.js +500 -0
  202. data/vendor/assets/javascripts/rails_admin/jquery-ui/safe-active-element.js +42 -0
  203. data/vendor/assets/javascripts/rails_admin/jquery-ui/scroll-parent.js +47 -0
  204. data/vendor/assets/javascripts/rails_admin/jquery-ui/unique-id.js +51 -0
  205. data/vendor/assets/javascripts/rails_admin/jquery-ui/version.js +17 -0
  206. data/vendor/assets/javascripts/rails_admin/jquery-ui/widget.js +735 -0
  207. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/autocomplete.js +689 -0
  208. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/menu.js +680 -0
  209. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/mouse.js +230 -0
  210. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/sortable.js +1561 -0
  211. data/vendor/assets/javascripts/rails_admin/jquery.pjax.js +317 -160
  212. data/vendor/assets/javascripts/rails_admin/jquery3.js +10872 -0
  213. data/vendor/assets/javascripts/rails_admin/moment-with-locales.js +11210 -9290
  214. data/vendor/assets/stylesheets/rails_admin/font-awesome.scss +4476 -2216
  215. metadata +118 -262
  216. data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
  217. data/app/assets/images/rails_admin/aristo/images/icon_sprite.png +0 -0
  218. data/app/assets/images/rails_admin/aristo/images/progress_bar.gif +0 -0
  219. data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
  220. data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  221. data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  222. data/app/assets/images/rails_admin/bullet_black.png +0 -0
  223. data/app/assets/images/rails_admin/bullet_white.png +0 -0
  224. data/app/assets/images/rails_admin/calendar.png +0 -0
  225. data/app/assets/images/rails_admin/clock.png +0 -0
  226. data/app/assets/images/rails_admin/logo.png +0 -0
  227. data/app/assets/images/rails_admin/magnifier.png +0 -0
  228. data/app/assets/images/rails_admin/multiselect/icon_sprite.png +0 -0
  229. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
  230. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-light.png +0 -0
  231. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
  232. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
  233. data/app/assets/javascripts/rails_admin/jquery-ui.js.erb +0 -8
  234. data/app/assets/javascripts/rails_admin/ra.filter-box.js +0 -248
  235. data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +0 -331
  236. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +0 -294
  237. data/app/assets/javascripts/rails_admin/ra.i18n.js +0 -28
  238. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.js +0 -59
  239. data/app/assets/javascripts/rails_admin/ra.remote-form.js +0 -155
  240. data/app/assets/javascripts/rails_admin/ra.sidescroll.js +0 -31
  241. data/app/assets/javascripts/rails_admin/ra.widgets.js +0 -379
  242. data/app/assets/javascripts/rails_admin/rails_admin.js +0 -20
  243. data/app/assets/javascripts/rails_admin/ui.js +0 -135
  244. data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
  245. data/app/assets/stylesheets/rails_admin/aristo/images/icon_sprite.png +0 -0
  246. data/app/assets/stylesheets/rails_admin/aristo/images/progress_bar.gif +0 -0
  247. data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
  248. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  249. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  250. data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.scss +0 -733
  251. data/app/assets/stylesheets/rails_admin/base/font-awesome-4-compability.scss +0 -153
  252. data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.scss +0 -88
  253. data/app/assets/stylesheets/rails_admin/ra.sidescroll.scss +0 -29
  254. data/app/assets/stylesheets/rails_admin/ra.widgets.scss +0 -17
  255. data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +0 -110
  256. data/app/assets/stylesheets/rails_admin/themes/cerulean/variables.scss +0 -857
  257. data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.haml +0 -2
  258. data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.haml +0 -4
  259. data/app/views/kaminari/ra-twitter-bootstrap/_page.html.haml +0 -4
  260. data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.haml +0 -9
  261. data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.haml +0 -4
  262. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.haml +0 -4
  263. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.haml +0 -4
  264. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.haml +0 -4
  265. data/app/views/layouts/rails_admin/_head.html.haml +0 -7
  266. data/app/views/layouts/rails_admin/_navigation.html.haml +0 -12
  267. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +0 -10
  268. data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +0 -3
  269. data/app/views/layouts/rails_admin/application.html.haml +0 -16
  270. data/app/views/layouts/rails_admin/pjax.html.haml +0 -12
  271. data/app/views/rails_admin/main/_dashboard_history.html.haml +0 -21
  272. data/app/views/rails_admin/main/_delete_notice.html.haml +0 -24
  273. data/app/views/rails_admin/main/_form_action_text.html.haml +0 -7
  274. data/app/views/rails_admin/main/_form_boolean.html.haml +0 -3
  275. data/app/views/rails_admin/main/_form_code_mirror.html.haml +0 -9
  276. data/app/views/rails_admin/main/_form_colorpicker.html.haml +0 -1
  277. data/app/views/rails_admin/main/_form_datetime.html.haml +0 -5
  278. data/app/views/rails_admin/main/_form_enumeration.html.haml +0 -19
  279. data/app/views/rails_admin/main/_form_field.html.haml +0 -1
  280. data/app/views/rails_admin/main/_form_file_upload.html.haml +0 -17
  281. data/app/views/rails_admin/main/_form_froala.html.haml +0 -8
  282. data/app/views/rails_admin/main/_form_multiple_file_upload.html.haml +0 -16
  283. data/app/views/rails_admin/main/_form_nested_many.html.haml +0 -15
  284. data/app/views/rails_admin/main/_form_nested_one.html.haml +0 -17
  285. data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +0 -26
  286. data/app/views/rails_admin/main/_form_simple_mde.haml +0 -8
  287. data/app/views/rails_admin/main/_form_text.html.haml +0 -1
  288. data/app/views/rails_admin/main/_form_wysihtml5.html.haml +0 -8
  289. data/app/views/rails_admin/main/_submit_buttons.html.haml +0 -16
  290. data/app/views/rails_admin/main/bulk_delete.html.haml +0 -11
  291. data/app/views/rails_admin/main/dashboard.html.haml +0 -34
  292. data/app/views/rails_admin/main/delete.html.haml +0 -18
  293. data/app/views/rails_admin/main/edit.html.haml +0 -2
  294. data/app/views/rails_admin/main/export.html.haml +0 -92
  295. data/app/views/rails_admin/main/history.html.haml +0 -51
  296. data/app/views/rails_admin/main/index.html.haml +0 -126
  297. data/app/views/rails_admin/main/new.html.haml +0 -2
  298. data/app/views/rails_admin/main/show.html.haml +0 -15
  299. data/config/initializers/devise_patch.rb +0 -9
  300. data/config/initializers/haml.rb +0 -5
  301. data/lib/rails_admin/adapters/active_record/abstract_object.rb +0 -32
  302. data/lib/rails_admin/adapters/mongoid/abstract_object.rb +0 -42
  303. data/lib/rails_admin/bootstrap-sass/compass_functions.rb +0 -28
  304. data/lib/rails_admin/bootstrap-sass/sass_functions.rb +0 -16
  305. data/lib/rails_admin/bootstrap-sass.rb +0 -49
  306. data/lib/rails_admin/config/lazy_model.rb +0 -68
  307. data/lib/rails_admin/extensions/history/auditing_adapter.rb +0 -37
  308. data/lib/rails_admin/extensions/history/history.rb +0 -44
  309. data/lib/rails_admin/extensions/history.rb +0 -3
  310. data/lib/rails_admin/support/i18n.rb +0 -43
  311. data/vendor/assets/fonts/rails_admin/FontAwesome.otf +0 -0
  312. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.eot +0 -0
  313. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.svg +0 -2671
  314. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.ttf +0 -0
  315. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff +0 -0
  316. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff2 +0 -0
  317. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
  318. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
  319. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
  320. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
  321. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
  322. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
  323. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
  324. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
  325. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
  326. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
  327. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
  328. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
  329. data/vendor/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
  330. data/vendor/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
  331. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
  332. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
  333. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
  334. data/vendor/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
  335. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
  336. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
  337. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
  338. data/vendor/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
  339. data/vendor/assets/images/rails_admin/colorpicker/select.png +0 -0
  340. data/vendor/assets/images/rails_admin/colorpicker/select2.png +0 -0
  341. data/vendor/assets/images/rails_admin/colorpicker/slider.png +0 -0
  342. data/vendor/assets/javascripts/rails_admin/jquery.colorpicker.js +0 -484
  343. data/vendor/assets/stylesheets/rails_admin/jquery.colorpicker.scss +0 -182
@@ -0,0 +1,35 @@
1
+ <% object = delete_notice %>
2
+ <li style="display:block; margin-top:10px">
3
+ <span class="label label-default">
4
+ <%= @abstract_model.pretty_name %>
5
+ </span>
6
+ <% wording = object.send(@model_config.object_label_method) %>
7
+ <% if show_action = action(:show, @abstract_model, object) %>
8
+ <%= link_to(wording, url_for(action: show_action.action_name, model_name: @abstract_model.to_param, id: object.id), class: 'pjax') %>
9
+ <% else %>
10
+ <%= wording %>
11
+ <% end %>
12
+ <ul>
13
+ <% @abstract_model.each_associated_children(object) do |association, children| %>
14
+ <% humanized_association = @abstract_model.model.human_attribute_name association.name %>
15
+ <% limit = children.count > 12 ? 10 : children.count %>
16
+ <% children.first(limit).each do |child| %>
17
+ <%= content_tag :li, class: dom_class(child) do %>
18
+ <% child_config = RailsAdmin.config(child) %>
19
+ <%= humanized_association.singularize %>
20
+ <% wording = child.send(child_config.object_label_method) %>
21
+ <% if child.id && (show_action = action(:show, child_config.abstract_model, child)) %>
22
+ <%= link_to(wording, url_for(action: show_action.action_name, model_name: child_config.abstract_model.to_param, id: child.id), class: 'pjax') %>
23
+ <% else %>
24
+ <%= wording %>
25
+ <% end %>
26
+ <% end %>
27
+ <% end %>
28
+ <% if children.count > limit %>
29
+ <li>
30
+ <%= t('admin.misc.more', count: children.count - limit, models_name: humanized_association) %>
31
+ </li>
32
+ <% end %>
33
+ <% end %>
34
+ </ul>
35
+ </li>
@@ -0,0 +1,7 @@
1
+ <%
2
+ js_data = {
3
+ csspath: field.css_location,
4
+ jspath: field.js_location
5
+ }
6
+ %>
7
+ <%= form.rich_text_area field.method_name, field.html_attributes.reverse_merge(data: { options: js_data.to_json }) %>
@@ -0,0 +1,16 @@
1
+ <% if field.nullable? %>
2
+ <div class="btn-group" data-toggle="buttons">
3
+ <% {'1': true, '0': false, '': nil}.each do |text, value| %>
4
+ <label class="<%= [field.css_classes[value], ("active" if field.form_value == value)].compact.join(' ') %> btn btn-default">
5
+ <%= form.radio_button field.method_name, text, field.html_attributes.reverse_merge({ checked: field.form_value == value, required: field.required}) %>
6
+ <%= field.labels[value].html_safe %>
7
+ </label>
8
+ <% end %>
9
+ </div>
10
+ <% else %>
11
+ <div class="checkbox">
12
+ <label style="display: block;">
13
+ <%= form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge({ value: field.form_value, checked: field.form_value.in?([true, '1']), required: field.required}) %>
14
+ </label>
15
+ </div>
16
+ <% end %>
@@ -1,4 +1,4 @@
1
- :ruby
1
+ <%
2
2
  js_data = {
3
3
  jspath: field.location ? field.location : field.base_location + "ckeditor.js",
4
4
  base_location: field.base_location,
@@ -6,5 +6,5 @@
6
6
  customConfig: field.config_js ? field.config_js : field.base_location + "config.js"
7
7
  }
8
8
  }
9
-
10
- = form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: 'ckeditor', options: js_data.to_json }).reverse_merge({ value: field.form_value })
9
+ %>
10
+ <%= form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: 'ckeditor', options: js_data.to_json }).reverse_merge({ value: field.form_value }) %>
@@ -0,0 +1,9 @@
1
+ <%
2
+ js_data = {
3
+ csspath: field.css_location,
4
+ jspath: field.js_location,
5
+ options: field.config,
6
+ locations: field.assets
7
+ }
8
+ %>
9
+ <%= form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: 'codemirror', options: js_data.to_json }).reverse_merge({ value: field.form_value }) %>
@@ -0,0 +1 @@
1
+ <%= form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge({class: 'form-control', value: field.form_value}) %>
@@ -0,0 +1,9 @@
1
+ <div class="form-inline">
2
+ <div class="input-group">
3
+ <%= form.hidden_field(field.method_name, id: nil, value: field.form_value) %>
4
+ <%= form.text_field field.method_name, field.html_attributes.reverse_merge({class: 'form-control', data: {datetimepicker: true, options: field.datepicker_options.to_json}, name: nil, value: nil}) %>
5
+ <%= form.label(field.method_name, class: 'input-group-addon') do %>
6
+ <i class="fa fa-fw fa-calendar"></i>
7
+ <% end %>
8
+ </div>
9
+ </div>
@@ -0,0 +1,21 @@
1
+ <% unless field.multiple? %>
2
+ <%= form.select field.method_name, field.enum, { include_blank: true }.reverse_merge({ selected: field.form_value }), field.html_attributes.reverse_merge({ data: { enumeration: true }, placeholder: t('admin.misc.search') }) %>
3
+ <% else %>
4
+ <%
5
+ js_data = {
6
+ xhr: false,
7
+ sortable: false,
8
+ cacheAll: true,
9
+ regional: {
10
+ add: t("admin.misc.add_new"),
11
+ chooseAll: t("admin.misc.chose_all"),
12
+ clearAll: t("admin.misc.clear_all"),
13
+ down: t("admin.misc.down"),
14
+ remove: t("admin.misc.remove"),
15
+ search: t("admin.misc.search"),
16
+ up: t("admin.misc.up")
17
+ }
18
+ }
19
+ %>
20
+ <%= form.select field.method_name, field.enum, { selected: field.form_value, object: form.object }, field.html_attributes.reverse_merge({data: { filteringmultiselect: true, options: js_data.to_json }, multiple: true}) %>
21
+ <% end %>
@@ -0,0 +1 @@
1
+ <%= form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge({ value: field.form_value, class: 'form-control', required: field.required}) %>
@@ -0,0 +1,17 @@
1
+ <% file = field.value %>
2
+ <% if field.cache_method %>
3
+ <%= form.hidden_field(field.cache_method, value: field.cache_value) %>
4
+ <% end %>
5
+ <div class="toggle" style="<%= ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1') %>">
6
+ <% if value = field.pretty_value %>
7
+ <%= value %>
8
+ <% end %>
9
+ <%= form.file_field(field.name, field.html_attributes.reverse_merge({ data: { fileupload: true }})) %>
10
+ </div>
11
+ <% if field.optional? && field.errors.blank? && file && field.delete_method %>
12
+ <a class="btn btn-info btn-remove-image" data-toggle="button" href="#" role="button">
13
+ <i class="fas fa-trash"></i>
14
+ <%= I18n.t('admin.actions.delete.link', object_label: field.label) %>
15
+ </a>
16
+ <%= form.check_box(field.delete_method, style: 'display:none;') %>
17
+ <% end %>
@@ -1,4 +1,4 @@
1
- :ruby
1
+ <%
2
2
  related_id = params[:associations] && params[:associations][field.name.to_s]
3
3
  config = field.associated_model_config
4
4
  source_abstract_model = RailsAdmin.config(form.object.class).abstract_model
@@ -23,7 +23,7 @@
23
23
 
24
24
  js_data = {
25
25
  xhr: xhr,
26
- :'edit-url' => (authorized?(:edit, config.abstract_model) ? edit_path(model_name: config.abstract_model.to_param, id: '__ID__') : ''),
26
+ :'edit-url' => (field.inline_edit && authorized?(:edit, config.abstract_model) ? edit_path(model_name: config.abstract_model.to_param, id: '__ID__') : ''),
27
27
  remote_source: index_path(config.abstract_model, source_object_id: form.object.id, source_abstract_model: source_abstract_model.to_param, associated_collection: field.name, current_action: current_action, compact: true),
28
28
  sortable: !!field.orderable,
29
29
  removable: !!field.removable,
@@ -38,12 +38,12 @@
38
38
  up: t('admin.misc.up')
39
39
  }
40
40
  }
41
-
42
- %input{name: form.dom_name(field), type: "hidden", value: ""}
43
-
44
- - selected_ids = (hdv = field.form_default_value).nil? ? selected_ids : hdv
45
- = form.select field.method_name, collection, { selected: selected_ids, object: form.object }, field.html_attributes.reverse_merge({data: { filteringmultiselect: true, options: js_data.to_json }, multiple: true})
46
- - if authorized?(:new, config.abstract_model) && field.inline_add
47
- - path_hash = { model_name: config.abstract_model.to_param, modal: true }
48
- - path_hash.merge!({ associations: { field.inverse_of => (form.object.persisted? ? form.object.id : 'new') } }) if field.inverse_of
49
- = link_to "<i class=\"icon-plus icon-white\"></i> ".html_safe + wording_for(:link, :new, config.abstract_model), '#', data: { link: new_path(path_hash) }, class: "create btn btn-info", style: 'margin-left:10px'
41
+ %>
42
+ <input name="<%= form.dom_name(field) %>" type="hidden"></input>
43
+ <% selected_ids = (hdv = field.form_default_value).nil? ? selected_ids : hdv %>
44
+ <%= form.select field.method_name, collection, { selected: selected_ids, object: form.object }, field.html_attributes.reverse_merge({data: { filteringmultiselect: true, options: js_data.to_json }, multiple: true}) %>
45
+ <% if authorized?(:new, config.abstract_model) && field.inline_add %>
46
+ <% path_hash = { model_name: config.abstract_model.to_param, modal: true } %>
47
+ <% path_hash.merge!({ associations: { field.inverse_of => (form.object.persisted? ? form.object.id : 'new') } }) if field.inverse_of %>
48
+ <%= link_to "<i class=\"fas fa-plus\"></i> ".html_safe + wording_for(:link, :new, config.abstract_model), '#', data: { link: new_path(path_hash) }, class: "create btn btn-info", style: 'margin-left:10px' %>
49
+ <% end %>
@@ -1,4 +1,4 @@
1
- :ruby
1
+ <%
2
2
  config = field.associated_model_config
3
3
  related_id = params[:associations] && params[:associations][field.name.to_s]
4
4
  source_abstract_model = RailsAdmin.config(form.object.class).abstract_model
@@ -24,14 +24,15 @@
24
24
  xhr: xhr,
25
25
  remote_source: index_path(config.abstract_model.to_param, source_object_id: form.object.id, source_abstract_model: source_abstract_model.to_param, associated_collection: field.name, current_action: current_action, compact: true)
26
26
  }
27
-
28
- - selected_id = (hdv = field.form_default_value).nil? ? selected_id : hdv
29
- = form.select field.method_name, collection, { selected: selected_id, include_blank: true }, field.html_attributes.reverse_merge({ data: { filteringselect: true, options: js_data.to_json }, placeholder: t('admin.misc.search'), style: "float: left" })
30
-
31
- - if authorized?(:new, config.abstract_model) && field.inline_add
32
- - path_hash = { model_name: config.abstract_model.to_param, modal: true }
33
- - path_hash.merge!({ associations: { field.inverse_of => (form.object.persisted? ? form.object.id : 'new') } }) if field.inverse_of
34
- = link_to "<i class=\"icon-plus icon-white\"></i> ".html_safe + wording_for(:link, :new, config.abstract_model), '#', data: { link: new_path(path_hash) }, class: "btn btn-info create", style: 'margin-left:10px'
35
-
36
- - if edit_url.present? && field.inline_edit
37
- = link_to "<i class=\"icon-pencil icon-white\"></i> ".html_safe + wording_for(:link, :edit, config.abstract_model), '#', data: { link: edit_url }, class: "btn btn-info update #{field.value.nil? && 'disabled'}", style: 'margin-left:10px'
27
+ %>
28
+
29
+ <% selected_id = (hdv = field.form_default_value).nil? ? selected_id : hdv %>
30
+ <%= form.select field.method_name, collection, { selected: selected_id, include_blank: true }, field.html_attributes.reverse_merge({ data: { filteringselect: true, options: js_data.to_json }, placeholder: t('admin.misc.search'), style: "float: left" }) %>
31
+ <% if authorized?(:new, config.abstract_model) && field.inline_add %>
32
+ <% path_hash = { model_name: config.abstract_model.to_param, modal: true } %>
33
+ <% path_hash.merge!({ associations: { field.inverse_of => (form.object.persisted? ? form.object.id : 'new') } }) if field.inverse_of %>
34
+ <%= link_to "<i class=\"fas fa-plus\"></i> ".html_safe + wording_for(:link, :new, config.abstract_model), '#', data: { link: new_path(path_hash) }, class: "btn btn-info create", style: 'margin-left:10px' %>
35
+ <% end %>
36
+ <% if edit_url.present? && field.inline_edit %>
37
+ <%= link_to "<i class=\"fas fa-pencil-alt\"></i> ".html_safe + wording_for(:link, :edit, config.abstract_model), '#', data: { link: edit_url }, class: "btn btn-info update #{field.value.nil? && 'disabled'}", style: 'margin-left:10px' %>
38
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%
2
+ js_data = {
3
+ csspath: field.css_location,
4
+ jspath: field.js_location,
5
+ config_options: field.config_options.to_json
6
+ }
7
+ %>
8
+ <%= form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: 'froala-wysiwyg', options: js_data.to_json }).reverse_merge({ value: field.form_value }) %>
@@ -0,0 +1,20 @@
1
+ <% field.attachments.each_with_index do |attachment, i| %>
2
+ <div class="<%= field.reorderable? ? 'sortables' : '' %> toggle">
3
+ <%= attachment.pretty_value %>
4
+ <% if field.delete_method || field.keep_method %>
5
+ <a class="btn btn-info btn-remove-image" data-toggle="button" href="#" role="button">
6
+ <i class="fas fa-trash"></i>
7
+ <%= I18n.t('admin.form.delete_file', field_label: field.label, number: i + 1) %>
8
+ </a>
9
+ <% if field.keep_method %>
10
+ <%= form.check_box(field.keep_method, {multiple:true, checked: true, style: 'display:none;'}, attachment.keep_value, nil) %>
11
+ <% elsif field.delete_method %>
12
+ <%= form.check_box(field.delete_method, {multiple:true, style: 'display:none;'}, attachment.delete_value, nil) %>
13
+ <% end %>
14
+ <% end %>
15
+ </div>
16
+ <% end %>
17
+ <%= form.file_field(field.name, field.html_attributes.reverse_merge({ data: { :"multiple-fileupload" => true }, multiple: true })) %>
18
+ <% if field.cache_method %>
19
+ <%= form.hidden_field(field.cache_method) %>
20
+ <% end %>
@@ -0,0 +1,21 @@
1
+ <div class="controls col-sm-10" data-nestedmany="true">
2
+ <div class="btn-group">
3
+ <a class="<%= (field.active? ? 'active' : '') %> btn btn-info toggler" data-target="<%= form.jquery_namespace(field) %> > .tab-content, <%= form.jquery_namespace(field) %> > .controls > .nav" data-toggle="button">
4
+ <i class="fas"></i>
5
+ </a>
6
+ <% unless field.nested_form[:update_only] || !field.inline_add %>
7
+ <%= form.link_to_add "<i class=\"fas fa-plus\"></i> #{wording_for(:link, :new, field.associated_model_config.abstract_model)}".html_safe, field.name, { class: 'btn btn-info' } %>
8
+ <% end %>
9
+ </div>
10
+ <%= form.errors_for(field) %>
11
+ <%= form.help_for(field) %>
12
+ <ul class="nav nav-tabs"></ul>
13
+ </div>
14
+ <div class="tab-content">
15
+ <%= form.fields_for field.name do |nested_form| %>
16
+ <% if field.nested_form[:allow_destroy] || nested_form.options[:child_index] == "new_#{field.name}" %>
17
+ <%= nested_form.link_to_remove '<span class="btn btn-small btn-danger"><i class="fas fa-trash"></i></span>'.html_safe %>
18
+ <% end %>
19
+ <%= nested_form.generate({action: :nested, model_config: field.associated_model_config, nested_in: field }) %>
20
+ <% end %>
21
+ </div>
@@ -0,0 +1,21 @@
1
+ <div class="controls col-sm-10" data-nestedone="true">
2
+ <ul class="nav" style="margin-bottom:0px; display:none"></ul>
3
+ <div class="btn-group">
4
+ <a class="<%= (field.active? ? 'active' : '') %> btn btn-info toggler" data-target="<%= form.jquery_namespace(field) %> > .tab-content">
5
+ <i class="fas"></i>
6
+ </a>
7
+ <% unless field.nested_form[:update_only] || !field.inline_add %>
8
+ <%= form.link_to_add "<i class=\"fas fa-plus\"></i> #{wording_for(:link, :new, field.associated_model_config.abstract_model)}".html_safe, field.name, { class: 'btn btn-info', :'data-add-label' => "<i class=\"fas fa-plus\"></i> #{wording_for(:link, :new, field.associated_model_config.abstract_model)}".gsub("\n", "") } %>
9
+ <% end %>
10
+ </div>
11
+ <%= form.errors_for(field) %>
12
+ <%= form.help_for(field) %>
13
+ </div>
14
+ <div class="tab-content">
15
+ <%= form.fields_for field.name do |nested_form| %>
16
+ <% if field.nested_form[:allow_destroy] %>
17
+ <%= nested_form.link_to_remove '<span class="btn btn-small btn-danger"><i class="fas fa-trash"></i></span>'.html_safe %>
18
+ <% end %>
19
+ <%= nested_form.generate({action: :nested, model_config: field.associated_model_config, nested_in: field }) %>
20
+ <% end %>
21
+ </div>
@@ -0,0 +1,27 @@
1
+ <%
2
+ type_collection = field.polymorphic_type_collection
3
+ type_column = field.association.foreign_type.to_s
4
+ selected_type = field.bindings[:object].send(type_column)
5
+ selected = field.bindings[:object].send(field.association.name)
6
+ collection = selected ? [[field.formatted_value, selected.id]] : [[]]
7
+ column_type_dom_id = form.dom_id(field).sub(field.method_name.to_s, type_column)
8
+ current_action = params[:action].in?(['create', 'new']) ? 'create' : 'update'
9
+
10
+ default_options = { float_left: false }
11
+
12
+ js_data = type_collection.inject({}) do |options, model|
13
+ source_abstract_model = RailsAdmin.config(form.object.class).abstract_model
14
+ options.merge(model.second.downcase.gsub('::', '-') => {
15
+ xhr: true,
16
+ remote_source: index_path(model.second.underscore, source_object_id: form.object.id, source_abstract_model: source_abstract_model.to_param, current_action: current_action, compact: true),
17
+ float_left: false
18
+ })
19
+ end
20
+ %>
21
+ <div class="form-inline">
22
+ <% js_data.each do |model, value| %>
23
+ <div data-options="<%= value.to_json %>" id="<%= model %>-js-options"></div>
24
+ <% end %>
25
+ <%= form.select type_column, type_collection, {include_blank: true, selected: selected_type}, class: "form-control", id: column_type_dom_id, data: { polymorphic: true, urls: field.polymorphic_type_urls.to_json }, style: "float: left; margin-right: 10px;" %>
26
+ <%= form.select field.method_name, collection, {include_blank: true, selected: selected.try(:id)}, class: "form-control", data: { filteringselect: true, options: js_data[selected_type.try(:downcase)] || default_options }, placeholder: 'Search' %>
27
+ </div>
@@ -0,0 +1,8 @@
1
+ <%
2
+ js_data = {
3
+ js_location: field.js_location,
4
+ css_location: field.css_location,
5
+ instance_config: field.instance_config
6
+ }
7
+ %>
8
+ <%= form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: 'simplemde', options: js_data.to_json }).reverse_merge({ value: field.form_value }) %>
@@ -0,0 +1 @@
1
+ <%= form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: false, options: {}.to_json }).reverse_merge({ value: field.form_value, class: 'form-control', required: field.required }) %>
@@ -0,0 +1,8 @@
1
+ <%
2
+ js_data = {
3
+ csspath: field.css_location,
4
+ jspath: field.js_location,
5
+ config_options: field.config_options.to_json
6
+ }
7
+ %>
8
+ <%= form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: 'bootstrap-wysihtml5', options: js_data.to_json }).reverse_merge({ value: field.form_value }) %>
@@ -0,0 +1,25 @@
1
+ <div class="form-group form-actions">
2
+ <div class="col-sm-offset-2 col-sm-10">
3
+ <input name="return_to" type="<%= :hidden %>" value="<%= (params[:return_to].presence || request.referer) %>"></input>
4
+ <button class="btn btn-primary" data-disable-with="<%= t("admin.form.save") %>" name="_save" type="submit">
5
+ <i class="fas fa-check"></i>
6
+ <%= t("admin.form.save") %>
7
+ </button>
8
+ <span class="extra_buttons">
9
+ <% if authorized? :new, @abstract_model %>
10
+ <button class="btn btn-info" data-disable-with="<%= t("admin.form.save_and_add_another") %>" name="_add_another" type="submit">
11
+ <%= t("admin.form.save_and_add_another") %>
12
+ </button>
13
+ <% end %>
14
+ <% if authorized? :edit, @abstract_model %>
15
+ <button class="btn btn-info" data-disable-with="<%= t("admin.form.save_and_edit") %>" name="_add_edit" type="submit">
16
+ <%= t("admin.form.save_and_edit") %>
17
+ </button>
18
+ <% end %>
19
+ <button class="btn btn-default" data-disable-with="<%= t("admin.form.cancel") %>" formnovalidate="<%= true %>" name="_continue" type="submit">
20
+ <i class="fas fa-times"></i>
21
+ <%= t("admin.form.cancel") %>
22
+ </button>
23
+ </span>
24
+ </div>
25
+ </div>
@@ -0,0 +1,19 @@
1
+ <h4>
2
+ <%= I18n.t('admin.form.bulk_delete') %>
3
+ </h4>
4
+ <ul>
5
+ <%= render partial: "delete_notice", collection: @objects %>
6
+ </ul>
7
+ <%= form_tag bulk_delete_path(model_name: @abstract_model.to_param, bulk_ids: @objects.map(&:id)), method: :delete do %>
8
+ <div class="form-actions">
9
+ <input name="return_to" type="<%= :hidden %>" value="<%= (params[:return_to].presence || request.referer) %>"></input>
10
+ <button class="btn btn-danger" data-disable-with="<%= t("admin.form.confirmation") %>" type="submit">
11
+ <i class="fas fa-check"></i>
12
+ <%= t("admin.form.confirmation") %>
13
+ </button>
14
+ <button class="btn" data-disable-with="<%= t("admin.form.cancel") %>" name="_continue" type="submit">
15
+ <i class="fas fa-times"></i>
16
+ <%= t("admin.form.cancel") %>
17
+ </button>
18
+ </div>
19
+ <% end %>
@@ -0,0 +1,64 @@
1
+ <% if @abstract_models %>
2
+ <table class="table table-condensed table-striped table-hover">
3
+ <thead>
4
+ <tr>
5
+ <th class="shrink model-name">
6
+ <%= t "admin.table_headers.model_name" %>
7
+ </th>
8
+ <th class="shrink last-created">
9
+ <%= t "admin.table_headers.last_created" %>
10
+ </th>
11
+ <th class="records">
12
+ <%= t "admin.table_headers.records" %>
13
+ </th>
14
+ <th class="shrink controls"></th>
15
+ </tr>
16
+ </thead>
17
+ <tbody>
18
+ <% @abstract_models.each do |abstract_model| %>
19
+ <% if authorized? :index, abstract_model %>
20
+ <% index_path = index_path(model_name: abstract_model.to_param) %>
21
+ <% row_class = "#{cycle("odd", "even")}#{" link" if index_path} #{abstract_model.param_key}_links" %>
22
+ <tr class="<%= row_class %>" data-link="<%= index_path %>">
23
+ <% last_created = @most_recent_created[abstract_model.model.name] %>
24
+ <% active = last_created.try(:today?) %>
25
+ <td>
26
+ <span class="show">
27
+ <%= link_to abstract_model.config.label_plural, index_path, class: 'pjax' %>
28
+ </span>
29
+ </td>
30
+ <td>
31
+ <% if last_created %>
32
+ <%= t "admin.misc.time_ago", time: time_ago_in_words(last_created), default: "#{time_ago_in_words(last_created)} #{t("admin.misc.ago")}" %>
33
+ <% end %>
34
+ </td>
35
+ <td>
36
+ <% count = @count[abstract_model.model.name] %>
37
+ <% percent = count > 0 ? (@max <= 1 ? count : ((Math.log(count+1) * 100.0) / Math.log(@max+1)).to_i) : -1 %>
38
+ <div class="progress-<%= get_indicator(percent) %> <%= active && 'active progress-striped' %> progress" style="margin-bottom:0px">
39
+ <div class="progress-bar-<%= get_indicator(percent) %> progress-bar animate-width-to" data-animate-length="<%= ([1.0, percent].max.to_i * 20) %>" data-animate-width-to="<%= [2.0, percent].max.to_i %>%" style="width:2%">
40
+ <%= @count[abstract_model.model.name] %>
41
+ </div>
42
+ </div>
43
+ </td>
44
+ <td class="links">
45
+ <ul class="inline list-inline">
46
+ <%= menu_for :collection, abstract_model, nil, true %>
47
+ </ul>
48
+ </td>
49
+ </tr>
50
+ <% end %>
51
+ <% end %>
52
+ </tbody>
53
+ </table>
54
+ <% end %>
55
+ <% if @auditing_adapter && authorized?(:history_index) %>
56
+ <div class="block" id="block-tables">
57
+ <div class="content">
58
+ <h2>
59
+ <%= t("admin.actions.history_index.menu") %>
60
+ </h2>
61
+ <%= render partial: 'rails_admin/main/dashboard_history' %>
62
+ </div>
63
+ </div>
64
+ <% end %>
@@ -0,0 +1,21 @@
1
+ <h4>
2
+ <%= t("admin.form.are_you_sure_you_want_to_delete_the_object", model_name: @abstract_model.pretty_name.downcase) %>
3
+ &ldquo;<strong><%= @model_config.with(object: @object).object_label %></strong>&rdquo;
4
+ <%= t("admin.form.all_of_the_following_related_items_will_be_deleted") %>
5
+ </h4>
6
+ <ul>
7
+ <%= render partial: "delete_notice", object: @object %>
8
+ </ul>
9
+ <%= form_for(@object, url: delete_path(model_name: @abstract_model.to_param, id: @object.id), html: {method: "delete"}) do %>
10
+ <input name="return_to" type="<%= :hidden %>" value="<%= (params[:return_to].presence || request.referer) %>"></input>
11
+ <div class="form-actions">
12
+ <button class="btn btn-danger" data-disable-with="<%= t("admin.form.confirmation") %>" type="submit">
13
+ <i class="fas fa-check"></i>
14
+ <%= t("admin.form.confirmation") %>
15
+ </button>
16
+ <button class="btn" data-disable-with="<%= t("admin.form.cancel") %>" name="_continue" type="submit">
17
+ <i class="fas fa-times"></i>
18
+ <%= t("admin.form.cancel") %>
19
+ </button>
20
+ </div>
21
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= rails_admin_form_for @object, url: edit_path(@abstract_model, @object.id), as: @abstract_model.param_key, html: { method: "put", multipart: true, class: "form-horizontal denser", data: { title: @page_name } } do |form| %>
2
+ <%= form.generate action: :update %>
3
+ <% end %>