Skip to content
Snippets Groups Projects
Commit 83d39362 authored by Julian Rother's avatar Julian Rother
Browse files

Added "external" property for courses (#213)

parent 25683ada
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,8 @@ CREATE TABLE IF NOT EXISTS `courses_data` ( ...@@ -61,7 +61,8 @@ CREATE TABLE IF NOT EXISTS `courses_data` (
`description` text NOT NULL DEFAULT '', `description` text NOT NULL DEFAULT '',
`internal` text NOT NULL DEFAULT '', `internal` text NOT NULL DEFAULT '',
`responsible` 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` ( CREATE TABLE IF NOT EXISTS `filesizes` (
`path` varchar(255) NOT NULL PRIMARY KEY, `path` varchar(255) NOT NULL PRIMARY KEY,
......
...@@ -25,7 +25,8 @@ editable_tables = { ...@@ -25,7 +25,8 @@ editable_tables = {
'internal': {'type': 'text'}, 'internal': {'type': 'text'},
'responsible': {'type': 'shortstring'}, 'responsible': {'type': 'shortstring'},
'deleted': {'type': 'boolean'}, 'deleted': {'type': 'boolean'},
'description': {'type': 'text'} }, 'description': {'type': 'text'},
'external': {'type': 'boolean'}},
'creationtime_fields': ['created_by', 'time_created', 'time_updated'] }, 'creationtime_fields': ['created_by', 'time_created', 'time_updated'] },
'lectures': { 'lectures': {
'table': 'lectures_data', 'table': 'lectures_data',
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<tbody> <tbody>
<tr><td>Sichtbar:</td><td>{{ moderator_checkbox(['courses',course.id,'visible'], course.visible) }}</td></tr> <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>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>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>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> <tr><td>Handle:</td><td>{{ moderator_editor(['courses',course.id,'handle'], course.handle) }}</td></tr>
......
...@@ -26,7 +26,7 @@ def timetable(): ...@@ -26,7 +26,7 @@ def timetable():
SELECT lectures.*, courses.short, "course" AS sep, courses.* SELECT lectures.*, courses.short, "course" AS sep, courses.*
FROM lectures FROM lectures
JOIN courses ON (lectures.course_id = courses.id) 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)): 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 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 # we still use it to only get the lectures for a 3 week periode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment