effective_search 0.4.1 → 0.4.3

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
  SHA256:
3
- metadata.gz: 0d53d74846e3d5e8b6c4b759e88d1362ed4fa18f2305fc80ecdda046b1909e91
4
- data.tar.gz: 5f46bbab96941100ce0250041d532a45edf9c328ca7d15c71297feef12a5e9a5
3
+ metadata.gz: b5feaea13bc0b16130921950f17986efc656f0513b206f77e73f5670efda0a03
4
+ data.tar.gz: 7d90f185e8ea44e61aec8a128399868c74860a16f9541cc208430cd5b54b6dda
5
5
  SHA512:
6
- metadata.gz: f06e7ee79de96f4a4eedb848c4200a57ef8aa5f24747aef60c5833d5d4a8e4826ab6d1184b1b5b9df011fa726593c0c36fa620e3f861ce4a28447bdbde724b6a
7
- data.tar.gz: 3dabcc4fd22ee6f51dbf3ce42390f656616a01d46e93da8c1d569c71fa9fa8571c60fec928f9fd31323bb4326536cebc3ff9a9f3f540a7113e149b78123f058d
6
+ metadata.gz: 062d82c34bd5934fa46c36d7fed819ac661c932cca2e6bd95269fd8f1fcf751ad9fe2948c250004311bc61f7b1071a9a1aebacc4e16a9b927d219d7457b53104
7
+ data.tar.gz: d169ecfc9d97b52c102f667b67eea00b4a18e44a16b1ffdf2c1956ab21c95eddf2759977a725b4b40b61a0c4471fc66763be511527de4ea36d4af590c6413172
@@ -45,7 +45,19 @@ module EffectiveSearchAdminSearch
45
45
  end
46
46
 
47
47
  def applicants
48
- @applicants = EffectiveMemberships.Applicant.where(user: users).order(created_at: :desc)
48
+ @applicants ||= EffectiveMemberships.Applicant.where(user: users).order(created_at: :desc)
49
+ end
50
+
51
+ def events
52
+ @events ||= Effective::Resource.new(Effective::Event).search_any(term, columns: [:title]).reorder(start_at: :desc)
53
+ end
54
+
55
+ def pages
56
+ @pages ||= Effective::Resource.new(Effective::Page).search_any(term, columns: [:title])
57
+ end
58
+
59
+ def posts
60
+ @posts ||= Effective::Resource.new(Effective::Post).search_any(term, columns: [:title]).reorder(published_start_at: :desc)
49
61
  end
50
62
 
51
63
  # Search and assigns the collection
@@ -56,6 +68,9 @@ module EffectiveSearchAdminSearch
56
68
  @orders = orders()
57
69
  @applicants = applicants()
58
70
  @organizations = organizations()
71
+ @events = events()
72
+ @pages = pages()
73
+ @posts = posts()
59
74
  end
60
75
 
61
76
  # The paginated results
@@ -75,6 +90,18 @@ module EffectiveSearchAdminSearch
75
90
  results(organizations, page: page)
76
91
  end
77
92
 
93
+ def event_results(page: nil)
94
+ results(events, page: page)
95
+ end
96
+
97
+ def page_results(page: nil)
98
+ results(pages, page: page)
99
+ end
100
+
101
+ def post_results(page: nil)
102
+ results(posts, page: page)
103
+ end
104
+
78
105
  private
79
106
 
80
107
  def results(collection, page: nil)
@@ -0,0 +1,7 @@
1
+ - path = (EffectiveResources.authorized?(self, :edit, event) ? effective_events.edit_admin_event_path(event) : effective_events.admin_event_path(event))
2
+
3
+ %a.list-group-item.list-group-item-action{href: path, title: event}
4
+ %strong= event.to_s
5
+ %small.text-muted
6
+ - if event.try(:start_at).present?
7
+ = event.start_at.strftime('%B %d, %Y')
@@ -6,4 +6,4 @@
6
6
  = render('admin/search/search', search: search, modal: true)
7
7
 
8
8
  .modal-footer.bg-light.p-1
9
- %small.text-muted Search by name, email, or order number. Quick open with /
9
+ %small.text-muted Search by name, title, email, or order number. Quick open with forward slash.
@@ -1,7 +1,7 @@
1
1
  - path = (EffectiveResources.authorized?(self, :edit, order) ? effective_orders.admin_edit_order_path(order) : effective_orders.admin_order_path(order))
2
2
 
3
3
  %a.list-group-item.list-group-item-action{href: path, title: order}
4
- = order.to_s
4
+ %strong= order.to_s
5
5
  %small.text-muted
6
6
  = order.billing_name
7
7
  •
@@ -1,5 +1,5 @@
1
1
  %a.list-group-item.list-group-item-action{href: effective_memberships.edit_admin_organization_path(organization), title: organization}
2
- %p.mb-0= organization
2
+ %strong= organization
3
3
  %small.text-muted
4
4
  - if organization.class.try(:effective_memberships_organization_owner?)
5
5
  - if (membership = organization.try(:membership)).present?
@@ -0,0 +1,9 @@
1
+ - path = (EffectiveResources.authorized?(self, :edit, page) ? effective_pages.edit_admin_page_path(page) : effective_pages.admin_page_path(page))
2
+
3
+ %a.list-group-item.list-group-item-action{href: path, title: page}
4
+ %strong= page.to_s
5
+ %small.text-muted
6
+ = badge(page.try(:draft?) ? :draft : :published)
7
+ - if page.try(:slug).present?
8
+ •
9
+ = page.slug
@@ -0,0 +1,12 @@
1
+ - path = (EffectiveResources.authorized?(self, :edit, post) ? effective_posts.edit_admin_post_path(post) : effective_posts.admin_post_path(post))
2
+
3
+ %a.list-group-item.list-group-item-action{href: path, title: post}
4
+ %strong= post.to_s
5
+ %small.text-muted
6
+ - if post.try(:published_at).present?
7
+ = post.published_at.strftime('%B %d, %Y')
8
+ •
9
+ = badge(post.try(:draft?) ? :draft : :published)
10
+ - if post.try(:category).present?
11
+ •
12
+ = post.category
@@ -5,7 +5,7 @@
5
5
 
6
6
  .d-flex.align-items-center.mb-3
7
7
  .flex-grow-1
8
- = f.text_field :term, placeholder: 'Search users, companies, applicants, and orders', label: false, autofocus: true, autocomplete: 'off',
8
+ = f.text_field :term, placeholder: 'Search users, companies, applicants, orders, events, pages, and posts', label: false, autofocus: true, autocomplete: 'off',
9
9
  'data-load-ajax-url': effective_search.admin_search_path,
10
10
  'data-load-ajax-div': '#effective-search-results',
11
11
  'data-load-ajax-all': true,
@@ -36,3 +36,18 @@
36
36
  - if search.applicant_results.present?
37
37
  %small.font-weight-bold Applicants (#{search.applicants.count})
38
38
  .list-group.list-group-flush= render(collection: search.applicant_results, partial: 'admin/search/applicant')
39
+ %hr
40
+
41
+ - if search.event_results.present?
42
+ %small.font-weight-bold Events (#{search.events.count})
43
+ .list-group.list-group-flush= render(collection: search.event_results, partial: 'admin/search/event')
44
+ %hr
45
+
46
+ - if search.page_results.present?
47
+ %small.font-weight-bold Pages (#{search.pages.count})
48
+ .list-group.list-group-flush= render(collection: search.page_results, partial: 'admin/search/page')
49
+ %hr
50
+
51
+ - if search.post_results.present?
52
+ %small.font-weight-bold Posts (#{search.posts.count})
53
+ .list-group.list-group-flush= render(collection: search.post_results, partial: 'admin/search/post')
@@ -1,3 +1,3 @@
1
1
  module EffectiveSearch
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.4.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
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: 2026-02-17 00:00:00.000000000 Z
11
+ date: 2026-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: effective_datatables
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: effective_developer
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +164,20 @@ dependencies:
150
164
  - - ">="
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: wicked
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
153
181
  description: Search effective events pages and posts with pg_search
154
182
  email:
155
183
  - info@codeandeffect.com
@@ -178,11 +206,14 @@ files:
178
206
  - app/models/effective/search.rb
179
207
  - app/models/effective/search_content.rb
180
208
  - app/views/admin/search/_applicant.html.haml
209
+ - app/views/admin/search/_event.html.haml
181
210
  - app/views/admin/search/_form_nav_icon.html.haml
182
211
  - app/views/admin/search/_layout.html.haml
183
212
  - app/views/admin/search/_modal.html.haml
184
213
  - app/views/admin/search/_order.html.haml
185
214
  - app/views/admin/search/_organization.html.haml
215
+ - app/views/admin/search/_page.html.haml
216
+ - app/views/admin/search/_post.html.haml
186
217
  - app/views/admin/search/_search.html.haml
187
218
  - app/views/admin/search/_user.html.haml
188
219
  - app/views/admin/search/index.html.haml
@@ -224,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
255
  - !ruby/object:Gem::Version
225
256
  version: '0'
226
257
  requirements: []
227
- rubygems_version: 3.5.6
258
+ rubygems_version: 3.5.9
228
259
  signing_key:
229
260
  specification_version: 4
230
261
  summary: Search effective events pages and posts with pg_search