Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Commit 57950b1

Browse files
committed
feat: add buttons for creating lesson plans and worksheets, and back to top functionality
1 parent bee67be commit 57950b1

3 files changed

Lines changed: 72 additions & 6 deletions

File tree

src/pages/library/library.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ <h6>Kuriki Library</h6>
6262
<h6>Library</h6>
6363
<div>The Living Library</div>
6464
</div>
65+
66+
<button class="chip vertical" id="create-lesson-plan-button">
67+
<i>add_notes</i>
68+
<span class="l m">Create Lesson Plan</span>
69+
<div class="s tooltip left">
70+
Create Lesson Plan
71+
</div>
72+
</button>
73+
<button class="chip vertical" id="create-worksheet-button">
74+
<i>assignment_add</i>
75+
<span class="l m">Create Worksheet</span>
76+
<div class="s tooltip left">
77+
Create Worksheet
78+
</div>
79+
</button>
6580
</nav>
6681

6782
<div class="fixed center middle small-width small-height" id="loading-indicator">
@@ -93,6 +108,11 @@ <h6>Library</h6>
93108
<div class="grid" id="library">
94109
</div>
95110
</main>
111+
112+
<button class="fixed bottom right margin circle extra" id="back-to-top-button">
113+
<i>arrow_upward</i>
114+
<span>Back to Top</span>
115+
</button>
96116
</body>
97117

98118
</html>

src/pages/library/library.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { LessonRecord, LessonsAPI } from "@api/lessons-api";
77
import { LessonCard } from "@components/lesson/card-element";
88
import { LessonList } from "@components/lesson/list-element";
99
import { debounce } from "@utils/debounce";
10+
import { builtInTemplates } from "@models/lesson-template";
11+
import { WorksheetsAPI } from "@api/worksheets-api";
1012

1113
type ViewMode = "grid" | "list";
1214

@@ -113,4 +115,48 @@ document.addEventListener("DOMContentLoaded", async () => {
113115

114116
gridButton.addEventListener("click", () => setView("grid"));
115117
listButton.addEventListener("click", () => setView("list"));
118+
119+
const backToTopButton = document.getElementById("back-to-top-button") as HTMLButtonElement;
120+
backToTopButton.addEventListener("click", () => window.scrollTo(0, 0));
121+
122+
const createLessonPlanButton = document.getElementById("create-lesson-plan-button") as HTMLButtonElement;
123+
createLessonPlanButton.addEventListener("click", async () => {
124+
const idKey = Number(new Date().getTime().toString());
125+
126+
const lessonData = {
127+
topic: "",
128+
name: "",
129+
author: localStorage.getItem("authorName") || "Anonymous",
130+
gradeLevel: "",
131+
date: new Date().toISOString(),
132+
timeLength: "~ 1 hour",
133+
teacherNotes: "",
134+
curricularOutcomes: [],
135+
resourceLinks: [],
136+
assessmentEvidence: [],
137+
notes: builtInTemplates[0]!.markdown,
138+
};
139+
140+
await LessonsAPI.post(idKey, lessonData, []);
141+
window.open(`/lesson.html?id=${idKey}`, "_blank");
142+
});
143+
144+
const createWorksheetButton = document.getElementById("create-worksheet-button") as HTMLButtonElement;
145+
createWorksheetButton.addEventListener("click", async () => {
146+
const idKey = Number(new Date().getTime().toString());
147+
148+
const worksheetData = {
149+
topic: "",
150+
name: "",
151+
author: localStorage.getItem("authorName") || "Anonymous",
152+
gradeLevel: "",
153+
date: new Date().toISOString(),
154+
teacherNotes: "",
155+
curricularOutcomes: [],
156+
blocks: []
157+
};
158+
159+
await WorksheetsAPI.post(idKey, worksheetData, []);
160+
window.open(`/worksheet.html?id=${idKey}`, "_blank");
161+
});
116162
});

src/pages/manitoba_global_compentencies/manitoba_global_compentencies.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,27 @@ <h6 class="s">Competencies</h6>
6262
<main class="responsive">
6363
<div>
6464
<div class="tabs scroll left-align">
65-
<a class="active" data-ui="#critical-thinking">
65+
<a class="vertical active" data-ui="#critical-thinking">
6666
<i>psychology</i>
6767
<span>Critical Thinking</span>
6868
</a>
69-
<a data-ui="#creativity">
69+
<a class="vertical" data-ui="#creativity">
7070
<i>lightbulb</i>
7171
<span>Creativity</span>
7272
</a>
73-
<a data-ui="#citizenship">
73+
<a class="vertical" data-ui="#citizenship">
7474
<i>gavel</i>
7575
<span>Citizenship</span>
7676
</a>
77-
<a data-ui="#connection-to-self">
77+
<a class="vertical" data-ui="#connection-to-self">
7878
<i>self_improvement</i>
7979
<span>Connection to Self</span>
8080
</a>
81-
<a data-ui="#collaboration">
81+
<a class="vertical" data-ui="#collaboration">
8282
<i>groups</i>
8383
<span>Collaboration</span>
8484
</a>
85-
<a data-ui="#communication">
85+
<a class="vertical" data-ui="#communication">
8686
<i>chat</i>
8787
<span>Communication</span>
8888
</a>

0 commit comments

Comments
 (0)