zuora_connect_ui 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e91757c7d997a8d72f0589ca060480cf8cf7eb2
|
4
|
+
data.tar.gz: 792fd53612e44d1d6b001bfde0cadd2d6ff13a5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caf970f2b54d47a556382c7efa2c979bf8f5b0908fb16224b2cd2b195998a342ece2c955b54628a22f41d7c4de972987335381d0e2746c02d6c4ff9f6d2debf9
|
7
|
+
data.tar.gz: 09a453c62a32fe43a76fed40635c7711c476a643d4874b63fc4cd43c462b7ac35bc7117620e9ecd43564b7a1e9e63738ba4ecaf1a79fd612d34d6d4a516cc68b
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Helper methods for rendering JQuery Datatables
|
4
|
+
module DatatableHelper
|
5
|
+
def default_datatable_columns(object)
|
6
|
+
datatable_columns(object, ['actions'] + object.column_names)
|
7
|
+
end
|
8
|
+
|
9
|
+
def datatable_columns(object, cols)
|
10
|
+
obj_name = object.to_s.underscore.pluralize
|
11
|
+
cols.map do |col|
|
12
|
+
if col == 'actions'
|
13
|
+
{ title: '', data: "#{obj_name.tr('/', '_')}__actions",
|
14
|
+
class: 'actions center', bSortable: false }
|
15
|
+
else
|
16
|
+
{ title: col.split('_').collect(&:capitalize).join(' ').to_s,
|
17
|
+
data: "#{obj_name}__#{col}", visible: true }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def render_datatable(object, table_url, columns: nil, table_name: nil, aoData: [], initial_size: 25, table_views: { table: true, grid: false }, table_filters: {}, table_actions: nil, sort: [[0, 'asc']])
|
23
|
+
if table_name.nil?
|
24
|
+
table_name = object.to_s.pluralize.underscore.tr('/', '_')
|
25
|
+
end
|
26
|
+
columns = default_datatable_columns(object) if columns.nil?
|
27
|
+
render(
|
28
|
+
partial: 'partials/table', locals: {
|
29
|
+
table_name: table_name, aoData: aoData, columns: columns, sort: sort,
|
30
|
+
table_filters: table_filters, table_views: table_views,
|
31
|
+
initial_size: initial_size, table_actions: table_actions,
|
32
|
+
table_url: table_url
|
33
|
+
}.merge(request.query_parameters), formats: [:html]
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
@@ -98,7 +98,7 @@
|
|
98
98
|
});
|
99
99
|
|
100
100
|
var <%= table_name %> = $('#<%= "#{table_name}_content" %>').find('table.datatable').dataTable({
|
101
|
-
"sDom": "<'
|
101
|
+
"sDom": "t<'row'<'grid_view col-lg-12'>><'table_footer'i<'<%="\##{table_name}_select_container" %>.select_container'>p>",
|
102
102
|
"pagingType": "full_numbers",
|
103
103
|
"language" : {
|
104
104
|
"paginate" : {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zuora_connect_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Connect Team
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- LICENSE.txt
|
133
133
|
- README.md
|
134
134
|
- app/assets/javascripts/zuora_connect_ui.js
|
135
|
+
- app/assets/javascripts/zuora_connect_ui/datatable.js
|
135
136
|
- app/assets/javascripts/zuora_connect_ui/input.js
|
136
137
|
- app/assets/stylesheets/_zuora_connect_ui.scss
|
137
138
|
- app/assets/stylesheets/zuora_connect_ui/base.scss
|
@@ -143,6 +144,7 @@ files:
|
|
143
144
|
- app/assets/stylesheets/zuora_connect_ui/input.scss
|
144
145
|
- app/assets/stylesheets/zuora_connect_ui/modal.scss
|
145
146
|
- app/assets/stylesheets/zuora_connect_ui/tabs.scss
|
147
|
+
- app/helpers/datatable_helper.rb
|
146
148
|
- app/helpers/input_helper.rb
|
147
149
|
- app/views/partials/_admin_menu.html.erb
|
148
150
|
- app/views/partials/_filters.html.erb
|