forked from github/wulkanowy-mirror
Fix timetable sync (#48)
This commit is contained in:
parent
5649986a20
commit
23ac726d3c
@ -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");
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user