def user_group_view(uid): user = User.query.filter_by(id=uid).first() tree = build_group_tree_db(Group.query.all()) gnames = [x.group_name for x in user.groups] return render_template('user_groupedit.html', u=user, groups=namesort(tree), user_groups=gnames)
def ez_quota_edit(parent): # NOTE: Could narrow the db-query down some but this is easiest for now group = build_group_tree_db(Group.query.all()).find(parent) if not group or not group.children or len(group.children) <= 1: flash('Group %s not an intermediate group with >1 children!' % parent, category="error") return redirect(url_for('main_menu')) subtree = group.children.values() # Special case for root node, set it's quota here -- must be a better way! if group.parent is None: group.quota = sum(x.quota for x in subtree) return render_template('quota_edit.html', groups=subtree)
def add_groups(): root = build_group_tree_db(Group.query.all()) return render_template('group_add_rm.html', groups=namesort(root), defaults=group_defaults)
def edit_groups(): root = build_group_tree_db(Group.query.all()) return render_template('edit_group.html', groups=namesort(root))
def main_menu(): root = build_group_tree_db(Group.query.all()) return render_template('main_view.html', groups=namesort(root))
def ez_quota_chooser(): root = build_group_tree_db(Group.query.all()) return render_template('quota_group_chooser.html', groups=namesort(root))