CodeYourFuture / CodeYourFuture/curriculum

Feature: The next class is link

Open
#1,119 1 comment 0 reactions 0 assignees View on GitHub
:gear: good first issue help wanted Hugo lore
Dominant language
HTML
Stars
76
Forks
135
Avg merge
1d 3h
Merged PRs (30d)
20

Description

**Which module(s) and week(s) does this change affect?**
ITP all

**What is the work that needs to be done?**

Replace "Here’s how you find out what to do when" with a partial that computes the next likely day plan and provides a link directly to it

Here's how, I guess

Given we have course data in org-cyf-theme
And this shows duration, frequency, starts, eg
```toml
name="Intro to Programming"
code="itp"
weight=2
menu="start here"
url="https://programming.codeyourfuture.io"
description="Programming with JavaScript, Python, and SQL; collaborate to deliver working software with tests"
emoji="🐣"
days=84
commitment="part time"
frequency=4
starts=[1,4,7,10]
```
And we have the time now `time.Now`

And we add our scheduled modules to a menu called something like, er `scheduled`

Then we should be able to do something like this:

1. Find the day today `$today`
1. Find next Saturday `$nextClass`
1. Range over `starts` and find the last course that is less than or eq the month of next Saturday to set `$currentCourse`
1. Given that each course starts on the first of the month, derive the sprint number we are on now based on the distance between now and the first of the month of `$currentCourse`
1. Range over the items in the menu scheduled and get a slice of all the dayplans in order - the page objects
1. Match the dayplan index to the sprint number to access the `RelPermalink` on the page object

Handle edge cases eg Christmas, but don't spend too long on it BECAUSE this should come from @CodeYourFuture/class-planner-devs API in the future when we have consumable APIs as they already are doing this manual work.

BTW this is just off the top of my head so if you see a better/faster/sweeter way to do this please override me!

**Why is this work important to do?**

Volunteers should prepare, but when they don't let's not disrupt class orienting them -- let's put a link on the front page

**Additional context**

**Who might need to know about this change?**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.