effective_search 0.3.1 → 0.4.0
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/assets/javascripts/effective_search/admin.js +13 -1
- data/app/assets/javascripts/effective_search/base.js +24 -0
- data/app/assets/stylesheets/effective_search/admin.scss +15 -11
- data/app/assets/stylesheets/effective_search/base.scss +26 -1
- data/app/models/concerns/effective_search_admin_search.rb +1 -1
- data/app/views/admin/search/_applicant.html.haml +8 -12
- data/app/views/admin/search/_form_nav_icon.html.haml +5 -3
- data/app/views/admin/search/_modal.html.haml +3 -2
- data/app/views/admin/search/_order.html.haml +11 -15
- data/app/views/admin/search/_organization.html.haml +21 -25
- data/app/views/admin/search/_search.html.haml +24 -27
- data/app/views/admin/search/_user.html.haml +18 -23
- data/app/views/effective/search/_form_nav_icon.html.haml +3 -1
- data/lib/effective_search/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7bfa4a21057a6cd4cb527775c03d5e93519efdb983f4077b2af83de9c1045c10
|
|
4
|
+
data.tar.gz: 6a479c7e6c53a85eac7971cab1ec74781a643df4ef7ac899b2fb4aecdbafc3bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: acb2120f14ed4e41e4b2273105a19456f1d5a09d0a6380c48c70cd58c2832e091aa9f434dbd03fd26a829eb0d1a8581838827179d024d33e14b6ae7f6e5e9cdb
|
|
7
|
+
data.tar.gz: b91e5e86ef6fe69f32f78376c59f2f2052aa7b77eab1708e61db59d4e1c420ca4e9fe300509b54e8691ff23bdb077ddbfaabea84387b6917e970b327321a6ca3
|
|
@@ -55,8 +55,20 @@ $(document).on('keydown keyup', "#effective-search-admin-modal form", function(e
|
|
|
55
55
|
if(event.key === 'Enter') { event.preventDefault(); }
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
// Open the search modal when "/" is pressed
|
|
59
|
+
$(document).on('keydown', function(event) {
|
|
60
|
+
if (event.key !== '/') return;
|
|
61
|
+
|
|
62
|
+
// Don't trigger when typing in an input, textarea, or contenteditable
|
|
63
|
+
var tag = event.target.tagName;
|
|
64
|
+
if (tag === 'input' || tag === 'textarea' || tag === 'select' || event.target.isContentEditable) return;
|
|
65
|
+
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
$('#effective-search-admin-modal').modal('show');
|
|
68
|
+
});
|
|
69
|
+
|
|
58
70
|
// Auto focus the search input when the modal is shown
|
|
59
71
|
$(document).on('shown.bs.modal', '#effective-search-admin-modal', function () {
|
|
60
|
-
$(".effective-search-admin").find('
|
|
72
|
+
$(".effective-search-admin").find('#q_term').focus();
|
|
61
73
|
});
|
|
62
74
|
|
|
@@ -1,7 +1,31 @@
|
|
|
1
|
+
$(document).on('show.bs.collapse', '#effective-search-icon-form', function () {
|
|
2
|
+
var $form = $(this);
|
|
3
|
+
$("#effective-search-overlay").addClass('active');
|
|
4
|
+
|
|
5
|
+
// Fade in form: wait for browser to paint opacity:0, then transition to 1
|
|
6
|
+
requestAnimationFrame(function() {
|
|
7
|
+
requestAnimationFrame(function() {
|
|
8
|
+
$form.css('opacity', '1');
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
1
13
|
$(document).on('shown.bs.collapse', '#effective-search-icon-form', function () {
|
|
14
|
+
$(this).css('opacity', '');
|
|
2
15
|
$("#effective-search-input").focus();
|
|
3
16
|
});
|
|
4
17
|
|
|
18
|
+
$(document).on('hide.bs.collapse', '#effective-search-icon-form', function () {
|
|
19
|
+
$("#effective-search-overlay").removeClass('active');
|
|
20
|
+
});
|
|
21
|
+
|
|
5
22
|
$(document).on('hidden.bs.collapse', '#effective-search-icon-form', function () {
|
|
23
|
+
$(this).css('opacity', '');
|
|
6
24
|
$("#effective-search-input").blur();
|
|
7
25
|
});
|
|
26
|
+
|
|
27
|
+
$(document).on('keydown', function (e) {
|
|
28
|
+
if (e.key === 'Escape' && $('#effective-search-icon-form').hasClass('show')) {
|
|
29
|
+
$('#effective-search-icon-form').collapse('hide');
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
a {
|
|
4
|
-
display: block;
|
|
5
|
-
color: inherit;
|
|
6
|
-
text-decoration: none;
|
|
7
|
-
}
|
|
1
|
+
#effective-search-results {
|
|
2
|
+
hr {
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
margin-left:-1rem;
|
|
5
|
+
margin-right:-1rem;
|
|
6
|
+
margin-top: 1.5rem;
|
|
7
|
+
margin-bottom: 1rem;
|
|
13
8
|
}
|
|
14
9
|
}
|
|
10
|
+
|
|
11
|
+
#effective-search-button {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
border: solid 1px #D1D9E0;
|
|
15
|
+
border-radius: 0.25rem;
|
|
16
|
+
background: #f8f9fa;
|
|
17
|
+
padding: 0.25rem 0.5rem;
|
|
18
|
+
}
|
|
@@ -62,13 +62,38 @@ div.effective-search {
|
|
|
62
62
|
text-decoration: none;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
#effective-search-overlay {
|
|
66
|
+
position: fixed;
|
|
67
|
+
top: 0;
|
|
68
|
+
left: 0;
|
|
69
|
+
width: 100vw;
|
|
70
|
+
height: 100vh;
|
|
71
|
+
// background-color: #f8f9fc;
|
|
72
|
+
opacity: 0;
|
|
73
|
+
z-index: 8999;
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
transition: opacity 0.35s ease;
|
|
76
|
+
|
|
77
|
+
&.active {
|
|
78
|
+
opacity: 0.5;
|
|
79
|
+
pointer-events: auto;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
65
83
|
#effective-search-icon-form {
|
|
66
|
-
position:
|
|
84
|
+
position: fixed;
|
|
67
85
|
left: 0;
|
|
68
86
|
top: 0;
|
|
69
87
|
z-index: 9000;
|
|
70
88
|
height: 90px;
|
|
71
89
|
border-bottom: solid 1px;
|
|
90
|
+
|
|
91
|
+
&.collapsing {
|
|
92
|
+
height: 90px !important;
|
|
93
|
+
width: 100% !important;
|
|
94
|
+
opacity: 0;
|
|
95
|
+
transition: opacity 0.35s ease !important;
|
|
96
|
+
}
|
|
72
97
|
}
|
|
73
98
|
|
|
74
99
|
#effective-search-icon {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
%
|
|
2
|
-
%
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
= ' • '.html_safe
|
|
10
|
-
= applicant.owner&.email
|
|
11
|
-
= ' • '.html_safe
|
|
12
|
-
= badge(applicant.status)
|
|
1
|
+
%a.list-group-item.list-group-item-action{href: effective_memberships.edit_admin_applicant_path(applicant), title: applicant}
|
|
2
|
+
%strong= applicant.owner
|
|
3
|
+
%small.text-muted
|
|
4
|
+
= applicant.summary_title
|
|
5
|
+
•
|
|
6
|
+
= applicant.owner&.email
|
|
7
|
+
•
|
|
8
|
+
= badge(applicant.status)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
%
|
|
3
|
-
= icon('search')
|
|
1
|
+
.form-inline.ml-auto.mr-2
|
|
2
|
+
%button#effective-search-button{data: { toggle: 'modal', target: '#effective-search-admin-modal' }, title: 'Search'}
|
|
3
|
+
%span= icon('search')
|
|
4
|
+
%small.px-3 Quick search...
|
|
5
|
+
%small.px-2.border.bg-white /
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
#effective-search-admin-modal.modal.fade{tabindex: '-1', role: 'dialog', 'data-turbolinks-permanent': true}
|
|
2
2
|
.modal-dialog.modal-lg{role: 'document'}
|
|
3
3
|
.modal-content
|
|
4
4
|
.modal-body
|
|
5
5
|
- search = EffectiveSearch.AdminSearch.new
|
|
6
6
|
= render('admin/search/search', search: search, modal: true)
|
|
7
|
+
|
|
7
8
|
.modal-footer.bg-light.p-1
|
|
8
|
-
%small.text-muted Search by name, email,
|
|
9
|
+
%small.text-muted Search by name, email, or order number. Quick open with /
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
%td
|
|
3
|
-
- path = (EffectiveResources.authorized?(self, :edit, order) ? effective_orders.admin_edit_order_path(order) : effective_orders.admin_order_path(order))
|
|
1
|
+
- path = (EffectiveResources.authorized?(self, :edit, order) ? effective_orders.admin_edit_order_path(order) : effective_orders.admin_order_path(order))
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
= ' • '.html_safe
|
|
16
|
-
= badge(order.status)
|
|
3
|
+
%a.list-group-item.list-group-item-action{href: path, title: order}
|
|
4
|
+
= order.to_s
|
|
5
|
+
%small.text-muted
|
|
6
|
+
= order.billing_name
|
|
7
|
+
•
|
|
8
|
+
= order.email
|
|
9
|
+
•
|
|
10
|
+
= price_to_currency(order.total)
|
|
11
|
+
•
|
|
12
|
+
= badge(order.status)
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
%
|
|
2
|
-
%
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
= organization
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Removed member
|
|
17
|
-
- else
|
|
18
|
-
Not a member
|
|
19
|
-
= ' • '.html_safe
|
|
1
|
+
%a.list-group-item.list-group-item-action{href: effective_memberships.edit_admin_organization_path(organization), title: organization}
|
|
2
|
+
%p.mb-0= organization
|
|
3
|
+
%small.text-muted
|
|
4
|
+
- if organization.class.try(:effective_memberships_organization_owner?)
|
|
5
|
+
- if (membership = organization.try(:membership)).present?
|
|
6
|
+
= membership.statuses.to_sentence
|
|
7
|
+
= membership.categories.to_sentence
|
|
8
|
+
member
|
|
9
|
+
- if membership.number.present?
|
|
10
|
+
= ' #' + membership.number
|
|
11
|
+
- elsif organization.membership_removed?
|
|
12
|
+
Removed member
|
|
13
|
+
- else
|
|
14
|
+
Not a member
|
|
15
|
+
•
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
= organization.email
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
- if (principals = organization.representatives.select { |rep| rep.is_any?(:principal) }).present?
|
|
20
|
+
•
|
|
21
|
+
= principals.to_sentence
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
•
|
|
24
|
+
= pluralize(organization.representatives.count, 'representative')
|
|
@@ -3,39 +3,36 @@
|
|
|
3
3
|
= effective_form_with(scope: :q, model: search, method: :get, url: effective_search.admin_search_path) do |f|
|
|
4
4
|
= hidden_field_tag :page, (params[:page] || 1)
|
|
5
5
|
|
|
6
|
-
.d-flex.align-items-center
|
|
6
|
+
.d-flex.align-items-center.mb-3
|
|
7
7
|
.flex-grow-1
|
|
8
|
-
= f.
|
|
8
|
+
= f.text_field :term, placeholder: 'Search users, companies, applicants, and orders', 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
|
-
'data-load-ajax-all': true
|
|
11
|
+
'data-load-ajax-all': true,
|
|
12
|
+
wrapper: { class: 'form-group mb-0' }
|
|
12
13
|
|
|
13
14
|
- if modal
|
|
14
15
|
%div
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
%div.ml-4.mb-3
|
|
18
|
-
%button.close{type: 'button', data: { dismiss: 'modal' }, 'aria-label': 'Close'}
|
|
19
|
-
%span{'aria-hidden': 'true'} ×
|
|
16
|
+
%button.btn.btn-sm.btn-light.ml-3.border{type: 'button', data: { dismiss: 'modal' }, 'aria-label': 'Close'}
|
|
17
|
+
%span{'aria-hidden': 'true'} ESC
|
|
20
18
|
|
|
21
19
|
#effective-search-results
|
|
22
20
|
- if search.present?
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
%
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
%
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
%
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
%tbody= render(collection: search.order_results, partial: 'admin/search/order')
|
|
21
|
+
- if search.order_results.present?
|
|
22
|
+
%small.font-weight-bold Orders (#{search.orders.count})
|
|
23
|
+
.list-group.list-group-flush= render(collection: search.order_results, partial: 'admin/search/order')
|
|
24
|
+
%hr
|
|
25
|
+
|
|
26
|
+
- if search.user_results.present?
|
|
27
|
+
%small.font-weight-bold Users (#{search.users.count})
|
|
28
|
+
.list-group.list-group-flush= render(collection: search.user_results, partial: 'admin/search/user')
|
|
29
|
+
%hr
|
|
30
|
+
|
|
31
|
+
- if search.organization_results.present?
|
|
32
|
+
%small.font-weight-bold #{ets(search.organizations)} (#{search.organizations.count})
|
|
33
|
+
.list-group.list-group-flush= render(collection: search.organization_results, partial: 'admin/search/organization')
|
|
34
|
+
%hr
|
|
35
|
+
|
|
36
|
+
- if search.applicant_results.present?
|
|
37
|
+
%small.font-weight-bold Applicants (#{search.applicants.count})
|
|
38
|
+
.list-group.list-group-flush= render(collection: search.applicant_results, partial: 'admin/search/applicant')
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
%
|
|
2
|
-
%
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
= user.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- if
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- elsif user.membership_removed?
|
|
16
|
-
Removed member
|
|
17
|
-
- else
|
|
18
|
-
Not a member
|
|
19
|
-
= ' • '.html_safe
|
|
1
|
+
%a.list-group-item.list-group-item-action{href: edit_admin_user_path(user), title: user}
|
|
2
|
+
%strong= user.to_s
|
|
3
|
+
%small.text-muted
|
|
4
|
+
- if user.class.try(:effective_memberships_owner?)
|
|
5
|
+
- if(membership = user.try(:membership) || user.try(:organizations).try(:first).try(:membership)).present?
|
|
6
|
+
= membership.statuses.to_sentence
|
|
7
|
+
= membership.categories.to_sentence
|
|
8
|
+
- if membership.number.present?
|
|
9
|
+
= ' #' + membership.number
|
|
10
|
+
- elsif user.membership_removed?
|
|
11
|
+
Removed member
|
|
12
|
+
- else
|
|
13
|
+
Not a member
|
|
14
|
+
•
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
= user.email
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
- if user.try(:representatives).present?
|
|
19
|
+
•
|
|
20
|
+
= user.representatives.map(&:organization).to_sentence
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
%li.nav-item.effective-search-nav-item.d-flex
|
|
2
|
-
#effective-search-icon-form.collapse.width.w-100.bg-
|
|
2
|
+
#effective-search-icon-form.collapse.width.w-100.bg-primary.shadow-sm.rounded-0
|
|
3
3
|
.d-flex.p-4
|
|
4
4
|
= effective_form_with(scope: :q, model: EffectiveSearch.Search.new, method: :get, url: effective_search.search_path, layout: :inline, class: "w-100") do |f|
|
|
5
5
|
= f.text_field :term, label: false, placeholder: 'Search', autofocus: false, id: "effective-search-input", class: "form-control-lg border-0 w-100"
|
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
.nav-link.ml-auto.flex-shrink-1.text-white{"data-toggle":"collapse", "data-target":"#effective-search-icon-form", role: "button"}
|
|
8
8
|
= icon('x', class: "big-1")
|
|
9
9
|
|
|
10
|
+
#effective-search-overlay.bg-primary{"data-toggle":"collapse", "data-target":"#effective-search-icon-form"}
|
|
11
|
+
|
|
10
12
|
.nav-link#effective-search-icon.d-flex.align-items-center{"data-target":"#effective-search-icon-form", "data-toggle":"collapse"}
|
|
11
13
|
= icon('search')
|
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
|
+
version: 0.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: 2026-
|
|
11
|
+
date: 2026-02-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|