From 0491f499a035b17e5e522c66cd66ade2aa217a9f Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 27 Dec 2017 22:31:11 +0000 Subject: [PATCH] Change to jinja2: index.html is now rendered with jinja2 (no styling yet). git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2755 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wradmin/__init__.py | 5 +++-- wradmin/templates/index.html | 27 +++++++++++---------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/wradmin/__init__.py b/wradmin/__init__.py index 0c450c6..4a0efa1 100644 --- a/wradmin/__init__.py +++ b/wradmin/__init__.py @@ -1,7 +1,7 @@ # http://flask.pocoo.org/ # FLASK_APP=wradmin FLASK_DEBUG=1 WRADMIN_SETTINGS=development.cfg python3 -m flask run # FLASK_APP=wradmin WRADMIN_SETTINGS=production.cfg python3 -m flask run -from flask import Flask, send_from_directory, abort, g +from flask import Flask, send_from_directory, abort, g, render_template from sqlalchemy.engine import create_engine import wradmin.model from wradmin.genshi import render_genshi_template @@ -14,6 +14,7 @@ from wradmin.controllers.coordtool import CoordtoolController app = Flask(__name__) app.config.from_envvar('WRADMIN_SETTINGS') wradmin.model.init_model(create_engine(app.config['DATABASE_URI'])) +app.jinja_env.globals.update(h=wradmin.genshi.PylonsHelper()) @app.teardown_appcontext @@ -24,7 +25,7 @@ def remove_db_session(error): @app.route("/") def index(): - return render_genshi_template('index.html') + return render_template('index.html') @app.route("/rodelbahn/list") diff --git a/wradmin/templates/index.html b/wradmin/templates/index.html index 82db47b..8182ff6 100644 --- a/wradmin/templates/index.html +++ b/wradmin/templates/index.html @@ -1,31 +1,26 @@ - - - - + + - Hauptmenü + Hauptmenü -

Hauptmenü

+

Hauptmenü

Willkommen auf den Administrationsseiten von Winterrodeln.

-- 2.39.5