diff --git a/.gitignore b/.gitignore index ddf68b9..eed5415 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .edrys client/.nuxt client/node_modules -docker-compose.yaml -dist \ No newline at end of file +docker-compose.yaml \ No newline at end of file diff --git a/client/components/Settings.vue b/client/components/Settings.vue index 9259750..c8aeda4 100644 --- a/client/components/Settings.vue +++ b/client/components/Settings.vue @@ -63,6 +63,26 @@ outlined required > + + + + + + @@ -125,7 +145,7 @@ {{ scrapedModules[i].name }} - + {{scrapedModules[i].showInCustom}} @@ -135,7 +155,7 @@ style="white-space: break-spaces" > - + @@ -248,7 +268,7 @@ > - + Station Settings @@ -273,7 +293,7 @@ > - + Show in @@ -289,7 +309,7 @@ > - + @@ -556,7 +576,7 @@ import "prismjs/themes/prism-tomorrow.css"; // import syntax highlighting styles import draggable from "vuedraggable"; function parseClassroom(config) { - let classroom + let classroom; try { classroom = JSON.parse(config); @@ -571,7 +591,7 @@ function parseClassroom(config) { if (classroom) { // guarantees that older modules without a custom show can be loaded for (let module of classroom.modules) { - module.showInCustom = module.showInCustom || module.showIn || "" + module.showInCustom = module.showInCustom || module.showIn || ""; } } @@ -589,6 +609,9 @@ export default { memberTeacher: "", memberStudent: "", className: "", + logo: "", + description: "", + selfAssign: true, saveError: false, modules: [], pageLoading: true, @@ -614,6 +637,11 @@ export default { return { ...this.$store.state.class_, name: this.className, + meta: { + logo: this.logo, + description: this.description, + selfAssign: this.selfAssign, + }, members: { teacher: this.strToList(this.memberTeacher), student: this.strToList(this.memberStudent), @@ -624,7 +652,7 @@ export default { studentConfig: m.studentConfig, teacherConfig: m.teacherConfig, stationConfig: m.stationConfig, - showInCustom: m.showInCustom + showInCustom: m.showInCustom, })), }; }, @@ -643,9 +671,9 @@ export default { async modules() { const scrapedModules = []; for (const m of this.modules) { - let scraped = await this.scrapeModule(m) + let scraped = await this.scrapeModule(m); if (!m.showInCustom) { - m.showInCustom = scraped.shownIn.join(", ") + m.showInCustom = scraped.shownIn.join(", "); } scrapedModules.push(scraped); @@ -705,8 +733,8 @@ export default { const newClass = parseClassroom(res.target.result); if (newClass) { - this.updateState(newClass); - this.restoreSuccess = this.updateState(newClass); + this.updateState(newClass); + this.restoreSuccess = this.updateState(newClass); } else { this.restoreSuccess = false; this.saveError = true; @@ -750,18 +778,21 @@ export default { try { class_ = class_ || this.$store.state.class_; this.className = class_.name; + this.logo = class_?.meta?.logo || ""; + this.description = class_?.meta?.description || ""; + this.selfAssign = class_?.meta?.selfAssign || false; this.memberTeacher = class_.members?.teacher.join("\n") || ""; this.memberStudent = class_.members?.student?.join("\n") || ""; this.modules = [ - ...class_?.modules.map((m) => { + ...class_?.modules.map((m) => { return { ...m, config: yaml.dump(m.config), studentConfig: yaml.dump(m.studentConfig), teacherConfig: yaml.dump(m.teacherConfig), stationConfig: yaml.dump(m.stationConfig), - showInCustom : m.showInCustom + showInCustom: m.showInCustom, }; }), ] || []; diff --git a/client/components/Student.vue b/client/components/Student.vue index 8944b5e..01505c4 100644 --- a/client/components/Student.vue +++ b/client/components/Student.vue @@ -1,5 +1,120 @@