Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
efed38e6
Commit
efed38e6
authored
Apr 23, 2017
by
Andreas Valder
Browse files
closes
#51
parent
df29c74f
Changes
2
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
efed38e6
...
...
@@ -561,10 +561,18 @@ def auth(): # For use with nginx auth_request
@
register_navbar
(
'Changelog'
,
icon
=
'book'
)
@
mod_required
def
changelog
():
changelog
=
query
(
'SELECT * FROM changelog LEFT JOIN users ON (changelog.who = users.id) ORDER BY `when` DESC LIMIT 50'
)
if
'page'
in
request
.
args
:
page
=
max
(
0
,
int
(
request
.
args
[
'page'
]))
else
:
page
=
0
if
'pagesize'
in
request
.
args
:
pagesize
=
min
(
500
,
int
(
request
.
args
[
'pagesize'
]))
else
:
pagesize
=
50
changelog
=
query
(
'SELECT * FROM changelog LEFT JOIN users ON (changelog.who = users.id) ORDER BY `when` DESC LIMIT ? OFFSET ?'
,
pagesize
,
page
*
pagesize
)
for
entry
in
changelog
:
entry
[
'path'
]
=
'.'
.
join
([
entry
[
'table'
],
entry
[
'id_value'
],
entry
[
'field'
]])
return
render_template
(
'changelog.html'
,
changelog
=
changelog
)
return
render_template
(
'changelog.html'
,
changelog
=
changelog
,
page
=
page
,
pagesize
=
pagesize
)
@
app
.
route
(
'/files/<filename>'
)
def
files
(
filename
):
...
...
templates/changelog.html
View file @
efed38e6
...
...
@@ -8,6 +8,10 @@
</div>
<div
class=
"panel-body"
>
<p>
Hier werden alle Änderungen an Kursen/Veranstaltungen/Videos etc. geloggt und können Rückgängig gemacht werden.
</p>
<div
style=
"margin-top: 10px;"
class=
"col-xs-12"
>
<a
href=
"{{url_for('changelog', page=page-1) }}"
class=
"pull-left btn btn-default"
>
{{ "
<
<"
}}</
a
>
<a
href=
"{{url_for('changelog', page=page+1) }}"
class=
"pull-right btn btn-default"
>
{{ ">>" }}
</a>
</div>
</div>
<div
class=
"table-responsive"
>
<table
class=
"table table-condensed"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment