effective_datatables 2.11.2 → 2.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89fe9d65ab41811c5fe6f99d2a30178cdd17558e
4
- data.tar.gz: 3778600b8979aeb4ec2553e00aef1dbd9d856e58
3
+ metadata.gz: 672de368787ac30eb2d42e8bfcde9cba24a61e98
4
+ data.tar.gz: fe3cb8fd151b68c9da65fd9f81fb949fa86caead
5
5
  SHA512:
6
- metadata.gz: d25d50f56c92c86e72c812ff0d58ba59658cbe5856ff42965d5988406c7bca194e36114e6ad0958a135bd1447d7b3ed63bd6f2db7d2562eed02ae596662c0c1e
7
- data.tar.gz: e5cf61f381816ab5946f7e5f689f644c522e9181d05940a73535018aae9ea5cc6b21394a8e7976921b53d4fde2a708d2b6458adcee37c59ac4ba775c0af09885
6
+ metadata.gz: bdffcce1d831eb5d0e27a5242257647a717d043ee64799d264b3bbdd31b6b460c70a05b9ad14294fa981bfd9dd78c44310e1cf153428e25dc943656d2bfb945e
7
+ data.tar.gz: b831ffff4efc8d3b154e4d93747d155d90037b874293ffb786d3c2daaf8fcc4ed750ef59ff11da74dddc3ea2757d3af35c71b013210b035825b5942db91bde33
data/README.md CHANGED
@@ -501,7 +501,7 @@ datatable do
501
501
  bulk_actions_column do
502
502
  bulk_action 'Approve all', bulk_approve_posts_path, data: {confirm: 'Approve all selected posts?'}
503
503
  bulk_action_divider
504
- bulk_action 'Send emails', bulk_email_posts_path, data : {confirm: 'Really send emails?'}
504
+ bulk_action 'Send emails', bulk_email_posts_path, data: {confirm: 'Really send emails?'}
505
505
  end
506
506
 
507
507
  ...
@@ -1,3 +1,9 @@
1
- $(document).on 'click', 'a[data-reset-form]', (event) ->
1
+ $(document).on 'click', 'a[data-clear-form]', (event) ->
2
2
  event.preventDefault()
3
- $(event.currentTarget).closest('form').trigger('reset')
3
+ $(event.currentTarget).closest('form').trigger('clear')
4
+
5
+ $(document).on 'clear', '.effective-datatable-scopes form', (event) ->
6
+ $(this).find('.radio.active').removeClass('active');
7
+ $(this).find(':radio').prop('checked', false);
8
+ $('form.form-inline input:not([type=submit])').val('');
9
+ $(this).submit()
@@ -49,7 +49,6 @@ table.dataTable.sort-hidden thead .sorting_desc { background-image: none; }
49
49
 
50
50
  // Filter bar
51
51
  table.dataTable .form-group { width: 100%; margin-left: 0px; margin-right: 0px; }
52
- table.dataTable input { width: 100%; }
53
52
  table.dataTable select { width: 100%; }
54
53
  table.dataTable .form-control { width: 100%; }
55
54
  table.dataTable .form-group.datatable_filter_bulk_actions { margin-left: 4px; }
@@ -7,8 +7,8 @@ module EffectiveDatatablesHelper
7
7
  datatable.view ||= self
8
8
 
9
9
  begin
10
- EffectiveDatatables.authorized?(controller, :index, datatable.collection_class) || raise('unauthorized')
11
- rescue => e
10
+ EffectiveDatatables.authorized?(controller, :index, datatable.collection_class) || raise(Effective::AccessDenied)
11
+ rescue Effective::AccessDenied => e
12
12
  return content_tag(:p, "You are not authorized to view this datatable. (cannot :index, #{datatable.collection_class})")
13
13
  end
14
14
 
@@ -23,8 +23,8 @@ module EffectiveDatatablesHelper
23
23
  datatable.simple = true
24
24
 
25
25
  begin
26
- EffectiveDatatables.authorized?(controller, :index, datatable.collection_class) || raise('unauthorized')
27
- rescue => e
26
+ EffectiveDatatables.authorized?(controller, :index, datatable.collection_class) || raise(Effective::AccessDenied)
27
+ rescue Effective::AccessDenied => e
28
28
  return content_tag(:p, "You are not authorized to view this datatable. (cannot :index, #{datatable.collection_class})})")
29
29
  end
30
30
 
@@ -16,6 +16,6 @@
16
16
  - else
17
17
  = form.input name, options[:filter]
18
18
 
19
- = form.submit 'Submit', class: 'btn btn-primary', 'data-disable-with' => 'Submitting...'
20
- = link_to 'Reset', '#', 'data-reset-form' => true
21
-
19
+ .btn-group
20
+ = form.submit 'Filter', class: 'btn btn-primary', 'data-disable-with' => 'Submitting...'
21
+ = link_to 'Clear', '#', class: 'btn btn-default', 'data-clear-form' => true
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '2.11.2'.freeze
2
+ VERSION = '2.12.0'.freeze
3
3
  end
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: 2.11.2
4
+ version: 2.12.0
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-02-03 00:00:00.000000000 Z
11
+ date: 2017-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails