123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- {% extends 'base.html' %}
- {% block content %}
- <div id="search-results">
- <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
- <h1 class="h2">{{ playlist_type_display|title }} <span class="badge bg-primary rounded-pill">{{ playlists.count }}</span></h1>
- <div class="btn-toolbar mb-2 mb-md-0">
- <!--
- <div class="btn-group me-2">
- <button type="button" class="btn btn-outline-info">Grid</button>
- <button type="button" class="btn btn-outline-info">List</button>
- </div>
- -->
- <div class="btn-group">
- <button type="button" class="btn btn-outline-success dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
- Sort By
- </button>
- <ul class="dropdown-menu">
- <li><a class="dropdown-item" hx-get="{% url 'order_playlists_by' playlist_type 'playlist-duration-in-seconds' %}" hx-trigger="click" hx-target="#search-results">Duration</a></li>
- <li><a class="dropdown-item" hx-get="{% url 'order_playlists_by' playlist_type 'video-count' %}" hx-trigger="click" hx-target="#search-results"># Videos</a></li>
- <li><a class="dropdown-item" hx-get="{% url 'order_playlists_by' playlist_type 'recently-accessed' %}" hx-trigger="click" hx-target="#search-results">Recently Accessed</a></li>
- </ul>
- </div>
- </div>
- </div>
- {% if playlists %}
- <div class="">
- <input class="form-control border border-secondary" type="text"
- name="search" placeholder="Begin to search playlists..."
- hx-post="{% url 'search_playlists' playlist_type %}"
- hx-trigger="keyup changed delay:500ms"
- hx-target="#search-results"
- hx-indicator=".htmx-indicator">
- <br>
- </div>
- <div class="row row-cols-1 row-cols-md-3 g-4">
- {% for playlist in playlists %}
- <div class="col">
- <div class="card" style="background-color: #515355;">
- <a style="background-color: #1A4464;" href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item list-group-item-action text-white-50" aria-current="true">
- <div class="card-body">
- <h5 class="card-title text-white">
- {{ playlist.name }}
- </h5>
- <p class="card-text">
- {% if playlist.is_user_owned %}<small><span class="badge bg-light text-black-50">OWNED</span></small>{% else %}<small><span class="badge bg-light text-black-50">IMPORTED</span></small>{% endif %}
- {% if playlist.is_private_on_yt %}<small><span class="badge bg-secondary text-white">Private</span></small> {% endif %}
- {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-black-50">YT</span></small> {% endif %}
- </p>
- <small>
- <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} videos</span>
- <span class="badge bg-primary rounded-pill">{{ playlist.playlist_duration }} </span>
- </small>
- </div>
- </a>
- </div>
- </div>
- {% endfor %}
- {% else %}
- <h5 class="text-white align-content-center">Nothing to see here. Add something!</h5>
- </div>
- {% endif %}
- <br>
- </div>
- {% endblock %}
|