(pagename)
return render_template('public/'+rendpage, data=data), status_code
Generate static pages if they are defined
Generate static pages if they are defined
Generate static pages if they are defined
def static_pages(pagename):
    ''' Generate static pages if they are defined '''
    rendpage = '404.html'
    status_code = 404
    for page in app.config['STATIC_PAGES'].keys():
        # This is less efficent but it lessens the chance
        # of users rendering templates they shouldn't
        if pagename == page:
            rendpage = app.config['STATIC_PAGES'][page]
            status_code = 200

    data = {
        'active': pagename,
        'loggedin': False,
        'monitor_list': app.config['MONITORS'],
        'reaction_list' : app.config['REACTIONS'],
    }
    if "monitor" in pagename:
        data['js_bottom'] = ['monitors/monitorlist.js',]
    if "reaction" in pagename:
        data['js_bottom'] = ['reactions/reactionlist.js',]
    return render_template('public/'+rendpage, data=data), status_code
def static_pages ( pagename ) : rendpage = '404.html' status_code = 404 for page in app . config [ 'STATIC_PAGES' ] . keys ( ) : # This is less efficent but it lessens the chance # of users rendering templates they shouldn't if pagename == page : rendpage = app . config [ 'STATIC_PAGES' ] [ page ] status_code = 200 data = { 'active' : pagename , 'loggedin' : False , 'monitor_list' : app . config [ 'MONITORS' ] , 'reaction_list' : app . config [ 'REACTIONS' ] , } if "monitor" in pagename : data [ 'js_bottom' ] = [ 'monitors/monitorlist.js' , ] if "reaction" in pagename : data [ 'js_bottom' ] = [ 'reactions/reactionlist.js' , ] return render_template ( 'public/' + rendpage , data = data ) , status_code