mirror of
https://github.com/ae-utbm/sith.git
synced 2025-09-13 03:25:49 +00:00
update regex
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
<li><a href="{{ url('matmat:search_clear') }}">{% trans %}Matmatronch{% endtrans %}</a></li>
|
<li><a href="{{ url('matmat:search_clear') }}">{% trans %}Matmatronch{% endtrans %}</a></li>
|
||||||
<li><a href="{{ url('core:file_list') }}">{% trans %}Files{% endtrans %}</a></li>
|
<li><a href="{{ url('core:file_list') }}">{% trans %}Files{% endtrans %}</a></li>
|
||||||
<li><a href="{{ url('pedagogy:guide') }}">{% trans %}Pedagogy{% endtrans %}</a></li>
|
<li><a href="{{ url('pedagogy:guide') }}">{% trans %}Pedagogy{% endtrans %}</a></li>
|
||||||
|
<li><a href="{{ url('timetable:generator') }}">{% trans %}Timetable Generator{% endtrans %}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
<details name="navbar" class="menu">
|
<details name="navbar" class="menu">
|
||||||
|
@@ -2,7 +2,7 @@ import html2canvas from "html2canvas";
|
|||||||
|
|
||||||
// see https://regex101.com/r/QHSaPM/2
|
// see https://regex101.com/r/QHSaPM/2
|
||||||
const TIMETABLE_ROW_RE: RegExp =
|
const TIMETABLE_ROW_RE: RegExp =
|
||||||
/^(?<ueCode>[A-Z\d]{4}(?:\+[A-Z\d]{4})?)\s+(?<courseType>[A-Z]{2}\d)\s+((?<weekGroup>[AB])\s+)?(?<weekday>(lundi)|(mardi)|(mercredi)|(jeudi)|(vendredi)|(samedi)|(dimanche))\s+(?<startHour>\d{2}:\d{2})\s+(?<endHour>\d{2}:\d{2})\s+[\dA-B]\s+(?:[\wé]*\s+)?(?<room>\w+(?:, \w+)?)$/;
|
/^(?<ueCode>[^\t]+)\t+(?<courseType>[A-Z]{2}\d)\t+((?<weekGroup>[AB])\t+)?(?<weekday>(lundi)|(mardi)|(mercredi)|(jeudi)|(vendredi)|(samedi)|(dimanche))\t+(?<startHour>\d{2}:\d{2})\t+(?<endHour>\d{2}:\d{2})\t+[\dA-B]\t+(?:[^\t]*\t+)?(?<room>[^\t]+)$/;
|
||||||
|
|
||||||
const DEFAULT_TIMETABLE: string = `DS52\t\tCM1\t\tlundi\t08:00\t10:00\t1\tPrésentiel\tA113
|
const DEFAULT_TIMETABLE: string = `DS52\t\tCM1\t\tlundi\t08:00\t10:00\t1\tPrésentiel\tA113
|
||||||
DS53\t\tCM1\t\tlundi\t10:15\t12:15\t1\tPrésentiel\tA101
|
DS53\t\tCM1\t\tlundi\t10:15\t12:15\t1\tPrésentiel\tA101
|
||||||
@@ -135,11 +135,18 @@ document.addEventListener("alpine:init", () => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getStyle(slot: TimetableSlot) {
|
getStyle(slot: TimetableSlot) {
|
||||||
|
const hasWeekGroup = slot.weekGroup !== undefined;
|
||||||
|
const width = hasWeekGroup ? SLOT_WIDTH / 2 : SLOT_WIDTH;
|
||||||
|
const leftOffset = hasWeekGroup
|
||||||
|
? slot.weekGroup === "A"
|
||||||
|
? 0
|
||||||
|
: SLOT_WIDTH / 2
|
||||||
|
: 0;
|
||||||
return {
|
return {
|
||||||
height: `${(slot.endSlot - slot.startSlot) * SLOT_HEIGHT}px`,
|
height: `${(slot.endSlot - slot.startSlot) * SLOT_HEIGHT}px`,
|
||||||
width: `${SLOT_WIDTH}px`,
|
width: `${width}px`,
|
||||||
top: `${(slot.startSlot - this.startSlot) * SLOT_HEIGHT}px`,
|
top: `${(slot.startSlot - this.startSlot) * SLOT_HEIGHT}px`,
|
||||||
left: `${this.displayedWeekdays.indexOf(slot.weekday) * SLOT_WIDTH}px`,
|
left: `${this.displayedWeekdays.indexOf(slot.weekday) * SLOT_WIDTH + leftOffset}px`,
|
||||||
backgroundColor: this.colors[slot.ueCode],
|
backgroundColor: this.colors[slot.ueCode],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@@ -40,6 +40,7 @@
|
|||||||
<div class="slot" :style="getStyle(course)">
|
<div class="slot" :style="getStyle(course)">
|
||||||
<span x-text="`${course.ueCode} (${course.courseType})`"></span>
|
<span x-text="`${course.ueCode} (${course.courseType})`"></span>
|
||||||
<span x-text="`${course.startHour} - ${course.endHour}`"></span>
|
<span x-text="`${course.startHour} - ${course.endHour}`"></span>
|
||||||
|
<span x-text="(course.weekGroup ? `\nGroupe ${course.weekGroup}` : '')"></span>
|
||||||
<span x-text="course.room"></span>
|
<span x-text="course.room"></span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Reference in New Issue
Block a user