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

1113 Register must include location and made available to local leaders #1279

Merged
merged 9 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion common-theme/layouts/_default/day-plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@
<time-stamper start-time="{{$startTime}}">
<div class="c-block__series c-block__series--timeline">
{{ if ne .Params.noRegister true }}
{{ partial "register-attendance.html" (dict "course" site.Title "module" $.Page.CurrentSection.Parent.Title "day" $.Page.CurrentSection.Title) }}
{{ $moduleSection := $.Page.CurrentSection }}
SallyMcGrath marked this conversation as resolved.
Show resolved Hide resolved
{{/* Most of our modules have two levels of hierarchy - course > module > sprint. But some go straight course > sprint or module > sprint - allow opting into this with a param. */}}
{{ $parentsToTraverseToModule := $moduleSection.Params.parentsToTraverseToModule }}
SallyMcGrath marked this conversation as resolved.
Show resolved Hide resolved
{{ if eq $parentsToTraverseToModule nil }}
{{ $parentsToTraverseToModule = 1 }}
{{ end }}
{{ range seq $parentsToTraverseToModule }}
{{ $moduleSection = $moduleSection.Parent }}
{{ end }}
{{ partial "register-attendance.html" (dict "course" site.Title "module" $moduleSection.Title "day" $.Page.CurrentSection.Title) }}
{{ end }}
{{ range $index, $block := .Params.blocks }}

Expand Down
18 changes: 13 additions & 5 deletions common-theme/layouts/partials/register-attendance.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
{{ $module := .module }}
{{ $day := .day | urlize}}

{{ $orgData := index site.Data.courses $course }}
{{ $locations := $orgData.locations }}

{{/* if any of these params are null, error */}}
{{ if or (not $course) (not $module) (not $day) }}
{{ errorf "register must go on a day plan and capture course, module, and day correctly" }}
Expand All @@ -37,15 +40,20 @@ <h2 class="c-block__title e-heading__2" id="register">
<input type="hidden" name="module" value="{{ $module }}">
<input type="hidden" name="day" value="{{ $day }}">
<input type="hidden" name="buildTime" value="{{ now.Format "2006-01-02T15:04:05" }}">
<div><label for="givenName" class="is-invisible">Given Name</label>
<input type="text" name="givenName" id="givenName" autocomplete="given-name" placeholder="Given Name" required>
</div>
<div><label for="familyName" class="is-invisible">Family Name</label>
<input type="text" name="familyName" id="familyName" autocomplete="family-name" placeholder="Family Name" required>
<div><label for="name" class="is-invisible">Name</label>
<input type="text" name="name" id="name" autocomplete="name" placeholder="Name" required>
</div>
<div><label for="email" class="is-invisible">Email</label>
<input type="email" name="email" id="email" autocomplete="email" placeholder="Email" required>
</div>
{{ with $locations }}
<div><label for="location" class="is-invisible">Location</label>
<input list="locations" name="location" id="location" autocomplete="location" placeholder="Location" required>
<datalist id="locations">
{{ range . }}<option value="{{.}}"></option>{{ end }}
</datalist>
</div>
{{ end }}
<button class="e-button">Register</button>
</form>
</section>
Expand Down
1 change: 1 addition & 0 deletions org-cyf-itp/content/welcome/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ layout = 'module'
emoji= '🫶🏽'
menu = ['syllabus', 'course schedule']
weight='1'
parentsToTraverseToModule = 0
+++
2 changes: 1 addition & 1 deletion org-cyf-itp/hugo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title = "CYF ITP"
title = "ITP"
baseURL = "https://programming.codeyourfuture.io/"

[module]
Expand Down
5 changes: 3 additions & 2 deletions org-cyf-itp/tooling/netlify/functions/submission-created.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {Auth, google} from "googleapis";
// Each spreadsheet must also give write access to the email listed below in CREDENTIALS.
const COURSE_TO_SPREADSHEET_ID = {
"cyf-itp": "1YHKPCCN55PJD-o1jg4wbVKI3kbhB-ULiwB5hhG17DcA",
"cyf-piscine": "1XabWuYqvOUiY7HpUra0Vdic4pSxmXmNRZHMR72I1bjk",
};

const CREDENTIALS = {
Expand Down Expand Up @@ -47,7 +48,7 @@ const handler = async (event, context) => {
}
const request = body.payload.data;

for (const requiredField of ["course", "module", "givenName", "familyName", "email", "day", "buildTime"]) {
for (const requiredField of ["course", "module", "name", "email", "day", "location", "buildTime"]) {
if (!(requiredField in request)) {
const error = `Request missing field ${requiredField}`;
console.error(error, request);
Expand Down Expand Up @@ -83,7 +84,7 @@ const handler = async (event, context) => {
insertDataOption: "INSERT_ROWS",
resource: {
values: [
[request.givenName, request.familyName, request.email, new Date().toISOString(), request.course, request.module, request.day, request.buildTime],
[request.name, request.email, new Date().toISOString(), request.course, request.module, request.day, request.location, request.buildTime],
],
},
});
Expand Down
12 changes: 12 additions & 0 deletions org-cyf-piscine/content/sprints/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
+++
title = 'Piscine'
description = 'In teams and on your own, build working software with tests. Explain your work to others.'
layout = 'module'
emoji= '🐠'
menu = ['syllabus', 'next steps']
menus_to_map=['entry', 'sprints', 'assessment']
[build]
render = "never"
list = "local"
publishResources = false
+++
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ menu="selection"
url="https://piscine.codeyourfuture.io/"
days="22"
commitment="part time"
frequency=4
frequency=3
locations=["Birmingham", "Capetown", "Glasgow", "London", "Manchester", "Online", "Sheffield"]
1 change: 1 addition & 0 deletions org-cyf-theme/data/courses/itd.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ description="Meet the world of tech: write a CV with AI; evaluate data in spread
days=30
commitment="part time"
frequency=6
locations=["Birmingham", "Capetown", "Glasgow", "London", "Manchester", "Online", "Sheffield"]
3 changes: 2 additions & 1 deletion org-cyf-theme/data/courses/itp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ description="Programming with JavaScript, Python, and SQL; collaborate to delive
emoji="🐣"
days=84
commitment="part time"
frequency=4
frequency=3
locations=["Birmingham", "Capetown", "Glasgow", "London", "Manchester", "Online", "Sheffield"]
3 changes: 2 additions & 1 deletion org-cyf-theme/data/courses/launch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ description="In a cross functional Agile team, develop and deliver a real produc
emoji="🚀"
commitment="part time"
days=35
frequency=4
frequency=4
locations=["Online"]
3 changes: 2 additions & 1 deletion org-cyf-theme/data/courses/sdc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ weight=4
description="A secure grounding in software: binary, logic, systems, and problem solving"
days="84"
commitment="part time"
frequency=3
frequency=3
locations=["Birmingham", "Capetown", "Glasgow", "London", "Manchester", "Online", "Sheffield"]
3 changes: 2 additions & 1 deletion org-cyf-theme/data/courses/systems.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ description="An immersive, full time, systems engineering programme"
url="https://systems.codeyourfuture.io/"
menu="fellowships"
days=260
commitment="full time"
commitment="full time"
locations=["Online"]
Loading