62 """ |
62 """ |
63 |
63 |
64 rights = access.Checker(params) |
64 rights = access.Checker(params) |
65 rights['any_access'] = ['allow'] |
65 rights['any_access'] = ['allow'] |
66 rights['show'] = ['allow'] |
66 rights['show'] = ['allow'] |
67 rights['create'] = [('checkSeeded', ['checkHasActiveRoleForScope', host_logic.logic])] |
67 rights['create'] = [('checkSeeded', ['checkHasActiveRoleForScope', |
|
68 host_logic.logic])] |
68 rights['edit'] = ['checkIsHostForProgram'] |
69 rights['edit'] = ['checkIsHostForProgram'] |
69 rights['delete'] = ['checkIsDeveloper'] |
70 rights['delete'] = ['checkIsDeveloper'] |
70 |
71 |
71 new_params = {} |
72 new_params = {} |
72 new_params['logic'] = soc.logic.models.program.logic |
73 new_params['logic'] = soc.logic.models.program.logic |
282 "Register as a Student", 'any_access')] |
284 "Register as a Student", 'any_access')] |
283 |
285 |
284 if timeline_helper.isAfterEvent(timeline_entity, |
286 if timeline_helper.isAfterEvent(timeline_entity, |
285 'accepted_organization_announced_deadline'): |
287 'accepted_organization_announced_deadline'): |
286 # add a link to list all the organizations |
288 # add a link to list all the organizations |
287 items += [(redirects.getPublicListRedirect(program_entity, {'url_name': 'org'}), |
289 items += [(redirects.getPublicListRedirect(program_entity, |
|
290 {'url_name': 'org'}), |
288 "List participating Organizations", 'any_access')] |
291 "List participating Organizations", 'any_access')] |
289 |
292 |
290 if not student_entity: |
293 if not student_entity: |
291 # add apply to become a mentor link |
294 # add apply to become a mentor link |
292 items += [('/org/apply_mentor/%s' % (program_entity.key().name()), |
295 items += [('/org/apply_mentor/%s' % (program_entity.key().name()), |
293 "Apply to become a Mentor", 'any_access')] |
296 "Apply to become a Mentor", 'any_access')] |
294 |
297 |
295 return items |
298 return items |
296 |
299 |
297 def _getStudentEntries(self, program_entity, student_entity, params, id, user): |
300 def _getStudentEntries(self, program_entity, student_entity, |
|
301 params, id, user): |
298 """Returns a list with menu items for students in a specific program. |
302 """Returns a list with menu items for students in a specific program. |
299 """ |
303 """ |
300 |
304 |
301 items = [] |
305 items = [] |
302 |
306 |
303 timeline_entity = program_entity.timeline |
307 timeline_entity = program_entity.timeline |
304 |
308 |
305 if timeline_helper.isActivePeriod(timeline_entity, 'student_signup'): |
309 if timeline_helper.isActivePeriod(timeline_entity, 'student_signup'): |
306 items += [('/student_proposal/list_orgs/%s' % (student_entity.key().name()), |
310 items += [('/student_proposal/list_orgs/%s' % ( |
|
311 student_entity.key().name()), |
307 "Submit your Student Proposal", 'any_access')] |
312 "Submit your Student Proposal", 'any_access')] |
308 items += [(redirects.getListSelfRedirect(student_entity, |
313 items += [(redirects.getListSelfRedirect(student_entity, |
309 {'url_name':'student_proposal'}), |
314 {'url_name':'student_proposal'}), |
310 "List my Student Proposals", 'any_access')] |
315 "List my Student Proposals", 'any_access')] |
311 |
316 |
312 return items |
317 return items |
313 |
318 |
314 def _getOrganizationEntries(self, program_entity, org_admin_entity, |
319 def _getOrganizationEntries(self, program_entity, org_admin_entity, |