def government_home(): # Get current assignments assignments = office_utils.get_current_assignments() # Organize by type (excomm and ucc are special) excomm = [] ucc = [] other = [] for assignment in assignments: # Organize by type if assignment["is_excomm"]: excomm.append(assignment) elif assignment["is_ucc"]: ucc.append(assignment) else: other.append(assignment) ucc.sort(key=lambda x: x["office_name"]) other.sort(key=lambda x: x["office_name"]) # Tuple with name, email, and users, so that template can parse efficiently assignment_data = [ ("Executive Committee", "excomm", excomm), ("Upperclass Counselors", "uccs", ucc), ("Other Offices", None, other), ] return flask.render_template("government.html", assignment_data=assignment_data)
def government_home(): # Get current assignments assignments = office_utils.get_current_assignments() # Organize by type (excomm and ucc are special) excomm = [] ucc = [] other = [] for assignment in assignments: # Organize by type if assignment['is_excomm']: excomm.append(assignment) elif assignment['is_ucc']: ucc.append(assignment) else: other.append(assignment) ucc.sort(key=lambda x: x['office_name']) other.sort(key=lambda x: x['office_name']) # Tuple with name, email, and users, so that template can parse efficiently assignment_data = [ ('Executive Committee', 'excomm', excomm), ('Upperclass Counselors', 'uccs', ucc), ('Other Offices', None, other) ] return flask.render_template('government.html', assignment_data=assignment_data)
def government_home(): """Get current assignments.""" assignments = office_utils.get_current_assignments() # Organize by type (excomm and ucc are special) excomm = [] ucc = [] other = [] for assignment in assignments: # Organize by type if assignment['is_excomm']: excomm.append(assignment) elif assignment['is_ucc']: ucc.append(assignment) else: other.append(assignment) ucc.sort(key=lambda x: x['office_name']) other.sort(key=lambda x: x['office_name']) # Tuple with name, email, and users, so that template can parse efficiently assignment_data = [ ('Executive Committee', 'excomm', excomm), ('Upperclass Counselors', 'uccs', ucc), ('Other Offices', None, other) ] return flask.render_template('government.html', assignment_data=assignment_data)
def manage_positions(): """Provides an interface for managing office assignments.""" return flask.render_template( 'positions.html', current_assignments=office_utils.get_current_assignments(), future_assignments=office_utils.get_future_assignments())
def manage_positions(): """Provides an interface for managing office assignments.""" return flask.render_template('positions.html', current_assignments = office_utils.get_current_assignments(), future_assignments = office_utils.get_future_assignments())