From eda49b56c11403f4765d549a0fb16c0e6f45c92f Mon Sep 17 00:00:00 2001 From: Nirvik Date: Sat, 27 Mar 2021 16:29:41 +0530 Subject: [PATCH 01/14] add lboard api and fix lboard --- templates/lboard.html | 122 +++++++++++++++++++++--------------------- treasure/views.py | 7 +-- 2 files changed, 64 insertions(+), 65 deletions(-) diff --git a/templates/lboard.html b/templates/lboard.html index 7218517..f79bb43 100644 --- a/templates/lboard.html +++ b/templates/lboard.html @@ -1,78 +1,76 @@ -{%extends 'base.html'%} +{% extends 'base.html' %} -{%block content%} +{% block content %}

Leaderboard


{% if hide %} -

Leaderboard will be active from 10.30 PM, 8th Feb. -

+

Leaderboard will be active from 10.30 PM, 8th Feb. +

{% else %} -
- {% if players %} -
-
-
- {{ second.rank }} -
-
-
- {{ second.name }} -
-
- {{ second.score }} +
+
+
+
+ {{ second.rank }} +
+
+
+ {{ second.name }} +
+
+ {{ second.score }} +
-
-
-
- {{ first.rank }} -
-
-
- {{ first.name }} +
+
+ {{ first.rank }} +
+
+
+ {{ first.name }} +
+
+ {{ first.score }} +
-
- {{ first.score }} -
-
-
-
- 3 -
-
-
- {{ third.name }} -
-
- {{ third.score }} +
+
+ 3 +
+
+
+ {{ third.name }} +
+
+ {{ third.score }} +
- -
-
- {% for player in players %} -
-
- {{ player.rank }} -
-
-
-
- {{ player.name }} -
-
- {{ player.score }} + {% if players %} +
+ {% for player in players %} +
+
+ {{ player.rank }} +
+
+
+
+ {{ player.name }} +
+
+ {{ player.score }} +
+
+ {% endfor %}
-
- {% endfor %} -
- {% else %} - There are no players present. + {% else %} + There are no players present. + {% endif %} {% endif %}
-{% endif %} -
-{%endblock%} \ No newline at end of file +{% endblock %} \ No newline at end of file diff --git a/treasure/views.py b/treasure/views.py index 5dffc37..ecafd45 100644 --- a/treasure/views.py +++ b/treasure/views.py @@ -128,7 +128,7 @@ def lboard(request): players = players[3:] else: players = [] - + print(first, second, third) if request.user.is_authenticated: return render(request, 'lboard.html', {'players': players, 'player': player, 'first': first, 'second': second, 'third': third, 'hide': False}) else: @@ -153,9 +153,10 @@ def lboard_api(request): leaderboard = list() for pl in p: leaderboard.append({ + 'rank': pl.rank, 'name': pl.name, - 'value': str(pl.score), - 'email': pl.user.email + 'email': pl.user.email, + 'score': str(pl.score), }) return JsonResponse(leaderboard, safe=False) From 6bef2a0895029e82701d1b99fbca96f13f03c3ca Mon Sep 17 00:00:00 2001 From: Nirvik Date: Mon, 29 Mar 2021 02:01:10 +0530 Subject: [PATCH 02/14] 2020 -> 2021 --- templates/base.html | 4 ++-- templates/index_page.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/base.html b/templates/base.html index 699c05a..ae9c84f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -73,7 +73,7 @@ {%if user.is_authenticated%} {%endif%}
@@ -110,7 +110,7 @@
From e16f0602d28e68f6f032a50bfe226624fc22be51 Mon Sep 17 00:00:00 2001 From: Nirvik Date: Fri, 2 Apr 2021 20:51:39 +0530 Subject: [PATCH 09/14] unhide leaderboard --- treasure/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/treasure/views.py b/treasure/views.py index 6e4b612..69ba634 100644 --- a/treasure/views.py +++ b/treasure/views.py @@ -130,9 +130,9 @@ def lboard(request): players = [] print(first, second, third) if request.user.is_authenticated: - return render(request, 'lboard.html', {'players': players, 'player': player, 'first': first, 'second': second, 'third': third, 'hide': True}) + return render(request, 'lboard.html', {'players': players, 'player': player, 'first': first, 'second': second, 'third': third, 'hide': False}) else: - return render(request, 'lboard.html', {'players': players, 'first': first, 'second': second, 'third': third, 'hide': True}) + return render(request, 'lboard.html', {'players': players, 'first': first, 'second': second, 'third': third, 'hide': False}) def rules(request): From 09aaa942e6c78ceaa60909e778ec569be45cb926 Mon Sep 17 00:00:00 2001 From: YASHMAROO Date: Fri, 2 Apr 2021 22:57:34 +0530 Subject: [PATCH 10/14] Leaderboard fix --- static/css/base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/css/base.css b/static/css/base.css index 2c1c81a..9ea8a5d 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -455,7 +455,7 @@ td{ .list .item .pos { font-weight: 900; position: absolute; - left: -2rem; + left: -3.5rem; text-align: center; font-size: 1.5rem; width: 1.5rem; From 3734f1e72e7cd5da036208e51060bc951752496a Mon Sep 17 00:00:00 2001 From: YASHMAROO Date: Fri, 2 Apr 2021 23:19:55 +0530 Subject: [PATCH 11/14] Minor fixes to home page --- templates/index_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index_page.html b/templates/index_page.html index abe2b0b..a8623b6 100644 --- a/templates/index_page.html +++ b/templates/index_page.html @@ -47,7 +47,7 @@

Online Treasure Hunt

The exhilaration is - back! Aarohan 2021, brings you another thrilling edition of the Online Trueasure Hunt! Wondering what you need + back! Aarohan 2021, brings you another thrilling edition of the Online Treasure Hunt! Wondering what you need to loot the chest? Patience, a few mugs of coffee, resonably fast internet speed and the most important of all, The Art From 20d685298652b56a6dc6ccf1e45a92f2f62bc220 Mon Sep 17 00:00:00 2001 From: Nirvik Date: Sat, 3 Apr 2021 13:17:54 +0530 Subject: [PATCH 12/14] add footer icon --- templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base.html b/templates/base.html index e4d6457..91a9a21 100644 --- a/templates/base.html +++ b/templates/base.html @@ -112,7 +112,7 @@

From cc63654cd921ceb529128c39b9954ff6c4285d64 Mon Sep 17 00:00:00 2001 From: Nirvik Date: Sat, 3 Apr 2021 22:08:12 +0530 Subject: [PATCH 13/14] add social icons --- templates/base.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/base.html b/templates/base.html index 91a9a21..d9d935e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -110,10 +110,14 @@
From 7b973be88576dee7b1b6eeebe8bfc6b0a1a7da31 Mon Sep 17 00:00:00 2001 From: Nirvik Date: Sun, 4 Apr 2021 18:47:05 +0530 Subject: [PATCH 14/14] game complete msg --- templates/win.html | 5 +++-- treasure/views.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/win.html b/templates/win.html index 673b4a3..d8b9e8b 100644 --- a/templates/win.html +++ b/templates/win.html @@ -3,8 +3,9 @@ {%block content%}
-

Congratulations! - You have found all the treasures.

+ +

Thank You for participating in Online Treaure Hunt.

+

See you again next year!

diff --git a/treasure/views.py b/treasure/views.py index 69ba634..526ca23 100644 --- a/treasure/views.py +++ b/treasure/views.py @@ -24,6 +24,8 @@ def index(request): return render(request, 'timer.html', {'time': config.time}) player = models.player.objects.get(user_id=request.user.pk) + if player.current_level > numlevel: + return render(request, 'win.html', {'player': player}) if player.current_level <= lastlevel: level = models.level.objects.get(l_number=player.current_level) return render(request, 'level.html', {'player': player, 'level': level})