Beispiel #1
0
def batch_splash_page():
    groups = [x._asdict() for x in l.list_groups(request.user.id)]
    unread = l.get_unread_batches(request.user.id)
    stats = l.get_batch_stats()
    for group in groups:
        group['unread'] = group['id'] in unread
        group.update(stats[group['id']])
    percent = int( 100.0*sum(1.0 for x in groups if x['voted']) / len(groups))
    return render_template('batch/batch.html', groups=groups, percent=percent)
Beispiel #2
0
def batch_splash_page():
    groups = [x._asdict() for x in l.list_groups(request.user.id)]
    unread = l.get_unread_batches(request.user.id)
    stats = l.get_batch_stats()
    for group in groups:
        group['unread'] = group['id'] in unread
        group.update(stats[group['id']])
    percent = int(100.0 * sum(1.0 for x in groups if x['voted']) / len(groups))
    return render_template('batch/batch.html', groups=groups, percent=percent)
Beispiel #3
0
def batch_splash_page():
    return render_template('batch.html',
                            unread=l.get_unread_batches(request.user.id),
                            groups=l.list_groups(request.user.id))