diff --git a/templates/lecture.html b/templates/lecture.html index f39d37d293394e8c89303b6804d4cba9bc11e5f7..a5e0a07c6515b8be76e875393441b26ca590aab3 100644 --- a/templates/lecture.html +++ b/templates/lecture.html @@ -27,7 +27,6 @@ <div class="col-xs-12" style="padding-bottom: 5px;"> <a href="{{url_for('course', handle=course.handle)}}#lecture-{{lecture.id}}" class="btn btn-default" >Zur Veranstaltungsseite</a> <ul class="list-inline pull-right"> - <li><button class="btn btn-default" id="hintnewchapter">Kapitelmarker vorschlagen</button></li> <li>{{ video_embed_btn(lecture.id, course=course.handle) }}</li> <li class="dropdown">{{ video_download_btn(videos) }}</li> </ul> @@ -42,7 +41,9 @@ </div> {% if (chapters|length > 0) or ismod() %} <div class="col-xs-12 table-responsive" style="padding-top: 10px;"> - <p>Kapitel:</p> + <p>Kapitel: + <button class="btn btn-default" id="hintnewchapter">{% if ismod() %}Neues Kapitel{% else %}Kapitelmarker vorschlagen{% endif %}</button> + </p> <table class="table table-hover"> <tr> <th style="width: 130px;">Start</th> @@ -86,8 +87,12 @@ function hintchapterclick (src) { data: $(src).serialize(), success: function(data) { - alert("Kapitelmarker vorgeschlagen. Danke!"); - $('#hintnewchapter').popover('hide'); + {% if not ismod() %} + alert("Kapitelmarker vorgeschlagen. Danke!"); + {% else %} + window.location.reload(); + {% endif %} + $('#hintnewchapter').click(); } }); return false; @@ -97,6 +102,8 @@ $(function() { { html:true, title:'Kapitelmarkierung vorschlagen', + placement: 'bottom', + container: 'body', content: function() { var zeropad = function (num, places) { var zero = places - num.toString().length + 1; @@ -107,7 +114,7 @@ $(function() { var m = zeropad( Math.trunc((timestamp%3600)/60),2); var s = zeropad( Math.trunc(timestamp%60),2); var timeasstring = h+':'+m+':'+s; - return '<form method="post" data-url="{{ url_for('suggest_chapter', lectureid=lecture.id) }}" onSubmit="return hintchapterclick(this);"><input class="form-control" placeholder="00:00.000" name="time" type="text" value="'+timeasstring+'"><br><input class="form-control" placeholder="Kapitel" name="text" type="text"><br><input type="submit" class="btn btn-default" value="Vorschlagen"></form>'; + return '<form method="post" data-url="{{ url_for('suggest_chapter', lectureid=lecture.id) }}" onSubmit="return hintchapterclick(this);"><input class="form-control" placeholder="00:00.000" name="time" type="text" value="'+timeasstring+'"><br><input class="form-control" placeholder="Kapitel" name="text" type="text"><br><input type="submit" class="btn btn-default" value="{% if ismod() %}Hinzufügen{% else %}Vorschlagen{% endif %}"></form>'; } })