malept/gmusicprocurator

View on GitHub
gmusicprocurator/templates/js/playlist.mtpl

Summary

Maintainability
Test Coverage
<div>[% /* For flexbox */ %]
  [% if (typeof(playlist.ownerName) !== 'undefined' || playlist.id == AlpacAudio.QUEUE_ID) { %]
  <section id="playlist-info">
    [% if (!!playlist.name) { %]
    <h3 class="name">[%- playlist.name %]</h3>
    [% } /* playlist.name */ %]
    [% if (playlist.id != AlpacAudio.QUEUE_ID) { %]
    <ul class="actions">
      [% if (!!playlist.id) { %]
      <li><a href="/playlists/[[ playlist.id ]]">XSPF Playlist</a></li>
      [% } /* playlist.id */ %]
      <li><button class="add-to-queue">Add to queue</button></li>
    </ul>
    [% } /* !queue */ %]
  </section>
  [% } /* playlist.description */ %]
  [% if (!playlist.dont_scroll) { %]
  <div class="scrollable-contents">
    <div>[% /* For flexbox */ %]
  [% } /* !playlist.dont_scroll */ %]
      <table[% if (!!playlist.id) { %] data-playlist-id="[[ playlist.id ]]"[% } %] class="listing pure-table pure-table-striped">
        <thead>
          <tr>
            <th>&nbsp;</th>
            <th>Track</th>
            <th><span class="fa fa-clock-o" title="Duration"></span></th>
            <th>Artist</th>
            <th>Album</th>
            <th>#</th>
          </tr>
        </thead>
        <tbody>
          [[ playlist.tracks.map(playlist.render_track).join('') ]]
        </tbody>
      </table>
  [% if (!playlist.dont_scroll) { %]
    </div>
  </div>
  [% } /* !playlist.dont_scroll */ %]
</div>