card-mod-search 0.11.3 → 0.11.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/card/filter_query.rb +4 -0
- data/set/abstract/02_search_params.rb +1 -3
- data/set/abstract/03_filter/form_helper.rb +1 -1
- data/set/abstract/05_search/views.rb +3 -5
- data/set/abstract/06_cql_search.rb +2 -0
- data/set/self/search.rb +3 -1
- data/set/type/search_type.rb +1 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da80215b28b3fd3a1435b178a743ee3e604368833c2d8bafc45f98de457b21de
|
4
|
+
data.tar.gz: 4ef54f7fa398567d897d83e4119645eda8aa36e1f5a9ea9c26c57384ef27e5fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97ebfda126f45fb310eddae1389e0d8901245a6045388bdae669adefce59c0509068f456826a969ab4d2edc027db8994bafdff55b9bceb32590e473f58b6f85e
|
7
|
+
data.tar.gz: 3ba15a45174a9468861195da7b7af3199b62111ef0dcae15f37d35b24edd205d6b250511a1714d88187a84b1ebdb3cdb652bc184bc44200656b776b75917acb3
|
data/lib/card/filter_query.rb
CHANGED
@@ -16,6 +16,7 @@ class Card
|
|
16
16
|
|
17
17
|
def add_rule key, value
|
18
18
|
return unless value.present?
|
19
|
+
|
19
20
|
case @rules[key]
|
20
21
|
when Symbol
|
21
22
|
send("#{@rules[key]}_rule", key, value)
|
@@ -32,6 +33,7 @@ class Card
|
|
32
33
|
@cql = {}
|
33
34
|
@filter_cql.each do |cql_key, values|
|
34
35
|
next if values.empty?
|
36
|
+
|
35
37
|
case cql_key
|
36
38
|
when :right_plus, :left_plus, :type
|
37
39
|
merge_using_and cql_key, values
|
@@ -62,12 +64,14 @@ class Card
|
|
62
64
|
# nest values with the same key using :and
|
63
65
|
def build_nested_hash key, values
|
64
66
|
return { key => values[0] } if values.one?
|
67
|
+
|
65
68
|
val = values.pop
|
66
69
|
{ key => val, and: build_nested_hash(key, values) }
|
67
70
|
end
|
68
71
|
|
69
72
|
def name_cql name
|
70
73
|
return unless name.present?
|
74
|
+
|
71
75
|
@filter_cql[:name] = ["match", name]
|
72
76
|
end
|
73
77
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
format do
|
3
2
|
view :search_count, cache: :never do
|
4
3
|
search_with_params.to_s
|
@@ -55,6 +54,7 @@ format :json do
|
|
55
54
|
|
56
55
|
remaining_slots = limit - starts_with.size
|
57
56
|
return starts_with if remaining_slots.zero?
|
57
|
+
|
58
58
|
starts_with + match_search(not_names: starts_with, limit: remaining_slots)
|
59
59
|
end
|
60
60
|
|
@@ -145,12 +145,10 @@ format :html do
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
-
def search_result_list klass
|
148
|
+
def search_result_list klass, &block
|
149
149
|
with_paging do
|
150
150
|
wrap_with :div, class: klass do
|
151
|
-
search_with_params.map
|
152
|
-
yield item_card
|
153
|
-
end
|
151
|
+
search_with_params.map(&block)
|
154
152
|
end
|
155
153
|
end
|
156
154
|
end
|
@@ -14,6 +14,7 @@ end
|
|
14
14
|
def item_type
|
15
15
|
type = cql_hash[:type]
|
16
16
|
return if type.is_a?(Array) || type.is_a?(Hash)
|
17
|
+
|
17
18
|
type
|
18
19
|
end
|
19
20
|
|
@@ -44,6 +45,7 @@ def search args={}
|
|
44
45
|
# forces explicit limiting
|
45
46
|
# can be 0 or less to force no limit
|
46
47
|
raise "OH NO.. no limit" unless query.mods[:limit]
|
48
|
+
|
47
49
|
query.run
|
48
50
|
end
|
49
51
|
end
|
data/set/self/search.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
format do
|
3
2
|
view :search_error, cache: :never do
|
4
3
|
sr_class = search_with_params.class.to_s
|
@@ -34,6 +33,7 @@ end
|
|
34
33
|
format :html do
|
35
34
|
view :title, cache: :never do
|
36
35
|
return super() unless (title = keyword_search_title)
|
36
|
+
|
37
37
|
voo.title = title
|
38
38
|
end
|
39
39
|
|
@@ -62,12 +62,14 @@ format :json do
|
|
62
62
|
exact.name.valid? &&
|
63
63
|
!exact.virtual? &&
|
64
64
|
exact.ok?(:create)
|
65
|
+
|
65
66
|
[h(exact.name), URI.escape(exact.name)]
|
66
67
|
end
|
67
68
|
|
68
69
|
def new_item_of_type exact
|
69
70
|
return unless (exact.type_id == CardtypeID) &&
|
70
71
|
Card.new(type_id: exact.id).ok?(:create)
|
72
|
+
|
71
73
|
[exact.name, "new/#{exact.name.url_key}"]
|
72
74
|
end
|
73
75
|
|
data/set/type/search_type.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-08-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,28 +18,28 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.101.
|
21
|
+
version: 1.101.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.101.
|
28
|
+
version: 1.101.7
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: card-mod-collection
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.11.
|
35
|
+
version: 0.11.7
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.11.
|
42
|
+
version: 0.11.7
|
43
43
|
description: ''
|
44
44
|
email:
|
45
45
|
- info@decko.org
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.1.
|
111
|
+
rubygems_version: 3.1.6
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: search
|