templates/components/sound.html.twig line 1

Open in your IDE?
  1. <div {{ attributes }} data-live-component-id="{{ sound.id }}">
  2.     {% if isCard %}
  3.         <div class="card {{ this.playing ? 'active' }} h-100">
  4.             <div class="card-img-wrapper">
  5.                 <img src="{{ (sound_dir ~ '/' ~ sound.picture)|imagine_filter('sound_cover') }}"
  6.                      class="card-img-top shadow"
  7.                      alt="Couverture de l'album de {{ sound.artist.name }} - titre {{ sound.title }}">
  8.                 <div class="card-img-hover">
  9.                         <button class="player-btn">
  10.                     {% if this.playing %}
  11.                             <i class="fas fa-waveform-lines"></i>
  12.                     {%  else %}
  13.                             <i class="fas fa-play-circle"></i>
  14.                     {% endif %}
  15.                         </button>
  16.                     {% if app.user %}
  17.                         {{ component('bookmark', {
  18.                             sound: sound
  19.                         }) }}
  20.                     {% endif %}
  21.                 </div>
  22.             </div>
  23.             <div class="card-body">
  24.                 <div class="d-flex flex-column-reverse flex-sm-row justify-content-between ">
  25.                     <div>
  26.                         <h2 class="card-title fs-5 mb-0">{{ sound.artist.name }}</h2>
  27.                         <p class="mb-0">
  28.                             {{ sound.title }}
  29.                         </p>
  30.                     </div>
  31.                 </div>
  32.                 <a class="stretched-link"
  33.                    data-action="live#action"
  34.                    data-action-name="playSound"
  35.                    data-sound-file="{{ sound.file }}"
  36.                    aria-label="Écouter {{ sound.title }} de {{ sound.artist.name }}"
  37.                    href="#"></a>
  38.             </div>
  39.         </div>
  40.     {% else %}
  41.         <button
  42.             class="list-group-item list-group-item-action {{ this.isPlaying ? 'active' }} list-group-player"
  43.             data-action="live#action"
  44.             data-action-name="playSound"
  45.             data-sound-file="{{ sound.file }}">
  46.         <span class="list-group-player__index">
  47.             {{ index }}
  48.         </span>
  49.             <img class="img-fluid shadow-sm"
  50.                  src="{{ vich_uploader_asset(sound, 'imageFile')|imagine_filter('sound_cover_mini') }}" alt="">
  51.             {% if this.isPlaying %}
  52.                 <i class="fa-regular fa-circle-play"></i>
  53.             {% endif %}
  54.             <div class="list-group-player__details">
  55.                 <h3 class="list-group-player__artist">{{ sound.artist.name }}</h3>
  56.                 <p class="list-group-player__title">{{ sound.title }}</p>
  57.             </div>
  58.         </button>
  59.     {% endif %}
  60. </div>