Browse Source

minor ui fixes

sleepytaco 3 years ago
parent
commit
17c01277db

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

@@ -121,7 +121,7 @@
                 {% endif %}
 
             <br>
-            <h3><span style="border-bottom: 3px #ffffff dashed;">Most viewed playlists</span> {% if user_playlists.count > 3 %}<a href="{% url 'all_playlists' 'all' %}" class="pt-1"><i class="fas fa-binoculars"></i> </a>{% endif %}</h3>
+            <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" %}
@@ -201,7 +201,7 @@
             {% endif %}
 
         <br>
-            <h3><span style="border-bottom: 3px #ffffff dashed;">Recently Added</span></h3>
+            <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 %}

+ 5 - 2
apps/users/templates/index.html

@@ -3,6 +3,8 @@
 
 {% load socialaccount %}
 
+{% load static %}
+
 <!doctype html>
 <html lang="en">
   <head>
@@ -37,6 +39,7 @@
       </style>
 
       <link href="https://fonts.googleapis.com/css2?family=Fredoka+One&family=Open+Sans&display=swap" rel="stylesheet">
+        <link href="{% static 'fontawesome-free-5.15.3-web/css/all.min.css' %}" rel="stylesheet">
 
     <!-- Bootstrap core CSS -->
     <link href="https://getbootstrap.com/docs/4.0/dist/css/bootstrap.min.css" rel="stylesheet">
@@ -63,14 +66,14 @@
         <p class="lead">UnTube is a simple Youtube playlist manager. Modify and keep track of your YouTube playlists with ease.</p>
         <p class="lead">
             <br>
-            <a class="btn btn-outline-danger" href="{% provider_login_url 'google' %}">Login with Google</a>
+            <a class="btn btn-danger" href="{% provider_login_url 'google' %}">Login with Google</a>
 
         </p>
       </main>
 
       <footer class="mastfoot mt-auto">
         <div class="inner text-white">
-          <h6>Made with <span style="color: #e25555;">&hearts;</span> in Django</h6>
+          <h5>Made with <i class="fas fa-heart" style="color: #e25555;"></i> & <i class="fas fa-mug-hot" style="color: brown;"></i> in Django</h5>
         </div>
       </footer>
     </div>

+ 15 - 22
apps/users/templates/profile.html

@@ -114,29 +114,22 @@
               </div>
             </div>
             <div class="col-sm-6 mb-3">
-              <div class="card h-100 bg-dark text-white">
+              <div class="card h-100 bg-dark text-white overflow-auto" style="height: 100px;">
                 <div class="card-body">
-                  <h6 class="d-flex align-items-center mb-3"><span class="text-info me-2">23</span>Watching</h6>
-                  <small>Web Design</small>
-                  <div class="progress mb-3" style="height: 5px">
-                    <div class="progress-bar bg-primary" role="progressbar" style="width: 80%" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100"></div>
-                  </div>
-                  <small>Website Markup</small>
-                  <div class="progress mb-3" style="height: 5px">
-                    <div class="progress-bar bg-primary" role="progressbar" style="width: 72%" aria-valuenow="72" aria-valuemin="0" aria-valuemax="100"></div>
-                  </div>
-                  <small>One Page</small>
-                  <div class="progress mb-3" style="height: 5px">
-                    <div class="progress-bar bg-primary" role="progressbar" style="width: 89%" aria-valuenow="89" aria-valuemin="0" aria-valuemax="100"></div>
-                  </div>
-                  <small>Mobile Template</small>
-                  <div class="progress mb-3" style="height: 5px">
-                    <div class="progress-bar bg-primary" role="progressbar" style="width: 55%" aria-valuenow="55" aria-valuemin="0" aria-valuemax="100"></div>
-                  </div>
-                  <small>Backend API</small>
-                  <div class="progress mb-3" style="height: 5px">
-                    <div class="progress-bar bg-primary" role="progressbar" style="width: 66%" aria-valuenow="66" aria-valuemin="0" aria-valuemax="100"></div>
-                  </div>
+                  <h6 class="d-flex align-items-center mb-3"><span class="text-info me-2">{{ watching.count }}</span>Watching</h6>
+                  {% if watching %}
+                        {% for pl in watching|slice:"0:5" %}
+                      <small>{{ pl.name|truncatechars:"40" }} <span class="text-warning ms-1">{{ pl.num_videos_watched }}/{{ pl.video_count }} viewed</span></small>
+                      <div class="progress mb-3" style="height: 5px">
+                        <div class="progress-bar bg-primary" role="progressbar" style="width: 80%" aria-valuenow="{{ pl.num_videos_watched }}" aria-valuemin="0" aria-valuemax="{{ pl.video_count }}"></div>
+                      </div>
+                            {% if forloop.last and watching.count > 5 %}
+                                <a href="{% url 'all_playlists' 'watching' %}" style="color: white; text-decoration: none">+ {{ watching.count|add:"-5" }} more</a>
+                            {% endif %}
+                      {% endfor %}
+                      {% else %}
+                      <h5>Mark something as watching!</h5>
+                    {% endif %}
                 </div>
               </div>
             </div>

+ 4 - 1
apps/users/views.py

@@ -22,6 +22,8 @@ def index(request):
 @login_required
 def profile(request):
     user_playlists = request.user.profile.playlists.all()
+    watching = user_playlists.filter(marked_as="watching")
+
     total_num_playlists = user_playlists.count()
 
     statistics = {
@@ -40,7 +42,8 @@ def profile(request):
         statistics["watching_x"] = round(user_playlists.filter(marked_as="watching").count() / total_num_playlists, 1) * 100
         statistics["imported_x"] = round(user_playlists.filter(is_user_owned=False).count() / total_num_playlists, 1) * 100
 
-    return render(request, 'profile.html', {"statistics": statistics})
+    return render(request, 'profile.html', {"statistics": statistics,
+                                            "watching": watching})
 
 
 @login_required