Skip to content

Commit

Permalink
Added verification through regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Karakoc committed Aug 24, 2024
1 parent 12109b6 commit c5bf00f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/template/home.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,9 @@
</section>
</template>
<template x-if="plannedStreams.hasElements()">
<section class="tum-live-course-view-item px-3">
<section x-data="{isLectureHallValid(lectureHall) {const regex = /^\d{4}\.[A-Za-z0-9]{2}\.[A-Za-z0-9]{3,4}$/;
return regex.test(lectureHall);}}"
class="tum-live-course-view-item px-3">
<header>
<h3>Scheduled</h3>
</header>
Expand All @@ -590,7 +592,9 @@
<span x-text="`${s.TimeOfStart()} - ${s.TimeOfEnd()}`"></span>
</div>
<h4 x-text="s.Name" class="font-semibold text-1"></h4>
<a :href="`https://nav.tum.de/room/${s.LectureHall}`" class="no-underline" x-text="s.LectureHall"></a>
<template x-if="isLectureHallValid(s.LectureHall)">
<a :href="`https://nav.tum.de/room/${s.LectureHall}`" class="no-underline" x-text="s.LectureHall"></a>
</template>
</div>
</div>
</article>
Expand Down

0 comments on commit c5bf00f

Please sign in to comment.