]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/blobdiff - wradmin/__init__.py
Start creating render view of sledrun-JSON.
[philipp/winterrodeln/wradmin.git] / wradmin / __init__.py
index 2141d57116f4395607fded2f1ae05722ec973050..4dd0ebec06c0d4f47c30e0b4d19460403137dc94 100644 (file)
@@ -1,19 +1,18 @@
-from flask import Flask, send_from_directory, abort, g, render_template, request, redirect, url_for, flash, \
+from flask import g, render_template, request, redirect, url_for, flash, \
     session, current_app
-from flask_sqlalchemy import SQLAlchemy
-from sqlalchemy.engine import create_engine
+from flask_login import current_user, login_required, login_user, logout_user
+from flask_principal import RoleNeed, identity_changed, identity_loaded, Identity, \
+    AnonymousIdentity, UserNeed
+
 import wradmin.model
 import wradmin.template_helper
 from wradmin.app import app, db, admin_permission, login_manager
-from wradmin.controllers.rodelbahn import RodelbahnController
-from wradmin.controllers.gasthaus import GasthausController
-from wradmin.controllers.bericht import BerichtController
-from wradmin.controllers.coordtool import CoordtoolController
 from wradmin.auth import password_is_correct
 from wradmin.auth.forms import LoginForm
-from flask_login import LoginManager, current_user, login_required, login_user, logout_user
-from flask_principal import Principal, Permission, RoleNeed, identity_changed, identity_loaded, Identity, \
-    AnonymousIdentity, UserNeed
+from wradmin.controllers.bericht import BerichtController
+from wradmin.controllers.coordtool import CoordtoolController
+from wradmin.controllers.gasthaus import GasthausController
+from wradmin.controllers.rodelbahn import RodelbahnController
 
 
 @app.before_request
@@ -39,6 +38,18 @@ def rodelbahn_view(id):
     return RodelbahnController().view(id)
 
 
+@app.route("/rodelbahn/view_wikitext/<int:id>")
+def rodelbahn_view_wikitext(id):
+    return RodelbahnController().view_wikitext(id)
+
+
+@app.route("/rodelbahn/json/edit/<int:id>")
+@login_required
+@admin_permission.require(403)
+def rodelbahn_json_edit(id):
+    return RodelbahnController().json_edit(id)
+
+
 @app.route("/rodelbahn/update")
 @login_required
 def rodelbahn_update():