Commit ff053365 authored by Julian Rother's avatar Julian Rother
Browse files

Added notifications for chapter submission (closes #340)

parent 9c7bbbdd
......@@ -36,8 +36,12 @@ def suggest_chapter(lectureid):
submitter = None
if not ismod():
submitter = request.environ['REMOTE_ADDR']
lecture = query('SELECT * FROM lectures WHERE id = ?', lectureid)[0]
course = query('SELECT * FROM courses WHERE id = ?', lecture['course_id'])[0]
id = modify('INSERT INTO chapters (lecture_id, time, text, time_created, time_updated, created_by, submitted_by) VALUES (?, ?, ?, ?, ?, ?, ?)',
lectureid, time, text, datetime.now(), datetime.now(), session.get('user', {'dbid':None})['dbid'], submitter)
chapter = query('SELECT * FROM chapters WHERE id = ?', id)[0]
notify_mods('chapter_submitted', course['id'], course=course, lecture=lecture, chapter=chapter)
if 'ref' in request.values:
return redirect(request.values['ref'])
return 'OK', 200
......
Für das Video vom {{ lecture.time|date }} wurde folgender Kapitelmarker vorgeschlagen:
Zeit: {{ '%02d:%02d:%02d'|format( chapter.time//3600, (chapter.time//60)%60, chapter.time%60) }}
Titel: {{ chapter.text }}
Freischalten: {{ url_for('lecture', course=course.handle, id=lecture.id, t=chapter.time, _external=True) }}
Neuer Kapitelmarker in "{{ course.title }}" ({{ course.semester|semester }})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment