# HG changeset patch # User Lennard de Rijk # Date 1239377531 0 # Node ID 57c74ce47fa37f72a896dc04aa9a9e6f345f87e7 # Parent ea919c2dfe41fc4778d207828a6aefb7787ae862 Added Manage Student Projects item to the organization menu. Only visible after the accepted students deadline has passed and the current user is an org admin. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed diff -r ea919c2dfe41 -r 57c74ce47fa3 app/soc/views/models/organization.py --- a/app/soc/views/models/organization.py Fri Apr 10 15:24:43 2009 +0000 +++ b/app/soc/views/models/organization.py Fri Apr 10 15:32:11 2009 +0000 @@ -32,6 +32,7 @@ from soc.logic import cleaning from soc.logic import dicts from soc.logic import accounts +from soc.logic.helper import timeline as timeline_helper from soc.logic.models import mentor as mentor_logic from soc.logic.models import organization as org_logic from soc.logic.models import org_admin as org_admin_logic @@ -426,6 +427,7 @@ submenus = [] group_entity = role_description['group'] + program_entity = group_entity.scope roles = role_description['roles'] if roles.get('org_admin') or roles.get('mentor'): @@ -436,6 +438,15 @@ if roles.get('org_admin'): + + # add a link to manage student projects after they have been announced + if timeline_helper.isAfterEvent(program_entity.timeline, + 'accepted_students_announced_deadline'): + submenu = (redirects.getManageOverviewRedirect(group_entity, + {'url_name': 'student_project'}), + "Manage Student Projects", 'any_access') + submenus.append(submenu) + # add a link to the management page submenu = (redirects.getListRolesRedirect(group_entity, params), "Manage Admins and Mentors", 'any_access') diff -r ea919c2dfe41 -r 57c74ce47fa3 app/soc/views/models/student_project.py --- a/app/soc/views/models/student_project.py Fri Apr 10 15:24:43 2009 +0000 +++ b/app/soc/views/models/student_project.py Fri Apr 10 15:32:11 2009 +0000 @@ -133,7 +133,6 @@ new_params['edit_template'] = 'soc/student_project/edit.html' # TODO(ljvderijk) list all projects for one student - # TODO(ljvderijk) add manage item to org menu for admins params = dicts.merge(params, new_params)