-
Notifications
You must be signed in to change notification settings - Fork 13
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
Signup teams #210
base: main
Are you sure you want to change the base?
Signup teams #210
Conversation
…e cookie is not setting on registration post
@@ -29,6 +29,18 @@ | |||
<input id="email" name="email" type="text" data-auto-trim placeholder="{{{__ "enter email"}}}" value="{{formValues.email}}" size="30" class="pure-input-1 login-form-input"> | |||
</div> | |||
|
|||
{{#if signupTeamsTransfer}} | |||
<div class="pure-control-group"> | |||
<h4>Teams suggested by invite link, check box to join</h4> |
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.
May need to add explanation or link to explanation of what teams are.
Via Eloquence: text will need to be internationalized before merge
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.
If you pass the full team objects along, you can access the internationalized team names via {{{mlString this.name}}}
inside the {{#each}}
loop.
for (let i = 0; i < signupTeamsArray.length; i++) { | ||
let team = slugs.resolveAndLoadTeam(req, res, signupTeamsArray[i]) | ||
.then(result => { | ||
validSignupTeams.push({ 'team': result.canonicalSlugName }); |
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.
You can just push the team objects themselves into a plain array. That way, you can access slug, label and ID later.
In the template, you can loop through a plain array via {{#each}}
and access each team's properties via this
.
scripts: ['register.js'], | ||
inviteCode: code, | ||
signupLanguage: req.query.signupLanguage || req.body.signupLanguage, | ||
signupTeamsTransfer: validSignupTeams |
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.
Let's just call it signupTeams
again.
<h4>Teams suggested by invite link, check box to join</h4> | ||
{{#each signupTeamsTransfer}} | ||
<label for="checkbox-option-{{team}}" class="pure-checkbox"> | ||
<input id="checkbox-option-{{team}}" type="checkbox" value=""> |
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.
I would suggest setting the boxes to checked
state. Also be sure to set the name
for the input, not just the ID, so the field is submitted under that name.
Adding support for signup teams on registration page. A query appended on registration url of form ?signupTeams=validTeam will render a checkbox labeled validTeam for each team in query. Once user submits registration, they will be added to each team they selected.