-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use auto-complete-element for exhibit search
- Loading branch information
1 parent
0ee6298
commit 377e3f9
Showing
18 changed files
with
179 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
## | ||
# Provide the GitHub auto-complete-element response for exhibit autocomplete | ||
class ExhibitAutocompleteController < ApplicationController | ||
# /exhibit_autocomplete | ||
def index | ||
@exhibits = ExhibitFinder.search(params[:q]).as_json | ||
render layout: false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<% if @exhibits.empty? %> | ||
<li class="exhibit-result no-items" role="option" aria-disabled="true">No matches found</li> | ||
<% else %> | ||
<% @exhibits.each do |exhibit| %> | ||
<li class="exhibit-result tt-suggestion" role="option" data-autocomplete-value="<%= exhibit['slug'] %>" data-autocomplete-title="<%= exhibit['title'] %>"> | ||
<%= highlight_autocomplete_suggestion(exhibit['title']) %> | ||
<% if exhibit['subtitle'].present? %> | ||
<span class="subtitle"><%= highlight_autocomplete_suggestion(exhibit['subtitle']) %></span> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% if @suggestions.empty? %> | ||
<li class="suggestion-result no-items" role="option" aria-disabled="true">No matches found</li> | ||
<% else %> | ||
<% @suggestions.each do |suggestion| %> | ||
<li class="suggestion-result tt-suggestion" data-autocomplete-value="<%= suggestion %>" role="option"> | ||
<%= highlight_autocomplete_suggestion(suggestion) %> | ||
</li> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.