app/soc/views/models/program.py
changeset 1470 5e887fb80921
parent 1437 eec60d5bbe95
child 1475 22b63ab59b27
--- a/app/soc/views/models/program.py	Sun Feb 22 21:01:43 2009 +0000
+++ b/app/soc/views/models/program.py	Sun Feb 22 21:08:41 2009 +0000
@@ -259,7 +259,8 @@
     student_entity = student_logic.logic.getForFields(filter, unique=True)
 
     if student_entity:
-      items += self._getStudentEntries(program_entity, params, id, user)
+      items += self._getStudentEntries(program_entity, student_entity,
+                                       params, id, user)
 
     # get mentor and org_admin entity for this user and program
     filter = {'user': user,
@@ -268,7 +269,8 @@
     org_admin_entity = org_admin_logic.logic.getForFields(filter, unique=True)
 
     if mentor_entity or org_admin_entity:
-      items += self._getOrganizationEntries(program_entity, params, id, user)
+      items += self._getOrganizationEntries(program_entity, org_admin_entity,
+                                            mentor_entity, params, id, user)
 
     if not (student_entity or mentor_entity or org_admin_entity):
       if timeline_helper.isActivePeriod(timeline_entity, 'student_signup'):
@@ -289,7 +291,7 @@
 
     return items
 
-  def _getStudentEntries(self, program_entity, params, id, user):
+  def _getStudentEntries(self, program_entity, student_entity, params, id, user):
     """Returns a list with menu items for students in a specific program.
     """
 
@@ -302,13 +304,14 @@
     if timeline_helper.isActivePeriod(timeline_entity, 'student_signup'):
       #items += [('/org/apply_mentor/%s' % (program_entity.key().name()),
       #   "Send in your student proposal (N/A)", 'any_access')]
-      #items += [('/org/apply_mentor/%s' % (program_entity.key().name()),
-      #   "List my student proposals (N/A)", 'any_access')]
-      pass
+      items += [(redirects.getListSelfRedirect(student_entity,
+             {'url_name':'student_proposal'}),
+         "List my Student Proposals", 'any_access')]
 
     return items
 
-  def _getOrganizationEntries(self, program_entity, params, id, user):
+  def _getOrganizationEntries(self, program_entity, org_admin_entity,
+                              mentor_entity, params, id, user):
     """Returns a list with menu items for org admins and mentors in a 
        specific program.
     """