effective_search 0.2.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a28fa1842cb98730b4063cdb4d905ac9f2f91ae3828fc2f8999ed9e470836ef
4
- data.tar.gz: 443f7dcd1c2a96db2f8497473dc3d93ec8bcf6eee8cbd7eb0e7182728b9925fe
3
+ metadata.gz: 75a1014aa1a88849dda458a6b59ae0401bd9b32a6ecd1573d2359cab1ec23bac
4
+ data.tar.gz: 446831390104f3bd59bdee99fbd5f88d9e5bb852894ffc1175fad1796d7adb80
5
5
  SHA512:
6
- metadata.gz: 70beeef330bb5d7ac281bfcf471ea59f2a05cc870e4bbc8437a5e7c5b6e8d99e2b50f11ca69b5ab3e11c0dee148737b10716916356c75ebbcdf842061ee396b9
7
- data.tar.gz: 3762becb2d714652544bf5047902fd4143da7a480e143fbe0bba9c10a8aa6d93ddbd99cb746e2c6c8d6d1bb2ee7fb55d0f8fe2432ee1c56baf878dea84cb375e
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
- //.search-title { }
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
+
@@ -6,4 +6,10 @@ module EffectiveSearchHelper
6
6
  end
7
7
  end
8
8
 
9
+ def effective_search_nav_icon
10
+ if EffectiveResources.authorized?(self, :index, EffectiveSearch.Search)
11
+ render('effective/search/form_nav_icon')
12
+ end
13
+ end
14
+
9
15
  end
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveSearch
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.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.2.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-05-21 00:00:00.000000000 Z
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