hummingbird-me/kitsu-web

View on GitHub
app/templates/components/users/user-favorites/list.hbs

Summary

Maintainability
Test Coverage
{{#each showableItems  as |favorite|}}
  <div class="favorite-item col-xs-3 hint--top hint--bounce hint--rounded" aria-label={{if isCharacter favorite.item.name favorite.item.computedTitle}}>
    {{#if isCharacter}}
      <a href="#">
        {{lazy-image src=(image favorite.item.image)}}
      </a>
    {{else}}
      <a href={{href-to (concat type ".show") favorite.item}}>
        {{lazy-image src=(image favorite.item.posterImage "tiny")}}
      </a>
    {{/if}}
  </div>
{{/each}}

{{#unless (gte showCount items.length)}}
  <div class="text-xs-center w-100">
    <button class="button button--primary" onclick={{action "showMore"}}>
      {{t "components.users.favorites.more"}}
    </button>
  </div>
{{/unless}}