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

Signup teams #210

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Signup teams #210

wants to merge 12 commits into from

Conversation

pnoll1
Copy link
Contributor

@pnoll1 pnoll1 commented May 29, 2018

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.

@@ -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>
Copy link
Contributor Author

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

Copy link
Owner

@eloquence eloquence Jun 4, 2018

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 });
Copy link
Owner

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
Copy link
Owner

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="">
Copy link
Owner

@eloquence eloquence Jun 4, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants