Example #1
0
def render_admin(template, *args, **kwargs):
    """Special rendering for queue admin"""
    for k in default_queue_settings:
        setting = g.queue.setting(k)
        kwargs.update({'q_%s' % k: setting.value or setting.enabled})
    kwargs.setdefault('queue', g.queue)
    return render(template, *args, **kwargs)
Example #2
0
def not_found(error):
    return render('error.html',
        back=domain,
        title='404. Oops.',
        code=404,
        message='Oops. This page doesn\'t exist!',
        url=domain,
        action='Return to homepage?'), 404
Example #3
0
def render_queue(template, *args, **kwargs):
    """Special rendering for queue"""
    whitelist = g.queue.setting('whitelist').value
    if whitelist:
        entries = {}
        for entry in whitelist.split(','):
            entry = tuple(s.strip() for s in entry.split('('))
            if len(entry) == 2:
                entries[entry[0]] = entry[1][:-1]
            else:
                entries[entry[0]] = 'Staff'
        if current_user().is_authenticated and \
            current_user().email in entries:
            current_user().set_role(entries[current_user().email])
    for k in default_queue_settings:
        setting = g.queue.setting(k)
        kwargs.update({'q_%s' % k: (setting.value or setting.enabled) if setting.enabled else False })
    kwargs.setdefault('queue', g.queue)
    return render(template, *args, **kwargs)
Example #4
0
def home() -> str:
    """List of all 'unresolved' inquiries for the homepage."""
    return render("public/index.html", queues=Queue.query.all())
Example #5
0
def render_queue(template: str, *args, **context) -> str:
    """Special rendering for queue."""
    maybe_promote_current_user()
    update_context_with_queue_config(context)
    context.setdefault('queue', g.queue)
    return render(template, *args, **context)
Example #6
0
def render_dashboard(f, *args, **kwargs):
    """custom render for dashboard"""
    from quupod.views import render
    return render(f, *args, **kwargs)
Example #7
0
def home():
    """List of all 'unresolved' inquiries for the homepage"""
    return render('public/index.html', queues=Queue.query.all())