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
Iterations
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
Video AG Infrastruktur
website
Commits
aa46b95e
Commit
aa46b95e
authored
8 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Basic integration of video permission errors into player page (
#48
)
parent
bc071d3e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
server.py
+13
-2
13 additions, 2 deletions
server.py
templates/base.html
+1
-1
1 addition, 1 deletion
templates/base.html
with
14 additions
and
3 deletions
server.py
+
13
−
2
View file @
aa46b95e
...
...
@@ -129,8 +129,8 @@ def authdescr(auths):
return
'
rwth
'
,
'
Nur für RWTH-Angehörige verfügbar
'
if
l2p_courses
:
if
password
:
return
'
rwth
'
,
'
Nur für Teilnehmer der Veranstaltung und Nutzer mit Passwort verfügbar
'
return
'
rwth
'
,
'
Nur für Teilnehmer der Veranstaltung verfügbar
'
return
'
l2p
'
,
'
Nur für Teilnehmer der Veranstaltung und Nutzer mit Passwort verfügbar
'
return
'
l2p
'
,
'
Nur für Teilnehmer der Veranstaltung verfügbar
'
if
password
:
return
'
password
'
,
'
Nur für Nutzer mit Passwort verfügbar
'
return
'
public
'
,
'
Öffentlich verfügbar
'
...
...
@@ -295,12 +295,22 @@ def lecture(id):
WHERE videos.lecture_id = ? AND (? OR videos.visible)
ORDER BY formats.prio DESC
'''
,
lecture
[
'
course_id
'
],
lecture
[
'
id
'
],
ismod
())
auths
=
query
(
'
SELECT auth.* FROM auth WHERE (auth.lecture_id = ? OR auth.course_id = ?)
'
,
lecture
[
'
id
'
],
lecture
[
'
course_id
'
])
if
not
videos
:
flash
(
'
Zu dieser Vorlesung wurden noch keine Videos veröffentlicht!
'
)
course
=
query
(
'
SELECT * FROM courses WHERE id = ? AND (? OR (visible AND listed))
'
,
lecture
[
'
course_id
'
],
ismod
())[
0
]
if
not
course
:
return
render_endpoint
(
'
course
'
,
'
Diese Veranstaltung existiert nicht!
'
),
404
chapters
=
query
(
'
SELECT * FROM chapters WHERE lecture_id = ? AND NOT deleted AND (? OR visible) ORDER BY time ASC
'
,
id
,
ismod
())
if
not
checkauth
(
auths
):
mode
,
text
=
authdescr
(
auths
)
if
mode
==
'
rwth
'
:
flash
(
text
+
'
. <a target=
"
_blank
"
href=
"'
+
url_for
(
'
start_rwthauth
'
)
+
'"
>Hier authorisieren</a>.
'
)
elif
mode
==
'
l2p
'
:
flash
(
text
+
'
. <a target=
"
_blank
"
href=
"'
+
url_for
(
'
start_l2pauth
'
)
+
'"
>Hier authorisieren</a>.
'
)
else
:
flash
(
text
+
'
.
'
)
return
render_template
(
'
embed.html
'
if
request
.
endpoint
==
'
embed
'
else
'
lecture.html
'
,
course
=
course
,
lecture
=
lecture
,
videos
=
videos
,
chapters
=
chapters
)
...
...
@@ -436,6 +446,7 @@ def auth(): # For use with nginx auth_request
AND (? OR (courses.visible AND lectures.visible AND videos.visible))
ORDER BY auth.video_id DESC, auth.lecture_id DESC, auth.course_id DESC
'''
,
url
,
ismod
())
if
not
videos
:
return
"
Not allowed
"
,
403
auth
=
request
.
authorization
...
...
This diff is collapsed.
Click to expand it.
templates/base.html
+
1
−
1
View file @
aa46b95e
...
...
@@ -106,7 +106,7 @@
<div
class=
"col-xs-12 col-md-offset-{{ page_border }} col-md-{{ 12-(2*page_border) }}"
>
{% endif %}
{% for msg in get_flashed_messages() %}
<div
class=
"hidden-print alert alert-danger"
role=
"alert"
>
{{ msg }}
</div>
<div
class=
"hidden-print alert alert-danger"
role=
"alert"
>
{{ msg
|safe
}}
</div>
{% endfor %}
{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string]) %}
<div
class=
"hidden-print alert alert-{{levels.get(msg.level, ('info', ''))[0]}}"
role=
"alert"
>
...
...
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