mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
This adds bootstrap-dialog to help with creation of nice dialogs, and adds the ability for modules to render Javascript into the browser, and specify onclick handlers in the menu system. Also add a basic About dialog, using the new infrastructure and showing some useful info about the application.
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2014, The pgAdmin Development Team
|
|
# This software is released under the PostgreSQL Licence
|
|
#
|
|
##########################################################################
|
|
|
|
"""A blueprint module implementing the about box."""
|
|
MODULE_NAME = 'about'
|
|
|
|
from flask import Blueprint, current_app, render_template, __version__
|
|
from flask.ext.security import current_user, login_required
|
|
|
|
import sys
|
|
|
|
import config
|
|
|
|
# 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("/")
|
|
@login_required
|
|
def index():
|
|
"""Render the about box."""
|
|
info = { }
|
|
info['python_version'] = sys.version
|
|
info['flask_version'] = __version__
|
|
if config.SERVER_MODE == True:
|
|
info['app_mode'] = 'Server'
|
|
else:
|
|
info['app_mode'] = 'Desktop'
|
|
info['current_user'] = current_user.email
|
|
|
|
return render_template(MODULE_NAME + '/index.html', info=info)
|