From c5ef90568843e0ee6fab48d0e574c729692843eb Mon Sep 17 00:00:00 2001 From: Andreas <andreasv@fsmpi.rwth-aachen.de> Date: Mon, 12 Sep 2016 01:48:49 +0200 Subject: [PATCH] fixed chapter marks, now editable, closes #22 --- templates/chapters.srt | 7 ++++--- templates/lecture.html | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/templates/chapters.srt b/templates/chapters.srt index 0f2f3bc..cf76270 100644 --- a/templates/chapters.srt +++ b/templates/chapters.srt @@ -2,13 +2,14 @@ WEBVTT - - {% for c in chapters|sort(attribute='start') %} {{ loop.index }} {# time format is 'minutes:seconds.ms' we expect full seconds #} {{ vtttime(c['start']) }} --> {{ vtttime(c['end']) }} {{ c['text'] }} -{% else $} +{% else %} +00:00:00.000 --> 23:59:59.999 +Video + {% endfor %} diff --git a/templates/lecture.html b/templates/lecture.html index ab0fc0d..13088a4 100644 --- a/templates/lecture.html +++ b/templates/lecture.html @@ -1,6 +1,10 @@ {% from 'macros.html' import player %} {% from 'macros.html' import video_download_btn %} {% from 'macros.html' import video_embed_btn %} +{% from 'macros.html' import vtttime %} +{% from 'macros.html' import valueeditor %} +{% from 'macros.html' import valuedeletebtn %} +{% from 'macros.html' import valuecheckbox %} {% set page_border = 0 -%} {% extends "base.html" %} @@ -27,6 +31,25 @@ {{ player(lecture, videos) }} </div> <div class="col-xs-12" style="padding-top: 10px;"> + <p>Kapitel:</p> + <table class="table table-hover"> + <tr> + <th>Index</th> + <th>Start</th> + <th>Kapitel</th> + <th>Sichtbar</th> + <th></th> + </tr> + {% for c in chapters|sort(attribute='start') %} + <tr onclick=" $('.player video')[0].setCurrentTime({{c['time']}})"> + <td>{{ loop.index }}</td> + <td>{{ vtttime(c['time']) }}</td> + <td>{{ valueeditor(['chapters',c.id,'text'],c['text']) }}</td> + <td>{{ valuecheckbox(['chapters',c.id,'visible'], c.visible) }}</td> + <td>{{ valuedeletebtn(['chapters',c.id,'deleted']) }}</td> + </tr> + {% endfor %} + </table> </div> </div> </div> -- GitLab