From 164abed0a8300b0cb7acb2cd9e75f638853eedb0 Mon Sep 17 00:00:00 2001 From: KrishnaKanth1729 Date: Tue, 14 Dec 2021 19:27:00 +0530 Subject: [PATCH 1/5] Added Table for Marks Breakdown in view_team --- TWT/apps/timathon/views/view_team.py | 6 ++-- TWT/static/css/timathonTeam.css | 50 +++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/TWT/apps/timathon/views/view_team.py b/TWT/apps/timathon/views/view_team.py index f332849..0e3a71d 100644 --- a/TWT/apps/timathon/views/view_team.py +++ b/TWT/apps/timathon/views/view_team.py @@ -6,7 +6,7 @@ from django.views import View from random import randint from TWT.apps.challenges.models import Challenge -from TWT.apps.timathon.models import Team +from TWT.apps.timathon.models import Team, Vote from TWT.context import get_discord_context from ..models import Submission @@ -45,9 +45,11 @@ def get_context(self, request: WSGIRequest, team_ID) -> dict: context["challenge"] = team.challenge if team.submitted: try: - context["submission"] = Submission.objects.get( + team_submission = Submission.objects.get( team=team, challenge=team.challenge ) + context["submission"] = team_submission + context["votes"] = Vote.objects.filter(submission=team_submission) except: pass print(context["challenge"].submissions_status) diff --git a/TWT/static/css/timathonTeam.css b/TWT/static/css/timathonTeam.css index 760b22b..7d0671b 100644 --- a/TWT/static/css/timathonTeam.css +++ b/TWT/static/css/timathonTeam.css @@ -1,5 +1,7 @@ + + .team-container { color:#F9F9FA; font-family:Roboto; @@ -114,6 +116,53 @@ padding: 10px; height:auto; } +table{ + color: white; + border: 2px solid red; + margin-left: auto; + margin-right: auto; + border-radius: .5rem; + width: 70vw; +} + +tr{ + border: 2px solid orange; + +} + +th{ + border: 4px solid orange; + font-size: 1.5rem; + text-align: center; + padding: .5rem; +} + +td{ + border: 4px solid orange; + font-size: 1.1rem; + text-align: center; + padding: .5rem; + word-wrap: break-word; +} + +/* @media (max-width: 900px){ + table{ + width: 80vw; + } +} + +@media (max-width: 800px){ + table{ + width: 550px; + } +} + +@media (max-width: 700px) { + table{ + width: 500px; + } +} */ + @media screen and (max-width: 768px){ .members-card{ flex: 1; @@ -130,4 +179,3 @@ padding: 10px; } - From ad7a06e0f8e48d118832c1b30666744db1997fcb Mon Sep 17 00:00:00 2001 From: KrishnaKanth1729 Date: Tue, 14 Dec 2021 19:29:51 +0530 Subject: [PATCH 2/5] Made some changes --- TWT/static/css/timathonTeam.css | 17 ----------------- TWT/templates/timathon/view_team.html | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/TWT/static/css/timathonTeam.css b/TWT/static/css/timathonTeam.css index 7d0671b..18cc79a 100644 --- a/TWT/static/css/timathonTeam.css +++ b/TWT/static/css/timathonTeam.css @@ -145,23 +145,6 @@ td{ word-wrap: break-word; } -/* @media (max-width: 900px){ - table{ - width: 80vw; - } -} - -@media (max-width: 800px){ - table{ - width: 550px; - } -} - -@media (max-width: 700px) { - table{ - width: 500px; - } -} */ @media screen and (max-width: 768px){ .members-card{ diff --git a/TWT/templates/timathon/view_team.html b/TWT/templates/timathon/view_team.html index 9a28b47..5fe3efe 100644 --- a/TWT/templates/timathon/view_team.html +++ b/TWT/templates/timathon/view_team.html @@ -59,6 +59,29 @@
{{ submission.description }}
{% endif %} + + {% if not challenge.voting_status and votes %} +

Marks Breakdown

+ + + + + + + + + {% for vote in votes %} + + + + + + + + {% endfor %} +
C1C2C3C4Notes
{{ vote.c1 }}{{ vote.c2 }}{{ vote.c3 }}{{ vote.c4 }}{{ vote.notes }}
+ {% endif %} +