sleepytaco il y a 3 ans
Parent
commit
f0df4d6fb1

+ 1 - 1
apps/main/templates/intercooler/videos.html

@@ -5,7 +5,7 @@
 <div class="list-group" id="video-checkboxes">
     {% if videos %}
       {% for video in videos|slice:"0:50" %}
-                <li {% if forloop.last %}hx-get="{% url 'load_more_videos' playlist.playlist_id page|default:"1" %}"
+                <li {% if forloop.last and videos.count > 50 %}hx-get="{% url 'load_more_videos' playlist.playlist_id page|default:"1" %}"
     hx-trigger="revealed"
     hx-swap="afterend" hx-indicator="#load-more-videos-spinner"{% endif %} class="list-group-item d-flex justify-content-between align-items-center bg-transparent" style="background-color: #40B3A2">
 

+ 24 - 11
apps/main/templates/view_playlist.html

@@ -98,7 +98,7 @@
                 <button type="button" class="btn btn-warning" hx-post="{% url 'add_playlist_tag' playlist.playlist_id %}" hx-trigger="click" hx-include="[name='playlistTag']" hx-target="this">Add Tag</button>
             </div>
       </div>
-    <div class="d-flex justify-content-start mt-3">
+    <div class="d-flex justify-content-start mt-3 mb-2">
           - OR -
       </div>
         {% endif %}
@@ -265,22 +265,35 @@
       <h5>{% if playlist.is_user_owned %}Move or {% endif %}Copy videos to another playlist!</h5>
 
       <div class="d-flex justify-content-start">
-          <input class="form-control w-50 bg-dark text-white border border-secondary" placeholder="Enter playlist ID or comma seperated list of playlist IDs here">
-          {% if playlist.is_user_owned %}
-          <div class="btn-group ms-2">
-            <button type="button" class="btn btn-info" id="select-all-btn">Move!</button>
-          </div>
-          {% endif %}
-          <div class="btn-group ms-2">
-            <button type="button" class="btn btn-info" id="select-all-btn">Copy!</button>
+
+
+          <div class="col-md-6 text-dark">
+                <select class="visually-hidden" onchange="triggerSubmit()"
+                     id="choices-multiple-remove-button" name="playlist-tags" placeholder="Select Playlists" multiple>
+                    {% for pl in user_owned_playlists %}
+                        {% if pl.playlist_id != playlist.playlist_id %}
+                            <option value="{{ pl.playlist_id }}" class="text-dark">{{ pl.name }}</option>
+                        {% endif %}
+                    {% endfor %}
+                </select>
           </div>
 
       </div>
 
-      <div class="d-flex justify-content-start mt-3">
+      <div class="d-flex justify-content-start mt-2">
+          <!--
           <div class="btn-group">
               <a href="{% url 'all_playlists' 'all' %}" target="_blank" class="btn btn-sm btn-success" id="select-all-btn">Search for Playlists <i class="fas fa-external-link-alt" aria-hidden="true"></i></a>
           </div>
+          -->
+          {% if playlist.is_user_owned %}
+          <div class="btn-group me-2">
+            <button type="button" class="btn btn-info" id="select-all-btn">Move!</button>
+          </div>
+          {% endif %}
+          <div class="btn-group">
+            <button type="button" class="btn btn-info" id="select-all-btn">Copy!</button>
+          </div>
       </div>
 
     </div>
@@ -319,7 +332,7 @@
         <div class="list-group" id="video-checkboxes">
           {% for video in videos|slice:"0:50" %}
 
-            <li {% if forloop.last %}hx-get="{% url 'load_more_videos' playlist.playlist_id page|default:"1" %}"
+            <li {% if forloop.last and videos.count > 50 %}hx-get="{% url 'load_more_videos' playlist.playlist_id page|default:"1" %}"
     hx-trigger="revealed"
     hx-swap="afterend" hx-indicator="#load-more-videos-spinner" {% endif %} class="list-group-item d-flex justify-content-between align-items-center bg-transparent" style="background-color: #40B3A2">
 

+ 3 - 1
apps/main/views.py

@@ -107,6 +107,7 @@ def video_notes(request, playlist_id, video_id):
 @login_required
 def view_playlist(request, playlist_id):
     user_profile = request.user.profile
+    user_owned_playlists = user_profile.playlists.filter(Q(is_user_owned=True) & Q(is_in_db=True))
 
     # specific playlist requested
     if user_profile.playlists.filter(Q(playlist_id=playlist_id) & Q(is_in_db=True)).count() != 0:
@@ -140,7 +141,8 @@ def view_playlist(request, playlist_id):
     return render(request, 'view_playlist.html', {"playlist": playlist,
                                                   "playlist_tags": playlist_tags,
                                                   "unused_tags": unused_tags,
-                                                  "videos": videos})
+                                                  "videos": videos,
+                                                  "user_owned_playlists": user_owned_playlists})
 
 
 @login_required