hummingbird-me/hummingbird

View on GitHub
frontend/app/templates/onboarding/library.hbs

Summary

Maintainability
Test Coverage
<div class="panel-header">
  <div class="step-instructions col-sm-6">
    <h3>Tell us what you've seen and read</h3>
    <p>Hummingbird learns from your ratings to improve your recommendations.</p>
  </div>
  {{#if canContinue}}
    {{#link-to 'onboarding.finish' class='btn btn-primary continue-button categories'}}Continue{{/link-to}}
  {{else}}
    <a class='btn btn-primary continue-button no-continue'>
      Rate <strong>{{remainingRatings}} more</strong> to continue
    </a>
  {{/if}}
  <div class="col-sm-12">
    <div class="import-panel">
      {{#if currentUser.isImportErrored}}
        <i class="fa fa-warning"></i> {{currentUser.importError}}
      {{/if}}
      {{#if currentUser.isImportOngoing}}
        <i class="fa fa-spinner"></i>
        We're importing your data. Keep going, we'll tell you when it's done.
      {{else}}
        {{view "file-upload" action="importMal" name="animelist" id="mal-file"}}
        Have a MAL account? <a href="#" {{action "pickMalFile"}}>We can import your XML backup!</a>
        <a href="http://myanimelist.net/panel.php?go=export" target="_blank" class="import-help"><i class="fa fa-question-circle"></i></a>
      {{/if}}
    </div>
  </div>
</div>

<div class="library-tab-wrapper col-sm-8">
  <ul class="library-tabs inline-list">
    <li>
      <a {{action 'mangaTab' false}} {{bind-attr class=":anime-tab showManga::active"}}>Anime</a>
    </li>
    <li>
      <a {{action 'mangaTab' true}} {{bind-attr class=":manga-tab showManga:active"}}>Manga</a>
    </li>
  </ul>
</div>

<div class="search-section col-sm-4">
  <div class="search-wrapper">
    <i class="fa fa-search"></i>
    {{input value=searchTerm class="library-search-widget" type="text" placeholder="Search by title..."}}
  </div>
</div>

<ul class="library-thumbs">
  {{#if loading}}
    {{loading-indicator}}
  {{else}}
    {{#if showManga}}
      {{#each mangaData as |manga|}}
        <li class="block-grid-item">
          <div class="thumbnail">
            <img {{bind-attr src=manga.posterImage}} />
          </div>
          <span class="library-title">{{manga.englishTitle}}</span>
          <div class="awesome-rating-widget">
            {{awesome-rating type=currentUser.ratingType editable="true" action="setLibraryRating" rating=manga.mangaLibraryEntry.rating media=manga}}
          </div>
        </li>
      {{else}}
        No search results ...
      {{/each}}
    {{else}}
      {{#each animeData as |anime|}}
        <li class="block-grid-item">
          <div class="thumbnail">
            <img {{bind-attr src=anime.posterImage}} />
          </div>
          <span class="library-title">{{anime.canonicalTitle}}</span>
          <div class="awesome-rating-widget">
            {{awesome-rating type=currentUser.ratingType editable="true" action="setLibraryRating" rating=anime.libraryEntry.rating media=anime}}
          </div>
        </li>
      {{else}}
        No search results ...
      {{/each}}
    {{/if}}
  {{/if}}
</ul>

<div class="pull-right">
  {{#link-to 'onboarding.finish'}}Skip{{/link-to}}
</div>