rails_admin 2.3.1 → 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 (329) 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 +5 -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 +5 -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 +19 -21
  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 +25 -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 +12 -7
  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 +8 -4
  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/theming.scss +93 -34
  162. data/src/rails_admin/styles/base.scss +64 -0
  163. data/src/rails_admin/styles/filtering-multiselect.scss +53 -0
  164. data/src/rails_admin/styles/filtering-select.scss +70 -0
  165. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/theming.scss +23 -21
  166. data/src/rails_admin/styles/themes/cerulean/variables.scss +830 -0
  167. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/mixins.scss +1 -1
  168. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/variables.scss +1 -1
  169. data/src/rails_admin/styles/widgets.scss +35 -0
  170. data/src/rails_admin/ui.js +172 -0
  171. data/src/rails_admin/vendor/jquery.pjax.js +899 -0
  172. data/src/rails_admin/vendor/jquery_nested_form.js +122 -0
  173. data/src/rails_admin/widgets.js +512 -0
  174. data/vendor/assets/fonts/rails_admin/fa-solid-900.eot +0 -0
  175. data/vendor/assets/fonts/rails_admin/fa-solid-900.svg +5034 -0
  176. data/vendor/assets/fonts/rails_admin/fa-solid-900.ttf +0 -0
  177. data/vendor/assets/fonts/rails_admin/fa-solid-900.woff +0 -0
  178. data/vendor/assets/fonts/rails_admin/fa-solid-900.woff2 +0 -0
  179. data/vendor/assets/javascripts/rails_admin/jquery-ui/data.js +41 -0
  180. data/vendor/assets/javascripts/rails_admin/jquery-ui/effect.js +1637 -0
  181. data/vendor/assets/javascripts/rails_admin/jquery-ui/ie.js +17 -0
  182. data/vendor/assets/javascripts/rails_admin/jquery-ui/keycode.js +47 -0
  183. data/vendor/assets/javascripts/rails_admin/jquery-ui/position.js +500 -0
  184. data/vendor/assets/javascripts/rails_admin/jquery-ui/safe-active-element.js +42 -0
  185. data/vendor/assets/javascripts/rails_admin/jquery-ui/scroll-parent.js +47 -0
  186. data/vendor/assets/javascripts/rails_admin/jquery-ui/unique-id.js +51 -0
  187. data/vendor/assets/javascripts/rails_admin/jquery-ui/version.js +17 -0
  188. data/vendor/assets/javascripts/rails_admin/jquery-ui/widget.js +735 -0
  189. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/autocomplete.js +689 -0
  190. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/menu.js +680 -0
  191. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/mouse.js +230 -0
  192. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/sortable.js +1561 -0
  193. data/vendor/assets/javascripts/rails_admin/jquery3.js +10872 -0
  194. data/vendor/assets/stylesheets/rails_admin/font-awesome.scss +4476 -2216
  195. metadata +118 -263
  196. data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
  197. data/app/assets/images/rails_admin/aristo/images/icon_sprite.png +0 -0
  198. data/app/assets/images/rails_admin/aristo/images/progress_bar.gif +0 -0
  199. data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
  200. data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  201. data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  202. data/app/assets/images/rails_admin/bullet_black.png +0 -0
  203. data/app/assets/images/rails_admin/bullet_white.png +0 -0
  204. data/app/assets/images/rails_admin/calendar.png +0 -0
  205. data/app/assets/images/rails_admin/clock.png +0 -0
  206. data/app/assets/images/rails_admin/logo.png +0 -0
  207. data/app/assets/images/rails_admin/magnifier.png +0 -0
  208. data/app/assets/images/rails_admin/multiselect/icon_sprite.png +0 -0
  209. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
  210. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-light.png +0 -0
  211. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
  212. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
  213. data/app/assets/javascripts/rails_admin/jquery-ui.js.erb +0 -8
  214. data/app/assets/javascripts/rails_admin/jquery.migrate.js +0 -3
  215. data/app/assets/javascripts/rails_admin/ra.filter-box.js +0 -253
  216. data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +0 -331
  217. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +0 -294
  218. data/app/assets/javascripts/rails_admin/ra.i18n.js +0 -28
  219. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.js +0 -59
  220. data/app/assets/javascripts/rails_admin/ra.remote-form.js +0 -155
  221. data/app/assets/javascripts/rails_admin/ra.sidescroll.js +0 -31
  222. data/app/assets/javascripts/rails_admin/ra.widgets.js +0 -379
  223. data/app/assets/javascripts/rails_admin/rails_admin.js +0 -21
  224. data/app/assets/javascripts/rails_admin/ui.js +0 -135
  225. data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
  226. data/app/assets/stylesheets/rails_admin/aristo/images/icon_sprite.png +0 -0
  227. data/app/assets/stylesheets/rails_admin/aristo/images/progress_bar.gif +0 -0
  228. data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
  229. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  230. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  231. data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.scss +0 -733
  232. data/app/assets/stylesheets/rails_admin/base/font-awesome-4-compability.scss +0 -153
  233. data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.scss +0 -88
  234. data/app/assets/stylesheets/rails_admin/ra.sidescroll.scss +0 -29
  235. data/app/assets/stylesheets/rails_admin/ra.widgets.scss +0 -17
  236. data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +0 -110
  237. data/app/assets/stylesheets/rails_admin/themes/cerulean/variables.scss +0 -857
  238. data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.haml +0 -2
  239. data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.haml +0 -4
  240. data/app/views/kaminari/ra-twitter-bootstrap/_page.html.haml +0 -4
  241. data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.haml +0 -9
  242. data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.haml +0 -4
  243. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.haml +0 -4
  244. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.haml +0 -4
  245. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.haml +0 -4
  246. data/app/views/layouts/rails_admin/_head.html.haml +0 -7
  247. data/app/views/layouts/rails_admin/_navigation.html.haml +0 -12
  248. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +0 -10
  249. data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +0 -3
  250. data/app/views/layouts/rails_admin/application.html.haml +0 -16
  251. data/app/views/layouts/rails_admin/pjax.html.haml +0 -12
  252. data/app/views/rails_admin/main/_dashboard_history.html.haml +0 -21
  253. data/app/views/rails_admin/main/_delete_notice.html.haml +0 -24
  254. data/app/views/rails_admin/main/_form_action_text.html.haml +0 -7
  255. data/app/views/rails_admin/main/_form_boolean.html.haml +0 -3
  256. data/app/views/rails_admin/main/_form_code_mirror.html.haml +0 -9
  257. data/app/views/rails_admin/main/_form_colorpicker.html.haml +0 -1
  258. data/app/views/rails_admin/main/_form_datetime.html.haml +0 -5
  259. data/app/views/rails_admin/main/_form_enumeration.html.haml +0 -19
  260. data/app/views/rails_admin/main/_form_field.html.haml +0 -1
  261. data/app/views/rails_admin/main/_form_file_upload.html.haml +0 -17
  262. data/app/views/rails_admin/main/_form_froala.html.haml +0 -8
  263. data/app/views/rails_admin/main/_form_multiple_file_upload.html.haml +0 -16
  264. data/app/views/rails_admin/main/_form_nested_many.html.haml +0 -15
  265. data/app/views/rails_admin/main/_form_nested_one.html.haml +0 -17
  266. data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +0 -26
  267. data/app/views/rails_admin/main/_form_simple_mde.haml +0 -8
  268. data/app/views/rails_admin/main/_form_text.html.haml +0 -1
  269. data/app/views/rails_admin/main/_form_wysihtml5.html.haml +0 -8
  270. data/app/views/rails_admin/main/_submit_buttons.html.haml +0 -16
  271. data/app/views/rails_admin/main/bulk_delete.html.haml +0 -11
  272. data/app/views/rails_admin/main/dashboard.html.haml +0 -34
  273. data/app/views/rails_admin/main/delete.html.haml +0 -18
  274. data/app/views/rails_admin/main/edit.html.haml +0 -2
  275. data/app/views/rails_admin/main/export.html.haml +0 -92
  276. data/app/views/rails_admin/main/history.html.haml +0 -51
  277. data/app/views/rails_admin/main/index.html.haml +0 -126
  278. data/app/views/rails_admin/main/new.html.haml +0 -2
  279. data/app/views/rails_admin/main/show.html.haml +0 -15
  280. data/config/initializers/haml.rb +0 -5
  281. data/lib/rails_admin/adapters/active_record/abstract_object.rb +0 -38
  282. data/lib/rails_admin/adapters/active_record.rb.bak +0 -348
  283. data/lib/rails_admin/adapters/mongoid/abstract_object.rb +0 -42
  284. data/lib/rails_admin/bootstrap-sass/compass_functions.rb +0 -28
  285. data/lib/rails_admin/bootstrap-sass/sass_functions.rb +0 -16
  286. data/lib/rails_admin/bootstrap-sass.rb +0 -49
  287. data/lib/rails_admin/config/lazy_model.rb +0 -68
  288. data/lib/rails_admin/extensions/history/auditing_adapter.rb +0 -37
  289. data/lib/rails_admin/extensions/history/history.rb +0 -44
  290. data/lib/rails_admin/extensions/history.rb +0 -3
  291. data/lib/rails_admin/support/i18n.rb +0 -43
  292. data/vendor/assets/fonts/rails_admin/FontAwesome.otf +0 -0
  293. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.eot +0 -0
  294. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.svg +0 -2671
  295. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.ttf +0 -0
  296. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff +0 -0
  297. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff2 +0 -0
  298. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
  299. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
  300. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
  301. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
  302. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
  303. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
  304. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
  305. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
  306. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
  307. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
  308. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
  309. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
  310. data/vendor/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
  311. data/vendor/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
  312. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
  313. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
  314. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
  315. data/vendor/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
  316. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
  317. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
  318. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
  319. data/vendor/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
  320. data/vendor/assets/images/rails_admin/colorpicker/select.png +0 -0
  321. data/vendor/assets/images/rails_admin/colorpicker/select2.png +0 -0
  322. data/vendor/assets/images/rails_admin/colorpicker/slider.png +0 -0
  323. data/vendor/assets/javascripts/rails_admin/jquery.colorpicker.js +0 -484
  324. data/vendor/assets/stylesheets/rails_admin/jquery.colorpicker.scss +0 -182
  325. /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/README.txt +0 -0
  326. /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/mixins.scss +0 -0
  327. /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/variables.scss +0 -0
  328. /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/mixins.scss +0 -0
  329. /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/theming.scss +0 -0
@@ -1,484 +0,0 @@
1
- /**
2
- *
3
- * Color picker
4
- * Author: Stefan Petre www.eyecon.ro
5
- *
6
- * Dual licensed under the MIT and GPL licenses
7
- *
8
- */
9
- (function ($) {
10
- var ColorPicker = function () {
11
- var
12
- ids = {},
13
- inAction,
14
- charMin = 65,
15
- visible,
16
- tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
17
- defaults = {
18
- eventName: 'click',
19
- onShow: function () {},
20
- onBeforeShow: function(){},
21
- onHide: function () {},
22
- onChange: function () {},
23
- onSubmit: function () {},
24
- color: 'ff0000',
25
- livePreview: true,
26
- flat: false
27
- },
28
- fillRGBFields = function (hsb, cal) {
29
- var rgb = HSBToRGB(hsb);
30
- $(cal).data('colorpicker').fields
31
- .eq(1).val(rgb.r).end()
32
- .eq(2).val(rgb.g).end()
33
- .eq(3).val(rgb.b).end();
34
- },
35
- fillHSBFields = function (hsb, cal) {
36
- $(cal).data('colorpicker').fields
37
- .eq(4).val(hsb.h).end()
38
- .eq(5).val(hsb.s).end()
39
- .eq(6).val(hsb.b).end();
40
- },
41
- fillHexFields = function (hsb, cal) {
42
- $(cal).data('colorpicker').fields
43
- .eq(0).val(HSBToHex(hsb)).end();
44
- },
45
- setSelector = function (hsb, cal) {
46
- $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
47
- $(cal).data('colorpicker').selectorIndic.css({
48
- left: parseInt(150 * hsb.s/100, 10),
49
- top: parseInt(150 * (100-hsb.b)/100, 10)
50
- });
51
- },
52
- setHue = function (hsb, cal) {
53
- $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
54
- },
55
- setCurrentColor = function (hsb, cal) {
56
- $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
57
- },
58
- setNewColor = function (hsb, cal) {
59
- $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
60
- },
61
- keyDown = function (ev) {
62
- var pressedKey = ev.charCode || ev.keyCode || -1;
63
- if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
64
- return false;
65
- }
66
- var cal = $(this).parent().parent();
67
- if (cal.data('colorpicker').livePreview === true) {
68
- change.apply(this);
69
- }
70
- },
71
- change = function (ev) {
72
- var cal = $(this).parent().parent(), col;
73
- if (this.parentNode.className.indexOf('_hex') > 0) {
74
- cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
75
- } else if (this.parentNode.className.indexOf('_hsb') > 0) {
76
- cal.data('colorpicker').color = col = fixHSB({
77
- h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
78
- s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
79
- b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
80
- });
81
- } else {
82
- cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
83
- r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
84
- g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
85
- b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
86
- }));
87
- }
88
- if (ev) {
89
- fillRGBFields(col, cal.get(0));
90
- fillHexFields(col, cal.get(0));
91
- fillHSBFields(col, cal.get(0));
92
- }
93
- setSelector(col, cal.get(0));
94
- setHue(col, cal.get(0));
95
- setNewColor(col, cal.get(0));
96
- cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
97
- },
98
- blur = function (ev) {
99
- var cal = $(this).parent().parent();
100
- cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
101
- },
102
- focus = function () {
103
- charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
104
- $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
105
- $(this).parent().addClass('colorpicker_focus');
106
- },
107
- downIncrement = function (ev) {
108
- var field = $(this).parent().find('input').focus();
109
- var current = {
110
- el: $(this).parent().addClass('colorpicker_slider'),
111
- max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
112
- y: ev.pageY,
113
- field: field,
114
- val: parseInt(field.val(), 10),
115
- preview: $(this).parent().parent().data('colorpicker').livePreview
116
- };
117
- $(document).bind('mouseup', current, upIncrement);
118
- $(document).bind('mousemove', current, moveIncrement);
119
- },
120
- moveIncrement = function (ev) {
121
- ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
122
- if (ev.data.preview) {
123
- change.apply(ev.data.field.get(0), [true]);
124
- }
125
- return false;
126
- },
127
- upIncrement = function (ev) {
128
- change.apply(ev.data.field.get(0), [true]);
129
- ev.data.el.removeClass('colorpicker_slider').find('input').focus();
130
- $(document).unbind('mouseup', upIncrement);
131
- $(document).unbind('mousemove', moveIncrement);
132
- return false;
133
- },
134
- downHue = function (ev) {
135
- var current = {
136
- cal: $(this).parent(),
137
- y: $(this).offset().top
138
- };
139
- current.preview = current.cal.data('colorpicker').livePreview;
140
- $(document).bind('mouseup', current, upHue);
141
- $(document).bind('mousemove', current, moveHue);
142
- },
143
- moveHue = function (ev) {
144
- change.apply(
145
- ev.data.cal.data('colorpicker')
146
- .fields
147
- .eq(4)
148
- .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
149
- .get(0),
150
- [ev.data.preview]
151
- );
152
- return false;
153
- },
154
- upHue = function (ev) {
155
- fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
156
- fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
157
- $(document).unbind('mouseup', upHue);
158
- $(document).unbind('mousemove', moveHue);
159
- return false;
160
- },
161
- downSelector = function (ev) {
162
- var current = {
163
- cal: $(this).parent(),
164
- pos: $(this).offset()
165
- };
166
- current.preview = current.cal.data('colorpicker').livePreview;
167
- $(document).bind('mouseup', current, upSelector);
168
- $(document).bind('mousemove', current, moveSelector);
169
- },
170
- moveSelector = function (ev) {
171
- change.apply(
172
- ev.data.cal.data('colorpicker')
173
- .fields
174
- .eq(6)
175
- .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
176
- .end()
177
- .eq(5)
178
- .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
179
- .get(0),
180
- [ev.data.preview]
181
- );
182
- return false;
183
- },
184
- upSelector = function (ev) {
185
- fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
186
- fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
187
- $(document).unbind('mouseup', upSelector);
188
- $(document).unbind('mousemove', moveSelector);
189
- return false;
190
- },
191
- enterSubmit = function (ev) {
192
- $(this).addClass('colorpicker_focus');
193
- },
194
- leaveSubmit = function (ev) {
195
- $(this).removeClass('colorpicker_focus');
196
- },
197
- clickSubmit = function (ev) {
198
- var cal = $(this).parent();
199
- var col = cal.data('colorpicker').color;
200
- cal.data('colorpicker').origColor = col;
201
- setCurrentColor(col, cal.get(0));
202
- cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
203
- },
204
- show = function (ev) {
205
- var cal = $('#' + $(this).data('colorpickerId'));
206
- cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
207
- var pos = $(this).offset();
208
- var viewPort = getViewport();
209
- var top = pos.top + this.offsetHeight;
210
- var left = pos.left;
211
- if (top + 176 > viewPort.t + viewPort.h) {
212
- top -= this.offsetHeight + 176;
213
- }
214
- if (left + 356 > viewPort.l + viewPort.w) {
215
- left -= 356;
216
- }
217
- cal.css({left: left + 'px', top: top + 'px'});
218
- if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
219
- cal.show();
220
- }
221
- $(document).bind('mousedown', {cal: cal}, hide);
222
- return false;
223
- },
224
- hide = function (ev) {
225
- if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
226
- if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
227
- ev.data.cal.hide();
228
- }
229
- $(document).unbind('mousedown', hide);
230
- }
231
- },
232
- isChildOf = function(parentEl, el, container) {
233
- if (parentEl == el) {
234
- return true;
235
- }
236
- if (parentEl.contains) {
237
- return parentEl.contains(el);
238
- }
239
- if ( parentEl.compareDocumentPosition ) {
240
- return !!(parentEl.compareDocumentPosition(el) & 16);
241
- }
242
- var prEl = el.parentNode;
243
- while(prEl && prEl != container) {
244
- if (prEl == parentEl)
245
- return true;
246
- prEl = prEl.parentNode;
247
- }
248
- return false;
249
- },
250
- getViewport = function () {
251
- var m = document.compatMode == 'CSS1Compat';
252
- return {
253
- l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
254
- t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
255
- w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
256
- h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
257
- };
258
- },
259
- fixHSB = function (hsb) {
260
- return {
261
- h: Math.min(360, Math.max(0, hsb.h)),
262
- s: Math.min(100, Math.max(0, hsb.s)),
263
- b: Math.min(100, Math.max(0, hsb.b))
264
- };
265
- },
266
- fixRGB = function (rgb) {
267
- return {
268
- r: Math.min(255, Math.max(0, rgb.r)),
269
- g: Math.min(255, Math.max(0, rgb.g)),
270
- b: Math.min(255, Math.max(0, rgb.b))
271
- };
272
- },
273
- fixHex = function (hex) {
274
- var len = 6 - hex.length;
275
- if (len > 0) {
276
- var o = [];
277
- for (var i=0; i<len; i++) {
278
- o.push('0');
279
- }
280
- o.push(hex);
281
- hex = o.join('');
282
- }
283
- return hex;
284
- },
285
- HexToRGB = function (hex) {
286
- var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
287
- return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
288
- },
289
- HexToHSB = function (hex) {
290
- return RGBToHSB(HexToRGB(hex));
291
- },
292
- RGBToHSB = function (rgb) {
293
- var hsb = {
294
- h: 0,
295
- s: 0,
296
- b: 0
297
- };
298
- var min = Math.min(rgb.r, rgb.g, rgb.b);
299
- var max = Math.max(rgb.r, rgb.g, rgb.b);
300
- var delta = max - min;
301
- hsb.b = max;
302
- if (max != 0) {
303
-
304
- }
305
- hsb.s = max != 0 ? 255 * delta / max : 0;
306
- if (hsb.s != 0) {
307
- if (rgb.r == max) {
308
- hsb.h = (rgb.g - rgb.b) / delta;
309
- } else if (rgb.g == max) {
310
- hsb.h = 2 + (rgb.b - rgb.r) / delta;
311
- } else {
312
- hsb.h = 4 + (rgb.r - rgb.g) / delta;
313
- }
314
- } else {
315
- hsb.h = -1;
316
- }
317
- hsb.h *= 60;
318
- if (hsb.h < 0) {
319
- hsb.h += 360;
320
- }
321
- hsb.s *= 100/255;
322
- hsb.b *= 100/255;
323
- return hsb;
324
- },
325
- HSBToRGB = function (hsb) {
326
- var rgb = {};
327
- var h = Math.round(hsb.h);
328
- var s = Math.round(hsb.s*255/100);
329
- var v = Math.round(hsb.b*255/100);
330
- if(s == 0) {
331
- rgb.r = rgb.g = rgb.b = v;
332
- } else {
333
- var t1 = v;
334
- var t2 = (255-s)*v/255;
335
- var t3 = (t1-t2)*(h%60)/60;
336
- if(h==360) h = 0;
337
- if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
338
- else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
339
- else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
340
- else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
341
- else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
342
- else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
343
- else {rgb.r=0; rgb.g=0; rgb.b=0}
344
- }
345
- return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
346
- },
347
- RGBToHex = function (rgb) {
348
- var hex = [
349
- rgb.r.toString(16),
350
- rgb.g.toString(16),
351
- rgb.b.toString(16)
352
- ];
353
- $.each(hex, function (nr, val) {
354
- if (val.length == 1) {
355
- hex[nr] = '0' + val;
356
- }
357
- });
358
- return hex.join('');
359
- },
360
- HSBToHex = function (hsb) {
361
- return RGBToHex(HSBToRGB(hsb));
362
- },
363
- restoreOriginal = function () {
364
- var cal = $(this).parent();
365
- var col = cal.data('colorpicker').origColor;
366
- cal.data('colorpicker').color = col;
367
- fillRGBFields(col, cal.get(0));
368
- fillHexFields(col, cal.get(0));
369
- fillHSBFields(col, cal.get(0));
370
- setSelector(col, cal.get(0));
371
- setHue(col, cal.get(0));
372
- setNewColor(col, cal.get(0));
373
- };
374
- return {
375
- init: function (opt) {
376
- opt = $.extend({}, defaults, opt||{});
377
- if (typeof opt.color == 'string') {
378
- opt.color = HexToHSB(opt.color);
379
- } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
380
- opt.color = RGBToHSB(opt.color);
381
- } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
382
- opt.color = fixHSB(opt.color);
383
- } else {
384
- return this;
385
- }
386
- return this.each(function () {
387
- if (!$(this).data('colorpickerId')) {
388
- var options = $.extend({}, opt);
389
- options.origColor = opt.color;
390
- var id = 'collorpicker_' + parseInt(Math.random() * 1000);
391
- $(this).data('colorpickerId', id);
392
- var cal = $(tpl).attr('id', id);
393
- if (options.flat) {
394
- cal.appendTo(this).show();
395
- } else {
396
- cal.appendTo(document.body);
397
- }
398
- options.fields = cal
399
- .find('input')
400
- .bind('keyup', keyDown)
401
- .bind('change', change)
402
- .bind('blur', blur)
403
- .bind('focus', focus);
404
- cal
405
- .find('span').bind('mousedown', downIncrement).end()
406
- .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
407
- options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
408
- options.selectorIndic = options.selector.find('div div');
409
- options.el = this;
410
- options.hue = cal.find('div.colorpicker_hue div');
411
- cal.find('div.colorpicker_hue').bind('mousedown', downHue);
412
- options.newColor = cal.find('div.colorpicker_new_color');
413
- options.currentColor = cal.find('div.colorpicker_current_color');
414
- cal.data('colorpicker', options);
415
- cal.find('div.colorpicker_submit')
416
- .bind('mouseenter', enterSubmit)
417
- .bind('mouseleave', leaveSubmit)
418
- .bind('click', clickSubmit);
419
- fillRGBFields(options.color, cal.get(0));
420
- fillHSBFields(options.color, cal.get(0));
421
- fillHexFields(options.color, cal.get(0));
422
- setHue(options.color, cal.get(0));
423
- setSelector(options.color, cal.get(0));
424
- setCurrentColor(options.color, cal.get(0));
425
- setNewColor(options.color, cal.get(0));
426
- if (options.flat) {
427
- cal.css({
428
- position: 'relative',
429
- display: 'block'
430
- });
431
- } else {
432
- $(this).bind(options.eventName, show);
433
- }
434
- }
435
- });
436
- },
437
- showPicker: function() {
438
- return this.each( function () {
439
- if ($(this).data('colorpickerId')) {
440
- show.apply(this);
441
- }
442
- });
443
- },
444
- hidePicker: function() {
445
- return this.each( function () {
446
- if ($(this).data('colorpickerId')) {
447
- $('#' + $(this).data('colorpickerId')).hide();
448
- }
449
- });
450
- },
451
- setColor: function(col) {
452
- if (typeof col == 'string') {
453
- col = HexToHSB(col);
454
- } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
455
- col = RGBToHSB(col);
456
- } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
457
- col = fixHSB(col);
458
- } else {
459
- return this;
460
- }
461
- return this.each(function(){
462
- if ($(this).data('colorpickerId')) {
463
- var cal = $('#' + $(this).data('colorpickerId'));
464
- cal.data('colorpicker').color = col;
465
- cal.data('colorpicker').origColor = col;
466
- fillRGBFields(col, cal.get(0));
467
- fillHSBFields(col, cal.get(0));
468
- fillHexFields(col, cal.get(0));
469
- setHue(col, cal.get(0));
470
- setSelector(col, cal.get(0));
471
- setCurrentColor(col, cal.get(0));
472
- setNewColor(col, cal.get(0));
473
- }
474
- });
475
- }
476
- };
477
- }();
478
- $.fn.extend({
479
- ColorPicker: ColorPicker.init,
480
- ColorPickerHide: ColorPicker.hidePicker,
481
- ColorPickerShow: ColorPicker.showPicker,
482
- ColorPickerSetColor: ColorPicker.setColor
483
- });
484
- })(jQuery)