forked from thoughtbot/administrate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes thoughtbot#121. Problem: Users cannot clear their search unless they re-submit the search with an empty field, or click on the resource link in the navigation bar. Solution: Add a button for clearing out the search field and going back to showing all resources.
- Loading branch information
Showing
5 changed files
with
73 additions
and
18 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,21 @@ | ||
<form class="search"> | ||
<span class="search__icon"> | ||
<%= svg_tag "administrate/search.svg", "search", width: 16, height: 16 %> | ||
</span> | ||
<input | ||
type="text" | ||
name="search" | ||
class="search__input" | ||
placeholder="Search" | ||
value="<%= search_term %>" | ||
aria-label="Search" | ||
/> | ||
<span class="search__hint"> | ||
Press enter to search | ||
</span> | ||
<span class="search__clear"> | ||
<%= link_to params.except(:search) do %> | ||
<%= svg_tag "administrate/cancel.svg", "cancel-search", width: 16, height: 16 %> | ||
<% end %> | ||
</span> | ||
</form> |
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