hummingbird-me/kitsu-web

View on GitHub
app/templates/media/show/units/show.hbs

Summary

Maintainability
Test Coverage
<div class="col-sm-8 no-padding">
  <a href={{href-to (concat media.modelType ".show." model.modelType "s")}} class="episode-list">{{t "media.show.units.back" type=model.modelType}}</a>
  <div class="unit-summary">
    <div class="unit-thumbnail row">
      <div class="thumbnail-wrapper col-sm-4 no-padding-right">
        {{#if (is-object-empty model.thumbnail)}}
          {{lazy-image src=(image media.posterImage "medium")}}
        {{else}}
          {{lazy-image src=(image model.thumbnail)}}
        {{/if}}
      </div>

      <div class="unit-meta col-sm">
        <div>
          <h6 class="unit-number">
            {{t "media.show.units.unit" type=model.modelType}}
            {{model.number}}
          </h6>
          {{#if (not (eq model.canonicalTitle (concat (capitalize model.modelType) " " model.number)))}}
            <div class="info-emphasis thumb-caption">{{model.canonicalTitle}}</div>
          {{/if}}
          <div class="unit-info small">
          {{#if humanizedLength}}
            <div class="unit-length">
              {{humanizedLength}}
            </div>
          {{/if}}

          {{#if (or model.airdate model.published)}}
            <div class="unit-date">
              {{#if (eq model.modelType "episode")}}
                {{t "media.show.units.date" type="episode" }}: {{moment-format model.airdate "MMM D, YYYY" timeZone="UTC"}}
              {{else}}
                {{t "media.show.units.date" type="chapter" }}: {{moment-format model.published "MMM D, YYYY" timeZone="UTC"}}
              {{/if}}
            </div>
          {{/if}}
        </div>
        </div>
      </div>
    </div>

    {{#if model.description}}
      <div class="unit-description">
        {{read-more model.description 280}}
      </div>
    {{/if}}
  </div>

  <section class="unit-discussion">
    <h5>{{t "media.show.units.feed.header" type=model.modelType}}</h5>
    {{stream-feed/list
      subject=model.number
      streamType=(concat model.modelType "_aggr")
      streamId=model.id
      streamFilter="user"
      readOnly=(not (can "write post"))
      media=media
      unitNumber=model.number
      forceUnit=true
    }}
  </section>
</div>