Browse Source

minor fixes

sleepytaco 3 years ago
parent
commit
8af0077752

+ 7 - 58
apps/main/templates/all_playlists.html

@@ -2,7 +2,6 @@
 {% 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 mb-3">
             <h1 class="h2"><span style="border-bottom: 3px #ffffff dashed;">{{ playlist_type_display|title }}</span> <span class="badge bg-primary rounded-pill">{{ playlists.count }}</span></h1>
@@ -32,62 +31,16 @@
         </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">
+                   name="search" placeholder="Begin to search playlists..."
+                   hx-post="{% url 'search_playlists' playlist_type %}"
+                   hx-trigger="keyup changed delay:700ms"
+                   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>
-                                {% if playlist.tags.all %}
-                                <p class="card-text">
-                                    <span class="d-flex justify-content-start flex-wrap">
-                                        <small>
-                                        <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
-                                            <i class="fas fa-tags"></i>
-                                        </span>
-                                        </small>
-                                        {% for tag in playlist.tags.all %}
-                                            <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
-                                                {{ tag.name }}
-                                            </span>
-                                        {% endfor %}
-                                    </span>
-                                </p>
-                                {% endif %}
-                                <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 %}
-
 
+        <div id="search-results">
+            {% include 'intercooler/playlists.html' %}
         </div>
         {% else %}
               <div class="card bg-dark text-white mb-3">
@@ -122,8 +75,4 @@
         {% endif %}
         <br>
 
-    </div>
-
-
-
 {% endblock %}

+ 1 - 1
apps/main/templates/home.html

@@ -69,7 +69,7 @@
                             {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-dark">YT</span></small> {% endif %}
                         </h5>
                         <p class="card-text">
-                            <span class="badge bg-{% if playlist.get_watch_time_left == "0secs." %}success{% else %}info{% endif %} text-white">{{ playlist.get_watched_videos_count }}/{{ playlist.get_watchable_videos_count }} viewed</span>
+                            <span class="badge bg-{% if playlist.get_watch_time_left == "0secs." %}success{% else %}primary{% endif %} text-white">{{ playlist.get_watched_videos_count }}/{{ playlist.get_watchable_videos_count }} viewed</span>
 
                             {% if playlist.get_watch_time_left != "0secs." %}<span class="badge bg-dark text-white">{{ playlist.get_watch_time_left }} left</span>{% endif %}
                         </p>

+ 78 - 66
apps/main/templates/intercooler/playlists.html

@@ -1,79 +1,91 @@
 
-        <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>
+{% if watching %}
+       <div class="row row-cols-1 row-cols-md-3 g-4 text-dark">
+        {% for playlist in playlists %}
+        <div class="col">
+            <div class="card">
+                <a style="background-color: #1A4464;" href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item list-group-item-action" aria-current="true">
+                    <div class="card-body">
+                <h5 class="card-title text-white">
+                   {{ playlist.name }}
+                    {% if playlist.is_private_on_yt %}<small><span class="badge bg-light text-dark">Private</span></small> {% endif %}
+                    {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-dark">YT</span></small> {% endif %}
+                </h5>
+                <p class="card-text">
+                    <span class="badge bg-{% if playlist.get_watch_time_left == "0secs." %}success{% else %}primary{% endif %} text-white">{{ playlist.get_watched_videos_count }}/{{ playlist.get_watchable_videos_count }} viewed</span>
+                    <span class="badge bg-light text-black-50">{{ playlist.playlist_duration }} </span>
 
-            <div class="btn-toolbar mb-2 mb-md-0">
-                  <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>
+                    {% if playlist.get_watch_time_left != "0secs." %}<span class="badge bg-dark text-white-50">{{ playlist.get_watch_time_left }} left</span>{% endif %}
+                </p>
+                    {% if playlist.tags.all %}
+                <small>
+                <i class="fas fa-tags fa-sm" style="color: yellow"></i>
+                    {% for tag in playlist.tags.all %}
+                        <span class="badge rounded-pill bg-primary mb-lg-1">
+                            {{ tag.name }}
+                        </span>
+                    {% endfor %}
+                </small>
+                    {% endif %}
+                </div>
+                </a>
             </div>
-
         </div>
 
-        <div class="">
-            <input class="form-control border border-secondary" type="text"
-       name="search" placeholder="Begin to search playlists..."
-                   value="{{ search_query }}"
-       hx-post="{% url 'search_playlists' playlist_type %}"
-       hx-trigger="keyup changed delay:1s"
-       hx-target="#search-results"
-       hx-indicator=".htmx-indicator" autofocus onfocus="this.setSelectionRange(this.value.length,this.value.length);">
-            <br>
-        </div>
+        {% endfor %}
+    </div>
 
-        <div class="row row-cols-1 row-cols-md-3 g-4">
-                {% if playlists %}
-                {% 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" aria-current="true">
+{% else %}
+<div class="row row-cols-1 row-cols-md-3 g-4">
+        {% if playlists %}
+        {% 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" aria-current="true">
 
-                            <div class="card-body">
+                    <div class="card-body">
 
-                                <h5 class="card-title text-white">
-                                    {{ playlist.name }}
+                        <h5 class="card-title text-white">
+                            {{ playlist.name }}
 
-                                </h5>
+                        </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>
+                        <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 %}
+                            {% if playlist.marked_as == "watching" %}<small><span class="badge bg-primary text-white">WATCHING</span></small>{% endif %}
+                        </p>
 
-                                {% if playlist.tags.all %}
-<p class="card-text">
-    <span class="d-flex justify-content-start flex-wrap">
-        <small>
-        <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
-            <i class="fas fa-tags"></i>
-        </span>
-        </small>
-        {% for tag in playlist.tags.all %}
-            <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
-                {{ tag.name }}
-            </span>
-        {% endfor %}
-    </span>
-</p>
-{% endif %}
-                                <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>
+                        {% if playlist.tags.all %}
+                            <p class="card-text">
+                            <span class="d-flex justify-content-start flex-wrap">
+                            <small>
+                            <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
+                                <i class="fas fa-tags"></i>
+                            </span>
+                            </small>
+                            {% for tag in playlist.tags.all %}
+                                <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
+                                    {{ tag.name }}
+                                </span>
+                            {% endfor %}
+                            </span>
+                            </p>
+                        {% endif %}
+                        <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>
-                </div>
-                {% endfor %}
-
-                {% else %}
-                <h5 class="text-white align-content-center">Nothing found :(</h5>
-                {% endif %}
+                </a>
             </div>
-    <br>
+        </div>
+        {% endfor %}
+
+        {% else %}
+        <h5 class="text-dark align-content-center">Nothing playlists found :(</h5>
+        {% endif %}
+    </div>
+{% endif %}
+<br>

+ 28 - 78
apps/main/templates/intercooler/search_untube_results.html

@@ -6,57 +6,7 @@
 </div>
 
 <div>
-    <div class="row row-cols-1 row-cols-md-3 g-4">
-        {% if playlists %}
-        {% for playlist in playlists %}
-        <div class="col">
-            <div class="card" style="background-color: #1A4464;">
-                <a style="background-color: #1A4464;" href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item list-group-item-action" aria-current="true">
-
-                    <div class="card-body text-white">
-
-                        <h5 class="card-title">
-                            {{ playlist.name|truncatewords:"15" }}
-                            {% if playlist.is_private_on_yt %}<small><span class="badge bg-light text-dark">Private</span></small> {% endif %}
-                            {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-dark">YT</span></small> {% endif %}
-                        </h5>
-                        <p class="card-text">
-                            {% if playlist.description %}
-                                {{ playlist.description|truncatewords:"15" }}
-                            {% else %}
-                                No description
-                            {% endif %}
-                        </p>
-                        {% if playlist.tags.all %}
-    <p class="card-text">
-        <span class="d-flex justify-content-start flex-wrap">
-            <small>
-            <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
-                <i class="fas fa-tags"></i>
-            </span>
-            </small>
-            {% for tag in playlist.tags.all %}
-                <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
-                    {{ tag.name }}
-                </span>
-            {% endfor %}
-        </span>
-    </p>
-    {% endif %}
-                        <small>
-                            <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} views</span>
-                            <span class="badge bg-primary rounded-pill">{{ playlist.playlist_duration }} </span>
-                        </small>
-                    </div>
-                </a>
-            </div>
-        </div>
-        {% endfor %}
-
-        {% else %}
-        <h5 class="text-dark align-content-center">Nothing found :(</h5>
-        {% endif %}
-    </div>
+    {% include 'intercooler/playlists.html' %}
 </div>
 
 <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
@@ -120,41 +70,41 @@
     <div class="row row-cols-1 row-cols-md-3 g-4">
         {% for playlist in all_playlists %}
         <div class="col">
-            <div class="card" style="background-color: #1A4464;">
+            <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" aria-current="true">
 
-                    <div class="card-body text-white">
+                    <div class="card-body">
+
+                        <h5 class="card-title text-white">
+                            {{ playlist.name }}
 
-                        <h5 class="card-title">
-                            {{ playlist.name|truncatewords:"15" }}
-                            {% if playlist.is_private_on_yt %}<small><span class="badge bg-light text-dark">Private</span></small> {% endif %}
-                            {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-dark">YT</span></small> {% endif %}
                         </h5>
+
                         <p class="card-text">
-                            {% if playlist.description %}
-                                {{ playlist.description|truncatewords:"15" }}
-                            {% else %}
-                                No description
-                            {% endif %}
+                            {% 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 %}
+                            {% if playlist.marked_as == "watching" %}<small><span class="badge bg-primary text-white">WATCHING</span></small>{% endif %}
                         </p>
+
                         {% if playlist.tags.all %}
-    <p class="card-text">
-        <span class="d-flex justify-content-start flex-wrap">
-            <small>
-            <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
-                <i class="fas fa-tags"></i>
-            </span>
-            </small>
-            {% for tag in playlist.tags.all %}
-                <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
-                    {{ tag.name }}
-                </span>
-            {% endfor %}
-        </span>
-    </p>
-    {% endif %}
+                            <p class="card-text">
+                            <span class="d-flex justify-content-start flex-wrap">
+                            <small>
+                            <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
+                                <i class="fas fa-tags"></i>
+                            </span>
+                            </small>
+                            {% for tag in playlist.tags.all %}
+                                <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
+                                    {{ tag.name }}
+                                </span>
+                            {% endfor %}
+                            </span>
+                            </p>
+                        {% endif %}
                         <small>
-                            <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} views</span>
+                            <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>

+ 6 - 56
apps/main/templates/search_untube_page.html

@@ -68,68 +68,18 @@
     </div>
 </div>
 
-<div id="spinner" class="htmx-indicator d-flex justify-content-center p-3">
-    <div class="spinner-border text-light" role="status">
+    <div id="spinner" class="htmx-indicator d-flex justify-content-center p-3">
+        <div class="spinner-border text-light" role="status">
+        </div>
     </div>
-</div>
 
     <div id="untube-searchbar-results">
-        {% if user.profile.playlists.all %}
+        {% if playlists %}
         <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">All Playlists <span class="badge bg-primary rounded-pill">{{ user.profile.playlists.count }}</span></h1>
-        </div>
-
-        <div>
-            <div class="row row-cols-1 row-cols-md-3 g-4">
-                {% for playlist in user.profile.playlists.all %}
-                <div class="col">
-                    <div class="card" style="background-color: #1A4464;">
-                        <a style="background-color: #1A4464;" href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item list-group-item-action" aria-current="true">
-
-                            <div class="card-body text-white">
-
-                                <h5 class="card-title">
-                                    {{ playlist.name|truncatewords:"15" }}
-                                    {% if playlist.is_private_on_yt %}<small><span class="badge bg-light text-dark">Private</span></small> {% endif %}
-                                    {% if playlist.is_from_yt %}<small><span class="badge bg-danger text-dark">YT</span></small> {% endif %}
-                                </h5>
-                                <p class="card-text">
-                                    {% if playlist.description %}
-                                        {{ playlist.description|truncatewords:"15" }}
-                                    {% else %}
-                                        No description
-                                    {% endif %}
-                                </p>
-                                {% if playlist.tags.all %}
-            <p class="card-text">
-                <span class="d-flex justify-content-start flex-wrap">
-                    <small>
-                    <span style="color: #eed868;" class="me-lg-1 mb-lg-1">
-                        <i class="fas fa-tags"></i>
-                    </span>
-                    </small>
-                    {% for tag in playlist.tags.all %}
-                        <span class="badge rounded-pill bg-info mb-lg-1 me-lg-1 text-black-50">
-                            {{ tag.name }}
-                        </span>
-                    {% endfor %}
-                </span>
-            </p>
-            {% endif %}
-                                <small>
-                                    <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} views</span>
-                                    <span class="badge bg-primary rounded-pill">{{ playlist.playlist_duration }} </span>
-                                </small>
-                            </div>
-                        </a>
-                    </div>
-                </div>
-                {% endfor %}
-            </div>
+            <h1 class="h2">All Playlists <span class="badge bg-primary rounded-pill">{{ playlists.count }}</span></h1>
         </div>
+            {% include 'intercooler/playlists.html' %}
         {% endif %}
     </div>
 
-
-
 {% endblock %}

+ 20 - 18
apps/main/views.py

@@ -176,7 +176,7 @@ def all_playlists(request, playlist_type):
     "none", "watching", "plan-to-watch"
     """
     playlist_type = playlist_type.lower()
-
+    watching = False
     if playlist_type == "" or playlist_type == "all":
         playlists = request.user.profile.playlists.all().filter(is_in_db=True)
         playlist_type_display = "All Playlists"
@@ -192,6 +192,8 @@ def all_playlists(request, playlist_type):
     elif playlist_type.lower() in ["watching", "plan-to-watch"]:
         playlists = request.user.profile.playlists.filter(Q(marked_as=playlist_type.lower()) & Q(is_in_db=True))
         playlist_type_display = playlist_type.lower().replace("-", " ")
+        if playlist_type.lower() == "watching":
+            watching = True
     elif playlist_type.lower() == "home":  # displays cards of all playlist types
         return render(request, 'playlists_home.html')
     elif playlist_type.lower() == "random":  # randomize playlist
@@ -219,7 +221,8 @@ def all_playlists(request, playlist_type):
 
     return render(request, 'all_playlists.html', {"playlists": playlists,
                                                   "playlist_type": playlist_type,
-                                                  "playlist_type_display": playlist_type_display})
+                                                  "playlist_type_display": playlist_type_display,
+                                                  "watching": watching})
 
 
 @login_required
@@ -324,17 +327,22 @@ def order_playlist_by(request, playlist_id, order_by):
 
 @login_required
 def order_playlists_by(request, playlist_type, order_by):
+    watching = False
+
     if playlist_type == "" or playlist_type.lower() == "all":
         playlists = request.user.profile.playlists.all()
-        playlist_type_display = "All Playlists"
     elif playlist_type.lower() == "favorites":
         playlists = request.user.profile.playlists.filter(Q(is_favorite=True) & Q(is_in_db=True))
-        playlist_type_display = "Favorites"
     elif playlist_type.lower() in ["watching", "plan-to-watch"]:
         playlists = request.user.profile.playlists.filter(Q(marked_as=playlist_type.lower()) & Q(is_in_db=True))
-        playlist_type_display = "Watching"
+        if playlist_type.lower() == "watching":
+            watching = True
+    elif playlist_type.lower() == "imported":
+        playlists = request.user.profile.playlists.filter(Q(is_user_owned=False) & Q(is_in_db=True))
+    elif playlist_type.lower() == "user-owned":
+        playlists = request.user.profile.playlists.filter(Q(is_user_owned=True) & Q(is_in_db=True))
     else:
-        return redirect('home')
+        return HttpResponse("Not found.")
 
     if order_by == 'recently-accessed':
         playlists = playlists.order_by("-updated_at")
@@ -344,9 +352,7 @@ def order_playlists_by(request, playlist_type, order_by):
         playlists = playlists.order_by("-video_count")
 
     return HttpResponse(loader.get_template("intercooler/playlists.html")
-                        .render({"playlists": playlists,
-                                 "playlist_type_display": playlist_type_display,
-                                 "playlist_type": playlist_type}))
+                        .render({"playlists": playlists, "watching": watching}))
 
 
 @login_required
@@ -441,47 +447,43 @@ def search_playlists(request, playlist_type):
     # print(request.POST)  # prints <QueryDict: {'search': ['aa']}>
 
     search_query = request.POST["search"]
+    watching = False
 
     if playlist_type == "all":
         try:
             playlists = request.user.profile.playlists.all().filter(Q(name__startswith=search_query) & Q(is_in_db=True))
         except:
             playlists = request.user.profile.playlists.all()
-        playlist_type_display = "All Playlists"
     elif playlist_type == "user-owned":  # YT playlists owned by user
         try:
             playlists = request.user.profile.playlists.filter(
                 Q(name__startswith=search_query) & Q(is_user_owned=True) & Q(is_in_db=True))
         except:
             playlists = request.user.profile.playlists.filter(Q(is_user_owned=True) & Q(is_in_db=True))
-        playlist_type_display = "Your YouTube Playlists"
     elif playlist_type == "imported":  # YT playlists (public) owned by others
         try:
             playlists = request.user.profile.playlists.filter(
                 Q(name__startswith=search_query) & Q(is_user_owned=False) & Q(is_in_db=True))
         except:
             playlists = request.user.profile.playlists.filter(Q(is_user_owned=True) & Q(is_in_db=True))
-        playlist_type_display = "Imported Playlists"
     elif playlist_type == "favorites":  # YT playlists (public) owned by others
         try:
             playlists = request.user.profile.playlists.filter(
                 Q(name__startswith=search_query) & Q(is_favorite=True) & Q(is_in_db=True))
         except:
             playlists = request.user.profile.playlists.filter(Q(is_favorite=True) & Q(is_in_db=True))
-        playlist_type_display = "Your Favorites"
     elif playlist_type in ["watching", "plan-to-watch"]:
         try:
             playlists = request.user.profile.playlists.filter(
                 Q(name__startswith=search_query) & Q(marked_as=playlist_type) & Q(is_in_db=True))
         except:
             playlists = request.user.profile.playlists.all().filter(Q(marked_as=playlist_type) & Q(is_in_db=True))
-        playlist_type_display = playlist_type.replace("-", " ")
+        if playlist_type == "watching":
+            watching = True
 
     return HttpResponse(loader.get_template("intercooler/playlists.html")
                         .render({"playlists": playlists,
-                                 "playlist_type_display": playlist_type_display,
-                                 "playlist_type": playlist_type,
-                                 "search_query": search_query}))
+                                 "watching": watching}))
 
 
 #### MANAGE VIDEOS #####
@@ -523,7 +525,7 @@ def mark_video_watched(request, playlist_id, video_id):
 @login_required
 def search(request):
     if request.method == "GET":
-        return render(request, 'search_untube_page.html')
+        return render(request, 'search_untube_page.html', {"playlists": request.user.profile.playlists.all()})
     else:
         return render('home')