From c4d98a5564cf3937e0132a9add73575de31672f8 Mon Sep 17 00:00:00 2001 From: OfficialBrot <36410565+OfficialFreak@users.noreply.github.com> Date: Sun, 17 Mar 2024 19:51:19 +0100 Subject: [PATCH 1/3] Weekplan Progress --- client/src/App.svelte | 6 +- .../src/components/{ => Plan}/Lesson.svelte | 8 +- client/src/components/{ => Plan}/Plan.svelte | 14 +- client/src/components/Weekplan.svelte | 9 - client/src/components/Weekplan/Lesson.svelte | 503 ++++++++++++++++++ .../src/components/Weekplan/Weekplan.svelte | 77 +++ 6 files changed, 594 insertions(+), 23 deletions(-) rename client/src/components/{ => Plan}/Lesson.svelte (98%) rename client/src/components/{ => Plan}/Plan.svelte (98%) delete mode 100644 client/src/components/Weekplan.svelte create mode 100644 client/src/components/Weekplan/Lesson.svelte create mode 100644 client/src/components/Weekplan/Weekplan.svelte diff --git a/client/src/App.svelte b/client/src/App.svelte index a558b407..e4aec56f 100644 --- a/client/src/App.svelte +++ b/client/src/App.svelte @@ -1,6 +1,6 @@ - -

Coming soon...

- - \ No newline at end of file diff --git a/client/src/components/Weekplan/Lesson.svelte b/client/src/components/Weekplan/Lesson.svelte new file mode 100644 index 00000000..97f4d0f9 --- /dev/null +++ b/client/src/components/Weekplan/Lesson.svelte @@ -0,0 +1,503 @@ + + +
+
+ +
+ {#if lesson.scheduled_class == null && lesson.current_class == null} + - + {:else} + {lesson.current_class != null ? lesson.current_class : ""} + {#if lesson.takes_place} + {#if lesson.scheduled_class !== lesson.current_class && lesson.scheduled_class != null} + {#if lesson.current_class != null} {/if} + {lesson.scheduled_class} + {/if} + {:else} + {lesson.scheduled_class} + {/if} + {/if} +
+ + {#if plan_type !== "teachers"} +
+ {#if teachers.length !== 0 || s_teachers.length !== 0} + {#each teachers || [] as teacher} + + {/each} + {#each s_teachers || [] as teacher} + + {/each} + {:else} + - + {/if} +
+ {/if} + + {#if plan_type !== "rooms"} +
+ {#if rooms.length !== 0 || s_rooms.length !== 0} + {#each rooms || [] as room} + + {:else} + - + {/each} + {#each s_rooms || [] as room} + + {/each} + {:else} + - + {/if} +
+ {/if} + + {#if plan_type !== "forms"} + {#if forms.length === 0 && s_forms.length === 0} +
+ - +
+ {:else if forms.length === 1 && s_forms.length === 0} +
+ +
+ {:else if forms.length === 0 && s_forms.length === 1} +
+ +
+ {:else} +
+ + + + {#each forms as form} + + {/each} + {#each s_forms as form} + + {/each} + +
+ {/if} + {/if} +
+ +
+ {#if (lesson.info.length > 0) || (plan_type === "forms" && (forms.length > 1)) || (plan_type === "teachers" && (teachers.length > 1)) || (plan_type === "rooms" && (rooms.length > 1))} +
+
    + {#each lesson.info as info_paragraph} + {#each info_paragraph as info_message} +
  • +
    + {#each info_message.text_segments as text_segment} + {#if text_segment.link?.value.length === 1} + + {:else if text_segment.link?.value.length >= 2} +
    + + + + {#each text_segment.link.value as item} + + {/each} + +
    + {:else} + + {/if} + {/each} +
    +
  • + {/each} + {/each} + {#if plan_type === "forms" && (forms.length > 1)} +
  • +
    + Beteiligte Klassen: +
    + + + + {#each forms as form} + + {/each} + +
    +
    +
  • + {/if} + {#if plan_type === "teachers" && (teachers.length > 1)} +
  • +
    + Beteiligte Lehrer: +
    + + + + {#each teachers as teacher} + + {/each} + +
    +
    +
  • + {/if} + {#if plan_type === "rooms" && (rooms.length > 1)} +
  • +
    + In Räumen: +
    + + + + {#each rooms as room} + + {/each} + +
    +
    +
  • + {/if} +
+
+ {/if} +
+
+ \ No newline at end of file diff --git a/client/src/components/Weekplan/Weekplan.svelte b/client/src/components/Weekplan/Weekplan.svelte new file mode 100644 index 00000000..7598adce --- /dev/null +++ b/client/src/components/Weekplan/Weekplan.svelte @@ -0,0 +1,77 @@ + + +Yippeee + + + + \ No newline at end of file From ce7f36e4ddf6a29896e44a8e5b9cf2e9c974db08 Mon Sep 17 00:00:00 2001 From: OfficialBrot <36410565+OfficialFreak@users.noreply.github.com> Date: Tue, 19 Mar 2024 17:27:48 +0100 Subject: [PATCH 2/3] Wochenplan Design Progress --- client/src/components/Plan/Plan.svelte | 7 +- client/src/components/Weekplan/Lesson.svelte | 118 +++--- .../src/components/Weekplan/Weekplan.svelte | 380 +++++++++++++++++- 3 files changed, 422 insertions(+), 83 deletions(-) diff --git a/client/src/components/Plan/Plan.svelte b/client/src/components/Plan/Plan.svelte index 009e23d7..ba592faf 100644 --- a/client/src/components/Plan/Plan.svelte +++ b/client/src/components/Plan/Plan.svelte @@ -16,7 +16,6 @@ export let plan_type; export let plan_value; export let meta; - export let show_title = true; export let extra_height = true; export let week_letter = ""; export let external_times = true; @@ -40,7 +39,7 @@ let cache_loading_failed = false; let network_loading_failed = false; let data_from_cache = false; - let plan_type_map = { + const plan_type_map = { "forms": "Klasse", "rooms": "Raum", "teachers": "Lehrer" @@ -229,6 +228,8 @@ } update_hash(gen_location_hash("plan", school_num, date, plan_type, plan_value)); })(); + + $: console.log(rooms_data); @@ -236,7 +237,7 @@
{#if plan_type !== "room_overview"} - {#if show_title && info && plan_type && plan_value} + {#if info && plan_type && plan_value} {#if plan_type === "forms" && ($selected_favorite !== -1)} {/if} diff --git a/client/src/components/Weekplan/Lesson.svelte b/client/src/components/Weekplan/Lesson.svelte index 97f4d0f9..4fb68c08 100644 --- a/client/src/components/Weekplan/Lesson.svelte +++ b/client/src/components/Weekplan/Lesson.svelte @@ -29,9 +29,9 @@
-
+
-
+
{#if lesson.scheduled_class == null && lesson.current_class == null} - {:else} @@ -48,7 +48,7 @@
{#if plan_type !== "teachers"} -
{#if teachers.length !== 0 || s_teachers.length !== 0} {#each teachers || [] as teacher} @@ -72,7 +72,7 @@ {/if} {#if plan_type !== "rooms"} -
+
{#if rooms.length !== 0 || s_rooms.length !== 0} {#each rooms || [] as room}
{:else if forms.length === 0 && s_forms.length === 1} -
+
{:else} -
+
+ {/if} +

+ Woche für {plan_type_map[plan_type]} {plan_value}{#if plan_type === "teachers"}{#if full_teacher_name !== null}{` (${full_teacher_name})`}{/if}{/if} vom {format_date(week_info.start)} {#if week_info.type}({week_info.type}-Woche){/if} +

+ {/if} +
+
+
+ {#each {length: block_count} as _, i} + {i + block_start} + {/each} +
+
+ {#each {length: lesson_count} as _, i} + {i + lesson_start} + {/each} +
+
+ {#each {length: 5} as _, i} +
+

Mon. 11.3.

+ {#if false} + Lädt... + {:else if false} + Plan konnte nicht geladen werden. + {:else} + {#if false} + {#if plan_type} + Keine Stunden + {:else} + + {/if} + {:else} + + {#each {length: block_count} as _, i} +
+
+ +
+
+
+
+
+
+
+
+ {/each} + {/if} + {/if} +
+ {/each} +
+{:else} + + {#if week_info} +

Freie Räume in der Woche vom {format_date(week_info.start)} ({week_info.type}-Woche)

+ {/if} + {#if false} + Lädt... + {:else if false} + Plan{#if is_default_plan}vorhersage{/if} konnte nicht geladen werden + {:else} +
+ {#each {length: 5} as _, i} +
+

Mon. 11.03.

+ +
+ {/each} +
+ {/if} +{/if} + \ No newline at end of file From 56a0dc1e8acb7a26bea27c6dc794e5ec4685161e Mon Sep 17 00:00:00 2001 From: OfficialBrot <36410565+OfficialFreak@users.noreply.github.com> Date: Fri, 22 Mar 2024 19:22:40 +0100 Subject: [PATCH 3/3] Finished Weekplan --- client/public/base_static/favicon.png | Bin 3127 -> 0 bytes client/public/index.html | 2 +- client/src/App.svelte | 45 +- client/src/base_components/Modal.svelte | 120 ++--- client/src/components/Contact.svelte | 4 +- client/src/components/Navbar.svelte | 21 +- client/src/components/PWAInstallHelper.svelte | 8 +- client/src/components/Plan/DayInfos.svelte | 227 +++++++++ client/src/components/Plan/Lesson.svelte | 14 + client/src/components/Plan/Plan.svelte | 228 ++-------- client/src/components/SchoolManager.svelte | 6 +- client/src/components/Settings.svelte | 24 +- client/src/components/Weekplan/Day.svelte | 429 ++++++++++++++++++ .../src/components/Weekplan/DayInspect.svelte | 29 ++ client/src/components/Weekplan/Lesson.svelte | 180 +++----- .../components/Weekplan/LessonInspect.svelte | 25 + .../src/components/Weekplan/Weekplan.svelte | 381 ++++++---------- client/src/plan.js | 14 +- client/src/stores.js | 3 + client/src/utils.js | 2 +- user_settings.py | 4 + 21 files changed, 1085 insertions(+), 681 deletions(-) delete mode 100644 client/public/base_static/favicon.png create mode 100644 client/src/components/Plan/DayInfos.svelte create mode 100644 client/src/components/Weekplan/Day.svelte create mode 100644 client/src/components/Weekplan/DayInspect.svelte create mode 100644 client/src/components/Weekplan/LessonInspect.svelte diff --git a/client/public/base_static/favicon.png b/client/public/base_static/favicon.png deleted file mode 100644 index 7e6f5eb5a2f1f1c882d265cf479de25caa925645..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3127 zcmV-749N3|P)i z7)}s4L53SJCkR}iVi00SFk;`MXX*#X*kkwKs@nFGS}c;=?XFjU|G$3t^5sjIVS2G+ zw)WGF83CpoGXhLGW(1gW%uV|X7>1P6VhCX=Ux)Lb!*DZ%@I3!{Gsf7d?gtIQ%nQiK z3%(LUSkBji;C5Rfgd6$VsF@H`Pk@xtY6t<>FNR-pD}=C~$?)9pdm3XZ36N5PNWYjb z$xd$yNQR9N!dfj-Vd@BwQo^FIIWPPmT&sZyQ$v81(sCBV=PGy{0wltEjB%~h157*t zvbe_!{=I_783x!0t1-r#-d{Y?ae$Q4N_Nd^Ui^@y(%)Gjou6y<3^XJdu{rmUf-Me?)zZ>9OR&6U5H*cK; z$gUlB{g0O4gN0sLSO|Of?hU(l?;h(jA3uH!Z{EBKuV23ouU@^Y6#%v+QG;>e*E}%?wlu-NT4DG zs)z)7WbLr)vGAu(ohrKc^em@OpO&f~6_>E61n_e0_V3@{U3^O;j{`^mNCJUj_>;7v zsMs6Hu3g7+@v+lSo;=yTYFqq}jZmQ-BK8K{C4kqi_i*jBaQE(Au0607V-zKeT;EPg zX(`vrn=L+e74+-Tqeok@_`tDa$G9I|$nTU5H*2V8@y()n*zqM?J1G!-1aX;CfDC9B zTnJ#j_%*n8Qb1)re*Bno7g0RG{Eb;IK14irJYJp$5Z6ac9~b_P?+5t~95~SRG$g?1 znFJ7p$xV&GZ18m~79TGRdfsc-BcX$9yXTR*n)mPD@1~O(_?cT$ZvFPucRmGlq&se0 zKrcUf^k}4hM*biEJOWKzz!qQe;CB_ZtSOO9Owg#lZAc=s65^rb{fZe(TYu_rk!wKkEf}RIt=#Om( zR8mN`DM<^xj~59euMMspBolVN zAPTr8sSDI104orIAdmL$uOXn*6hga1G+0WD0E?UtabxC#VC~vf3|10|phW;yQ3CY8 z2CM=)ErF;xq-YJ5G|um}>*1#E+O_Mu|Nr#qQ&G1P-NMq@f?@*XUcSbV?tX=)ilM-Q zBZP|!Bpv0V;#ojKcpc7$=eqO;#Uy~#?^kNI{vSZfLx&DEt~LTmaKWXcx=joubklI<*Aw z>LtMaQ7DR<1I2LkWvwyu#Rwn~;ezT}_g(@5l3h?W%-a86Y-t#O1PubP+z<%?V5D(U zy57A6{h+{?kOZp7&WKZR+=sznMJ}+Dnpo=C_0%R_x_t~J5T?E_{+))l5v1%52>)d-`iiZyx|5!%M2Fb2dU zW3~MwwpEH9Rhue+k$UIOoo($Ds!NbOyMR36fRHu;*15(YcA7siIZk#%JWz>P!qX1?IUojG&nKR>^gArBt2 zit(ETyZ=@V&7mv_Fi4bABcnwP+jzQuHcfU&BrAV91u-rFvEi7y-KnWsvHH=d2 zgAk(GKm_S8RcTJ>2N3~&Hbwp{Z3NF_Xeh}g4Eke)V&dY{W(3&b1j9t4yK_aYJisZZ{1rcU5- z;eD>K;ndPq&B-8yA_S0F!4ThA&{1{x)H<#?k9a#6Pc6L?V^s0``ynL&D;p(!Nmx`Y zFkHex{4p!Ggm^@DlehW}iHHVi}~u=$&N? z(NEBLQ#UxxAkdW>X9LnqUr#t4Lu0=9L8&o>JsqTtT5|%gb3QA~hr0pED71+iFFr)dZ=Q=E6ng{NE{Z~0)C?deO#?Aj zSDQ$z#TeC2T^|=}6GBo-&$;E{HL3!q3Z-szuf)O=G#zDjin4SSP%o%6+2IT#sLjQa ziyxFFz~LMjWY+_a5H!U6%a<=b7QVP^ z*90a62;bVq{?@)P6^DWd^Yilq4|YTV2Nw!Yu;a1lPI-sxR)rf@Fe5DhDP7FH zZZ%4S*1C30P;|O+jB!1;m|rXT90Sm5*RBbQN`PKu+hDD*S^yE(CdtSfg=z>u$cIj> zBetter VPlan - + diff --git a/client/src/App.svelte b/client/src/App.svelte index e4aec56f..b0d7c5aa 100644 --- a/client/src/App.svelte +++ b/client/src/App.svelte @@ -13,7 +13,7 @@ import SveltyPicker from 'svelty-picker'; import {get_settings, group_rooms, update_colors, navigate_page, init_indexed_db, clear_plan_cache, get_favorites} from "./utils.js"; import {notifications} from './notifications.js'; - import {logged_in, title, current_page, settings, active_modal, pwa_prompt, indexed_db, selected_favorite, favorites} from './stores.js' + import {logged_in, title, current_page, settings, active_modal, pwa_prompt, selected_favorite, favorites, api_base} from './stores.js' import {getDateDisabled} from './plan.js'; import SchoolManager from "./components/SchoolManager.svelte"; import Changelog from "./components/Changelog.svelte"; @@ -29,6 +29,9 @@ import { fade } from "svelte/transition"; import FancyBackground from "./components/FancyBackground.svelte"; import NotFound from "./components/NotFound.svelte"; + import {gen_revision_arr} from "./plan.js"; + import LessonInspect from "./components/Weekplan/LessonInspect.svelte"; + import DayInspect from "./components/Weekplan/DayInspect.svelte"; const pad = (n, s = 2) => (`${new Array(s).fill(0)}${n}`).slice(-s); let school_num; @@ -39,7 +42,6 @@ let teacher_dict; let all_rooms; let grouped_forms; - let api_base; let selected_revision; let meta; let enabled_dates; @@ -74,7 +76,7 @@ teacher_dict = {}; all_rooms = null; grouped_forms = []; - api_base = null; + $api_base = null; selected_revision = ".newest"; meta = {}; enabled_dates = []; @@ -264,17 +266,6 @@ } } - function gen_revision_arr(all_revisions) { - revision_arr = []; - for(const [index, revision] of Object.entries(all_revisions)) { - if (index == 1) {continue;} - revision_arr.push({ - "id": revision, - "display_name": format_revision_date(revision, all_revisions[1]) - }); - } - } - function customGetDateDisabled(date) { if(typeof date === "object") { date = `${date.getFullYear()}-${pad(date.getMonth()+1)}-${pad(date.getDate())}`; @@ -330,7 +321,7 @@ if(!load_favorite || !$settings.load_first_favorite) { return; } - navigate_page('plan'); + navigate_page($settings.weekplan_default ? "weekplan" : "plan"); if($favorites.length === 0) { return; } @@ -358,16 +349,16 @@ $: $logged_in && init_indexed_db(); $: !$logged_in && logout(); $: select_plan($favorites, $selected_favorite); - $: school_num && (api_base = `/api/v69.420/${school_num}`); + $: school_num && ($api_base = `/api/v69.420/${school_num}`); $: school_num && get_meta(school_num); - $: all_revisions = [".newest"].concat((meta?.dates || {})[date] || []); + $: all_revisions = [".newest"].concat((meta?.dates || {})[date] || []) // If no date selected, default to today $: !date && (() => { let tmp_date = new Date(); date = `${tmp_date.getFullYear()}-${pad(tmp_date.getMonth()+1)}-${pad(tmp_date.getDate())}` })(); // If the selected date is disabled, and meta date is not disabled, set to meta date - $: date && customGetDateDisabled(date) && (date !== meta.date) && (() => { + $: date && !$current_page.startsWith("weekplan") && customGetDateDisabled(date) && (date !== meta.date) && (() => { date = meta.date; })(); //$: school_num && get_preferences(); @@ -383,7 +374,7 @@ $: date && gen_teacher_arr(teacher_dict); $: selected_room && set_plan("rooms", selected_room); $: gen_room_arr(grouped_rooms); - $: gen_revision_arr(all_revisions); + $: revision_arr = gen_revision_arr(all_revisions); $: reset_selects(plan_type); const resizeObserver = new ResizeObserver((entries) => { @@ -404,7 +395,7 @@ return; } navigate_page(new_location); - if (new_location.startsWith("plan")) { + if (new_location.startsWith("plan") || new_location.startsWith("weekplan")) { refresh_plan_vars(); } }); @@ -413,7 +404,7 @@ if(!((new_location === "login" || new_location === "register") && $logged_in)) { if(new_location === "favorite") { load_favorite = true; - new_location = "plan"; + new_location = $settings.weekplan_default ? "weekplan" : "plan"; } navigate_page(new_location); } @@ -439,6 +430,8 @@ + +
@@ -472,7 +465,7 @@ inputClasses="datepicker-input" bind:value={date} /> - {#if available_plan_version} + {#if available_plan_version && $current_page.startsWith("plan")}
{#if available_plan_version === "default_plan"} warning @@ -507,13 +500,9 @@
{#if $current_page.substring(0, 4) === "plan"} - + {:else} - - {/if} - - {#if $settings.show_revision_selector} - + {/if} {:else if $current_page === "school_manager"} diff --git a/client/src/base_components/Modal.svelte b/client/src/base_components/Modal.svelte index 668db499..d91bc7a2 100644 --- a/client/src/base_components/Modal.svelte +++ b/client/src/base_components/Modal.svelte @@ -46,69 +46,71 @@ \ No newline at end of file diff --git a/client/src/components/Contact.svelte b/client/src/components/Contact.svelte index 6cd853e0..a6231220 100644 --- a/client/src/components/Contact.svelte +++ b/client/src/components/Contact.svelte @@ -3,7 +3,7 @@ import {notifications} from "../notifications.js"; import Select from "../base_components/Select.svelte"; import { onMount } from "svelte"; - import { title } from "../stores.js"; + import {settings, title} from "../stores.js"; import Button from "../base_components/Button.svelte"; let category = "bug"; @@ -23,7 +23,7 @@ }) .then(data => { notifications.success("Nachricht übermittelt"); - navigate_page("plan"); + navigate_page($settings.weekplan_default ? "weekplan" : "plan"); }) .catch(error => { notifications.danger(error.message); diff --git a/client/src/components/Navbar.svelte b/client/src/components/Navbar.svelte index 11c94f8e..3d7e44b7 100644 --- a/client/src/components/Navbar.svelte +++ b/client/src/components/Navbar.svelte @@ -1,10 +1,10 @@
- {:else} -
- {/if} - {/each} -
- {/if} - {#if info} - {#if info.additional_info.length > 0} -
- {#each info.processed_additional_info as info_paragraph} - {#if info_paragraph.length > 0} -
- {#each info_paragraph as text_segment} - {#if text_segment.link?.value.length === 1} - - {:else if text_segment.link?.value.length >= 2} -
- - - - {#each text_segment.link.value as item} - - {/each} - -
- {:else} - {text_segment.text} - {/if} - {/each} -
- {:else} -
- {/if} - {/each} -
- {/if} -
- {#if !is_default_plan}Plan zuletzt aktualisiert: {format_timestamp(info.timestamp)}
{/if} - Zuletzt auf neue Pläne überprüft: {format_timestamp(last_fetch)}
- {/if} +
@@ -377,17 +310,6 @@ padding: .08em 0; } - .inline-wrapper > * { - font-size: inherit; - color: var(--text-color); - white-space: pre-wrap; - word-break: break-word; - } - - .info-spacer { - height: 5px; - } - .dropdown-arrow { font-size: 1.4em; display: block; @@ -409,70 +331,6 @@ transform: rotate(180deg); } - .fit-content-width { - width: fit-content; - } - - .fit-content-width .dropdown-wrapper button, .max-width .dropdown-wrapper button { - border: none; - background: transparent; - color: var(--text-color); - transition: background-color .2s ease; - width: 100%; - padding: 2px 0px 2px 5px; - font-size: inherit; - - &:hover, &:focus-visible { - background-color: rgba(0, 0, 0, 0.5); - } - - &.toggle-button { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - background: rgba(255, 255, 255, 0.08); - border-radius: 5px; - overflow: hidden; - text-align: left; - font-size: inherit; - font-weight: inherit; - color: var(--text-color); - - span.grow { - flex: 1; - white-space: nowrap; - } - - &.center-align { - text-align: center; - } - - &:hover, &:focus-visible { - background-color: rgba(255, 255, 255, 0.15); - } - } - } - - .no-btn-visuals { - border: 0; - background: none; - padding: 0; - margin: 0; - text-align: start; - } - - .clickable { - background: rgba(255, 255, 255, 0.08); - border-radius: 5px; - padding: 2px 5px; - transition: background-color 0.2s ease; - - &:hover, &:focus-visible { - background-color: rgba(255, 255, 255, 0.2); - } - } - .day-controls { position: fixed; bottom: 0; @@ -596,50 +454,16 @@ } .custom-badge { - display: inline-flex; - flex-direction: row; - column-gap: .3em; - align-items: center; - - background: rgba(255, 255, 255, 0.07); - padding: 2px 7px; - border-radius: 5px; - white-space: nowrap; - margin-bottom: .2em; - } - - .last-updated { - font-size: var(--font-size-base); - line-height: 1.5; - margin-top: 20px; - display: block !important; - } - - .additional-info { - position: relative; - font-size: var(--font-size-base); - line-height: 1.5; - border: clamp(1px, .3vmax, 3px) solid rgba(255, 255, 255, 0.2); - padding: 10px; - padding-top: calc(10px + var(--font-size-md) / 2); - margin-top: 30px; - border-radius: 5px; - - &::before { - content: "Informationen"; - font-size: var(--font-size-md); - color: rgba(255, 255, 255, 0.2); - background: var(--background); - padding: 0px 5px; - position: absolute; - top: 0; - left: 20px; - transform: translateY(-50%); - } - - &.exams::before { - content: "Klausuren"; - } + display: inline-flex; + flex-direction: row; + column-gap: .3em; + align-items: center; + + background: rgba(255, 255, 255, 0.07); + padding: 2px 7px; + border-radius: 5px; + white-space: nowrap; + margin-bottom: .2em; } .no-linebreak { diff --git a/client/src/components/SchoolManager.svelte b/client/src/components/SchoolManager.svelte index 92f0bd93..61584e96 100644 --- a/client/src/components/SchoolManager.svelte +++ b/client/src/components/SchoolManager.svelte @@ -1,7 +1,7 @@ +
+

+ {date ? format_date_heading(date) : "..."} + {#if (exams && Object.keys(exams).length !== 0) || info} + + {/if} +

+ {#if loading} + Tag Lädt... + {:else if getDateDisabled(enabled_dates, free_days, date)} + Kein Plan verfügbar. + {:else if loading_failed} + Plan konnte nicht geladen werden. + {:else} + {#if lessons.length === 0} + {#if plan_type} + Keine Stunden + {:else} + Wähle eine Klasse, einen Lehrer, einen Raum oder die Raumübersicht aus, um {#if is_default_plan}eine Planvorhersage{:else}einen Plan{/if} zu sehen. + {/if} + {:else} + {#if plan_type !== "room_overview"} + + {#each {length: block_count} as _, i} +
+ {#if lessons[i][0].length > 0} +
+ {#each lessons[i][0] as lesson} + + {/each} +
+ {/if} + {#if lessons[i][1].length > 0 || lessons[i][2].length > 0} +
+
+ {#each lessons[i][1] as lesson} + + {/each} +
+
+ {#each lessons[i][2] as lesson} + + {/each} +
+
+ {/if} +
+ {/each} + {:else} + + {/if} + {/if} + {/if} +
+ + \ No newline at end of file diff --git a/client/src/components/Weekplan/DayInspect.svelte b/client/src/components/Weekplan/DayInspect.svelte new file mode 100644 index 00000000..4b3c51e3 --- /dev/null +++ b/client/src/components/Weekplan/DayInspect.svelte @@ -0,0 +1,29 @@ + + + +

{$inspecting_day ? $inspecting_day.date : "..."}

+ + {#if $inspecting_day} + + {/if} + + + + +
\ No newline at end of file diff --git a/client/src/components/Weekplan/Lesson.svelte b/client/src/components/Weekplan/Lesson.svelte index 4fb68c08..d05cad8d 100644 --- a/client/src/components/Weekplan/Lesson.svelte +++ b/client/src/components/Weekplan/Lesson.svelte @@ -1,6 +1,6 @@
+ {#if (lesson.info.length > 0) || (plan_type === "forms" && (forms.length > 1)) || (plan_type === "teachers" && (teachers.length > 1)) || (plan_type === "rooms" && (rooms.length > 1))} + + {/if}
@@ -48,7 +56,7 @@
{#if plan_type !== "teachers"} -
{#if teachers.length !== 0 || s_teachers.length !== 0} {#each teachers || [] as teacher} @@ -144,124 +152,38 @@ {/if} {/if}
- -
- {#if (lesson.info.length > 0) || (plan_type === "forms" && (forms.length > 1)) || (plan_type === "teachers" && (teachers.length > 1)) || (plan_type === "rooms" && (rooms.length > 1))} -
-
    - {#each lesson.info as info_paragraph} - {#each info_paragraph as info_message} -
  • -
    - {#each info_message.text_segments as text_segment} - {#if text_segment.link?.value.length === 1} - - {:else if text_segment.link?.value.length >= 2} -
    - - - - {#each text_segment.link.value as item} - - {/each} - -
    - {:else} - - {/if} - {/each} -
    -
  • - {/each} - {/each} - {#if plan_type === "forms" && (forms.length > 1)} -
  • -
    - Beteiligte Klassen: -
    - - - - {#each forms as form} - - {/each} - -
    -
    -
  • - {/if} - {#if plan_type === "teachers" && (teachers.length > 1)} -
  • -
    - Beteiligte Lehrer: -
    - - - - {#each teachers as teacher} - - {/each} - -
    -
    -
  • - {/if} - {#if plan_type === "rooms" && (rooms.length > 1)} -
  • -
    - In Räumen: -
    - - - - {#each rooms as room} - - {/each} - -
    -
    -
  • - {/if} -
-
- {/if} -