1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-09-20 00:49:10 -05:00

Fix timetable sync (#48)

This commit is contained in:
Mikołaj Pich 2018-01-11 21:24:03 +01:00 committed by GitHub
parent 5649986a20
commit 23ac726d3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 1 deletions

View File

@ -88,6 +88,8 @@ public class Timetable {
}
private void addLessonDetails(Lesson lesson, Elements e) {
moveWarningToLessonNode(e);
switch (e.size()) {
case 1:
addLessonInfoFromElement(lesson, e.first());
@ -104,6 +106,15 @@ public class Timetable {
}
}
private void moveWarningToLessonNode(Elements e) {
Elements warn = e.select(".uwaga-panel");
if (!warn.isEmpty()) {
e.select(".x-treelabel-rlz").last().text("(" + warn.text() + ")");
e.remove(1);
}
}
private void addLessonInfoFromElement(Lesson lesson, Element e) {
Elements spans = e.select("span");

View File

@ -148,6 +148,7 @@ public class TimetableTest extends StudentAndParentTestCase {
Assert.assertEquals("zastępstwo (poprzednio: Religia)", full.getWeekTable().getDay(2).getLesson(0).getDescription());
Assert.assertEquals("zastępstwo (poprzednio: Wychowanie fizyczne)", full.getWeekTable().getDay(3).getLesson(1).getDescription());
Assert.assertEquals("", full.getWeekTable().getDay(4).getLesson(0).getDescription());
Assert.assertEquals("egzamin", full.getWeekTable().getDay(3).getLesson(0).getDescription());
Assert.assertEquals("", holidays.getWeekTable().getDay(3).getLesson(3).getDescription());
}

View File

@ -52,7 +52,16 @@
<span class="x-treelabel-rlz">(zastępstwo)</span>
</div>
</td>
<td></td>
<td>
<div>
<span class="x-treelabel-ppl x-treelabel-inv">Język polski</span>
<span class="x-treelabel-ppl x-treelabel-inv"> </span>
<span class="x-treelabel-ppl x-treelabel-inv">16</span>
<span class="x-treelabel-rlz">(oddział nieobecny)</span>
</div>
<button type="button" class="uwaga-btn">Uwaga</button>
<div class="uwaga-panel">egzamin</div>
</td>
<td>
<div>
<span class="x-treelabel-ppl">Uroczyste zakończenie roku szkolnego</span>