effective_datatables 3.3.14 → 3.4.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: ea8489f1a21f2dd9b48a0c3fdcceb3d9c3c1b705
4
- data.tar.gz: 8c5c8d254c485bd5975aca3436bb82a5e0c51299
3
+ metadata.gz: 619baaf788e1e0e7522bc2327fef27a997dba06e
4
+ data.tar.gz: 61e406f431079e6d251fd4d9ad55a76fd5a77da0
5
5
  SHA512:
6
- metadata.gz: 108b2f1856fee2aa9e153dd1baf76f0fa4a8a8b047ac8a9a36648fe7f657e33970d38d2afed2c3b4c0529e5938361a09b5efd020de0bcc026f68e16b3986d8f4
7
- data.tar.gz: f54da3d46cf77a19b0626a8d51f12b33b95cb461d8642c72bea9286b40cfe4a7a5398582bbd24d7fc7eed54a55741f475f1306914266dd093df53626f7c46b8c
6
+ metadata.gz: fac7b347fac1755ca7a49780d038c561b7588bcd8955192cdd7af37f1ff29549758fbfcc4d92d35fc5c4b7b77e1f750d16c048e35317ffbbc32e960e82742306
7
+ data.tar.gz: 3683794e47ae401d6313213bd4ccad4d139fd250f8667cf17e71664853b28ed0756e071914e17f7005b27b516558a0215689e891daa33193ba7f3844b34f2512
@@ -18,7 +18,7 @@ module EffectiveDatatablesHelper
18
18
 
19
19
  effective_datatable_params = {
20
20
  id: datatable.to_param,
21
- class: Array(datatable.table_html_class).join(' '),
21
+ class: ('effective-datatable ' + Array(datatable.table_html_class).join(' ')),
22
22
  data: {
23
23
  'effective-form-inputs' => defined?(EffectiveFormInputs),
24
24
  'bulk-actions' => datatable_bulk_actions(datatable),
@@ -59,6 +59,26 @@ module EffectiveDatatablesHelper
59
59
  end
60
60
  end
61
61
 
62
+ def render_simple_datatable(datatable)
63
+ raise 'expected datatable to be present' unless datatable
64
+
65
+ datatable.view ||= self
66
+
67
+ unless EffectiveDatatables.authorized?(controller, :index, datatable.collection_class)
68
+ return content_tag(:p, "You are not authorized to view this datatable. (cannot :index, #{datatable.collection_class})")
69
+ end
70
+
71
+ effective_datatable_params = {
72
+ id: datatable.to_param,
73
+ class: Array(datatable.table_html_class).join(' '),
74
+ data: {}
75
+ }
76
+
77
+ render(partial: 'effective/datatables/datatable',
78
+ locals: { datatable: datatable, effective_datatable_params: effective_datatable_params }
79
+ )
80
+ end
81
+
62
82
  def render_datatable_filters(datatable)
63
83
  raise 'expected datatable to be present' unless datatable
64
84
 
@@ -1,4 +1,4 @@
1
- %table.effective-datatable{effective_datatable_params}
1
+ %table{effective_datatable_params}
2
2
  %thead
3
3
  - if datatable.columns.any? { |_, opts| opts[:th].present? } == false
4
4
  %tr
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '3.3.14'.freeze
2
+ VERSION = '3.4.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: 3.3.14
4
+ version: 3.4.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: 2018-01-25 00:00:00.000000000 Z
11
+ date: 2018-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails