diff --git a/db_schema.sql b/db_schema.sql index 85036ec2148f7d5e7f6b6884b18ba8d2cb012e0f..f47c8b9ba0c5acc5dba6a89de21b4adc096632d6 100644 --- a/db_schema.sql +++ b/db_schema.sql @@ -98,7 +98,8 @@ CREATE TABLE IF NOT EXISTS `lectures_data` ( `time_updated` datetime NOT NULL, `jumplist` text NOT NULL DEFAULT '', `titlefile` varchar(255) NOT NULL DEFAULT '', - `live` INTEGER NOT NULL DEFAULT 0 + `live` INTEGER NOT NULL DEFAULT 0, + `norecording` INTEGER NOT NULL DEFAULT 0 ); CREATE TABLE IF NOT EXISTS `places` ( `place` varchar(20) NOT NULL PRIMARY KEY, diff --git a/edit.py b/edit.py index a00f7a6d6801ddf4ad505c0dc5929f44fa6b0e06..77c8d929b4b14bff20e7ca4758bfffba2bce1d00 100644 --- a/edit.py +++ b/edit.py @@ -41,7 +41,8 @@ editable_tables = { 'duration': {'type': 'duration'}, 'jumplist': {'type': ''}, 'deleted': {'type': 'boolean'}, - 'live': {'type': 'boolean'}}, + 'live': {'type': 'boolean'}, + 'norecording': {'type': 'boolean'}}, 'creationtime_fields': ['course_id', 'time_created', 'time_updated'] }, 'videos': { 'table': 'videos_data', diff --git a/server.py b/server.py index 288b462e67c6524345b8d7c144229e3b101052d4..1e7bcab517770b3711e48031f21908a772b1b11e 100644 --- a/server.py +++ b/server.py @@ -331,7 +331,7 @@ def index(): SELECT lectures.*, "course" AS sep, courses.* FROM lectures JOIN courses ON (lectures.course_id = courses.id) - WHERE (time > ?) AND (time < ?) and lectures.visible and courses.visible and courses.listed + WHERE (time > ?) AND (time < ?) and lectures.visible and courses.visible and courses.listed and not lectures.norecording ORDER BY time ASC LIMIT 30''',start,end) for i in upcomming: i['date'] = i['time'].date() diff --git a/templates/macros.html b/templates/macros.html index c57cb0b69fe56e4fd2c8fc131f20cfba74b98ccf..7ea20683593d918a5e879e0ef6f0489c62ab7c11 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -165,7 +165,7 @@ $('#embedcodebtn').popover( {% endmacro %} {% macro lecture_list_item(lecture,videos,global_permissions) %} -<li class="list-group-item" id="lecture-{{lecture.id}}"> +<li class="list-group-item{% if lecture.norecording %} text-muted{% endif %}" id="lecture-{{lecture.id}}"> <div class="row"> <div style="background-image: url('{{ config.VIDEOPREFIX }}/thumbnail/l_{{lecture.id}}.jpg')" class="col-sm-2 col-xs-12 thumbnailimg"> {% if not videos|length is equalto 0 %} @@ -189,6 +189,7 @@ $('#embedcodebtn').popover( <li>{{ moderator_editor(['lectures',lecture.id,'internal'], lecture.internal) }}</li> <li>Sichtbar: {{ moderator_checkbox(['lectures',lecture.id,'visible'], lecture.visible) }}</li> <li>Livestream geplant: {{ moderator_checkbox(['lectures',lecture.id,'live'], lecture.live) }}</li> + <li>Wird nicht aufgenommen: {{ moderator_checkbox(['lectures',lecture.id,'norecording'], lecture.norecording) }}</li> <li>Hörsaal: {{ moderator_editor(['lectures',lecture.id,'place'], lecture.place) }} </li> {% endif %} </ul> diff --git a/timetable.py b/timetable.py index 2ccb548870b4a16c87876ed5b1e0b04eec5511e1..1fee5bb6fbbc7f27d8e4d62dee42f5ebf08ae8d5 100644 --- a/timetable.py +++ b/timetable.py @@ -26,7 +26,7 @@ def timetable(): SELECT lectures.*, courses.short, "course" AS sep, courses.* FROM lectures JOIN courses ON (lectures.course_id = courses.id) - WHERE time < ? and time > ? + WHERE time < ? AND time > ? AND NOT norecording ORDER BY time ASC''', i['date']+timedelta(weeks=2), i['date']-timedelta(weeks=2)): # we can not use the where clause of sql to match against the time, because sqlite and mysql use a different syntax -.- # we still use it to only get the lectures for a 3 week periode