<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>
<?php if( 0 == engine_count($this->paginator) ): ?>
  <div class="no_result_tip">
    <i><img src="application/modules/Core/externals/images/no-results.png" height="100" width="100" alt="No Result"></i>
    <p><?php echo $this->translate('There is no music uploaded yet.') ?></p>
    <p>  
      <?php if( $this->canCreate ): ?>
        <?php echo $this->htmlLink(array(
          'route' => 'music_general',
          'action' => 'create'
        ), $this->translate('Why don\'t you add some?')) ?>
      <?php endif; ?>
    </p>
  </div>
<?php else: ?>
  <ul class="music_listing">
    <?php foreach ($this->paginator as $playlist): ?>
      <li id="music_playlist_item_<?php echo $playlist->getIdentity() ?>" class="music_listing_item">
        <article class="d-flex align-items-start justify-content-start gap-3">
          <div class="music_browse_author_photo">
            <?php echo $this->htmlLink($playlist->getOwner(),
            $this->itemBackgroundPhoto($playlist->getOwner(), 'thumb.icon') ) ?>
          </div>
          <div class="music_browse_info">
            <div class="manage_listing_title">
              <?php echo $this->htmlLink($playlist->getHref(), $playlist->getTitle(), array('class' => 'font_color'))?>
            </div>
            <div class="music_info_top d-flex align-items-start justify-content-start flex-wrap gap-2 mt-1">
              <div class="music_browse_info_date">
                <?php echo $this->translate('Created %s by ', $this->timestamp($playlist->creation_date)) ?>
                <?php echo $this->htmlLink($playlist->getOwner(), $playlist->getOwner()->getTitle(),array('class' => 'font_color')) ?>
              </div>    
              <div class="music_playlist_stats">
                <?php //if( $playlist->like_count > 0 ) :?>
                  <span>
                    <i class="icon_like"></i>
                    <?php echo $this->translate(array('%s Like', '%s Likes', $playlist->like_count), $this->locale()->toNumber($playlist->like_count)) ?>
                  </span>
                <?php //endif; ?>
               <?php //if( $playlist->comment_count > 0 ) :?>
                  <span>
                    <i class="icon_comment"></i>
                    <?php echo $this->translate(array('%s Comment', '%s Comments', $playlist->comment_count), $this->locale()->toNumber($playlist->comment_count)) ?>
                  </span>
                <?php //endif; ?>
                <?php //if( $playlist->view_count > 0 ) :?>
                  <span class="music_views">
                    <i class="icon_view"></i>
                    <?php echo $this->translate(array('%s View', '%s Views', $playlist->view_count), $this->locale()->toNumber($playlist->view_count)) ?>
                  </span>
                <?php //endif; ?>
                <?php //if( $playlist->play_count > 0 ) :?>
                  <span>
                    <i class="icon_play"></i>
                    <?php echo $this->translate(array('%s Play', '%s Plays', $playlist->play_count), $this->locale()->toNumber($playlist->play_count)) ?>
                  </span>
                <?php //endif; ?>
              </div>                        
            </div>
            <?php echo $this->partial('_Player.tpl', array('playlist' => $playlist, 'hideStats' => true)) ?>
            <div class="music_browse_info_desc">
              <p><?php echo $this->string()->truncate($this->string()->stripTags($playlist->description), 300) ?></p>
            </div>            
          </div>
        </article>
      </li>
    <?php endforeach; ?>
  </ul>
  <?php echo $this->paginationControl($this->paginator, null, null, array(
    'pageAsQuery' => true,
    'query' => $this->formValues,
    //'params' => $this->formValues,
  )); ?>
<?php endif; ?>
