Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tournaments/implement frontend tournament design #349

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

Riyush
Copy link

@Riyush Riyush commented Dec 1, 2023

The following pull request address issue #316. When a user presses the button to join a tournament, they will be redirected to the tournament bracket url. This url shows a visual representation of the tournament. It displays the tournament name, game and all joined users in a visually appealing format. The bracket is built for tournaments of 8 people. Create a tournament and join as a user to test this functionality. There is a seperate page for displaying a winner. Modifications are made to many files and this functionality relies on the join button which is currently in the dev branch. Rafael helped conceptualise the design and Riyush implemented the code.

Copy link
Contributor

@rqueiroz20 rqueiroz20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tournament bracket frontend display looks amazing! I was able to successfully view the tournament bracket when I pressed the join button when logged in as a user. Some things we should address before i approve the PR:

  1. Do we want the tournament to add brackets dynamically based on the maximum number of players in a tournament? I don't think your code currently does that, but we can always leave that feature for future classes.
  2. I don't see the point of the tournament winner HTML and CSS pages since I can't interact with them in this PR. Perhaps moving them to a different PR would be more useful?

Besides those things, this looks great!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my testing and this PR, I don't see how this file is related to pressing the Join button for a tournament. This could perhaps be included in another PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! I will delete the tournament winner html file as that is not directly related to this branch.

@rqueiroz20 rqueiroz20 self-requested a review December 2, 2023 00:21
Copy link
Contributor

@rqueiroz20 rqueiroz20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to go! I was successfully able to view the tournament bracket structure and was able to see multiple people in the bracket view as well. Nicely done!

Copy link
Contributor

@elizabethli31 elizabethli31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sizing of the page looks weird because you are hardcoding by pixels for everything in the CSS which will not accommodate to other computers. This is what I see:
image
My main issue with this PR right now is that it requires 8 players exactly. If it's possible to make a dynamic brackets feature, that would be ideal. But for the purposes of the demo that's okay, just make sure to document that. The brackets themselves look very good - color choice and gradient are nice touches! See my comments for more detailed changes.

@@ -27,6 +27,8 @@
# placeholder game
path("lobby/<int:pk>/coinflip", views.coin_flip_game, name="placeholder-game"),
path("lobby/<int:pk>/flipresult", views.check_guess, name="flip-result"),
# tournament bracket display
path("tournament-bracket/<int:tournament_id>/", views.TournamentBracketView.as_view(), name="tournament-bracket"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL should be something like tournament/id/bracket to match the other paths

@@ -414,6 +421,30 @@ def check_guess(request, pk):
)


class TournamentBracketView(TemplateView):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to see the bracket view as a button somewhere on the detail view, so users can access it

<div class="text-wrapper">
{% if players.1 %}{{ players.1.username }}{% endif %}
</div>
<div class="text-wrapper-2">0</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 should not be hardcoded. Do something to get whether that player has won the match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

3 participants