forked from hummingbird-me/kitsu-web
-
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.
Switch favorites to use Algolia search
- Loading branch information
1 parent
291e19c
commit 9719c42
Showing
2 changed files
with
115 additions
and
49 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
70 changes: 47 additions & 23 deletions
70
app/templates/components/users/edit-profile/body/favorites/list.hbs
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 |
---|---|---|
@@ -1,60 +1,84 @@ | ||
<div class="favorite-search m-t-2 m-b-2"> | ||
<div class='favorite-search m-t-2 m-b-2'> | ||
{{#power-select | ||
search=(perform searchTask) | ||
onchange=(action "addFavorite") | ||
onchange=(action 'addFavorite') | ||
renderInPlace=true | ||
as |item|}} | ||
as |item| | ||
}} | ||
{{#if isCharacter}} | ||
<span class="waifu-wrapper"> | ||
<span class='waifu-wrapper'> | ||
{{lazy-image src=(image item.image)}} | ||
</span> | ||
<strong>{{item.name}}</strong> | ||
<strong>{{item.canonicalName}}</strong> | ||
{{else}} | ||
<strong>{{item.computedTitle}}</strong> | ||
<strong>{{item.canonicalTitle}}</strong> | ||
{{/if}} | ||
{{/power-select}} | ||
</div> | ||
|
||
{{#if getFavoritesTask.last.isRunning}} | ||
<div class="text-xs-center w-100 m-b-2 m-t-2"> | ||
{{loading-spinner size="large"}} | ||
<div class='text-xs-center w-100 m-b-2 m-t-2'> | ||
{{loading-spinner size='large'}} | ||
</div> | ||
{{else if getFavoritesTask.last.error}} | ||
<div class="text-xs-center w-100 m-b-2 m-t-2"> | ||
{{t "errors.load"}} | ||
<div class='text-xs-center w-100 m-b-2 m-t-2'> | ||
{{t 'errors.load'}} | ||
</div> | ||
{{else if filteredFavorites}} | ||
{{#infinite-pagination onPagination=(action "onPagination")}} | ||
{{#sortable-group tagName="ul" class="media-sortable nav" onChange=(action "reorderItems") as |group|}} | ||
{{#infinite-pagination onPagination=(action 'onPagination')}} | ||
{{#sortable-group | ||
tagName='ul' | ||
class='media-sortable nav' | ||
onChange=(action 'reorderItems') | ||
as |group| | ||
}} | ||
{{#each filteredFavorites as |favorite|}} | ||
{{#sortable-item model=favorite group=group tagName="li" class="media-sort-item card"}} | ||
{{#sortable-item | ||
model=favorite | ||
group=group | ||
tagName='li' | ||
class='media-sort-item card' | ||
}} | ||
{{#if isCharacter}} | ||
<a class="media-sort-thumb-wrapper" href="#"> | ||
{{lazy-image src=(image favorite.item.image) class="media-sort-thumb"}} | ||
<a class='media-sort-thumb-wrapper' href='#'> | ||
{{lazy-image | ||
src=(image favorite.item.image) | ||
class='media-sort-thumb' | ||
}} | ||
</a> | ||
{{else}} | ||
<a class="media-sort-thumb-wrapper" href={{href-to (concat type ".show") favorite.item.slug}}> | ||
{{lazy-image src=(image favorite.item.posterImage "tiny") class="media-sort-thumb"}} | ||
<a | ||
class='media-sort-thumb-wrapper' | ||
href={{href-to (concat type '.show') favorite.item.slug}} | ||
> | ||
{{lazy-image | ||
src=(image favorite.item.posterImage 'tiny') | ||
class='media-sort-thumb' | ||
}} | ||
</a> | ||
{{/if}} | ||
<span class="media-sort-title"> | ||
<span class='media-sort-title'> | ||
{{#if isCharacter}} | ||
{{favorite.item.name}} | ||
{{else}} | ||
{{favorite.item.computedTitle}} | ||
{{/if}} | ||
</span> | ||
<span class="media-sort-action"> | ||
<a class="hint--left hint--bounce hint--rounded" aria-label={{t "users.edit-modal.favorites.remove"}} {{action "removeFavorite" favorite}}> | ||
{{svg-jar "cancel"}} | ||
<span class='media-sort-action'> | ||
<a | ||
class='hint--left hint--bounce hint--rounded' | ||
aria-label={{t 'users.edit-modal.favorites.remove'}} | ||
{{action 'removeFavorite' favorite}} | ||
> | ||
{{svg-jar 'cancel'}} | ||
</a> | ||
</span> | ||
{{/sortable-item}} | ||
{{/each}} | ||
{{/sortable-group}} | ||
{{/infinite-pagination}} | ||
{{else}} | ||
<div class="text-xs-center w-100 m-b-2 m-t-2"> | ||
{{t "errors.contentEmpty"}} | ||
<div class='text-xs-center w-100 m-b-2 m-t-2'> | ||
{{t 'errors.contentEmpty'}} | ||
</div> | ||
{{/if}} |