Add automatic browser menu integration for modules.

Modules may now include functions that return lists of menu items
that will be included on the main browser window menu. While we're
at it, move the test views into a separate module.
This commit is contained in:
Dave Page
2015-01-27 14:18:27 +00:00
parent 0cff5fca2c
commit d492da3ca1
11 changed files with 176 additions and 25 deletions
-16
View File
@@ -18,22 +18,6 @@ from time import time, ctime
# Initialise the module
blueprint = Blueprint(MODULE_NAME, __name__, static_folder='static', static_url_path='', template_folder='templates', url_prefix='/' + MODULE_NAME)
##########################################################################
# A test page
##########################################################################
@blueprint.route("/test")
@login_required
def test():
"""Generate a simple test page to demonstrate that output can be rendered."""
output = """
Today is <b>%s</b>
<br />
<i>This is Flask-generated HTML.</i>
<br /><br />
<a href="http://www.pgadmin.org/">%s v%s</a>""" % (ctime(time()), config.APP_NAME, config.APP_VERSION)
return output
##########################################################################
# A special URL used to "ping" the server
##########################################################################