123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- {% extends 'base.html' %}
- {% block content %}
- <br>
- {% if user.profile.playlists.all.count == 0 %}
- <div class="alert alert-success" role="alert">
- <h4 class="alert-heading">It's empty in here</h4>
- <p>
- There's no playlists in your UnTube right now. You can change that by heading over to <a href="{% url 'manage_playlists' %}" class="btn btn-sm btn-primary">Manage</a> to import some public playlists into your UnTube.
- {% if not user.profile.imported_yt_playlists %}
- Or you could always head over to your <a href="{% url 'profile' %}" class="btn btn-sm btn-primary">Profile</a> to import all of your public/private YouTube playlists.
- {% else %}
- Keep in mind that your own YouTube playlists will automatically be imported into UnTube.
- {% endif %}
- </p>
- </div>
- {% endif %}
- {% if import_successful %}
- <br>
- <br>
- <div class="d-flex justify-content-center pt-3 pb-2 mb-3">
- <h1>Welcome to UnTube, {{ user.username|capfirst }}</h1>
- </div>
- <div class="d-flex justify-content-center pt-3 pb-2 mb-3">
- <h2>{{ user.profile.playlists.all.count }} playlists from YouTube have been successfully imported.</h2>
- </div>
- <div class="d-flex justify-content-center pt-3 pb-2 mb-3">
- <h3>You'll now be notified on the Dashboard whenever there's any new un-exported playlists on YouTube :)</h3>
- </div>
- <div class="d-flex justify-content-center pt-3 pb-2 mb-3">
- <a href="{% url 'home' %}" class="btn btn-lg btn-success">Go to Dashboard</a>
- </div>
- {% else %}
- <!--
- <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">Dashboard</h1>
- <span><small>Logged in as <b>{{ user.username }}</b></small></span>
- </div>
- -->
- {% if user.profile.imported_yt_playlists %}
- <div hx-get="{% url 'user_playlists_updates' 'check-for-updates' %}" hx-trigger="load" hx-swap="outerHTML">
- </div>
- {% endif %}
- {% if watching %}
- <div class="border border-5 rounded-3 border-primary p-3">
- <h3><span style="border-bottom: 3px #ffffff dashed;">Continue Watching</span><i class="fas fa-fire-alt ms-2" style="color: #d24646"></i></h3>
- <div class="row row-cols-1 row-cols-md-4 g-4 text-dark mt-0">
- {% for playlist in watching|slice:"0:3" %}
- <div class="col">
- <div class="card">
- <a style="background-color: #7e89c2;" 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">
- {{ 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>
- {% if playlist.get_watch_time_left != "0secs." %}<span class="badge bg-dark text-white">{{ 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>
- {% if forloop.counter == 3 %}
- {% if watching.count|add:"-3" != 0 %}
- <div class="col">
- <div class="card">
- <a style="background-color: #7e89c2;" href="{% url 'all_playlists' 'watching' %}" class="list-group-item list-group-item-action" aria-current="true">
- <div class="card-body">
- <p class="card-text">
- <h3>+ {{ watching.count|add:"-3" }} more</h3>
- </p>
- </div>
- </a>
- </div>
- </div>
- {% endif %}
- {% endif %}
- {% endfor %}
- </div>
- </div>
- <br>
- {% endif %}
- <div class="row text-dark mt-0 align-items-center">
- <div class="col">
- <div class="row">
- <div class="col">
- <div class="card" style="background: linear-gradient(-45deg, #aaae6b, #7b8eab, #8abc97, #e666f5); background-size: 400% 400%; animation: gradient 7s ease infinite;">
- <a href="#" class="list-group-item bg-transparent list-group-item-action" aria-current="true">
- <div class="card-body">
- <div class="d-flex justify-content-center h1">
- <i class="fas fa-map-pin" style="color:#c22929"></i>
- </div>
- <div class="d-flex justify-content-center h1">
- YOUR
- </div>
- <div class="d-flex justify-content-center h1">
- PINS
- </div>
- </div>
- </a>
- </div>
- </div>
- <div class="col">
- <div class="card" style="background: linear-gradient(-45deg, #0645a4, #2480cd, #84bcf3, #b7d6f7); background-size: 400% 400%; animation: gradient 7s ease infinite;">
- <a href="#" class="list-group-item list-group-item-action bg-transparent" aria-current="true">
- <div class="card-body">
- <div class="d-flex justify-content-center h1">
- <i class="fas fa-heart" style="color: indianred"></i>
- </div>
- <div class="d-flex justify-content-center h1">
- LIKED
- </div>
- <div class="d-flex justify-content-center h1">
- VIDEOS
- </div>
- </div>
- </a>
- </div>
- </div>
- </div>
- <!-- Implement later
- <div class="row mt-3">
- <div class="col">
- </div>
- <div class="col-6">
- <div class="card">
- <a style="background: linear-gradient(-45deg, #e2b968, #68af5b, #8a97bc, #d69ab2); background-size: 400% 400%; animation: gradient 7s ease infinite;" href="#" class="list-group-item list-group-item-action" aria-current="true">
- <div class="card-body">
- <div class="d-flex justify-content-center h1">
- <i class="fas fa-history"></i>
- </div>
- <div class="d-flex justify-content-center h1">
- YOUR
- </div>
- <div class="d-flex justify-content-center h1">
- ACTIVITY
- </div>
- </div>
- </a>
- </div>
- </div>
- <div class="col">
- </div>
- </div>
- -->
- </div>
- <div class="col-8">
- <div class="card bg-transparent text-black border border-5 rounded-3 border-success p-3">
- <div class="card-body">
- <h3><span style="border-bottom: 3px #ffffff dashed;">Most viewed playlists</span> <a href="{% url 'all_playlists' 'all' %}" class="pt-1"><i class="fas fa-binoculars"></i> </a></h3>
- {% if user_playlists %}
- <div class="row row-cols-1 row-cols-md-3 g-4 text-dark mt-0">
- {% for playlist in user_playlists|slice:"0:3" %}
- <div class="col">
- <div class="card overflow-auto" style="background-color: #4790c7;">
- <a href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item bg-transparent list-group-item-action" aria-current="true">
- <div class="card-body">
- <h5 class="card-title">
- #{{ forloop.counter }} <br><br>{{ 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>
- <small>
- <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} videos</span>
- <span class="badge bg-primary rounded-pill">{{ playlist.playlist_duration }} </span>
- <span class="badge bg-secondary rounded-pill">{{ playlist.num_of_accesses }} clicks </span>
- </small>
- </div>
- </a>
- </div>
- </div>
- {% endfor %}
- </div>
- {% else %}
- <br>
- <h5>Nothing to see here... yet.</h5>
- {% endif %}
- </div>
- </div>
- </div>
- </div>
- <br>
- <div class="row text-dark mt-0 d-flex justify-content-evenly">
- <div class="col">
- <h3><span style="border-bottom: 3px #ffffff dashed;">Recently Added</span> <i class="fas fa-plus-square" style="color:#972727;"></i></h3>
- {% if recently_added_playlists %}
- <div class="row row-cols-1 row-cols-md-3 g-4 text-dark mt-0">
- {% for playlist in recently_added_playlists %}
- <div class="col">
- <div class="card overflow-auto" style="background-color: #958a44;">
- <a href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item bg-transparent list-group-item-action" aria-current="true">
- <div class="card-body">
- <h5 class="card-title">
- {{ 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>
- <small>
- <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} videos</span>
- <span class="badge bg-primary rounded-pill">{{ playlist.playlist_duration }} </span>
- <span class="badge bg-secondary rounded-pill">{{ playlist.num_of_accesses }} clicks </span>
- </small>
- </div>
- </a>
- </div>
- </div>
- {% endfor %}
- </div>
- {% else %}
- <br>
- <h5>You have no playlists ;-;</h5>
- {% endif %}
- </div>
- <div class="col">
- <h3><span style="border-bottom: 3px #ffffff dashed;">Recently Accessed</span> <i class="fas fa-redo fa-sm" style="color: #3c3fd2"></i></h3>
- {% if recently_accessed_playlists %}
- <div class="row row-cols-1 row-cols-md-3 g-4 text-dark mt-0">
- {% for playlist in recently_accessed_playlists %}
- <div class="col">
- <div class="card overflow-auto" style="background-color: #357779;">
- <a href="{% url 'playlist' playlist.playlist_id %}" class="list-group-item bg-transparent list-group-item-action" aria-current="true">
- <div class="card-body">
- <h5 class="card-title">
- {{ 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>
- <small>
- <span class="badge bg-primary rounded-pill">{{ playlist.video_count }} videos</span>
- <span class="badge bg-primary rounded-pill">{{ playlist.playlist_duration }} </span>
- <span class="badge bg-secondary rounded-pill">{{ playlist.num_of_accesses }} clicks </span>
- </small>
- </div>
- </a>
- </div>
- </div>
- {% endfor %}
- </div>
- {% else %}
- <br>
- <h5>Nothing to see here... yet.</h5>
- {% endif %}
- </div>
- </div>
- <br>
- <br>
- {% endif %}
- {% endblock %}
|