Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jannik Hellenkamp
website
Commits
a4b710f5
Commit
a4b710f5
authored
8 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Migrated new_lecture to "new" endpoint
parent
ac621026
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
db_schema.sql
+8
-8
8 additions, 8 deletions
db_schema.sql
server.py
+22
-23
22 additions, 23 deletions
server.py
templates/course.html
+1
-1
1 addition, 1 deletion
templates/course.html
templates/import_campus.html
+1
-1
1 addition, 1 deletion
templates/import_campus.html
with
32 additions
and
33 deletions
db_schema.sql
+
8
−
8
View file @
a4b710f5
...
@@ -84,19 +84,19 @@ CREATE TABLE IF NOT EXISTS `lectures_data` (
...
@@ -84,19 +84,19 @@ CREATE TABLE IF NOT EXISTS `lectures_data` (
`visible`
INTEGER
NOT
NULL
DEFAULT
'1'
,
`visible`
INTEGER
NOT
NULL
DEFAULT
'1'
,
`timed_release`
datetime
DEFAULT
NULL
,
`timed_release`
datetime
DEFAULT
NULL
,
`use_timed_release`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`use_timed_release`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`drehplan`
varchar
(
10
)
NOT
NULL
,
`drehplan`
varchar
(
10
)
NOT
NULL
DEFAULT
''
,
`deleted`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`deleted`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`title`
text
NOT
NULL
,
`title`
text
NOT
NULL
DEFAULT
''
,
`comment`
text
NOT
NULL
,
`comment`
text
NOT
NULL
DEFAULT
''
,
`internal`
text
NOT
NULL
,
`internal`
text
NOT
NULL
DEFAULT
''
,
`speaker`
text
NOT
NULL
,
`speaker`
text
NOT
NULL
DEFAULT
''
,
`place`
text
NOT
NULL
,
`place`
text
NOT
NULL
DEFAULT
''
,
`time`
datetime
NOT
NULL
,
`time`
datetime
NOT
NULL
,
`duration`
INTEGER
NOT
NULL
DEFAULT
'90'
,
`duration`
INTEGER
NOT
NULL
DEFAULT
'90'
,
`time_created`
datetime
NOT
NULL
,
`time_created`
datetime
NOT
NULL
,
`time_updated`
datetime
NOT
NULL
,
`time_updated`
datetime
NOT
NULL
,
`jumplist`
text
NOT
NULL
,
`jumplist`
text
NOT
NULL
DEFAULT
''
,
`titlefile`
varchar
(
255
)
NOT
NULL
`titlefile`
varchar
(
255
)
NOT
NULL
DEFAULT
''
);
);
CREATE
TABLE
IF
NOT
EXISTS
`places`
(
CREATE
TABLE
IF
NOT
EXISTS
`places`
(
`place`
varchar
(
20
)
NOT
NULL
PRIMARY
KEY
,
`place`
varchar
(
20
)
NOT
NULL
PRIMARY
KEY
,
...
...
This diff is collapsed.
Click to expand it.
server.py
+
22
−
23
View file @
a4b710f5
...
@@ -257,13 +257,20 @@ def logout():
...
@@ -257,13 +257,20 @@ def logout():
tabs
=
{
tabs
=
{
'
courses
'
:
(
'
courses_data
'
,
'
id
'
,
[
'
visible
'
,
'
listed
'
,
'
title
'
,
'
short
'
,
'
courses
'
:
(
'
courses_data
'
,
'
id
'
,
[
'
visible
'
,
'
listed
'
,
'
title
'
,
'
short
'
,
'
handle
'
,
'
organizer
'
,
'
subject
'
,
'
semester
'
,
'
downloadable
'
,
'
handle
'
,
'
organizer
'
,
'
subject
'
,
'
semester
'
,
'
downloadable
'
,
'
internal
'
,
'
responsible
'
,
'
deleted
'
]),
'
internal
'
,
'
responsible
'
,
'
deleted
'
],
[
'
created_by
'
,
'
time_created
'
,
'
time_updated
'
]),
'
lectures
'
:
(
'
lectures_data
'
,
'
id
'
,
[
'
visible
'
,
'
title
'
,
'
comment
'
,
'
lectures
'
:
(
'
lectures_data
'
,
'
id
'
,
[
'
visible
'
,
'
title
'
,
'
comment
'
,
'
internal
'
,
'
speaker
'
,
'
place
'
,
'
time
'
,
'
duration
'
,
'
jumplist
'
,
'
deleted
'
]),
'
internal
'
,
'
speaker
'
,
'
place
'
,
'
time
'
,
'
duration
'
,
'
jumplist
'
,
'
deleted
'
],
'
videos
'
:
(
'
videos_data
'
,
'
id
'
,
[
'
visible
'
,
'
deleted
'
]),
[
'
course_id
'
,
'
time_created
'
,
'
time_updated
'
]),
'
chapters
'
:
(
'
chapters
'
,
'
id
'
,
[
'
time
'
,
'
text
'
,
'
visible
'
,
'
deleted
'
]),
'
videos
'
:
(
'
videos_data
'
,
'
id
'
,
[
'
visible
'
,
'
deleted
'
],
'
announcements
'
:
(
'
announcements
'
,
'
id
'
,
[
'
text
'
,
'
level
'
,
'
visible
'
,
'
deleted
'
,
'
time_publish
'
,
'
time_expire
'
]),
[
'
created_by
'
,
'
time_created
'
,
'
time_updated
'
]),
'
featured
'
:
(
'
featured
'
,
'
id
'
,
[
'
title
'
,
'
text
'
,
'
internal
'
,
'
visible
'
,
'
deleted
'
])
'
chapters
'
:
(
'
chapters
'
,
'
id
'
,
[
'
time
'
,
'
text
'
,
'
visible
'
,
'
deleted
'
],
[
'
created_by
'
,
'
time_created
'
,
'
time_updated
'
]),
'
announcements
'
:
(
'
announcements
'
,
'
id
'
,
[
'
text
'
,
'
level
'
,
'
visible
'
,
'
deleted
'
,
'
time_publish
'
,
'
time_expire
'
],
[
'
created_by
'
,
'
time_created
'
,
'
time_updated
'
]),
'
featured
'
:
(
'
featured
'
,
'
id
'
,
[
'
title
'
,
'
text
'
,
'
internal
'
,
'
visible
'
,
'
deleted
'
],
[
'
created_by
'
,
'
time_created
'
,
'
time_updated
'
])
}
}
@app.route
(
'
/edit
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@app.route
(
'
/edit
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
...
@@ -297,15 +304,21 @@ def edit(prefix='', ignore=[]):
...
@@ -297,15 +304,21 @@ def edit(prefix='', ignore=[]):
@mod_required
@mod_required
def
create
(
table
):
def
create
(
table
):
assert
table
in
tabs
assert
table
in
tabs
columns
=
[
'
created_by
'
,
'
time_created
'
,
'
time_updated
'
]
defaults
=
{
'
created_by
'
:
session
[
'
user
'
][
'
dbid
'
],
'
time_created
'
:
datetime
.
now
(),
'
time_updated
'
:
datetime
.
now
()}
values
=
[
session
[
'
user
'
][
'
dbid
'
],
datetime
.
now
(),
datetime
.
now
()]
columns
=
[]
values
=
[]
for
column
,
val
in
defaults
.
items
():
if
column
in
tabs
[
table
][
3
]:
columns
.
append
(
column
)
values
.
append
(
val
)
args
=
request
.
values
args
=
request
.
values
if
request
.
is_json
:
if
request
.
is_json
:
args
=
request
.
get_json
()
args
=
request
.
get_json
()
for
column
,
val
in
args
.
items
():
for
column
,
val
in
args
.
items
():
if
column
==
'
ref
'
:
if
column
==
'
ref
'
:
continue
continue
assert
column
in
tabs
[
table
][
2
]
assert
column
in
tabs
[
table
][
2
]
+
tabs
[
table
][
3
]
assert
column
not
in
defaults
columns
.
append
(
column
)
columns
.
append
(
column
)
values
.
append
(
val
)
values
.
append
(
val
)
id
=
modify
(
'
INSERT INTO %s (%s) VALUES (%s)
'
%
(
tabs
[
table
][
0
],
id
=
modify
(
'
INSERT INTO %s (%s) VALUES (%s)
'
%
(
tabs
[
table
][
0
],
...
@@ -314,20 +327,6 @@ def create(table):
...
@@ -314,20 +327,6 @@ def create(table):
return
redirect
(
request
.
values
[
'
ref
'
])
return
redirect
(
request
.
values
[
'
ref
'
])
return
str
(
id
),
200
return
str
(
id
),
200
@app.route
(
'
/newlecture/<courseid>
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@mod_required
def
new_lecture
(
courseid
):
id
=
modify
(
'''
INSERT INTO lectures_data
(course_id, visible, drehplan, title, comment, internal, speaker, place,
time, time_created, time_updated, jumplist, titlefile)
VALUES (?, 0,
""
,
"
Noch kein Titel
"
,
""
,
""
,
""
,
""
, ?, ?, ?,
""
,
""
)
'''
,
courseid
,
datetime
.
now
(),
datetime
.
now
(),
datetime
.
now
())
edit
(
prefix
=
'
lectures.
'
+
str
(
id
)
+
'
.
'
,
ignore
=
[
'
ref
'
])
if
'
ref
'
in
request
.
values
:
return
redirect
(
request
.
values
[
'
ref
'
])
return
str
(
id
),
200
@app.route
(
'
/auth
'
)
@app.route
(
'
/auth
'
)
def
auth
():
# For use with nginx auth_request
def
auth
():
# For use with nginx auth_request
if
'
X-Original-Uri
'
not
in
request
.
headers
:
if
'
X-Original-Uri
'
not
in
request
.
headers
:
...
...
This diff is collapsed.
Click to expand it.
templates/course.html
+
1
−
1
View file @
a4b710f5
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
</div>
</div>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<div
class=
"panel-heading"
>
<h1
class=
"panel-title"
>
Videos{% if ismod() %}
<a
class=
"btn btn-default"
style=
"margin-right: 5px;"
href=
"{{ url_for('
new_lectur
e', courseid=course.id, ref=request.url) }}"
>
Neuer Termin
</a><a
class=
"btn btn-default"
style=
"margin-right: 5px;"
href=
"{{url_for('import_from', id=course['id'])}}"
>
Campus Import
</a>
{% endif %}
<a
class=
"fa fa-rss-square pull-right"
aria-hidden=
"true"
href=
"{{url_for('feed', handle=course.handle)}}"
></a>
</h1>
<h1
class=
"panel-title"
>
Videos{% if ismod() %}
<a
class=
"btn btn-default"
style=
"margin-right: 5px;"
href=
"{{ url_for('
create', table='lectures', time=datetime.now(), title='Noch kein Titl
e', course
_
id=course.id, ref=request.url) }}"
>
Neuer Termin
</a><a
class=
"btn btn-default"
style=
"margin-right: 5px;"
href=
"{{url_for('import_from', id=course['id'])}}"
>
Campus Import
</a>
{% endif %}
<a
class=
"fa fa-rss-square pull-right"
aria-hidden=
"true"
href=
"{{url_for('feed', handle=course.handle)}}"
></a>
</h1>
</div>
</div>
<ul
class=
"list-group lectureslist"
>
<ul
class=
"list-group lectureslist"
>
{% for l in lectures %}
{% for l in lectures %}
...
...
This diff is collapsed.
Click to expand it.
templates/import_campus.html
+
1
−
1
View file @
a4b710f5
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
{{ valuedeletebtn(['lectures',i.id,'deleted']) }}
{{ valuedeletebtn(['lectures',i.id,'deleted']) }}
{% endif%}
{% endif%}
{% if (i.type == 'import') %}
{% if (i.type == 'import') %}
<button
class=
"btn btn-default newlecture"
onclick=
"moderatorinterface.gethttp('{{ url_for('
new_
lecture', courseid=course.id, time=i.time, title=i.title, place=i.place) }}')"
>
anlegen
</a>
<button
class=
"btn btn-default newlecture"
onclick=
"moderatorinterface.gethttp('{{ url_for('
create', table='
lecture', course
_
id=course.id, time=i.time, title=i.title, place=i.place) }}')"
>
anlegen
</a>
{% endif%}
{% endif%}
</span>
</span>
</span>
</span>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment