Commit efed38e6 authored by Andreas Valder's avatar Andreas Valder
Browse files

closes #51

parent df29c74f
......@@ -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):
......
......@@ -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">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment