Skip to content
Snippets Groups Projects
Commit 79faf3c0 authored by Andreas Valder's avatar Andreas Valder
Browse files

started a campus import

parent fe30c0b0
No related branches found
No related tags found
No related merge requests found
......@@ -298,3 +298,11 @@ def stats():
def log():
changelog = query('SELECT *, ( "table" || "." || id_value || "." ||field) as path FROM changelog LEFT JOIN users ON (changelog.who = users.id) ORDER BY "when" DESC LIMIT 50')
return render_template('log.html', changelog=changelog)
@app.route('/import/<source>/<id>')
@app.route('/import/<source>/<int:numid>')
@handle_errors('course', 'Diese Veranstaltung existiert nicht!', 404, IndexError)
def import_from(numid=None, source=None, id=None):
if source != "campus":
return "Unknown source", 404
return render_template('import_campus.html')
......@@ -31,7 +31,7 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Videos{% if ismod() %} <a class="btn btn-default" style="margin-right: 5px;" href="todo">Neuer Termin</a>{% endif %}</h1>
<h1 class="panel-title">Videos{% if ismod() %} <a class="btn btn-default" style="margin-right: 5px;" href="todo">Neuer Termin</a><a class="btn btn-default" style="margin-right: 5px;" href="{{url_for('import_from', source="campus", id=course['id'])}}">Campus Import</a>{% endif %}</h1>
</div>
<ul class="list-group lectureslist">
{% for l in lectures %}
......
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% block content %}
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Campus Import</h1>
</div>
<div class="panel-body">
</div>
</div>
</div>
{% endblock %}
......@@ -19,7 +19,7 @@
{% for i in changelog %}
<tr>
<td>{{i.when}}</td>
<td>{% if (i.who != i.who|string) %}{{i.realname}}{% else %}{{i.who}}{%endif%}</td>
<td>{% if (i.who != i.who|string) %}{{i.realname}} ({{i.who}}){% else %}{{i.who}}{%endif%}</td>
<td>{{i.path}}</td>
<td>"{{i.value_old}}"</td>
<td>"{{i.value_new}}"</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment