89 rights['create'] = [('checkSeeded', ['checkHasActiveRoleForScope', |
89 rights['create'] = [('checkSeeded', ['checkHasActiveRoleForScope', |
90 host_logic.logic])] |
90 host_logic.logic])] |
91 rights['edit'] = [('checkIsHostForProgram', |
91 rights['edit'] = [('checkIsHostForProgram', |
92 [ghop_program_logic.logic])] |
92 [ghop_program_logic.logic])] |
93 rights['delete'] = ['checkIsDeveloper'] |
93 rights['delete'] = ['checkIsDeveloper'] |
|
94 rights['accepted_orgs'] = [('checkIsAfterEvent', |
|
95 ['student_signup_start', |
|
96 '__all__', ghop_program_logic.logic])] |
94 rights['task_difficulty'] = [('checkIsHostForProgram', |
97 rights['task_difficulty'] = [('checkIsHostForProgram', |
95 [ghop_program_logic.logic])] |
98 [ghop_program_logic.logic])] |
96 rights['task_type'] = [('checkIsHostForProgram', |
99 rights['task_type'] = [('checkIsHostForProgram', |
97 [ghop_program_logic.logic])] |
100 [ghop_program_logic.logic])] |
98 rights['difficulty_tag_edit'] = [('checkIsHostForProgram', |
101 rights['difficulty_tag_edit'] = [('checkIsHostForProgram', |
415 items += [('/ghop/student/apply/%s' % ( |
418 items += [('/ghop/student/apply/%s' % ( |
416 ghop_program_entity.key().id_or_name()), |
419 ghop_program_entity.key().id_or_name()), |
417 "Register as a Student", 'any_access')] |
420 "Register as a Student", 'any_access')] |
418 |
421 |
419 if timeline_helper.isAfterEvent(timeline_entity, 'org_signup_start'): |
422 if timeline_helper.isAfterEvent(timeline_entity, 'org_signup_start'): |
420 url = ghop_redirects.getParticipatingOrgsRedirect( |
423 url = redirects.getAcceptedOrgsRedirect( |
421 ghop_program_entity, params) |
424 ghop_program_entity, params) |
422 # add a link to list all the organizations |
425 # add a link to list all the organizations |
423 items += [(url, "List participating Organizations", 'any_access')] |
426 items += [(url, "List participating Organizations", 'any_access')] |
424 |
427 |
425 return items |
428 return items |
585 else: |
588 else: |
586 ghop_task_model.TaskTypeTag.get_or_create(program_entity, tag_value) |
589 ghop_task_model.TaskTypeTag.get_or_create(program_entity, tag_value) |
587 |
590 |
588 return http.HttpResponse(tag_value) |
591 return http.HttpResponse(tag_value) |
589 |
592 |
|
593 @decorators.merge_params |
|
594 @decorators.check_access |
|
595 def acceptedOrgs(self, request, access_type, |
|
596 page_name=None, params=None, filter=None, **kwargs): |
|
597 """List all the accepted orgs for the given program. |
|
598 """ |
|
599 |
|
600 from soc.modules.ghop.views.models.organization import view as \ |
|
601 ghop_org_view |
|
602 |
|
603 contents = [] |
|
604 logic = params['logic'] |
|
605 |
|
606 ghop_program_entity = logic.getFromKeyFieldsOr404(kwargs) |
|
607 |
|
608 ao_params = ghop_org_view.getParams().copy() |
|
609 ao_params['list_action'] = (redirects.getHomeRedirect, |
|
610 ao_params) |
|
611 ao_params['list_description'] = self.DEF_PARTICIPATING_ORGS_MSG_FMT % { |
|
612 'name': ghop_program_entity.name |
|
613 } |
|
614 |
|
615 filter = { |
|
616 'scope': ghop_program_entity, |
|
617 'status': ['new', 'active'], |
|
618 } |
|
619 |
|
620 order = ['name'] |
|
621 |
|
622 ao_list = lists.getListContent(request, ao_params, filter=filter, |
|
623 order=order, idx=0) |
|
624 |
|
625 contents.append(ao_list) |
|
626 |
|
627 params = params.copy() |
|
628 params['list_msg'] = ghop_program_entity.accepted_orgs_msg |
|
629 |
|
630 return self._list(request, params, contents, page_name) |
|
631 |
590 |
632 |
591 view = View() |
633 view = View() |
592 |
634 |
593 admin = decorators.view(view.admin) |
635 admin = decorators.view(view.admin) |
|
636 accepted_orgs = decorators.view(view.acceptedOrgs) |
594 assign_task_quotas = decorators.view(view.assignTaskQuotas) |
637 assign_task_quotas = decorators.view(view.assignTaskQuotas) |
595 create = decorators.view(view.create) |
638 create = decorators.view(view.create) |
596 delete = decorators.view(view.delete) |
639 delete = decorators.view(view.delete) |
597 edit = decorators.view(view.edit) |
640 edit = decorators.view(view.edit) |
598 list = decorators.view(view.list) |
641 list = decorators.view(view.list) |