diff --git a/db_schema.sql b/db_schema.sql index f47c8b9ba0c5acc5dba6a89de21b4adc096632d6..44ac919a500b8b2dfb18350d02c58c20aa7efd71 100644 --- a/db_schema.sql +++ b/db_schema.sql @@ -61,7 +61,8 @@ CREATE TABLE IF NOT EXISTS `courses_data` ( `description` text NOT NULL DEFAULT '', `internal` text NOT NULL DEFAULT '', `responsible` text NOT NULL DEFAULT '', - `feed_url` text NOT NULL DEFAULT '' + `feed_url` text NOT NULL DEFAULT '', + `external` INTEGER NOT NULL DEFAULT 0 ); CREATE TABLE IF NOT EXISTS `filesizes` ( `path` varchar(255) NOT NULL PRIMARY KEY, diff --git a/edit.py b/edit.py index 77c8d929b4b14bff20e7ca4758bfffba2bce1d00..cfd7d1e7debcc85dbd8ef8f29bf259e7def2296d 100644 --- a/edit.py +++ b/edit.py @@ -25,7 +25,8 @@ editable_tables = { 'internal': {'type': 'text'}, 'responsible': {'type': 'shortstring'}, 'deleted': {'type': 'boolean'}, - 'description': {'type': 'text'} }, + 'description': {'type': 'text'}, + 'external': {'type': 'boolean'}}, 'creationtime_fields': ['created_by', 'time_created', 'time_updated'] }, 'lectures': { 'table': 'lectures_data', diff --git a/templates/course.html b/templates/course.html index 9868782fac52a58f22e958483f919f012ad6e4a2..6bbb9e915a58af67c96861574ed0937f2ddd3f3a 100644 --- a/templates/course.html +++ b/templates/course.html @@ -41,6 +41,7 @@ <tbody> <tr><td>Sichtbar:</td><td>{{ moderator_checkbox(['courses',course.id,'visible'], course.visible) }}</td></tr> <tr><td>Gelistet:</td><td>{{ moderator_checkbox(['courses',course.id,'listed'], course.listed) }}</td></tr> + <tr><td>Nicht im Drehplan:</td><td>{{ moderator_checkbox(['courses',course.id,'external'], course.external) }}</td></tr> <tr><td>Videos downloadbar:</td><td>{{ moderator_checkbox(['courses',course.id,'downloadable'], course.downloadable) }}</td></tr> <tr><td>Short:</td><td>{{ moderator_editor(['courses',course.id,'short'], course.short) }}</td></tr> <tr><td>Handle:</td><td>{{ moderator_editor(['courses',course.id,'handle'], course.handle) }}</td></tr> diff --git a/timetable.py b/timetable.py index 1fee5bb6fbbc7f27d8e4d62dee42f5ebf08ae8d5..ad2a54dfeeb82a585466efdb0b7c4bc0e4d53cb9 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 > ? AND NOT norecording + WHERE time < ? AND time > ? AND NOT norecording AND NOT external 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