Beispiel #1
0
def before_request():
    try:
        g.user = current_user.username.decode('utf-8')
        g.email = current_user.email.decode('utf-8')
        # amount of Credits in user's account
        g.credits = current_user.neuro
        g.user_id = current_user.id
    except:
        g.user = None
        g.credits = None
    nav.register_element('top_nav', top_nav(g.user, g.credits))
Beispiel #2
0
def module_links():
    links = []
    for mod in module_names:
        links.append(Link(mod, '/module/' + mod))
    nav.register_element('frontend_top',
                         Navbar(
                             View('Home', '.index'),
                             Subgroup('File',
                                      View('Backup and Restore', 'frontend.fileForm'),
                                      View('Logs', 'frontend.logfileForm')),
                             Subgroup('Modules', *links)
                         )
                         )
Beispiel #3
0
from nav import nav

frontend = Blueprint('frontend', __name__)

# We're adding a navbar as well through flask-navbar. In our example, the
# navbar has an usual amount of Link-Elements, more commonly you will have a
# lot more View instances.
nav.register_element('frontend_top', Navbar(
    View('Flask-Bootstrap', '.index'),
    View('Home', '.index'),
    View('Forms Example', '.example_form'),
    Subgroup(
        'Docs',
        Link('Flask-Bootstrap', 'http://pythonhosted.org/Flask-Bootstrap'),
        Link('Flask-AppConfig', 'https://github.com/mbr/flask-appconfig'),
        Link('Flask-Debug', 'https://github.com/mbr/flask-debug'),
        Separator(),
        Text('Bootstrap'),
        Link('Getting started', 'http://getbootstrap.com/getting-started/'),
        Link('CSS', 'http://getbootstrap.com/css/'),
        Link('Components', 'http://getbootstrap.com/components/'),
        Link('Javascript', 'http://getbootstrap.com/javascript/'),
        Link('Customize', 'http://getbootstrap.com/customize/'), ),
    Text('Using Flask-Bootstrap {}'.format(FLASK_BOOTSTRAP_VERSION)), ))


# Our index-page just shows a quick explanation. Check out the template
# "templates/index.html" documentation for more details.
@frontend.route('/')
def index():
    return render_template('index.html')
Beispiel #4
0
import subprocess
import os
from robot.parsing.model import TestData
import datetime

frontend = Blueprint('frontend', __name__)

# We're adding a navbar as well through flask-navbar. In our example, the
# navbar has an usual amount of Link-Elements, more commonly you will have a
# lot more View instances.
nav.register_element(
    'frontend_top',
    Navbar(
        View('NHC Automation tool', '.index'),
        View('Create Package', '.package_form'),
        View('Package', '.package_list'),
        View('Create Config', '.create_config'),
        View('Configs', '.configs_list'),
        View('Features', '.feature_list'),
        View('Results', '.result_list'),
    ))


# Our index-page just shows a quick explanation. Check out the template
# "templates/index.html" documentation for more details.
@frontend.route('/')
def index():
    return render_template('index.html')


@frontend.route('/packages/', methods=('GET', 'POST'))
Beispiel #5
0
from flask_nav.elements import Navbar, View, Subgroup, Link, Text, Separator
from markupsafe import escape

from forms import SignupForm
from nav import nav

#This file is not used for much, however, it it allows for further
#potential for customization of back end system supporting the
#front end

frontend = Blueprint('frontend', __name__)

nav.register_element('frontend_top', Navbar(
    View('Home', '.index'),
    View('Profile', '.index'),
    View('Statistics', '.example_form'),
    View('Find A Store', 'debug.debug_root'),
    View('Donate', '.index')
))

@frontend.route('/')
def index():
    return render_template('login.html')

@frontend.route('/form/', methods = ('GET', 'POST'))
def signup_form():
    form = SignupForm()

    if form.validate_on_submit():
        flash("Thank you {} for signing up for the Goodwill of Delaware and Delaware County's Mobile Service!".format(escape(form.name.data)))
        return redirect(url_for('.index')) #warning: may need to change this redirect
from flask import Blueprint, render_template, flash, redirect, url_for
from flask_bootstrap import __version__ as FLASK_BOOTSTRAP_VERSION
from flask_nav.elements import Navbar, View, Subgroup, Link, Text, Separator
from markupsafe import escape

from nav import nav

from remote import RemoteStats, LocalStats

frontend = Blueprint('frontend', __name__)

nav.register_element(
    'frontend_top',
    Navbar(View('Watchatron-2000', '.index'), View('Home', '.index'),
           View('Stats', '.statistics')))

stats = RemoteStats()


@frontend.route('/')
def index():
    names = sorted(stats.get_stats().keys())
    return render_template('index.html',
                           servers=stats.get_stats(),
                           server_names=names,
                           updated=stats.get_time_updated())


@frontend.route('/force_update')
def force_update():
    stats.update_stats()
Beispiel #7
0
nav.register_element(
    'frontend_top',
    Navbar(
        Link('Login', '/login'),
        Link('Home', '/home'),
        Subgroup(
            'Appointments',
            Link('Create Appointment', '/home'),
            Link('View Past Appointments', '/home'),
            Link('Join Appointment', '/home'),
        ),
        Subgroup(
            'Medical Records',
            Link('My Medical Records', '/list'),
            Link('Create New', '/new'),
            Link('Find Patient Medical Records', '/medicalRecord/search'),
        ),
        Subgroup(
            'Payments',
            Link('My Payment Records', '/home'),
            Link('Make Payment', '/home'),
        ),
        Subgroup(
            'Prescriptions',
            Link('My Prescriptions', '/prescriptionList/search'),
            Link('List Prescriptions', '/prescriptionList'),
            Link('Search Patient Prescriptions',
                 '/patientPrescriptions/search'),
            Link('Pending Prescription', '/home'),
            Link('New Prescription', '/newPrescription'),
        ),
    ))
Beispiel #8
0
from flask_bootstrap import __version__ as FLASK_BOOTSTRAP_VERSION
from flask_wtf import FlaskForm
from wtforms.fields import *
from flask_nav.elements import Navbar, View, Subgroup, Link, Text, Separator
from markupsafe import escape
from werkzeug.utils import secure_filename
from forms import *
from nav import nav
import os
import pandas as pd

frontend = Blueprint('frontend', __name__)

# This code adds a navbar
nav.register_element(
    'frontend_top',
    Navbar(View('Text-Annotator', '.index'), View('Home', '.index'),
           View('Upload Data', '.upload_data')))
# View('Sample Data & Annotation Settings', '.display_data')))


@frontend.route('/', methods=['GET', 'POST'])
def index():

    # Create form that starts process
    start_form = StartForm()

    if start_form.validate_on_submit():
        return redirect(url_for('.upload_data'))

    return render_template('index.html', form=start_form)
from flask import Blueprint, render_template, flash, redirect, url_for
from flask_bootstrap import __version__ as FLASK_BOOTSTRAP_VERSION
from flask_nav.elements import Navbar, View, Subgroup, Link, Text, Separator
from markupsafe import escape

from nav import nav

from remote import RemoteStats, LocalStats

frontend = Blueprint('frontend', __name__)

nav.register_element('frontend_top', Navbar(
    View('Watchatron-2000', '.index'),
    View('Home', '.index'),
    View('Stats', '.statistics')
))

stats = RemoteStats()

@frontend.route('/')
def index():
    names = sorted(stats.get_stats().keys())
    return render_template(
        'index.html',
        servers=stats.get_stats(),
        server_names=names,
        updated=stats.get_time_updated()
    )


@frontend.route('/force_update')