rails_admin 1.4.3 → 2.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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -1
  3. data/README.md +2 -4
  4. data/app/assets/javascripts/rails_admin/jquery.pjax.js +1 -3
  5. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +9 -7
  6. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +1 -4
  7. data/app/assets/javascripts/rails_admin/ra.sidescroll.coffee +19 -0
  8. data/app/assets/javascripts/rails_admin/ra.widgets.coffee +35 -35
  9. data/app/assets/javascripts/rails_admin/rails_admin.js +1 -0
  10. data/app/assets/javascripts/rails_admin/ui.coffee +23 -18
  11. data/app/assets/stylesheets/rails_admin/ra.sidescroll.scss +29 -0
  12. data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +2 -1
  13. data/app/helpers/rails_admin/application_helper.rb +1 -1
  14. data/app/helpers/rails_admin/main_helper.rb +4 -4
  15. data/app/views/layouts/rails_admin/application.html.haml +0 -3
  16. data/app/views/layouts/rails_admin/pjax.html.haml +1 -5
  17. data/app/views/rails_admin/main/_form_action_text.html.haml +7 -0
  18. data/app/views/rails_admin/main/_form_file_upload.html.haml +1 -1
  19. data/app/views/rails_admin/main/_form_filtering_select.html.haml +1 -1
  20. data/app/views/rails_admin/main/_form_multiple_file_upload.html.haml +1 -1
  21. data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +18 -3
  22. data/app/views/rails_admin/main/dashboard.html.haml +1 -2
  23. data/app/views/rails_admin/main/export.html.haml +2 -2
  24. data/app/views/rails_admin/main/index.html.haml +18 -14
  25. data/app/views/rails_admin/main/show.html.haml +6 -7
  26. data/config/locales/rails_admin.en.yml +1 -1
  27. data/lib/rails_admin/adapters/active_record.rb +10 -6
  28. data/lib/rails_admin/adapters/active_record/property.rb +1 -5
  29. data/lib/rails_admin/adapters/mongoid.rb +16 -13
  30. data/lib/rails_admin/bootstrap-sass.rb +4 -2
  31. data/lib/rails_admin/bootstrap-sass/sass_functions.rb +1 -3
  32. data/lib/rails_admin/config.rb +4 -0
  33. data/lib/rails_admin/config/actions/index.rb +3 -3
  34. data/lib/rails_admin/config/configurable.rb +5 -3
  35. data/lib/rails_admin/config/fields.rb +2 -0
  36. data/lib/rails_admin/config/fields/base.rb +1 -1
  37. data/lib/rails_admin/config/fields/factories/action_text.rb +12 -0
  38. data/lib/rails_admin/config/fields/factories/dragonfly.rb +1 -1
  39. data/lib/rails_admin/config/fields/factories/shrine.rb +27 -0
  40. data/lib/rails_admin/config/fields/types/action_text.rb +31 -0
  41. data/lib/rails_admin/config/fields/types/active_record_enum.rb +3 -19
  42. data/lib/rails_admin/config/fields/types/active_storage.rb +1 -0
  43. data/lib/rails_admin/config/fields/types/all.rb +2 -0
  44. data/lib/rails_admin/config/fields/types/ck_editor.rb +5 -5
  45. data/lib/rails_admin/config/fields/types/code_mirror.rb +8 -10
  46. data/lib/rails_admin/config/fields/types/froala.rb +7 -9
  47. data/lib/rails_admin/config/fields/types/shrine.rb +48 -0
  48. data/lib/rails_admin/config/fields/types/simple_mde.rb +6 -3
  49. data/lib/rails_admin/config/fields/types/text.rb +0 -18
  50. data/lib/rails_admin/config/fields/types/wysihtml5.rb +12 -8
  51. data/lib/rails_admin/config/model.rb +3 -2
  52. data/lib/rails_admin/config/proxyable.rb +13 -1
  53. data/lib/rails_admin/config/proxyable/proxy.rb +3 -5
  54. data/lib/rails_admin/config/sections/list.rb +23 -0
  55. data/lib/rails_admin/engine.rb +1 -2
  56. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +16 -4
  57. data/lib/rails_admin/version.rb +4 -4
  58. data/vendor/assets/fonts/rails_admin/FontAwesome.otf +0 -0
  59. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.eot +0 -0
  60. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.svg +2671 -0
  61. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.ttf +0 -0
  62. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff +0 -0
  63. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff2 +0 -0
  64. data/vendor/assets/stylesheets/rails_admin/font-awesome.css.erb +2342 -0
  65. metadata +47 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2511d4339254d5f386a4b2730f4dd468526dc5bffec56a265113c003c8906b6
4
- data.tar.gz: bacfe19f0d8622834410c587a188061f1ed423a61e598bde8d23c8002b8e1a44
3
+ metadata.gz: 286d5b253a622e6ece58238f4b18544e53e0650f427ba1f0f4d4b3b880a46032
4
+ data.tar.gz: 21b11784af9577e8823db1fe56f4e87a187c962d632788e61ced23ea9af99214
5
5
  SHA512:
6
- metadata.gz: 90a5aed673d2db9af5c31fa297a5e155cf9edbe23a281020cb30a7f07f644dfaf70b4fbddb6aaf806d8815f398c6861711441be6378d154c97736f7fcd6ebf13
7
- data.tar.gz: 44144612bdc0eb7be539d3d730b1a0bddfe4686161e322f56d05df758427959e4aba3ef73305e792038ae82cccaa410e72ba750f51be804674d2fd9ef08509cb
6
+ metadata.gz: 2e89158a576546098a11cf0c660f84a43130bbc69e57d592e68e65a3adce27461e811c93649a9624632d1299d10cabbdce06ff41ecb90119f42c488dc6f95f46
7
+ data.tar.gz: e5944858dd931bc962e2c4a3b64117464c6ef118c9bc322c4ab9c54e5103b2d07972b3f50513b59b7d50e30ca19e05839cb58a93882b81425538d3be2eb37246
data/Gemfile CHANGED
@@ -10,7 +10,7 @@ group :active_record do
10
10
 
11
11
  platforms :ruby, :mswin, :mingw do
12
12
  gem 'mysql2', '>= 0.3.14'
13
- gem 'sqlite3', '~> 1.3.0'
13
+ gem 'sqlite3', '>= 1.3'
14
14
  end
15
15
  end
16
16
 
@@ -32,8 +32,11 @@ group :test do
32
32
  gem 'pundit'
33
33
  gem 'rack-cache', require: 'rack/cache'
34
34
  gem 'rspec-rails', '>= 2.14'
35
+ gem 'rspec-expectations', '!= 3.8.3'
35
36
  gem 'rubocop', '~> 0.41.2'
36
37
  gem 'simplecov', '>= 0.9', require: false
38
+ gem 'shrine', '~> 2.0'
39
+ gem 'shrine-memory'
37
40
  gem 'timecop', '>= 0.5'
38
41
 
39
42
  platforms :ruby_19 do
data/README.md CHANGED
@@ -50,7 +50,7 @@ RailsAdmin is a Rails engine that provides an easy-to-use interface for managing
50
50
 
51
51
  ## Installation
52
52
 
53
- 1. On your gemfile: `gem 'rails_admin', '~> 1.3'`
53
+ 1. On your gemfile: `gem 'rails_admin', '~> 2.0.0.beta'`
54
54
  2. Run `bundle install`
55
55
  3. Run `rails g rails_admin:install`
56
56
  4. Provide a namespace for the routes when asked
@@ -96,13 +96,11 @@ If you think you found a bug in RailsAdmin, you can [submit an issue](https://gi
96
96
  ## Supported Ruby Versions
97
97
  This library aims to support and is [tested against][travis] the following Ruby implementations:
98
98
 
99
- * Ruby 2.1
100
99
  * Ruby 2.2
101
100
  * Ruby 2.3
102
101
  * Ruby 2.4
103
102
  * Ruby 2.5
104
- * [Rubinius][]
103
+ * Ruby 2.6
105
104
  * [JRuby][]
106
105
 
107
- [rubinius]: http://rubinius.com
108
106
  [jruby]: http://jruby.org/
@@ -188,8 +188,6 @@ function pjax(options) {
188
188
  xhr.setRequestHeader('X-PJAX', 'true')
189
189
  xhr.setRequestHeader('X-PJAX-Container', context.selector)
190
190
 
191
- var result
192
-
193
191
  if (!fire('pjax:beforeSend', [xhr, settings]))
194
192
  return false
195
193
 
@@ -437,7 +435,7 @@ function fallbackPjax(options) {
437
435
  form.append($('<input>', {type: 'hidden', name: pair[0], value: pair[1]}))
438
436
  })
439
437
  } else if (typeof data === 'object') {
440
- for (key in data)
438
+ for (var key in data)
441
439
  form.append($('<input>', {type: 'hidden', name: key, value: data[key]}))
442
440
  }
443
441
 
@@ -31,21 +31,22 @@
31
31
  button: null,
32
32
  input: null,
33
33
  select: null,
34
+ filtering_select: null,
34
35
 
35
36
  _create: function() {
36
- var filtering_select = this.element.siblings(
37
+ this.filtering_select = this.element.siblings(
37
38
  '[data-input-for="' + this.element.attr('id') + '"]'
38
39
  );
39
40
 
40
41
  // When using the browser back and forward buttons, it is possible that
41
42
  // the autocomplete field will be cached which causes duplicate fields
42
43
  // to be generated.
43
- if (filtering_select.length > 0) {
44
- this.input = filtering_select.children('input');
45
- this.button = filtering_select.children('.input-group-btn');
44
+ if (this.filtering_select.length > 0) {
45
+ this.input = this.filtering_select.children('input');
46
+ this.button = this.filtering_select.children('.input-group-btn');
46
47
  } else {
47
48
  this.element.hide();
48
- filtering_select = this._inputGroup(this.element.attr('id'));
49
+ this.filtering_select = this._inputGroup(this.element.attr('id'));
49
50
  this.input = this._inputField();
50
51
  this.button = this._buttonField();
51
52
  }
@@ -56,7 +57,7 @@
56
57
  this._overloadRenderItem();
57
58
  this._autocompleteDropdownEvent(this.button);
58
59
 
59
- return filtering_select.append(this.input)
60
+ return this.filtering_select.append(this.input)
60
61
  .append(this.button)
61
62
  .insertAfter(this.element);
62
63
  },
@@ -201,7 +202,7 @@
201
202
  return $('<div>')
202
203
  .addClass('input-group filtering-select col-sm-2')
203
204
  .attr('data-input-for', inputFor)
204
- .css('float', 'left');
205
+ .css('float', this.element.css("float"));
205
206
  },
206
207
 
207
208
  _initAutocomplete: function() {
@@ -286,6 +287,7 @@
286
287
  this.input.remove();
287
288
  this.button.remove();
288
289
  this.element.show();
290
+ this.filtering_select.remove();
289
291
  $.Widget.prototype.destroy.call(this);
290
292
  }
291
293
  });
@@ -9,9 +9,6 @@ $(document).ready ->
9
9
  $(document).on 'nested:fieldAdded', 'form', (content) ->
10
10
  field = content.field.addClass('tab-pane').attr('id', 'unique-id-' + (new Date().getTime()))
11
11
  new_tab = $('<li><a data-toggle="tab" href="#' + field.attr('id') + '">' + field.children('.object-infos').data('object-label') + '</a></li>')
12
- new_tab = $('<li></li>').append(
13
- $('<a></a>').attr('data-toggle', 'tab').attr('href', '#' + field.attr('id')).text(field.children('.object-infos').data('object-label'))
14
- )
15
12
  parent_group = field.closest('.control-group')
16
13
  controls = parent_group.children('.controls')
17
14
  one_to_one = controls.data('nestedone') != undefined
@@ -27,7 +24,7 @@ $(document).on 'nested:fieldAdded', 'form', (content) ->
27
24
  toggler.addClass('active').removeClass('disabled').children('i').addClass('icon-chevron-down').removeClass('icon-chevron-right')
28
25
 
29
26
  # Convert the "add nested field" button to just showing the title of the new model
30
- controls.find('.add_nested_fields').removeClass('add_nested_fields').text(field.children('.object-infos').data('object-label')) if one_to_one
27
+ controls.find('.add_nested_fields').removeClass('add_nested_fields').html(field.children('.object-infos').data('object-label')) if one_to_one
31
28
 
32
29
  $(document).on 'nested:fieldRemoved', 'form', (content) ->
33
30
  field = content.field
@@ -0,0 +1,19 @@
1
+ (->
2
+ $ = jQuery
3
+
4
+ setFrozenColPositions = ->
5
+ $listForm = $('#bulk_form')
6
+ return unless $listForm.is('.ra-sidescroll')
7
+ frozenColumns = $listForm.data('ra-sidescroll')
8
+ $listForm.find('table tr').each (index, tr) ->
9
+ firstPosition = 0
10
+ $(tr).children().slice(0, frozenColumns).each (idx, td) ->
11
+ $(td).addClass('ra-sidescroll-frozen')
12
+ $(td).addClass('last-of-frozen') if idx == frozenColumns - 1
13
+ tdLeft = $(td).position().left
14
+ firstPosition = tdLeft if idx == 0
15
+ td.style.left = "#{tdLeft - firstPosition}px"
16
+
17
+ $(window).on('load', setFrozenColPositions) # Update after link icons load.
18
+ $(document).on('rails_admin.dom_ready', setFrozenColPositions)
19
+ )()
@@ -48,9 +48,12 @@ $(document).on 'rails_admin.dom_ready', (e, content) ->
48
48
  # fileupload
49
49
 
50
50
  content.find('[data-fileupload]').each ->
51
- input = this
52
- $(this).on 'click', ".delete input[type='checkbox']", ->
53
- $(input).children('.toggle').toggle('slow')
51
+ parent = $(this).closest('.controls')
52
+ parent.find('.btn-remove-image').on 'click', ->
53
+ $(this).siblings('[type=checkbox]').click()
54
+ parent.find('.toggle').toggle('slow')
55
+ $(this).toggleClass('btn-danger btn-info')
56
+ false
54
57
 
55
58
  # fileupload-preview
56
59
 
@@ -70,6 +73,15 @@ $(document).on 'rails_admin.dom_ready', (e, content) ->
70
73
  else
71
74
  image_container.hide()
72
75
 
76
+ # multiple-fileupload
77
+
78
+ content.find('[data-multiple-fileupload]').each ->
79
+ $(this).closest('.controls').find('.btn-remove-image').on 'click', ->
80
+ $(this).siblings('[type=checkbox]').click()
81
+ $(this).parent('.toggle').toggle('slow')
82
+ $(this).toggleClass('btn-danger btn-info')
83
+ false
84
+
73
85
  # multiple-fileupload-preview
74
86
 
75
87
  content.find('[data-multiple-fileupload]').change ->
@@ -115,11 +127,7 @@ $(document).on 'rails_admin.dom_ready', (e, content) ->
115
127
  # add each nested field to a tab-pane and reference it in the nav
116
128
  tab_content.children('.fields:not(.tab-pane)').addClass('tab-pane').each ->
117
129
  $(this).attr('id', 'unique-id-' + (new Date().getTime()) + Math.floor(Math.random()*100000)) # some elements are created on the same ms
118
- nav.append(
119
- $('<li></li>').append(
120
- $('<a></a>').attr('data-toggle', 'tab').attr('href', '#' + this.id).text($(this).children('.object-infos').data('object-label'))
121
- )
122
- )
130
+ nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
123
131
  # only if no tab is set to active
124
132
  if nav.find("> li.active").length == 0
125
133
  # init first tab, toggler and tab_content/tabs visibility
@@ -147,12 +155,8 @@ $(document).on 'rails_admin.dom_ready', (e, content) ->
147
155
  toggler = field.find('> .controls > .btn-group > .toggler')
148
156
  tab_content.children(".fields:not(.tab-pane)").addClass('tab-pane active').each ->
149
157
  # Convert the "add nested field" button to just showing the title of the new model
150
- field.find('> .controls .add_nested_fields').removeClass('add_nested_fields').text( $(this).children('.object-infos').data('object-label') )
151
- nav.append(
152
- $('<li></li>').append(
153
- $('<a></a>').attr('data-toggle', 'tab').attr('href', '#' + this.id).text($(this).children('.object-infos').data('object-label'))
154
- )
155
- )
158
+ field.find('> .controls .add_nested_fields').removeClass('add_nested_fields').html( $(this).children('.object-infos').data('object-label') )
159
+ nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
156
160
  first_tab = nav.find("> li > a[data-toggle='tab']:first")
157
161
  first_tab.tab('show')
158
162
  field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html())
@@ -176,25 +180,13 @@ $(document).on 'rails_admin.dom_ready', (e, content) ->
176
180
  field = type_select.parents('.control-group').first()
177
181
  object_select = field.find('select').last()
178
182
  urls = type_select.data('urls')
183
+
179
184
  type_select.on 'change', (e) ->
180
- if $(this).val() is ''
181
- object_select.html('<option value=""></option>')
182
- else
183
- $.ajax
184
- url: urls[type_select.val()]
185
- data:
186
- compact: true
187
- all: true
188
- beforeSend: (xhr) ->
189
- xhr.setRequestHeader("Accept", "application/json")
190
- success: (data, status, xhr) ->
191
- html = $('<option></option>')
192
- $(data).each (i, el) ->
193
- option = $('<option></option>')
194
- option.attr('value', el.id)
195
- option.text(el.label)
196
- html = html.add(option)
197
- object_select.html(html)
185
+ selected_type = type_select.val().toLowerCase()
186
+ selected_data = $("##{selected_type}-js-options").data('options')
187
+ object_select.data('options', selected_data)
188
+ object_select.filteringSelect("destroy")
189
+ object_select.filteringSelect selected_data
198
190
 
199
191
 
200
192
  # simplemde
@@ -302,9 +294,9 @@ $(document).on 'rails_admin.dom_ready', (e, content) ->
302
294
  authenticity_token: $('meta[name=csrf-token]').attr('content')
303
295
 
304
296
  $(@).addClass('froala-wysiwyged')
305
- $(@).editable(config_options)
297
+ $(@).froalaEditor(config_options)
306
298
  if uploadEnabled
307
- $(@).on 'editable.imageError', (e, editor, error) ->
299
+ $(@).on 'froalaEditor.image.error', (e, editor, error) ->
308
300
  alert("error uploading image: " + error.message);
309
301
  # Custom error message returned from the server.
310
302
  if error.code == 0
@@ -334,7 +326,7 @@ $(document).on 'rails_admin.dom_ready', (e, content) ->
334
326
 
335
327
  return
336
328
 
337
- .on('editable.afterRemoveImage', (e, editor, $img) ->
329
+ .on('froalaEditor.image.removed', (e, editor, $img) ->
338
330
  # Set the image source to the image delete params.
339
331
  editor.options.imageDeleteParams =
340
332
  src: $img.attr('src')
@@ -357,3 +349,11 @@ $(document).on 'rails_admin.dom_ready', (e, content) ->
357
349
  goFroalaWysiwygs(array)
358
350
  else
359
351
  goFroalaWysiwygs(array)
352
+
353
+ # action_text
354
+
355
+ content.find('trix-editor').each ->
356
+ if !window.Trix
357
+ options = $(this).data('options')
358
+ $('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
359
+ $.getScript options['jspath']
@@ -15,5 +15,6 @@
15
15
  //= require 'rails_admin/ra.i18n'
16
16
  //= require 'rails_admin/bootstrap/bootstrap'
17
17
  //= require 'rails_admin/ra.widgets'
18
+ //= require 'rails_admin/ra.sidescroll'
18
19
  //= require 'rails_admin/ui'
19
20
  //= require 'rails_admin/custom/ui'
@@ -53,12 +53,16 @@ $(document).on 'click', 'form .tab-content .tab-pane a.remove_nested_one_fields'
53
53
  siblings('i').toggleClass('icon-check icon-trash')
54
54
 
55
55
  $(document).ready ->
56
+ RailsAdmin.I18n.init $('html').attr('lang'), $("#admin-js").data('i18nOptions')
56
57
  $(document).trigger('rails_admin.dom_ready')
57
58
 
58
59
  $(document).on 'pjax:end', ->
59
60
  $(document).trigger('rails_admin.dom_ready')
60
61
 
61
62
  $(document).on 'rails_admin.dom_ready', ->
63
+ $('.nav.nav-pills li.active').removeClass('active')
64
+ $(".nav.nav-pills li[data-model=\"#{$('.page-header').data('model')}\"]").addClass('active')
65
+
62
66
  $('.animate-width-to').each ->
63
67
  length = $(this).data("animate-length")
64
68
  width = $(this).data("animate-width-to")
@@ -74,6 +78,23 @@ $(document).on 'rails_admin.dom_ready', ->
74
78
  $('[formnovalidate]').on 'click', ->
75
79
  $(this).closest('form').attr('novalidate', true)
76
80
 
81
+ $.each $('#filters_box').data('options'), ->
82
+ $.filters.append(this)
83
+
84
+ # Interactions for index action
85
+ $(document).on 'click', ".bulk-link", (event) ->
86
+ event.preventDefault()
87
+ $('#bulk_action').val($(this).data('action'))
88
+ $('#bulk_form').submit()
89
+
90
+ $(document).on 'click', "#remove_filter", (event) ->
91
+ event.preventDefault()
92
+ $("#filters_box").html("")
93
+ $("hr.filters_box").hide()
94
+ $(this).parent().siblings("input[type='search']").val("")
95
+ $(this).parents("form").submit()
96
+
97
+ # Interactions for export action
77
98
  $(document).on 'click', '#fields_to_export label input#check_all', () ->
78
99
  elems = $('#fields_to_export label input')
79
100
  if $('#fields_to_export label input#check_all').is ':checked'
@@ -81,22 +102,6 @@ $(document).on 'click', '#fields_to_export label input#check_all', () ->
81
102
  else
82
103
  $(elems).prop('checked',false)
83
104
 
84
- # when the user hits the back button, the inline JS <script> that
85
- # highlights the current model in the left menu doesn't get run by
86
- # pjax, so this code runs it:
87
- # https://github.com/defunkt/jquery-pjax/issues/241#issuecomment-13251065
88
- $(document).on 'pjax:popstate', () ->
89
- $(document).one 'pjax:end', (event) ->
90
- $(event.target).find('script').each () ->
91
- $.globalEval(this.text || this.textContent || this.innerHTML || '')
92
- return
93
- return
94
- return
105
+ $(document).on 'click', '#fields_to_export .reverse-selection', () ->
106
+ $(this).closest(".control-group").find(".controls").find("input").click()
95
107
 
96
- #Remove all filter and then refresh
97
- $(document).on 'click', "#remove_filter",(event) ->
98
- event.preventDefault()
99
- $("#filters_box").html("")
100
- $("hr.filters_box").hide()
101
- $(this).parent().siblings("input[type='search']").val("")
102
- $(this).parents("form").submit()
@@ -0,0 +1,29 @@
1
+ .ra-sidescroll {
2
+ margin-bottom: 20px;
3
+ overflow-x: auto;
4
+ .table {
5
+ margin-bottom: 0;
6
+ }
7
+
8
+ .ra-sidescroll-frozen {
9
+ position: sticky;
10
+
11
+ // border-right isn't sticky
12
+ &.last-of-frozen {
13
+ box-shadow: -1px 0 0 0 $table-border-color inset;
14
+ padding-right: $table-condensed-cell-padding + 1px;
15
+ }
16
+ }
17
+
18
+ // Remove transparency on frozen cells.
19
+ $table-bg-default: if($table-bg == transparent, if($body-bg == transparent, #fff, $body-bg), $table-bg) !default;
20
+ .table-striped > tbody > tr:nth-child(even) > td, .table-striped > thead > tr > th {
21
+ background-color: $table-bg-default;
22
+ }
23
+ $table-bg-header-sort: #e2eff6 !default;
24
+ .table .ra-sidescroll-frozen {
25
+ &.headerSortUp, &.headerSortDown {
26
+ background-color: $table-bg-header-sort;
27
+ }
28
+ }
29
+ }
@@ -55,12 +55,13 @@
55
55
  @import "rails_admin/bootstrap-datetimepicker-build";
56
56
  @import "rails_admin/ra.filtering-multiselect";
57
57
  @import "rails_admin/ra.widgets";
58
+ @import "rails_admin/ra.sidescroll";
58
59
  @import "rails_admin/jquery.colorpicker";
59
60
 
60
61
 
61
62
  /*** Font-awesome ***/
62
63
 
63
- @import 'font-awesome';
64
+ @import 'rails_admin/font-awesome';
64
65
  @import 'rails_admin/base/font-awesome-4-compability';
65
66
 
66
67
  /*** Bootstrap Theming ***/
@@ -160,7 +160,7 @@ module RailsAdmin
160
160
  content_tag(:ul, class: 'dropdown-menu', style: 'left:auto; right:0;') do
161
161
  actions.collect do |action|
162
162
  content_tag :li do
163
- link_to wording_for(:bulk_link, action), '#', onclick: "jQuery('#bulk_action').val('#{action.action_name}'); jQuery('#bulk_form').submit(); return false;"
163
+ link_to wording_for(:bulk_link, action, abstract_model), '#', class: 'bulk-link', data: {action: action.action_name}
164
164
  end
165
165
  end.join.html_safe
166
166
  end
@@ -56,8 +56,8 @@ module RailsAdmin
56
56
  end.to_a.sort_by(&:first)
57
57
  end
58
58
 
59
- def ordered_filter_string
60
- @ordered_filter_string ||= ordered_filters.map do |duplet|
59
+ def ordered_filter_options
60
+ @ordered_filter_options ||= ordered_filters.map do |duplet|
61
61
  options = {index: duplet[0]}
62
62
  filter_for_field = duplet[1]
63
63
  filter_name = filter_for_field.keys.first
@@ -77,8 +77,8 @@ module RailsAdmin
77
77
  options[:value] = filter_hash['v']
78
78
  options[:label] = field.label
79
79
  options[:operator] = filter_hash['o']
80
- %{$.filters.append(#{options.to_json});}
81
- end.join("\n").html_safe if ordered_filters
80
+ options
81
+ end if ordered_filters
82
82
  end
83
83
  end
84
84
  end
@@ -10,9 +10,6 @@
10
10
  = javascript_include_tag "rails_admin/rails_admin.js"
11
11
  %body.rails_admin
12
12
  #admin-js{:'data-i18n-options' => I18n.t("admin.js").to_json}
13
- -# Initialize JS simple i18n
14
- :javascript
15
- RailsAdmin.I18n.init('#{I18n.locale}', document.getElementById("admin-js").dataset.i18nOptions);
16
13
  #loading.label.label-warning{style: 'display:none; position:fixed; right:20px; bottom:20px; z-index:100000'}= t('admin.loading')
17
14
  %nav.navbar.navbar-default.navbar-fixed-top
18
15
  = render "layouts/rails_admin/navigation"