diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-05-14 14:46:41 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-05-14 14:46:41 +0100 |
| commit | 1e440d4523ed56af398f08b52d563443ab991d79 (patch) | |
| tree | 61bce662767a41e64f480b1697a8fdb52eb01a8f /app/views | |
| parent | 661bb19de7fe9eba830f96d042af20f2255c0bb5 (diff) | |
| download | cheatdb-1e440d4523ed56af398f08b52d563443ab991d79.tar.xz | |
Add help pages
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/__init__.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/views/__init__.py b/app/views/__init__.py index 22ed5ab..bf99d09 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -1,4 +1,4 @@ -from app import app +from app import app, pages from flask import * from flask_user import * from flask_login import login_user, logout_user @@ -31,3 +31,10 @@ def home_page(): return render_template("index.html", packages=packages) from . import users, githublogin, packages, sass, tasks, admin, notifications + +@menu.register_menu(app, ".help", "Help", order=19, endpoint_arguments_constructor=lambda: { 'path': 'help' }) +@app.route('/<path:path>/') +def flatpage(path): + page = pages.get_or_404(path) + template = page.meta.get('template', 'flatpage.html') + return render_template(template, page=page) |
