-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #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
70 additions
and
17 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.
20 changes: 20 additions & 0 deletions
20
administrate/app/views/administrate/application/_search.html.erb
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,20 @@ | ||
<form class="search"> | ||
<span class="search__icon"> | ||
<%= inline_svg "administrate/search.svg" %> | ||
</span> | ||
<input | ||
type="text" | ||
name="search" | ||
class="search__input" | ||
placeholder="Search" | ||
value="<%= search_term %>" | ||
/> | ||
<span class="search__hint"> | ||
Press enter to search | ||
</span> | ||
<span class="search__clear"> | ||
<%= link_to params.except(:search) do %> | ||
<%= inline_svg "administrate/cancel.svg" %> | ||
<% 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
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