Added list my Student Proposals link to the program menu.
authorLennard de Rijk <ljvderijk@gmail.com>
Sun, 22 Feb 2009 21:08:41 +0000
changeset 1470 5e887fb80921
parent 1469 d69b00439d59
child 1471 9b4717f6c416
Added list my Student Proposals link to the program menu. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/views/models/program.py
--- 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.
     """