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

Feature: The next class is link #1119

Open
SallyMcGrath opened this issue Oct 24, 2024 · 0 comments
Open

Feature: The next class is link #1119

SallyMcGrath opened this issue Oct 24, 2024 · 0 comments
Labels
⚙️ good first issue Good for newcomers help wanted SDG Hugo lore You need to know Hugo

Comments

@SallyMcGrath
Copy link
Member

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

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
  2. Find next Saturday $nextClass
  3. Range over starts and find the last course that is less than or eq the month of next Saturday to set $currentCourse
  4. 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
  5. Range over the items in the menu scheduled and get a slice of all the dayplans in order - the page objects
  6. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ good first issue Good for newcomers help wanted SDG Hugo lore You need to know Hugo
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant