Example #1
0
def index():
    data = {
        'title': 'Welcome',
        'name': 'Pytonik',
        'version': Version().VERSION_TEXT,
        'reversion': Version().VERSION_TEXT[0:5],
    }

    return app.views('index', data)
def index(Session):
    if Session.has('admin_id') != True and Session.get('admin_id') == "":
        return app.redirect('/admin/login', True)
    else:
        data = {
            'title': 'Welcome',
            'name': 'Pytonik',
            'version': Version().VERSION_TEXT,
            'reversion': Version().VERSION_TEXT[0:6],
        }

        return app.views('admin/dashboard', data)
def edit_users(Session):
    if Session.has('admin_id') != True and Session.get('admin_id') == "":
        return app.redirect('/admin/login', True)
    else:
        data = {
            'title': 'Welcome',
            'name': 'Pytonik',
            'flash': FlashBootstrap.display(),
            'version': Version().VERSION_TEXT,
            'reversion': Version().VERSION_TEXT[0:6],
        }

        return app.views('admin/list-users', data)
def list_products(Session):
    if Session.has('admin_id') != True and Session.get('admin_id') == "":
        return app.redirect('/admin/login', True)
    else:
        Product = Products().list()
        data = {
            'title': 'Welcome',
            'name': 'Pytonik',
            'Product': Product[1],
            'flash': FlashBootstrap.display(),
            'version': Version().VERSION_TEXT,
            'reversion': Version().VERSION_TEXT[0:6],
        }

        return app.views('admin/list-product', data)
def page405():
    data = {
        'title': '405 NOT Found!',
        'name': 'Pytonik',
        'version': Version().VERSION_TEXT
    }
    return app.views('405', data)