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

Add support for fall 2021 schedule #311

Merged
merged 7 commits into from
Sep 29, 2021
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
6 changes: 3 additions & 3 deletions public/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ p#large_clock_period {
}
#lunch_range {
-webkit-appearance: none;
width: 100px;
width: 157.5px;
height: 34px;
border-radius: 17px;
background: var(--gray3-to-white);
Expand Down Expand Up @@ -988,9 +988,9 @@ p#large_clock_period {
top: -44px;
height: 0px;
pointer-events: none;
letter-spacing: 2em;
letter-spacing: 1.75em;
text-align: center;
left: 25px;
left: 22px;
}

.unselectable {
Expand Down
6 changes: 3 additions & 3 deletions public/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ <h3 id="import_modal_title">Import Data</h3>
</div>
<div>
<p>Lunch:</p>
<input type="range" min="0" max="1" value="0" id="lunch_range" onchange="update_lunch()" class="unselectable">
<p id="lunch_label" class="unselectable">AB</p>
<input type="range" min="0" max="2" value="0" id="lunch_range" onchange="update_lunch()" class="unselectable">
<p id="lunch_label" class="unselectable">ABC</p>
</div>
<div style="margin-left: auto; align-self: center;">
<a href="https://drive.google.com/file/d/1KY24FxyA_g_t3CGIeAzFD14g2t5I8HG5/view" target="_blank">More information about schedules in May/June 2021</a>
<a href="https://drive.google.com/file/d/12Xbk-tNsQvIsS5_Ty4eVJPHRQAow6tjI/view" target="_blank">CRLS Bell Schedule 2021-2022</a>
</div>
</div>
<div id="scheduleTable"></div>
Expand Down
26 changes: 17 additions & 9 deletions public/js/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ logo = document.getElementById("logo");

// Controls whether to use the covid-19 schedule or the regular schedule
const covid_schedule = true;
let current_schedule = covid_schedule ? "covid-may" : "regular";
let current_schedule = covid_schedule ? "2021fa" : "regular";
// For covid-19 schedule
let selected_day_of_week = -1;
let day_of_week;
Expand Down Expand Up @@ -198,19 +198,27 @@ function get_lunch(p3room, p3id) {
return "a";
}

// War Memorial and remote teachers are lunch B
// War Memorial is lunch C
if (isNaN(parseInt(p3room))) {
return "b";
return "c";
}

const floor = parseInt(p3room[0]);
const zone = parseInt(p3room[1]);

if (floor <= 4 && zone < 6) {
// Rindge building floors 0 to 4
// Arts building is lunch C
if (zone == 6) {
return "c";
}

// Rindge building floors 1 and 2 are lunch A
if (floor <= 2) {
return "a";
}
// Rindge building floors 3, 4, 5 are lunch C if science, lunch B otherwise
if (p3id.startsWith("S")) {
return "c";
} else {
// Rindge building floor 5 and arts building
return "b";
}
}
Expand Down Expand Up @@ -243,7 +251,7 @@ function get_period_name(default_name, day_of_week) {

// Update slider
document.querySelector("#lunch_range").value =
["a", "b"].indexOf(lunch);
["a", "b", "c"].indexOf(lunch);

break;
}
Expand All @@ -263,9 +271,9 @@ function get_period_name(default_name, day_of_week) {

// Determine which covid schedule to use
if (day_of_week === 3) {
current_schedule = `covid-may-w${suffix || ""}`;
current_schedule = `2021fa-w${suffix || ""}`;
} else {
current_schedule = `covid-may${suffix || ""}`;
current_schedule = `2021fa${suffix || ""}`;
}
} else {
bs_day = document.getElementById("schedule_title").innerHTML
Expand Down
Loading