effective_datatables 3.7.10 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +32 -32
  4. data/app/assets/images/dataTables/sort-down.svg +1 -0
  5. data/app/assets/images/dataTables/sort-up.svg +1 -0
  6. data/app/assets/images/dataTables/sort.svg +1 -0
  7. data/app/assets/javascripts/dataTables/buttons/{buttons.bootstrap.js → buttons.bootstrap4.js} +7 -15
  8. data/app/assets/javascripts/dataTables/dataTables.bootstrap4.js +184 -0
  9. data/app/assets/javascripts/dataTables/responsive/dataTables.responsive.js +30 -11
  10. data/app/assets/javascripts/dataTables/responsive/{responsive.bootstrap.js → responsive.bootstrap4.js} +6 -6
  11. data/app/assets/javascripts/effective_datatables/bulk_actions.js.coffee +43 -43
  12. data/app/assets/javascripts/effective_datatables/events.js.coffee +7 -4
  13. data/app/assets/javascripts/effective_datatables/filters.js.coffee +0 -1
  14. data/app/assets/javascripts/effective_datatables/initialize.js.coffee +45 -49
  15. data/app/assets/javascripts/effective_datatables/overrides.js +12 -0
  16. data/app/assets/javascripts/effective_datatables/reset.js.coffee +1 -1
  17. data/app/assets/javascripts/effective_datatables.js +4 -4
  18. data/app/assets/stylesheets/dataTables/buttons/{buttons.bootstrap.scss → buttons.bootstrap4.css} +68 -1
  19. data/app/assets/stylesheets/dataTables/{dataTables.bootstrap.scss → dataTables.bootstrap4.css} +44 -29
  20. data/app/assets/stylesheets/dataTables/responsive/{responsive.bootstrap.scss → responsive.bootstrap4.css} +3 -3
  21. data/app/assets/stylesheets/effective_datatables/_overrides.scss +72 -152
  22. data/app/assets/stylesheets/effective_datatables.scss +3 -4
  23. data/app/controllers/effective/datatables_controller.rb +6 -39
  24. data/app/helpers/effective_datatables_helper.rb +55 -50
  25. data/app/helpers/effective_datatables_private_helper.rb +47 -179
  26. data/app/models/effective/datatable.rb +16 -44
  27. data/app/models/effective/datatable_column.rb +0 -1
  28. data/app/models/effective/datatable_column_tool.rb +2 -4
  29. data/app/models/effective/datatable_dsl_tool.rb +3 -11
  30. data/app/models/effective/datatable_value_tool.rb +23 -23
  31. data/app/models/effective/effective_datatable/attributes.rb +13 -5
  32. data/app/models/effective/effective_datatable/collection.rb +3 -18
  33. data/app/models/effective/effective_datatable/compute.rb +6 -17
  34. data/app/models/effective/effective_datatable/cookie.rb +20 -19
  35. data/app/models/effective/effective_datatable/dsl/bulk_actions.rb +25 -14
  36. data/app/models/effective/effective_datatable/dsl/datatable.rb +28 -70
  37. data/app/models/effective/effective_datatable/dsl/filters.rb +5 -5
  38. data/app/models/effective/effective_datatable/dsl.rb +3 -8
  39. data/app/models/effective/effective_datatable/format.rb +50 -95
  40. data/app/models/effective/effective_datatable/params.rb +3 -8
  41. data/app/models/effective/effective_datatable/resource.rb +76 -137
  42. data/app/models/effective/effective_datatable/state.rb +15 -30
  43. data/app/views/effective/datatables/_actions_column.html.haml +8 -1
  44. data/app/views/effective/datatables/_bulk_actions_column.html.haml +1 -1
  45. data/app/views/effective/datatables/_filters.html.haml +11 -12
  46. data/app/views/effective/datatables/_resource_column.html.haml +8 -11
  47. data/config/effective_datatables.rb +14 -12
  48. data/config/routes.rb +0 -1
  49. data/lib/effective_datatables/engine.rb +4 -14
  50. data/lib/effective_datatables/version.rb +1 -1
  51. data/lib/effective_datatables.rb +4 -57
  52. metadata +20 -31
  53. data/app/assets/config/effective_datatables_manifest.js +0 -3
  54. data/app/assets/images/dataTables/sort_asc.png +0 -0
  55. data/app/assets/images/dataTables/sort_both.png +0 -0
  56. data/app/assets/images/dataTables/sort_desc.png +0 -0
  57. data/app/assets/javascripts/dataTables/dataTables.bootstrap.js +0 -182
  58. data/app/assets/javascripts/dataTables/locales/en.lang +0 -33
  59. data/app/assets/javascripts/dataTables/locales/es.lang +0 -36
  60. data/app/assets/javascripts/dataTables/locales/nl.lang +0 -30
  61. data/app/assets/javascripts/effective_datatables/flash.js.coffee +0 -31
  62. data/app/assets/javascripts/effective_datatables/inline_crud.js.coffee +0 -217
  63. data/app/assets/javascripts/effective_datatables/overrides.js.coffee +0 -7
  64. data/app/assets/javascripts/effective_datatables/reorder.js.coffee +0 -43
  65. data/app/assets/stylesheets/effective_datatables/_filters.scss +0 -7
  66. data/app/views/effective/datatables/_reorder_column.html.haml +0 -5
  67. data/config/locales/en.yml +0 -12
  68. data/config/locales/es.yml +0 -12
  69. data/config/locales/nl.yml +0 -12
@@ -1,43 +0,0 @@
1
- reorder = (event, diff, edit) ->
2
- change = diff.find (obj) -> obj.node == edit.triggerRow.node()
3
- return unless change?
4
-
5
- $table = $(event.currentTarget)
6
- oldNode = $("<div>#{change.oldData}</div>").find('input[data-reorder-resource]')
7
- newNode = $("<div>#{change.newData}</div>").find('input[data-reorder-resource]')
8
- return unless oldNode? && newNode?
9
-
10
- url = @context[0].ajax.url.replace('.json', '/reorder.json')
11
- data = {'reorder[id]': oldNode.data('reorder-resource'), 'reorder[old]': oldNode.val(), 'reorder[new]': newNode.val(), attributes: $table.data('attributes') }
12
-
13
- @context[0].rowreorder.c.enable = false
14
-
15
- $.ajax(
16
- method: 'post',
17
- url: url,
18
- data: data,
19
- async: false
20
- ).fail((response, text, status) =>
21
- $(event.target).closest('table').DataTable().flash(status, 'danger')
22
- ).always((response) =>
23
- @context[0].rowreorder.c.enable = true
24
- )
25
-
26
- $.fn.DataTable.Api.register('reorder()', reorder);
27
-
28
- $(document).on 'click', '.dataTables_wrapper a.buttons-reorder', (event) ->
29
- event.preventDefault() # prevent the click
30
-
31
- $link = $(event.currentTarget)
32
- $table = $link.closest('.dataTables_wrapper').find('table.dataTable').first()
33
-
34
- column = $table.DataTable().column('.col-_reorder')
35
- return unless column.length > 0
36
-
37
- if column.visible()
38
- $table.removeClass('reordering')
39
- else
40
- $table.addClass('reordering')
41
-
42
- column.visible(!column.visible())
43
-
@@ -1,7 +0,0 @@
1
- .effective-datatables-filters { margin-bottom: 10px; }
2
- .effective-datatables-filters-scopes { display: inline-block; margin-right: 10px; }
3
- .effective-datatables-filters-inputs { display: inline-block; }
4
- .effective-datatables-filters-inputs span.select2-container { display: inline-block; }
5
- .effective-datatables-filters-inputs .form-group { margin-right: 10px; }
6
- .effective-datatables-filters-inputs .control-label { margin-right: 3px; }
7
- .effective-datatables-filters-btn { display: inline-block; }
@@ -1,5 +0,0 @@
1
- - id = (resource.try(:to_param) || resource.try(:id) || resource.object_id)
2
- - value = resource.send(column[:reorder])
3
-
4
- %input{type: 'hidden', value: value, 'data-reorder-resource': id}
5
- = glypicon('move')
@@ -1,12 +0,0 @@
1
- ---
2
- en:
3
- effective_datatables:
4
- apply: Apply
5
- reset: Reset
6
- reorder: Reorder
7
- new: New
8
- actions: Actions
9
- bulk_actions: Bulk Actions
10
- applying: Applying...
11
- boolean_true: 'Yes'
12
- boolean_false: 'No'
@@ -1,12 +0,0 @@
1
- ---
2
- es:
3
- effective_datatables:
4
- apply: Filtrar
5
- reset: Reiniciar
6
- reorder: Reordenar
7
- new: Nuevo
8
- actions: Acciones
9
- bulk_actions: Acciones en masa
10
- applying: Filtrando...
11
- boolean_true: 'Sí'
12
- boolean_false: 'No'
@@ -1,12 +0,0 @@
1
- ---
2
- nl:
3
- effective_datatables:
4
- apply: Toepassen
5
- reset: Reset
6
- reorder: Opnieuw ordenen
7
- new: Nieuwe
8
- actions: Acties
9
- bulk_actions: Bulkacties
10
- applying: Toepassen...
11
- boolean_true: 'Ja'
12
- boolean_false: 'Nee'