diff --git a/SETUP.md b/SETUP.md index 0547a93..ae78718 100644 --- a/SETUP.md +++ b/SETUP.md @@ -22,8 +22,8 @@ get_random_secret_key() ** ** * Now open TWT/settings.py and turn `DEBUG = True` -* Open TWT/discord.py and edit the guild_id in lines 79, 82, 85 according to your server -* edit all the role ids in lines 89-95 +* Open TWT/discord.py and edit the guild_id in lines 101, 104, 110 according to your server +* edit all the role ids in lines 118-123 ** ** * `Now run python manage.py makemigrations` @@ -49,4 +49,4 @@ get_random_secret_key() ![sc](https://cdn.discordapp.com/attachments/759043214153089043/761866434627895296/unknown.png) ##### You should select them and transfer -If you have problems in setting up please post in [#Code-jam-website](https://discordapp.com/channels/501090983539245061/763445637441519646/) +If you have problems in setting up please post in [#contrib-general](https://discord.com/channels/501090983539245061/795982206085890078) diff --git a/TWT/apps/timathon/views/view_team.py b/TWT/apps/timathon/views/view_team.py index f332849..da9e66f 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,20 @@ 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 + + votes = Vote.objects.filter(submission=team_submission) + + context['avg_1'] = sum(map(lambda x: x.c1, votes)) / len(votes) + context['avg_2'] = sum(map(lambda x: x.c2, votes)) / len(votes) + context['avg_3'] = sum(map(lambda x: x.c3, votes)) / len(votes) + context['avg_4'] = sum(map(lambda x: x.c4, votes)) / len(votes) + + context['total_score'] = context['avg_1'] + context['avg_2'] + context['avg_3'] + context['avg_4'] + context['votes'] = votes except: pass print(context["challenge"].submissions_status) diff --git a/TWT/static/css/index.css b/TWT/static/css/index.css index 33c6cd7..dd18a8b 100644 --- a/TWT/static/css/index.css +++ b/TWT/static/css/index.css @@ -1,3 +1,4 @@ +@import url('https://fonts.googleapis.com/css2?family=Rubik&display=swap'); .navigation-clean-button.navbar-light .navbar-nav .nav-link:hover { color: #fff; } @@ -7,7 +8,19 @@ background-color: #fff; margin-top: 100px; } - +strong{ + color: #FF7746; + font-weight: bold; +} +.fill-button{ + box-shadow: inset 0 0 0 0 #FF7746; + -webkit-transition: ease-out 0.4s; + -moz-transition: ease-out 0.4s; + transition: ease-out 0.4s; +} +.fill-button:hover{ + box-shadow: inset 400px 0 0 0 #FF7746 +} .brands a { display: block; text-align: center; diff --git a/TWT/static/css/timathonTeam.css b/TWT/static/css/timathonTeam.css index 760b22b..18cc79a 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,36 @@ 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 screen and (max-width: 768px){ .members-card{ flex: 1; @@ -130,4 +162,3 @@ padding: 10px; } - diff --git a/TWT/templates/challenges/index.html b/TWT/templates/challenges/index.html index b7ab3ab..c76b398 100644 --- a/TWT/templates/challenges/index.html +++ b/TWT/templates/challenges/index.html @@ -27,10 +27,10 @@

Timathon

CODE JAMS

-


Timathon is a code jam hosted every 2 months, each consisting of a different theme and allowing yourself to put your skills to the test.


Prizes:
For our code jams, you're in for a chance to win real cash prizes.
(USD) $150$100 and $50 will be split amongst the winning teams.

All top 5 teams, along with the winner and runner up of the category "Best project hosted on replit", will receive a 3 month Replit hacker plan (for the whole team)!

+


Timathon is a code jam hosted every 2 months, each consisting of a different theme and allowing yourself to put your skills to the test.


Prizes:
For our code jams, you're in for a chance to win real cash prizes.

(USD) $150$100 and $50 will be split amongst the winning teams.

All top 5 teams, along with the winner and runner up of the category "Best project hosted on replit", will receive a 3 month Replit hacker plan (for the whole team)!

View Timathon - Timathon History + Timathon History
@@ -80,7 +80,7 @@

{{ team.name }}

Discord

-

Join our discord server where you can participate in weekly challenges, talk with other programmers, ask for help and more!

+

Join our discord server where you can participate in weekly challenges, talk with other programmers, ask for help and more!

Join Server
diff --git a/TWT/templates/timathon/view_team.html b/TWT/templates/timathon/view_team.html index 9a28b47..b5aefca 100644 --- a/TWT/templates/timathon/view_team.html +++ b/TWT/templates/timathon/view_team.html @@ -59,6 +59,46 @@
{{ submission.description }}
{% endif %} + + {% if not challenge.voting_status and votes and user in team.members.all %} +

Marks Breakdown

+ + + + + + + + + {% for vote in votes %} + + + + + + + + {% endfor %} +
C1C2C3C4Notes
{{ vote.c1 }}{{ vote.c2 }}{{ vote.c3 }}{{ vote.c4 }}{{ vote.notes }}
+ + + + + + + + +
+ + + + + + + +
Avg C1Avg C2Avg C3Avg C4Total Score
{{ avg_1 }}{{ avg_2 }}{{ avg_3 }}{{ avg_4 }}{{ total_score }}
+ {% endif %} +