diff options
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/exams/page.inc.php | 9 | ||||
-rw-r--r-- | modules-available/exams/templates/page-upcoming-lectures.html | 11 |
2 files changed, 17 insertions, 3 deletions
diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php index 49b48bb6..930ba62c 100644 --- a/modules-available/exams/page.inc.php +++ b/modules-available/exams/page.inc.php @@ -165,7 +165,8 @@ class Page_Exams extends Page { $out = []; $now = time(); - $cutoff = strtotime('+ 5 day'); + $cutoff = strtotime('+30 day'); + $theCount = 0; foreach ($this->lectures as $lecture) { if ($lecture['endtime'] < $now || $lecture['starttime'] > $cutoff) continue; @@ -179,6 +180,9 @@ class Page_Exams extends Page if ($duration < 86400) { $entry['duration_s'] = gmdate('H:i', $duration); } + if (++$theCount > 5) { + $entry['class'] = 'collapse'; + } $out[] = $entry; } return $out; @@ -356,7 +360,8 @@ class Page_Exams extends Page Message::addInfo('no-upcoming-lecture-exams'); } else { Render::addTemplate('page-upcoming-lectures', [ - 'pending_lectures' => $upcoming + 'pending_lectures' => $upcoming, + 'decollapse' => array_key_exists('class', end($upcoming)) ]); } // Vis.js timeline diff --git a/modules-available/exams/templates/page-upcoming-lectures.html b/modules-available/exams/templates/page-upcoming-lectures.html index 4a62bc29..a1867444 100644 --- a/modules-available/exams/templates/page-upcoming-lectures.html +++ b/modules-available/exams/templates/page-upcoming-lectures.html @@ -8,7 +8,7 @@ <th>{{lang_actions}}</th> </tr> {{#pending_lectures}} - <tr> + <tr class="{{class}}"> <td> {{displayname}} <div class="small"> @@ -30,5 +30,14 @@ </td> </tr> {{/pending_lectures}} + {{#decollapse}} + <tr class="slx-decollapse"> + <td colspan="3"> + <span class="btn-group btn-group-justified"> + <span class="btn btn-default btn-sm"><span class="glyphicon glyphicon-menu-down"></span></span> + </span> + </td> + </tr> + {{/decollapse}} </table> </div>
\ No newline at end of file |