File tree Expand file tree Collapse file tree 6 files changed +253
-251
lines changed
Expand file tree Collapse file tree 6 files changed +253
-251
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ def forside(self):
108108 ],
109109 }
110110 )
111- print (forsideDict ["undervisning" ][navn ][- 1 ])
112111 for element in soup .find (
113112 "div" , {"id" : "s_m_Content_Content_skemaIsland_pa" }
114113 ).find_all ("div" ):
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def generatePayload(soup, eventTarget):
3030
3131def skemaBrikExtract (skemabrik , modul_id = None ):
3232 if modul_id is None :
33- if matches := re .search (r"(absid|ProeveholdId)=([0-9]+)" , skemabrik [ "href" ] ):
33+ if matches := re .search (r"(absid|ProeveholdId)=([0-9]+)" , skemabrik . get ( "href" ) or "" ):
3434 id_type , absid = matches .groups ()
3535 if id_type == "ProeveholdId" :
3636 absid = f"PH{ absid } "
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import type { RawHomework } from "./types/homework";
1414import type { Rooms } from "./types/rooms" ;
1515import type {
1616 Information ,
17- information ,
1817 RawInformation ,
1918} from "./types/information" ;
2019
Original file line number Diff line number Diff line change 11export type RawLesson = {
2- absid : string ;
2+ absid : null | string ;
33 andet : null | string ;
44 hold : null | string ;
55 hold_id : null | string ;
@@ -11,12 +11,12 @@ export type RawLesson = {
1111} ;
1212
1313export type Lesson = {
14- id : string ;
14+ id : string | null ;
1515 date : string ;
1616 class : string | null ;
1717 name : string | null ;
1818 note : string | null ;
1919 room : string | null ;
2020 status : string | null ;
2121 teacher : string | null ;
22- }
22+ } ;
Original file line number Diff line number Diff line change 8080 <div class =" flex flex-col gap-4" >
8181 <a
8282 class =" unstyled"
83- href ={nextClass ? (nextClass .id .startsWith (' PH' ) ? ` /eksamen?id=${nextClass .id .substring (2 )}&navn=${$frontPageStore ?.name } ` : ` /modul?absid=${nextClass .id } ` ) : ' ' }
83+ href ={nextClass ? (nextClass .id ? .startsWith (' PH' ) ? ` /eksamen?id=${nextClass .id .substring (2 )}&navn=${$frontPageStore ?.name } ` : ` /modul?absid=${nextClass .id } ` ) : ' ' }
8484 >
8585 <Card class ={cn (" p-2 overflow-auto border-2" , {" shrink-0" : ! nextClass })}>
8686 <div class =" flex items-center justify-between" >
163163 {#each classes as day }
164164 <h3 class ="text-sm font-medium leading-7 unstyled" >{day .name }</h3 >
165165 {#each day .lessons as lesson }
166- {@const url = lesson .id . startsWith (" PH" ) ? ` /eksamen?id=${lesson .id .substring (2 )}&navn=${$frontPageStore ?.name } ` : ` /modul?absid=${lesson .id } ` }
166+ {@const url = lesson .id ? lesson . id . startsWith (" PH" ) ? ` /eksamen?id=${lesson .id .substring (2 )}&navn=${$frontPageStore ?.name } ` : ` /modul?absid=${lesson .id } ` : null }
167167 <Card level ="2" class ="flex items-center p-3" error ={lesson .status === ' aflyst' }
168- on:click ={() => ! $isSmallScreen && goto (url )}>
168+ on:click ={() => ! $isSmallScreen && url && goto (url )}>
169169 <div
170170 class =" flex items-stretch sm:items-center max-sm:flex-col-reverse max-sm:content-start flex-1 h-full min-w-0" >
171171 <div class =" max-sm:hidden flex justify-center shrink-0 w-11" >
204204 {/if }
205205 </div >
206206 </div >
207- <Button
208- href ={url }
209- variant =" ghost" size =" sm" class =" max-sm:hidden" >
210- Vis
211- <ArrowRight class =" ml-1 size-4" />
212- </Button >
207+ {#if url }
208+ <Button
209+ href ={url }
210+ variant =" ghost" size =" sm" class =" max-sm:hidden" >
211+ Vis
212+ <ArrowRight class =" ml-1 size-4" />
213+ </Button >
214+ {/if }
213215 </Card >
214216 {/each }
215217 {/each }
You can’t perform that action at this time.
0 commit comments