effective_datatables 3.2.6 → 3.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_datatables/bulk_actions.js.coffee +1 -1
- data/app/assets/javascripts/effective_datatables/filters.js.coffee +1 -1
- data/app/assets/javascripts/effective_datatables/initialize.js.coffee +2 -2
- data/app/assets/stylesheets/effective_datatables/_overrides.scss +30 -22
- data/app/helpers/effective_datatables_helper.rb +4 -4
- data/app/models/effective/effective_datatable/resource.rb +3 -5
- data/app/views/effective/datatables/_filters.html.haml +1 -1
- data/lib/effective_datatables/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef7002186c955ceea81788574da37e926dde317e
|
4
|
+
data.tar.gz: e4bc57451595479713c11d423d2b21b22629eaae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07f99e9baa2ca960349e3fc42949cc14a679109d5156ec8990b7fca81ee24a5abd582a67b07bc2a476da9eb588fc04660944609065c7fc7eaae470d1ed2ebbe1
|
7
|
+
data.tar.gz: 867adf502935e2db8dec3171e785ee70039d0a15844ebea9a2858584a2f3a27201f5ecd4bf3918ff9c7ef227b7489559f92c0a66965d22ed45cd1a204914a2f9
|
@@ -58,7 +58,7 @@ $(document).on 'click', '.buttons-bulk-actions a', (event) ->
|
|
58
58
|
$processing.html(success)
|
59
59
|
$table.dataTable().data('bulk-actions-restore-selected-values', values)
|
60
60
|
$table.DataTable().draw()
|
61
|
-
failCallback:
|
61
|
+
failCallback: ->
|
62
62
|
error = "An error occured while attempting #{title} bulk action"
|
63
63
|
$processing.html(error)
|
64
64
|
alert(error)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
$(document).on 'click', 'a[data-apply-
|
1
|
+
$(document).on 'click', 'a[data-apply-effective-datatables-filters]', (event) ->
|
2
2
|
event.preventDefault()
|
3
3
|
$form = $(event.currentTarget).closest('.effective-datatables-filters')
|
4
4
|
$table = $('#' + $form.attr('aria-controls'))
|
@@ -3,9 +3,9 @@ initializeDataTables = ->
|
|
3
3
|
return if $.fn.DataTable.fnIsDataTable(this)
|
4
4
|
|
5
5
|
datatable = $(this)
|
6
|
-
simple = ('' + datatable.data('simple') == 'true')
|
7
6
|
input_js_options = datatable.data('input-js-options') || {}
|
8
7
|
buttons_export_columns = input_js_options['buttons_export_columns'] || ':not(.col-actions)'
|
8
|
+
simple = ('' + datatable.data('simple') == 'true')
|
9
9
|
|
10
10
|
if input_js_options['buttons'] == false
|
11
11
|
input_js_options['buttons'] = []
|
@@ -178,7 +178,7 @@ initializeDataTables = ->
|
|
178
178
|
|
179
179
|
if simple
|
180
180
|
init_options['dom'] = "<'row'<'col-sm-12'tr>>" # Just show the table
|
181
|
-
datatable.addClass('
|
181
|
+
datatable.addClass('simple')
|
182
182
|
|
183
183
|
# Let's actually initialize the table now
|
184
184
|
table = datatable.dataTable(jQuery.extend(init_options, input_js_options))
|
@@ -27,28 +27,37 @@ table.dataTable thead > tr > th.sorting {
|
|
27
27
|
padding-right: 18px;
|
28
28
|
}
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
30
|
+
// Search bar
|
31
|
+
table.dataTable thead {
|
32
|
+
tr th {
|
33
|
+
text-align: left;
|
34
|
+
vertical-align: top;
|
35
|
+
border-bottom: none;
|
36
|
+
white-space: nowrap;
|
37
|
+
padding: 6px;
|
38
|
+
}
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
.form-control, .form-group {
|
41
|
+
width: 100%;
|
42
|
+
font-weight: normal;
|
43
|
+
margin-left: 0px;
|
44
|
+
margin-right: 0px;
|
45
|
+
}
|
44
46
|
|
45
|
-
|
47
|
+
.datatable_search__bulk_actions { margin-left: 5px; }
|
48
|
+
}
|
49
|
+
|
50
|
+
// Simple styles
|
51
|
+
table.dataTable.simple {
|
52
|
+
thead {
|
53
|
+
.sorting { background-image: none; cursor: default; }
|
54
|
+
.sorting_asc { background-image: none; cursor: default; }
|
55
|
+
.sorting_desc { background-image: none; cursor: default; }
|
46
56
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
table.dataTable .form-group.datatable_search_bulk_actions { margin-left: 4px; }
|
57
|
+
.form-group { display: none; }
|
58
|
+
.col-bulk_actions { display: none; }
|
59
|
+
}
|
60
|
+
}
|
52
61
|
|
53
62
|
// Processing popup
|
54
63
|
div.dataTables_wrapper div.dataTables_processing {
|
@@ -61,7 +70,6 @@ div.dataTables_wrapper div.dataTables_processing {
|
|
61
70
|
|
62
71
|
// Show x per page
|
63
72
|
.dataTables_wrapper div.dataTables_length {
|
64
|
-
margin-bottom: 4px;
|
65
73
|
color: #909090;
|
66
74
|
font-size: 12px;
|
67
75
|
}
|
@@ -135,7 +143,7 @@ ul.dt-button-collection {
|
|
135
143
|
div.dataTables_wrapper div.dataTables_info {
|
136
144
|
color: #909090;
|
137
145
|
font-size: 12px;
|
138
|
-
padding: 5px 0px
|
146
|
+
padding: 5px 0px 6px 6px;
|
139
147
|
}
|
140
148
|
|
141
149
|
// Collapsed responsive view
|
@@ -144,7 +152,7 @@ table.dataTable > tbody > tr.child span.dtr-data { white-space: nowrap; }
|
|
144
152
|
|
145
153
|
table.dataTable.dtr-inline.collapsed > tbody > tr:not(.child) > td:first-child,
|
146
154
|
table.dataTable.dtr-inline.collapsed > tbody > tr:not(.child) > th:first-child {
|
147
|
-
|
155
|
+
padding-left: 30px !important;
|
148
156
|
}
|
149
157
|
|
150
158
|
// Column specific adjustments
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# These are expected to be called by a developer. They are part of the datatables DSL.
|
2
2
|
module EffectiveDatatablesHelper
|
3
3
|
|
4
|
-
def render_datatable(datatable, input_js: {}, charts: true, filters: true, simple: false
|
4
|
+
def render_datatable(datatable, input_js: {}, buttons: true, charts: true, filters: true, simple: false)
|
5
5
|
raise 'expected datatable to be present' unless datatable
|
6
6
|
|
7
7
|
datatable.view ||= self
|
@@ -14,7 +14,9 @@ module EffectiveDatatablesHelper
|
|
14
14
|
|
15
15
|
charts = charts && datatable._charts.present?
|
16
16
|
filters = filters && (datatable._scopes.present? || datatable._filters.present?)
|
17
|
-
|
17
|
+
|
18
|
+
datatable.attributes[:simple] = true if simple
|
19
|
+
input_js[:buttons] = false if simple || !buttons
|
18
20
|
|
19
21
|
effective_datatable_params = {
|
20
22
|
id: datatable.to_param,
|
@@ -53,8 +55,6 @@ module EffectiveDatatablesHelper
|
|
53
55
|
|
54
56
|
output
|
55
57
|
else
|
56
|
-
datatable.attributes[:simple] = true if simple
|
57
|
-
|
58
58
|
render(partial: 'effective/datatables/datatable',
|
59
59
|
locals: { datatable: datatable, effective_datatable_params: effective_datatable_params }
|
60
60
|
)
|
@@ -57,12 +57,12 @@ module Effective
|
|
57
57
|
case opts[:as]
|
58
58
|
when *resource.macros
|
59
59
|
opts[:resource] ||= Effective::Resource.new(resource.associated(name), namespace: controller_namespace)
|
60
|
-
|
60
|
+
opts[:sql_column] = name if opts[:sql_column].nil?
|
61
61
|
when Class
|
62
62
|
if opts[:as].ancestors.include?(ActiveRecord::Base)
|
63
63
|
opts[:resource] = Effective::Resource.new(opts[:as], namespace: controller_namespace)
|
64
64
|
opts[:as] = :resource
|
65
|
-
|
65
|
+
opts[:sql_column] = name if opts[:sql_column].nil?
|
66
66
|
end
|
67
67
|
when :effective_addresses
|
68
68
|
opts[:resource] = Effective::Resource.new(resource.associated(name), namespace: controller_namespace)
|
@@ -71,9 +71,7 @@ module Effective
|
|
71
71
|
opts[:sql_column] = :effective_roles
|
72
72
|
when :string # This is the fallback
|
73
73
|
# Anything that doesn't belong to the model or the sql table, we assume is a SELECT SUM|AVG|RANK() as fancy
|
74
|
-
if (resource.table && resource.column(name).blank?)
|
75
|
-
opts[:sql_as_column] = true
|
76
|
-
end
|
74
|
+
opts[:sql_as_column] = true if (resource.table && resource.column(name).blank?)
|
77
75
|
end
|
78
76
|
end
|
79
77
|
end
|
@@ -24,4 +24,4 @@
|
|
24
24
|
- if datatable._filters_form_required?
|
25
25
|
= form.button :submit, 'Apply', 'data-disable-with': 'Applying...'
|
26
26
|
- else
|
27
|
-
= link_to 'Apply', '#', class: 'btn btn-primary btn-sm btn-effective-datatables-filters', 'data-apply-
|
27
|
+
= link_to 'Apply', '#', class: 'btn btn-primary btn-sm btn-effective-datatables-filters', 'data-apply-effective-datatables-filters': true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_datatables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|