-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implementing self-selected game #144
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
0c24fe3
First attempt at self-selected
FedericoDM 2d68382
Adding players to game
FedericoDM 0ffd0f9
Linting
FedericoDM 9f019d0
Merge branch 'main' of github.com:prijatelilab/PrijateliTree into sel…
FedericoDM 7e2c05b
Adding self selected constant
FedericoDM fcd2688
Filtering for when names are not hidden
FedericoDM 5bdf1a1
Some changes for new table
FedericoDM 962de79
Adding relationships
FedericoDM aa84c95
Slight typo
FedericoDM 7051948
Linting
FedericoDM aafe62b
Migration file added
FedericoDM dcab547
Linting and adding template for function
FedericoDM fa0691d
Adding base html template for choosing neighbors
FedericoDM cd774bb
Progress in form
FedericoDM 6778ef4
Progress in both template and route
FedericoDM 88d1462
If condition in template
FedericoDM 0101ec8
URL typo fix
FedericoDM a6e5a15
Reformat
FedericoDM e7c8bee
Adding bottom margin
FedericoDM 13a80a9
Trying to get form to display student names
FedericoDM 75436e8
Games show succesfully
FedericoDM 0438201
Temporary place-holder for route
FedericoDM 7240aa7
Trying to get post to work
FedericoDM e8f4216
First attempt to add helper script
FedericoDM e9af871
Post now works
FedericoDM 02ea70d
Testing to see if neighbors are added to the new table
FedericoDM a7431d5
Testing endpoint
FedericoDM 2b0d246
Filtering by game
FedericoDM a915389
Adding to DB
FedericoDM 6ad7b61
Post succesful to db
FedericoDM d5d4b56
When choosing neighbors, redirect to waiting page
FedericoDM 9e7f294
Condition for self-selected game
FedericoDM cea7b23
Adding template for self-selected-intro
FedericoDM 5e08420
Condition to redirect
FedericoDM fcdf453
edits
FedericoDM 372ef1d
Aesthetic edits
FedericoDM b426fc4
Querying network
FedericoDM 17ed5d3
Pending to work on getting answers and names from neighbors
FedericoDM 7210052
Adding mechanism to get previous answers
FedericoDM 92f09f2
Adding javascript for error logging
FedericoDM e773a2d
Correct redirect to route and linting
FedericoDM cbab967
Removing own student from possible neighbors
FedericoDM 33caab2
Adding condition to advance to round after choosing neighbors
FedericoDM 4a79641
Neighbors' answers displayed correctly
FedericoDM 56922e8
Merge branch 'main' of github.com:prijatelilab/PrijateliTree into sel…
FedericoDM 0f69aa7
Linting
FedericoDM c30e8af
Linting
FedericoDM 87dc5f9
Merging main into self-selected-game
FedericoDM 185a5e6
refactor code, change order of self-selected game
anisfeld 476446d
Merge branch 'main' into self-selected-game
anisfeld 5eef785
lint
anisfeld 6c2652f
we need real_game_transition
anisfeld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% extends "base.html" %} | ||
{% block title %} | ||
PrijateliTree - Choose Neighbors | ||
{% endblock title %} | ||
{% block helper_script %} | ||
<script> | ||
fetch('{{ url_for("create_session") }}', { | ||
method: 'POST', | ||
body: formData | ||
}) | ||
.then(resp => { | ||
window.location.href = resp.url | ||
}) // or, resp.text(), etc | ||
.catch(error => { | ||
console.error(error); | ||
}); | ||
function cleanParams() { | ||
// Used to clear the URL of parameters after the banner alert is closed. | ||
window.history.replaceState(null, '', window.location.pathname); | ||
} | ||
</script> | ||
{% endblock helper_script %} | ||
{% block content %} | ||
{% if error %} | ||
<div class="alert alert-danger alert-dismissible fade show" role="alert"> | ||
<strong>ERROR:</strong> {{ error }} | ||
<button type="button" | ||
class="btn-close" | ||
data-bs-dismiss="alert" | ||
aria-label="Close" | ||
onclick="cleanParams()"></button> | ||
</div> | ||
{% endif %} | ||
<div class="container-sm general-container"> | ||
<h3 style="margin-bottom: 40px;"> | ||
{{ text.different_game_choices.please_choose_players | replace('{X}', num_neighbors) }} | ||
</h3> | ||
<div class="row justify-content-center"> | ||
<!-- Added row and justify-content-center classes --> | ||
<div class="col-sm-4"> | ||
<form method="post" | ||
action='{{ url_for("add_neighbors", game_id=game_id, player_id=player_id) }}'> | ||
<div class="mb-3 row"> | ||
<label for="pos-one" class="col-sm-4 form-label">{{ text.util.player }} 1</label> | ||
<div class="col-sm-8"> | ||
<select id="pos-one" class="form-select form-select-sm" name="player_one"> | ||
{% for s in students|sort(attribute='last_name') %}<option value="{{ s.id }}">{{ s.name_str }}</option>{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<label for="pos-two" class="col-sm-4 form-label">{{ text.util.player }} 2</label> | ||
<div class="col-sm-8"> | ||
<select id="pos-two" class="form-select form-select-sm" name="player_two"> | ||
{% for s in students|sort(attribute='last_name') %}<option value="{{ s.id }}">{{ s.name_str }}</option>{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
{% if num_neighbors > 2 %} | ||
<div class="mb-3 row"> | ||
<label for="pos-three" class="col-sm-4 form-label">{{ text.util.player }} 3</label> | ||
<div class="col-sm-8"> | ||
<select id="pos-three" class="form-select form-select-sm" name="player_three"> | ||
{% for s in students|sort(attribute='last_name') %}<option value="{{ s.id }}">{{ s.name_str }}</option>{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
{% endif %} | ||
<button type="submit" class="btn btn-primary float-end">{{ text.ready_to_play.im_ready }}</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a future issue called "Display errors to users during self-selected network". Include notes about the challenges you faced and our goal for the issue.