ez-resources 0.2.2 → 0.2.4
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 +4 -4
- data/app/cells/ez/resources/collection/table.slim +1 -1
- data/app/cells/ez/resources/collection_cell.rb +4 -0
- data/app/cells/ez/resources/search/show.slim +15 -6
- data/app/cells/ez/resources/search_cell.rb +5 -1
- data/lib/ez/resources/manager/config.rb +2 -2
- data/lib/ez/resources/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df9a053ecff5d70725db5d431e5d4c6300214d308bebd3aeb265cde0ff3207e1
|
4
|
+
data.tar.gz: 107c43e96b9e49bc05b3e42fcd2dd19fd026dca9cc4c7cc4de7b16d35f21e2eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08f114b5587039d6a523376af6f2a479dc191a19579390150a24b136990e7254a688d3a0802413950e0279abb5317cb6bda48b3874d26998399267f5df8f9165'
|
7
|
+
data.tar.gz: 5c2a4346c8990a8df4116e15f8c48bcfbb6cb02620b01cff340c80f53ce523acb625e00322bc2242dc88cf3ccfd6a7ac932c9b7206e444532c2dc3503612fd60
|
@@ -33,7 +33,7 @@
|
|
33
33
|
= edit_link(record)
|
34
34
|
= remove_link(record)
|
35
35
|
- model.collection_actions.each do |custom_action|
|
36
|
-
= link_to
|
36
|
+
= link_to custom_action_label(custom_action), custom_action.builder.call(controller, record), custom_action.options.merge(class: css_for('collection-table-td-action-item'))
|
37
37
|
|
38
38
|
- if paginator && paginator.count > 20
|
39
39
|
== pagination
|
@@ -7,12 +7,21 @@
|
|
7
7
|
- model.collection_columns.each do |field|
|
8
8
|
- if field.searchable && SEARCHABLE_FIELDS.include?(field.type)
|
9
9
|
= div_for 'collection-search-panel-field'
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
- if field.type == :checkboxes
|
11
|
+
= label_tag field.search_label
|
12
|
+
.checkboxes
|
13
|
+
- field.collection.each do |item|
|
14
|
+
.ui.checkbox
|
15
|
+
- checked = params.dig(:q, field.search_suffix) || []
|
16
|
+
= check_box_tag("q[#{field.search_suffix}][]", item.id, checked.include?(item.id.to_s), id: "checkbox-#{item.id}")
|
17
|
+
= label_tag item.id, item.name
|
18
|
+
- else
|
19
|
+
= f.input field_input_name(field),
|
20
|
+
label: field_label(field),
|
21
|
+
required: false,
|
22
|
+
as: cast_field_type(field.type),
|
23
|
+
collection: field.collection,
|
24
|
+
include_blank: true
|
16
25
|
|
17
26
|
= f.submit t('actions.apply'), class: css_for('collection-search-panel-submit-button')
|
18
27
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Ez
|
4
4
|
module Resources
|
5
5
|
class SearchCell < ApplicationCell
|
6
|
-
SEARCHABLE_FIELDS = %i[string association select link boolean].freeze
|
6
|
+
SEARCHABLE_FIELDS = %i[string association select link boolean checkboxes].freeze
|
7
7
|
|
8
8
|
form
|
9
9
|
|
@@ -38,6 +38,10 @@ module Ez
|
|
38
38
|
def association?(field)
|
39
39
|
field.type == :association && field.options[:association].present?
|
40
40
|
end
|
41
|
+
|
42
|
+
def checked_checkbox
|
43
|
+
params.dig(:q, field.search_suffix) || []
|
44
|
+
end
|
41
45
|
end
|
42
46
|
end
|
43
47
|
end
|
@@ -129,9 +129,9 @@ module Ez
|
|
129
129
|
pagy, paginated_collection = pagy dsl_config.collection_query.call(search.result,
|
130
130
|
controller)
|
131
131
|
else
|
132
|
-
pagy, paginated_collection = pagy search.result.includes(dsl_config.includes)
|
132
|
+
pagy, paginated_collection = pagy search.result.includes(dsl_config.includes),
|
133
|
+
items_param: :items
|
133
134
|
end
|
134
|
-
|
135
135
|
@paginator = pagy
|
136
136
|
paginated_collection
|
137
137
|
end
|
data/lib/ez/resources/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ez-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volodya Sveredyuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cells-rails
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: pagy
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 6.0.4
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 6.0.4
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|