From 6e74b4ddd7eba5ba04a3fdb8c287b252000f8626 Mon Sep 17 00:00:00 2001 From: Belissimo_T Date: Sat, 23 Sep 2023 01:03:06 +0200 Subject: [PATCH 1/9] improve validate_color() --- var.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var.py b/var.py index 56f11b4..d024281 100644 --- a/var.py +++ b/var.py @@ -17,7 +17,7 @@ def validate_bool(elem): def validate_color(elem): - if not re.search(r'^#(?:[0-9a-fA-F]{3}){1,2}$', elem): + if not re.fullmatch(r'^#(?:[0-9a-fA-F]{3}){1,2}$', elem): return False return True From be328c85e0ee2f2abbd42ef70e8bf7b04d125216 Mon Sep 17 00:00:00 2001 From: ArtrenH <79058115+ArtrenH@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:07:26 +0200 Subject: [PATCH 2/9] fix #170 --- client/src/SchoolManager.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/SchoolManager.svelte b/client/src/SchoolManager.svelte index 982a292..022bd1b 100644 --- a/client/src/SchoolManager.svelte +++ b/client/src/SchoolManager.svelte @@ -118,7 +118,7 @@ function get_school_name_by_id(school_id) { for (let school of schools) { if (school.id === school_id.toString()) { - return school.name + return school["display_name"] } } return "" From a130b75259090b533d3750389488687b3aaee326 Mon Sep 17 00:00:00 2001 From: OfficialFreak Date: Mon, 25 Sep 2023 16:07:59 +0200 Subject: [PATCH 3/9] removed unused meta variable + renamed all_meta --- client/src/App.svelte | 12 ++++-------- client/src/Plan.svelte | 10 +++++----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/client/src/App.svelte b/client/src/App.svelte index eab6af9..5b39e95 100644 --- a/client/src/App.svelte +++ b/client/src/App.svelte @@ -35,7 +35,6 @@ let api_base; let selected_revision; let meta; - let all_meta; let enabled_dates; let grouped_rooms; let course_lists; @@ -62,7 +61,6 @@ api_base = null; selected_revision = ".newest"; meta = {}; - all_meta = {}; enabled_dates = []; grouped_rooms = []; course_lists = {}; @@ -83,8 +81,7 @@ let data = localStorage.getItem(`${school_num}_meta`); if (data !== "undefined" && data) { data = JSON.parse(data); - all_meta = data; - meta = data.meta; + meta = data; all_rooms = data.rooms; teacher_list = Object.keys(data.teachers); grouped_forms = data.forms.grouped_forms; @@ -105,8 +102,7 @@ throw error; } } - all_meta = data; - meta = data.meta; + meta = data; all_rooms = data.rooms; teacher_list = Object.keys(data.teachers); grouped_forms = data.forms.grouped_forms; @@ -284,7 +280,7 @@ $: school_num && (api_base = `/api/v69.420/${school_num}`); $: school_num && reset_plan_vars(); $: school_num && get_meta(); - $: all_revisions = [".newest"].concat((all_meta?.dates || {})[date] || []); + $: all_revisions = [".newest"].concat((meta?.dates || {})[date] || []); $: school_num && get_preferences(); $: all_rooms && (grouped_rooms = group_rooms(all_rooms)); $: $logged_in && get_settings(); @@ -386,7 +382,7 @@ {#if $current_page.substring(0, 4) === "plan"} - + {:else} {/if} diff --git a/client/src/Plan.svelte b/client/src/Plan.svelte index 9d87c10..6ee3805 100644 --- a/client/src/Plan.svelte +++ b/client/src/Plan.svelte @@ -12,7 +12,7 @@ export let date; export let plan_type; export let plan_value; - export let all_meta; + export let meta; export let show_title = true; export let extra_height = true; export let week_letter = ""; @@ -57,10 +57,10 @@ return; } // Check the validity of the plan value - if((plan_type === "rooms" || plan_type === "teachers") && (!Object.keys(all_meta[plan_type]).includes(entity))) { + if((plan_type === "rooms" || plan_type === "teachers") && (!Object.keys(meta[plan_type]).includes(entity))) { reset_plan_vars(); return; - } else if((plan_type === "forms") && !Object.keys(all_meta.forms.forms).includes(entity)) { + } else if((plan_type === "forms") && !Object.keys(meta.forms.forms).includes(entity)) { reset_plan_vars(); return; } @@ -205,8 +205,8 @@ let full_teacher_name = null; let teacher_contact_link = null; $: if (plan_type === "teachers") { - full_teacher_name = all_meta.teachers[plan_value]?.surname || null; - teacher_contact_link = all_meta.teachers[plan_value]?.contact_link || null; + full_teacher_name = meta.teachers[plan_value]?.surname || null; + teacher_contact_link = meta.teachers[plan_value]?.contact_link || null; } let preferences_apply = true; From 6c938e45434d4336a6def6183c20b30377fea043 Mon Sep 17 00:00:00 2001 From: OfficialFreak Date: Mon, 25 Sep 2023 16:25:38 +0200 Subject: [PATCH 4/9] Update SchoolManager.svelte --- client/src/SchoolManager.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/SchoolManager.svelte b/client/src/SchoolManager.svelte index 022bd1b..6c3db80 100644 --- a/client/src/SchoolManager.svelte +++ b/client/src/SchoolManager.svelte @@ -118,7 +118,7 @@ function get_school_name_by_id(school_id) { for (let school of schools) { if (school.id === school_id.toString()) { - return school["display_name"] + return school.display_name } } return "" From 4b9a1333aa4573a4c7ace6207392f1edda209891 Mon Sep 17 00:00:00 2001 From: OfficialFreak Date: Mon, 25 Sep 2023 16:37:01 +0200 Subject: [PATCH 5/9] Create 10000000.png --- .../images/school_icons/10000000.png | Bin 0 -> 15552 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 client/public/base_static/images/school_icons/10000000.png diff --git a/client/public/base_static/images/school_icons/10000000.png b/client/public/base_static/images/school_icons/10000000.png new file mode 100644 index 0000000000000000000000000000000000000000..eeb05014d3a27a4afe8adbdc8d44d25a0aa2cb0d GIT binary patch literal 15552 zcmeHui96Ko_y4pKDwH*eY{eKtQ7IYOixQKuh8g=7Wyx0d%9dru5>iyMWo+3-*%`YK zLiUs;WMBH7(er#hzklF+UBBOTeV^;<>FPcA`@YY8?sK2>IQ-v=C3u+9hscO~`DF8j9om*FAD zJw@Gnw;asxxtciP5w5PTC@Xs#XEPH=Jj%hzB4JjR6M^7Cs9u%Vc6&ZE(BRBbj?7J`-9F@yv~nouxWlm9-2EcG z5uV2gnU^2kuQr=Kxak|ue3yRT3;U#mxS>`h-Y1!|{x?1zcGpPy>9w`glLBJh$@ZMt z4Sz=lN9==t?c$|JAU^I!vmy`=_xU5?2YOoAFM^ek1pi0!;C3Mpx>xGqjrR}#_l5u8 zv=q^W;t`b{BKj=NZT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;px+$;)p4 z;T0OANWiyq*K^165!+!vh{8`s`rEM%&6g4H@h)?k$Qa~Z(Jre zOoL}q*c}Xgl)s|H8Spkx@jIdy=yJv;zv6En%f}{K>_?hHC_+O(HJqmO!40m4E4g|F zIzdCNZEU@ZtR#p_P|kY;5LDV9`E8F_(VTkG0M(qkM&FEo*||QjHE2=$+oAGsPlGiZ z;sZZdINoEi(4c(YwJ+^0XLw-8-2KbzOW^5Hpd6jIr;bD1kk`us!{hp5sm;RF`r~Zl z_(f>u&gel*G;gf`%z-basGs}v1^n;lKK}!s`}{xnQS7$dsU;dNSqG;}aN-D6MUAW3 I=sUju2kq^rpa1{> literal 0 HcmV?d00001 From 390bdddb9cd39589b78938dd4328047b7e1b54d3 Mon Sep 17 00:00:00 2001 From: Belissimo_T Date: Mon, 25 Sep 2023 16:40:43 +0200 Subject: [PATCH 6/9] fix substitution plan processing --- backend/cache.py | 17 ++++++++--------- backend/plan_processor.py | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/backend/cache.py b/backend/cache.py index b3df9c6..b6d6c99 100644 --- a/backend/cache.py +++ b/backend/cache.py @@ -56,23 +56,22 @@ def get_plan_file(self, """Return the contents of a plan file from the cache.""" # self._logger.debug(f"get_plan_file({day!r}, {timestamp!r}, {filename!r})") - if newest_before: + if newest_before and not isinstance(timestamp, str): timestamps = self.get_timestamps(day) - if not isinstance(timestamp, str): - timestamps = [t for t in timestamps if t <= timestamp] + timestamps = [t for t in timestamps if t <= timestamp] - for timestamp in timestamps: + for older_timestamp in timestamps: try: - return self.get_plan_file(day, timestamp, filename, newest_before=False) + return self.get_plan_file(day, older_timestamp, filename, newest_before=False) except OSError: pass else: raise FileNotFoundError + else: + path = self.get_plan_path(day, timestamp) / filename - path = self.get_plan_path(day, timestamp) / filename - - with open(path, "r", encoding="utf-8") as f: - return f.read() + with open(path, "r", encoding="utf-8") as f: + return f.read() def store_meta_file(self, content: str, filename: str): """Store a meta file in the cache such as "meta.json".""" diff --git a/backend/plan_processor.py b/backend/plan_processor.py index 53a0bda..8f2f4bc 100644 --- a/backend/plan_processor.py +++ b/backend/plan_processor.py @@ -14,7 +14,7 @@ class PlanProcessor: - VERSION = "74" + VERSION = "75" def __init__(self, cache: Cache, school_number: str, *, logger: logging.Logger): self._logger = logger @@ -67,7 +67,7 @@ def compute_plans(self, date: datetime.date, timestamp: datetime.datetime): self._logger.warning(f"=> Could not find Indiware form plan for date {date!s} and timestamp {timestamp!s}.") else: try: - vplan_kl = self.cache.get_plan_file(date, timestamp, "VPlanKl.xml", newest_before=True) + vplan_kl = self.cache.get_plan_file(date, timestamp, "VplanKl.xml", newest_before=True) except FileNotFoundError: vplan_kl = None plan_extractor = PlanExtractor(plan_kl, vplan_kl, self.teachers.abbreviation_by_surname(), From e60d61c2134397cff5a0285f0f54507fb85531bc Mon Sep 17 00:00:00 2001 From: Belissimo_T Date: Mon, 25 Sep 2023 16:53:39 +0200 Subject: [PATCH 7/9] MetaExtractor: remove warning when revision does not contain plankl file --- backend/meta_extractor.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/backend/meta_extractor.py b/backend/meta_extractor.py index ceea89f..883a7f8 100644 --- a/backend/meta_extractor.py +++ b/backend/meta_extractor.py @@ -90,9 +90,6 @@ def iterate_daily_extractors(self) -> typing.Generator[DailyMetaExtractor, None, try: plan_kl = self.cache.get_plan_file(day, timestamp, "PlanKl.xml") except FileNotFoundError: - self._logger.warning( - f"Timestamp {timestamp!s} for day {day!s} has no PlanKl.xml file." - ) continue extractor = DailyMetaExtractor(plan_kl) From 09b22c08a74d5781d84f56ddb2935e1073305ae5 Mon Sep 17 00:00:00 2001 From: Belissimo_T Date: Mon, 25 Sep 2023 17:08:36 +0200 Subject: [PATCH 8/9] fix period parsing issue from substitution plan --- backend/vplan_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/vplan_utils.py b/backend/vplan_utils.py index 82e9557..555bc95 100644 --- a/backend/vplan_utils.py +++ b/backend/vplan_utils.py @@ -226,13 +226,16 @@ def periods_to_block_label(periods: list[int]) -> str: def _parse_periods(period_str: str) -> list[int]: + def period_str_to_int(string: str) -> int: + return int(string.replace("Stunde", "").replace(".", "")) + if not period_str: return [] elif "-" not in period_str: - return [int(period_str)] + return [period_str_to_int(period_str)] else: begin, end = period_str.split("-") - return list(range(int(begin), int(end) + 1)) + return list(range(period_str_to_int(begin), period_str_to_int(end) + 1)) def parse_periods(period_str: str) -> list[int]: From e19165ff7b9593a045f412ac269ccc8f172a9d10 Mon Sep 17 00:00:00 2001 From: OfficialFreak Date: Mon, 25 Sep 2023 18:29:02 +0200 Subject: [PATCH 9/9] #87 #68 Frontend Links in Additional Info --- client/src/Plan.svelte | 148 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 142 insertions(+), 6 deletions(-) diff --git a/client/src/Plan.svelte b/client/src/Plan.svelte index 6ee3805..81c83c5 100644 --- a/client/src/Plan.svelte +++ b/client/src/Plan.svelte @@ -6,6 +6,7 @@ import { swipe } from 'svelte-gestures'; import {preferences, settings, title} from './stores.js'; import {arraysEqual, customFetch, format_date, navigate_page, should_date_be_cached} from "./utils.js"; + import Dropdown from './Components/Dropdown.svelte'; export let api_base; export let school_num; @@ -126,6 +127,7 @@ } }); location.hash = gen_location_hash(); + console.log(info); } function periods_to_block_label(periods) { @@ -316,11 +318,43 @@ {#if info} {#if info.additional_info.length > 0}
- {#each info.additional_info as cur_info} - {#if cur_info !== null} - {cur_info} + {#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} + + {/if} + {/each} +
+ {:else} +
{/if} -
{/each}
{/if} @@ -352,6 +386,106 @@