123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- {% extends 'base.html' %}
- {% block content %}
- {% if messages %}
- <br>
- {% for message in messages %}
- <div class="alert alert-success alert-dismissible fade show" role="alert">
- {{ message }}
- <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
- </div>
- {% endfor %}
- {% 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 able to import/export playlists from YouTube and UnTube :)</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>
- -->
- <div hx-get="{% url 'user_playlists_updates' 'check-for-updates' %}" hx-trigger="load" hx-swap="outerHTML">
- </div>
- {% if watching %}
- <br>
- <div class="border border-5 rounded-3 border-primary p-3">
- <h3><span style="border-bottom: 3px #ffffff dashed;">Continue Watching</span></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-info text-white">15/23 viewed</span>
- <span class="badge bg-dark text-white">3hr. 4min. left</span>
- </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>
- <span class="badge bg-secondary rounded-pill">{{ playlist.num_of_accesses }} clicks </span>
- </small>
- </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>
- {% endif %}
- <br>
- <h3><span style="border-bottom: 3px #ffffff dashed;">Most viewed playlists</span> <a href="{% url 'all_playlists' 'all' %}" class="btn btn-sm btn-info">View All</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">
- <a style="background-color: #35795b;" 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">
- #{{ 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>
- <p class="card-text">
- {% if playlist.description %}
- {{ playlist.description|truncatewords:"15" }}
- {% else %}
- No description
- {% 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>
- <span class="badge bg-secondary rounded-pill">{{ playlist.num_of_accesses }} clicks </span>
- </small>
- </div>
- </a>
- </div>
- </div>
- {% endfor %}
- </div>
- {% else %}
- <h5>You have no playlists ;-;</h5>
- {% endif %}
- <br>
- <h3><span style="border-bottom: 3px #ffffff dashed;">Recently Accessed</span></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">
- <a style="background-color: #357779;" 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">
- {% if playlist.description %}
- {{ playlist.description|truncatewords:"15" }}
- {% else %}
- No description
- {% 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>
- <span class="badge bg-secondary rounded-pill">{{ playlist.num_of_accesses }} clicks </span>
- </small>
- </div>
- </a>
- </div>
- </div>
- {% endfor %}
- </div>
- {% else %}
- <h5>You have no playlists ;-;</h5>
- {% endif %}
- <br>
- <h3><span style="border-bottom: 3px #ffffff dashed;">Recently Added</span></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">
- <a style="background-color: #958a44;" 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">
- {% if playlist.description %}
- {{ playlist.description|truncatewords:"15" }}
- {% else %}
- No description
- {% 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>
- <span class="badge bg-secondary rounded-pill">{{ playlist.num_of_accesses }} clicks </span>
- </small>
- </div>
- </a>
- </div>
- </div>
- {% endfor %}
- </div>
- {% else %}
- <h5>You have no playlists ;-;</h5>
- {% endif %}
- <br>
- {% endif %}
- {% endblock %}
|