X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wradmin.git/blobdiff_plain/a273121b490c2a91ec115ccd56d5a6a13e8c6441..9f9969d09d9b027e93183d2df7de312772954b39:/wradmin/controllers/rodelbahn.py diff --git a/wradmin/controllers/rodelbahn.py b/wradmin/controllers/rodelbahn.py index 2089cdd..345cbc1 100644 --- a/wradmin/controllers/rodelbahn.py +++ b/wradmin/controllers/rodelbahn.py @@ -8,6 +8,7 @@ import wrpylib.mwmarkup from wradmin.app import db from wradmin.model import WrSledrunCache, WrReport +from wradmin.template_helper import PylonsHelper class RodelbahnController: @@ -34,6 +35,18 @@ class RodelbahnController: items_per_page=25) return render_template('rodelbahn_view.html', sledding=sledrun, paginator=paginator) + def json_edit(self, sledrun_id): + q = db.session.query(WrSledrunCache) + sledrun = q.get(sledrun_id) + if sledrun is None: + abort(404) + h = PylonsHelper() + return render_template('json_editor.html', + schema_url=url_for('static', filename='schema_v1.json'), + #json_url=url_for('static', filename='latschenhuette.json') + json_url=h.wiki(sledrun.page_title) + ) + def update(self): """Updates the wrsledruncache table from the wiki""" c = db.session.connection()