effective_search 0.2.1 → 0.2.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 +4 -4
- data/app/assets/javascripts/effective_search/base.js +11 -0
- data/app/assets/stylesheets/effective_search/base.scss +31 -3
- data/app/controllers/effective/search_controller.rb +3 -3
- data/app/helpers/effective_search_helper.rb +6 -0
- data/app/views/effective/search/_form_nav_icon.html.haml +11 -0
- data/app/views/effective/search/_search.html.haml +0 -5
- data/lib/effective_search/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75a1014aa1a88849dda458a6b59ae0401bd9b32a6ecd1573d2359cab1ec23bac
|
|
4
|
+
data.tar.gz: 446831390104f3bd59bdee99fbd5f88d9e5bb852894ffc1175fad1796d7adb80
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e196d2505d2ccf6181a4359d564c154898eec5923ef2a9ef634aa8dde2cce89f15a9238587785ddaeb258da8fc16f4e17f8559c8cc53427899d23821d986446a
|
|
7
|
+
data.tar.gz: 54586b1cf7043d0026542fb63d51cd42377ece606b14cdb6bd2cc0aa649edaf5a3fa803bdeea02b49dbe41365e3ddb3b255bb854cc00a7d6074ab367ddcecf36
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
$(document).on('turbolinks:load', function() { initializeSearchCollapse(); });
|
|
2
|
+
|
|
3
|
+
function initializeSearchCollapse() {
|
|
4
|
+
$('#effective-search-icon-form').on('shown.bs.collapse', function () {
|
|
5
|
+
$("#effective-search-input").focus()
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
$('#effective-search-icon-form').on('hidden.bs.collapse', function () {
|
|
9
|
+
$("#effective-search-input").blur()
|
|
10
|
+
})
|
|
11
|
+
}
|
|
@@ -9,15 +9,21 @@ div.effective-search {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.search-result {
|
|
12
|
-
margin-bottom: 1.5rem;
|
|
13
|
-
|
|
14
12
|
// mark { }
|
|
15
|
-
|
|
13
|
+
// .search-title { }
|
|
16
14
|
//.search-link { }
|
|
17
15
|
//.search-body { }
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
|
|
19
|
+
.search-result { margin-bottom: 2rem; }
|
|
20
|
+
.search-title { font-size: 1.5rem; margin-bottom: 0.25rem; }
|
|
21
|
+
.search-title a { text-decoration: none; }
|
|
22
|
+
.search-title a:hover { }
|
|
23
|
+
.search-link { display: block; margin-bottom: 0.25rem; }
|
|
24
|
+
.search-body { }
|
|
25
|
+
|
|
26
|
+
|
|
21
27
|
// The nav item search bar
|
|
22
28
|
.effective-search-nav-item {
|
|
23
29
|
input {
|
|
@@ -55,3 +61,25 @@ div.effective-search {
|
|
|
55
61
|
font-weight: 700;
|
|
56
62
|
text-decoration: none;
|
|
57
63
|
}
|
|
64
|
+
|
|
65
|
+
#effective-search-icon-form {
|
|
66
|
+
position: absolute;
|
|
67
|
+
left: 0;
|
|
68
|
+
top: 0;
|
|
69
|
+
z-index: 9000;
|
|
70
|
+
height: 90px;
|
|
71
|
+
border-bottom: solid 1px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#effective-search-icon {
|
|
75
|
+
&:hover { cursor: pointer; }
|
|
76
|
+
|
|
77
|
+
.eb-icon-search {
|
|
78
|
+
height: 1.25rem;
|
|
79
|
+
width:1.25rem;
|
|
80
|
+
stroke-width: 3px;
|
|
81
|
+
margin-bottom: 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
@@ -21,9 +21,9 @@ module Effective
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def build_search
|
|
24
|
-
search = EffectiveSearch.Search.new(
|
|
25
|
-
search.
|
|
26
|
-
search.
|
|
24
|
+
search = EffectiveSearch.Search.new()
|
|
25
|
+
search.assign_attributes(search_params.select { |k, _| search.respond_to?("#{k}=") })
|
|
26
|
+
search.assign_attributes(current_user: current_user, view_context: view_context)
|
|
27
27
|
search
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
%li.nav-item.effective-search-nav-item.d-flex
|
|
2
|
+
#effective-search-icon-form.collapse.width.w-100.bg-dark.shadow-sm
|
|
3
|
+
.d-flex.p-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
|
+
= f.text_field :term, label: false, placeholder: 'Search', autofocus: false, id: "effective-search-input", class: "form-control-lg border-0 w-100"
|
|
6
|
+
|
|
7
|
+
.nav-link.ml-auto.flex-shrink-1.text-white{"data-toggle":"collapse", "data-target":"#effective-search-icon-form", role: "button"}
|
|
8
|
+
= icon('x', class: "big-1")
|
|
9
|
+
|
|
10
|
+
.nav-link#effective-search-icon.d-flex.align-items-center{"data-target":"#effective-search-icon-form", "data-toggle":"collapse"}
|
|
11
|
+
= icon('search')
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
= render('effective/search/form', search: search)
|
|
3
3
|
|
|
4
4
|
- if search.present?
|
|
5
|
-
%hr
|
|
6
|
-
|
|
7
5
|
- results = search.results(page: params[:page])
|
|
8
6
|
- search_contents = search.search_contents.select { |resource| search.authorized?(resource) }
|
|
9
7
|
- permalinks = search.permalinks.select { |resource| search.authorized?(resource) }
|
|
@@ -22,9 +20,6 @@
|
|
|
22
20
|
|
|
23
21
|
-# Search results
|
|
24
22
|
%div{class: (permalinks.present? ? 'col-xl-8 col-lg-7' : 'col')}
|
|
25
|
-
%h3 Pages
|
|
26
|
-
%hr.mt-0
|
|
27
|
-
|
|
28
23
|
- if results.length == 0
|
|
29
24
|
.alert.alert-info There are no results for your search. Please try again.
|
|
30
25
|
|
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.2.
|
|
4
|
+
version: 0.2.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: 2025-
|
|
11
|
+
date: 2025-11-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -175,6 +175,7 @@ files:
|
|
|
175
175
|
- app/views/admin/search_contents/_form.html.haml
|
|
176
176
|
- app/views/admin/search_contents/_form_search_content.html.haml
|
|
177
177
|
- app/views/effective/search/_form.html.haml
|
|
178
|
+
- app/views/effective/search/_form_nav_icon.html.haml
|
|
178
179
|
- app/views/effective/search/_form_nav_item.html.haml
|
|
179
180
|
- app/views/effective/search/_layout.html.haml
|
|
180
181
|
- app/views/effective/search/_result.html.haml
|