Fixed some issues and implemented a final screen
authorGeorgios Atheridis <georgios@atheridis.org>
Sun, 22 Jan 2023 19:57:38 +0000 (19:57 +0000)
committerGeorgios Atheridis <georgios@atheridis.org>
Sun, 22 Jan 2023 19:57:38 +0000 (19:57 +0000)
core/core/settings.py
core/manager/templates/manager/final.html
core/static/main.css
core/templates/base.html

index 2d18b5f7f753c74622c28522089cac6da2fe16ab..e9ed0069f41f5f8fa53a40fc666903fdb0ebce92 100644 (file)
@@ -164,4 +164,5 @@ ACCOUNT_EMAIL_VERIFICATION = "none"
 ACCOUNT_LOGOUT_ON_GET = False
 ACCOUNT_UNIQUE_EMAIL = False
 ACCOUNT_AUTHENTICATED_LOGIN_REDIRECT = True
+LOGIN_REDIRECT_URL = "/"
 SOCIALACCOUNT_DISCONNECT_REDIRECT_URL = "/"
index e3f4e82555a5579a7761318efc5dabfedbf56ee7..846ee33bc94ef5adb5fd47eb79eefaef8efbda46 100644 (file)
@@ -1,7 +1,81 @@
 {% extends 'base.html' %}
 {% block content %}
-{% for video in videos %}
-{{ video.rank }}
-{% endfor %}
+<table id="final-ranks">
+    <tr>
+        <th>Rank 5</th>
+        {% for video in videos %}
+        {% if video.rank == 5 %}
+        <td>
+            <iframe
+                    src="https://clips.twitch.tv/embed?clip={{ video.id }}&parent=localhost"
+                    height="180"
+                    width="320"
+                    allowfullscreen>
+            </iframe>
+        </td>
+        {% endif %}
+        {% endfor %}
+    </tr>
+    <tr>
+        <th>Rank 4</th>
+        {% for video in videos %}
+        {% if video.rank == 4 %}
+        <td>
+            <iframe
+                    src="https://clips.twitch.tv/embed?clip={{ video.id }}&parent=localhost"
+                    height="180"
+                    width="320"
+                    allowfullscreen>
+            </iframe>
+        </td>
+        {% endif %}
+        {% endfor %}
+    </tr>
+    <tr>
+        <th>Rank 3</th>
+        {% for video in videos %}
+        {% if video.rank == 3 %}
+        <td>
+            <iframe
+                    src="https://clips.twitch.tv/embed?clip={{ video.id }}&parent=localhost"
+                    height="180"
+                    width="320"
+                    allowfullscreen>
+            </iframe>
+        </td>
+        {% endif %}
+        {% endfor %}
+    </tr>
+    <tr>
+        <th>Rank 2</th>
+        {% for video in videos %}
+        {% if video.rank == 2 %}
+        <td>
+            <iframe
+                    src="https://clips.twitch.tv/embed?clip={{ video.id }}&parent=localhost"
+                    height="180"
+                    width="320"
+                    allowfullscreen>
+            </iframe>
+        </td>
+        {% endif %}
+        {% endfor %}
+    </tr>
+    <tr>
+        <th>Rank 1</th>
+        {% for video in videos %}
+        {% if video.rank == 1 %}
+        <td>
+            <iframe
+                    src="https://clips.twitch.tv/embed?clip={{ video.id }}&parent=localhost"
+                    height="180"
+                    width="320"
+                    allowfullscreen>
+            </iframe>
+        </td>
+        {% endif %}
+        {% endfor %}
+    </tr>
+</table>
 {% endblock %}
 
index ce7fdb5088d4650e1cae4499d4e4db59a81f1df9..4ca4565b70999c3f9033b3d538354d1d1f194857 100644 (file)
@@ -50,9 +50,12 @@ button.btn:focus {
     padding: 16px;
     text-decoration: none;
     display: block;
-
 }
 
+button.btn:active {
+    background-color: #222;
+    color: #eee;
+}
 
 
 a.btn {
@@ -65,6 +68,11 @@ a:hover.btn {
     background-color: #ddd;
     color: black;
 }
+a:active.btn {
+    background-color: #222;
+    color: #eee;
+}
+
 
 .btn-bot {
     position: absolute;
@@ -126,3 +134,9 @@ a:hover.btn {
     background-color: #EEEEEE;
 }
 
+
+.rank-btn:active {
+    background-color: #111111;
+    color: #DDD;
+}
+
index cda10b36e91609e0a1549e3f3b3285c510c68975..d786b0370d4faf85f53af446bbf14f60cee664f0 100644 (file)
     <body>
         <div class="sidenav">
             <a class="btn" href="{% url 'index' %}">Home</a>
-            {% if user.is_authenticated %}
+            {% if user.is_superuser %}
             <a class="btn" href="{% url 'show' 1 %}">Rank</a>
             {% endif %}
             {% if user.is_superuser %}
                 <a class="btn" href="{% url 'admin:index' %}">Admin</a>
             {% endif %}
+            {% if user.is_superuser %}
+            <a class="btn" href="{% url 'final' %}">Results</a>
+            {% endif %}
             {% if user.is_authenticated %}
                 <form action="{% url 'account_logout' %}" method="post">
                     {% csrf_token %}