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
bc644317
Commit
bc644317
authored
8 years ago
by
Julian Rother
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.fsmpi.rwth-aachen.de:videoagwebsite/videoagwebsite
parents
f841a3a6
44bf5794
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
config.py.example
+1
-0
1 addition, 0 deletions
config.py.example
db.py
+1
-1
1 addition, 1 deletion
db.py
server.py
+16
-0
16 additions, 0 deletions
server.py
templates/base.html
+2
-2
2 additions, 2 deletions
templates/base.html
templates/macros.html
+23
-0
23 additions, 0 deletions
templates/macros.html
with
43 additions
and
3 deletions
config.py.example
+
1
−
0
View file @
bc644317
...
@@ -11,6 +11,7 @@ DB_DATA = 'db_example.sql'
...
@@ -11,6 +11,7 @@ DB_DATA = 'db_example.sql'
#DB_ENGINE = 'mysql'
#DB_ENGINE = 'mysql'
#MYSQL_HOST = 'localhost'
#MYSQL_HOST = 'localhost'
#MYSQL_USER = 'videoag'
#MYSQL_USER = 'videoag'
#MYSQL_PORT = 3306
#MYSQL_PASSWD = 'somuchsecret'
#MYSQL_PASSWD = 'somuchsecret'
#MYSQL_DB = 'videos'
#MYSQL_DB = 'videos'
...
...
This diff is collapsed.
Click to expand it.
db.py
+
1
−
1
View file @
bc644317
...
@@ -47,7 +47,7 @@ elif config['DB_ENGINE'] == 'mysql':
...
@@ -47,7 +47,7 @@ elif config['DB_ENGINE'] == 'mysql':
def
get_dbcursor
():
def
get_dbcursor
():
if
'
db
'
not
in
g
or
not
g
.
db
.
is_connected
():
if
'
db
'
not
in
g
or
not
g
.
db
.
is_connected
():
g
.
db
=
mysql
.
connector
.
connect
(
user
=
config
[
'
MYSQL_USER
'
],
password
=
config
[
'
MYSQL_PASSWD
'
],
host
=
config
[
'
MYSQL_HOST
'
],
database
=
config
[
'
MYSQL_DB
'
])
g
.
db
=
mysql
.
connector
.
connect
(
user
=
config
[
'
MYSQL_USER
'
],
password
=
config
[
'
MYSQL_PASSWD
'
],
host
=
config
[
'
MYSQL_HOST
'
],
port
=
config
[
'
MYSQL_PORT
'
],
database
=
config
[
'
MYSQL_DB
'
])
if
not
hasattr
(
request
,
'
db
'
):
if
not
hasattr
(
request
,
'
db
'
):
request
.
db
=
g
.
db
.
cursor
()
request
.
db
=
g
.
db
.
cursor
()
return
request
.
db
return
request
.
db
...
...
This diff is collapsed.
Click to expand it.
server.py
+
16
−
0
View file @
bc644317
...
@@ -629,6 +629,22 @@ def sitemap():
...
@@ -629,6 +629,22 @@ def sitemap():
return
Response
(
render_template
(
'
sitemap.xml
'
,
pages
=
pages
),
200
,
{
'
Content-Type
'
:
'
application/atom+xml
'
}
)
return
Response
(
render_template
(
'
sitemap.xml
'
,
pages
=
pages
),
200
,
{
'
Content-Type
'
:
'
application/atom+xml
'
}
)
@app.route
(
'
/site/
'
)
@app.route
(
'
/site/<string:phpfile>
'
)
def
legacy
(
phpfile
=
None
):
if
phpfile
==
'
embed.php
'
and
(
'
lecture
'
in
request
.
args
):
return
redirect
(
url_for
(
'
embed
'
,
id
=
request
.
args
[
'
lecture
'
]),
code
=
302
)
if
phpfile
==
'
feed.php
'
and
(
'
all
'
in
request
.
args
):
return
redirect
(
url_for
(
'
feed
'
),
code
=
302
)
if
phpfile
==
'
feed.php
'
and
(
'
newcourses
'
in
request
.
args
):
return
redirect
(
url_for
(
'
courses_feed
'
),
code
=
302
)
if
phpfile
==
'
feed.php
'
:
return
redirect
(
url_for
(
'
feed
'
,
handle
=
request
.
args
.
copy
().
popitem
()[
0
]),
code
=
302
)
print
(
"
Unknown legacy url:
"
,
request
.
url
)
return
redirect
(
url_for
(
'
index
'
),
code
=
302
)
import
feeds
import
feeds
import
importer
import
importer
import
stats
import
stats
...
...
This diff is collapsed.
Click to expand it.
templates/base.html
+
2
−
2
View file @
bc644317
...
@@ -131,7 +131,7 @@
...
@@ -131,7 +131,7 @@
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<ul
class=
"list-inline"
style=
"margin-top: 5px;"
>
<ul
class=
"list-inline"
style=
"margin-top: 5px;"
>
<li>
<li>
<a
href=
"http://www.fsmpi.rwth-aachen.de/"
>
Fachschaft I/1
</a>
<a
href=
"http
s
://www.fsmpi.rwth-aachen.de/"
>
Fachschaft I/1
</a>
</li>
</li>
<li>
<li>
<a
href=
"http://www.vampir.rwth-aachen.de/"
>
Vampir e.V.
</a>
<a
href=
"http://www.vampir.rwth-aachen.de/"
>
Vampir e.V.
</a>
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
<a
href=
"https://www.youtube.com/channel/UCxh5snRN7yZyBsytNbGNuEQ"
>
Youtube
</a>
<a
href=
"https://www.youtube.com/channel/UCxh5snRN7yZyBsytNbGNuEQ"
>
Youtube
</a>
</li>
</li>
<li>
<li>
<a
href=
"
#
"
>
Facebook
</a>
<a
href=
"
https://www.facebook.com/videoag
"
>
Facebook
</a>
</li>
</li>
<li>
<li>
<a
href=
"https://twitter.com/rwthvideo"
>
Twitter
</a>
<a
href=
"https://twitter.com/rwthvideo"
>
Twitter
</a>
...
...
This diff is collapsed.
Click to expand it.
templates/macros.html
+
23
−
0
View file @
bc644317
...
@@ -55,6 +55,29 @@
...
@@ -55,6 +55,29 @@
$
(
'
#videoplayer
'
).
addClass
(
"
vjs-16-9
"
);
$
(
'
#videoplayer
'
).
addClass
(
"
vjs-16-9
"
);
$
(
'
#videoplayer
'
).
css
(
"
width
"
);
$
(
'
#videoplayer
'
).
css
(
"
width
"
);
$
(
function
()
{
$
(
function
()
{
//resume
var
progress_key
=
"
progress_{{ lecture.id }}
"
;
var
seconds_played
;
if
(
localStorage
)
{
seconds_played
=
localStorage
.
getItem
(
progress_key
);
if
(
!
seconds_played
)
{
seconds_played
=
0
;
}
else
{
videojs
(
'
videoplayer
'
).
currentTime
(
seconds_played
);
}
}
videojs
(
"
videoplayer
"
).
on
(
"
timeupdate
"
,
function
()
{
if
(
localStorage
)
{
var
player_cur_Time
=
Math
.
round
(
videojs
(
"
videoplayer
"
).
currentTime
());
if
(
Math
.
abs
(
player_cur_Time
-
seconds_played
)
>=
10
)
{
seconds_played
=
player_cur_Time
;
localStorage
.
setItem
(
progress_key
,
seconds_played
)
}
}
});
//autoplay
var
playerplay
=
function
()
{
var
playerplay
=
function
()
{
if
(
$
(
'
#videoplayer
'
).
data
(
"
wasnotplayed
"
)
==
1
)
{
if
(
$
(
'
#videoplayer
'
).
data
(
"
wasnotplayed
"
)
==
1
)
{
videojs
(
'
videoplayer
'
).
play
();
videojs
(
'
videoplayer
'
).
play
();
...
...
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