hummingbird-me/kitsu-web

View on GitHub
app/templates/components/stream-feed/items/library-entry/activity.hbs

Summary

Maintainability
Test Coverage
<span class="agg-avatar">
  {{lazy-image src=(image activity.actor.avatar "tiny")}}
</span>
<span class="agg-action">
  <a href={{href-to "users.index" activity.actor}}>{{activity.actor.name}}</a>

  {{! others doing this activity }}
  {{#if (gt group.others.length 0)}}
    {{#if (eq group.others.length 1)}}
      {{#with (get group.others "firstObject") as |other|}}
        and <a href={{href-to "users.index" other.actor}}>{{other.actor.name}}</a>
      {{/with}}
    {{else}}
      and <strong>{{group.others.length}} others</strong>
    {{/if}}
  {{/if}}

  {{! TODO: Possible to refactor into something less gross? }}
  {{#if (eq activity.verb "updated")}}
    {{t "feeds.library.updated" status=(t (concat "library-shared." activity.status) type=media.modelType)}}
  {{else if (eq activity.verb "rated")}}
    {{t "feeds.library.rated"}}
    {{library-entry/readonly-rating rating=rating class="rating-container"}}
  {{else if (eq activity.verb "progressed")}}
    {{t "feeds.library.progressed" type=media.modelType num=activity.progress}}
  {{/if}}

  {{! Deletion }}
  {{#if (and (is-self activity.actor) (not readOnly))}}
    &mdash;
    {{#if isDeleteing}}
      {{t "components.stream-feed.post.pinned"}}{{t "components.stream-feed.library.deleting"}}
    {{else}}
      <a href="#" {{action "deleteActivity" activity}}>{{t "components.stream-feed.library.delete"}}</a>
    {{/if}}
  {{/if}}
</span>