Beispiel #1
0
  def _getExtraMenuItems(self, role_description, params=None):
    """Used to create the specific Sponsor menu entries.

    For args see group.View._getExtraMenuItems().
    """

    submenus = []

    group_entity = role_description['group']
    roles = role_description['roles']
  
    if roles.get('host'):
      # add a link to create a new program
      submenu = (redirects.getCreateRedirect(group_entity,
          {'url_name': 'program'}),"Create a New Program", 'any_access')
      submenus.append(submenu)

      # add a link to the management page
      submenu = (redirects.getListRolesRedirect(group_entity, params), 
          "Manage Program Administrators", 'any_access')
      submenus.append(submenu)

      # add a link to invite an a host
      submenu = (redirects.getInviteRedirectForRole(group_entity, 'host'), 
          "Invite a Program Administrator", 'any_access')
      submenus.append(submenu)

      # add a link to the request page
      submenu = (redirects.getListRequestsRedirect(group_entity, params), 
          "List Program Administrator Invites", 'any_access')
      submenus.append(submenu)

      # add a link to the edit page
      submenu = (redirects.getEditRedirect(group_entity, params), 
          "Edit Program Owner Profile", 'any_access')
      submenus.append(submenu)

      # add a link to resign as a host
      submenu = (redirects.getManageRedirect(roles['host'], 
          {'url_name': 'host'}), 
          "Resign as Program Administrator", 'any_access')
      submenus.append(submenu)

      # add a link to create a new document
      submenu = (redirects.getCreateDocumentRedirect(group_entity, 'sponsor'),
          "Create a New Document", 'any_access')
      submenus.append(submenu)

      # add a link to list all documents
      submenu = (redirects.getListDocumentsRedirect(group_entity, 'sponsor'),
          "List Documents", 'any_access')
      submenus.append(submenu)

    return submenus
Beispiel #2
0
  def _getExtraMenuItems(self, role_description, params=None):
    """Used to create the specific Sponsor menu entries.

    For args see group.View._getExtraMenuItems().
    """

    submenus = []

    group_entity = role_description['group']
    roles = role_description['roles']
  
    if roles.get('host'):
      # add a link to create a new program
      submenu = (redirects.getCreateRedirect(group_entity,
          {'url_name': 'program'}),"Create a New Program", 'any_access')
      submenus.append(submenu)

      # add a link to the management page
      submenu = (redirects.getListRolesRedirect(group_entity, params), 
          "Manage Program Administrators", 'any_access')
      submenus.append(submenu)

      # add a link to invite an a host
      submenu = (redirects.getInviteRedirectForRole(group_entity, 'host'), 
          "Invite a Program Administrator", 'any_access')
      submenus.append(submenu)

      # add a link to the request page
      submenu = (redirects.getListRequestsRedirect(group_entity, params), 
          "List Program Administrator Invites", 'any_access')
      submenus.append(submenu)

      # add a link to the edit page
      submenu = (redirects.getEditRedirect(group_entity, params), 
          "Edit Program Owner Profile", 'any_access')
      submenus.append(submenu)

      # add a link to resign as a host
      submenu = (redirects.getManageRedirect(roles['host'], 
          {'url_name': 'host'}), 
          "Resign as Program Administrator", 'any_access')
      submenus.append(submenu)

      # add a link to create a new document
      submenu = (redirects.getCreateDocumentRedirect(group_entity, 'sponsor'),
          "Create a New Document", 'any_access')
      submenus.append(submenu)

      # add a link to list all documents
      submenu = (redirects.getListDocumentsRedirect(group_entity, 'sponsor'),
          "List Documents", 'any_access')
      submenus.append(submenu)

    return submenus
Beispiel #3
0
    def _getExtraMenuItems(self, role_description, params=None):
        """Used to create the specific GCI Organization menu entries.

    For args see soc.views.models.organization.View._getExtraMenuItems().
    """
        submenus = []

        group_entity = role_description["group"]
        roles = role_description["roles"]

        mentor_entity = roles.get("gci_mentor")
        admin_entity = roles.get("gci_org_admin")

        is_active_mentor = mentor_entity and mentor_entity.status == "active"
        is_active_admin = admin_entity and admin_entity.status == "active"

        if admin_entity or mentor_entity:
            # add a link to view all the organization tasks.
            submenu = (
                gci_redirects.getListTasksRedirect(group_entity, {"url_name": "gci/task"}),
                "View all Tasks",
                "any_access",
            )
            submenus.append(submenu)

        if is_active_admin:
            # add a link to create task
            submenu = (
                redirects.getCreateRedirect(group_entity, {"url_name": "gci/task"}),
                "Create a Task",
                "any_access",
            )
            submenus.append(submenu)

            # add a link to bulk create tasks
            submenu = (
                gci_redirects.getBulkCreateRedirect(group_entity, {"url_name": "gci/task"}),
                "Bulk Create Tasks",
                "any_access",
            )
            submenus.append(submenu)

            # add a link to the management page
            submenu = (redirects.getListRolesRedirect(group_entity, params), "Manage Admins and Mentors", "any_access")
            submenus.append(submenu)

            # add a link to invite an org admin
            submenu = (
                redirects.getInviteRedirectForRole(group_entity, "gci/org_admin"),
                "Invite an Admin",
                "any_access",
            )
            submenus.append(submenu)

            # add a link to invite a member
            submenu = (redirects.getInviteRedirectForRole(group_entity, "gci/mentor"), "Invite a Mentor", "any_access")
            submenus.append(submenu)

            # add a link to the request page
            submenu = (
                redirects.getListRequestsRedirect(group_entity, params),
                "List Requests and Invites",
                "any_access",
            )
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (redirects.getEditRedirect(group_entity, params), "Edit Organization Profile", "any_access")
            submenus.append(submenu)

        if is_active_mentor:
            # add a link to suggest task
            submenu = (
                gci_redirects.getSuggestTaskRedirect(group_entity, {"url_name": "gci/task"}),
                "Suggest a Task",
                "any_access",
            )
            submenus.append(submenu)

        if is_active_admin or is_active_mentor:
            submenu = (
                redirects.getCreateDocumentRedirect(group_entity, "gci_org"),
                "Create a New Document",
                "any_access",
            )
            submenus.append(submenu)

            submenu = (redirects.getListDocumentsRedirect(group_entity, "gci_org"), "List Documents", "any_access")
            submenus.append(submenu)

        if is_active_admin:
            # add a link to the resign page
            submenu = (
                redirects.getManageRedirect(roles["gci_org_admin"], {"url_name": "gci/org_admin"}),
                "Resign as Admin",
                "any_access",
            )
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (
                redirects.getEditRedirect(roles["gci_org_admin"], {"url_name": "gci/org_admin"}),
                "Edit My Admin Profile",
                "any_access",
            )
            submenus.append(submenu)

        if is_active_mentor:
            # add a link to the resign page
            submenu = (
                redirects.getManageRedirect(roles["gci_mentor"], {"url_name": "gci/mentor"}),
                "Resign as Mentor",
                "any_access",
            )
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (
                redirects.getEditRedirect(roles["gci_mentor"], {"url_name": "gci/mentor"}),
                "Edit My Mentor Profile",
                "any_access",
            )
            submenus.append(submenu)

        return submenus
Beispiel #4
0
    def _getExtraMenuItems(self, role_description, params=None):
        """Used to create the specific Organization menu entries.

    For args see group.View._getExtraMenuItems().
    """
        submenus = []

        group_entity = role_description['group']
        program_entity = group_entity.scope
        roles = role_description['roles']

        mentor_entity = roles.get('mentor')
        admin_entity = roles.get('org_admin')

        is_active_mentor = mentor_entity and mentor_entity.status == 'active'
        is_active_admin = admin_entity and admin_entity.status == 'active'

        if admin_entity or mentor_entity:
            # add a link to view all the student proposals
            submenu = (redirects.getListProposalsRedirect(
                group_entity,
                params), "View all Student Proposals", 'any_access')
            submenus.append(submenu)

        if admin_entity:
            # 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': 'gsoc/student_project'}),
                           "Manage Student Projects", 'any_access')
                submenus.append(submenu)

        if is_active_admin:
            # add a link to the management page
            submenu = (redirects.getListRolesRedirect(group_entity, params),
                       "Manage Admins and Mentors", 'any_access')
            submenus.append(submenu)

            # add a link to invite an org admin
            submenu = (redirects.getInviteRedirectForRole(
                group_entity,
                'gsoc/org_admin'), "Invite an Admin", 'any_access')
            submenus.append(submenu)

            # add a link to invite a member
            submenu = (redirects.getInviteRedirectForRole(
                group_entity, 'gsoc/mentor'), "Invite a Mentor", 'any_access')
            submenus.append(submenu)

            # add a link to the request page
            submenu = (redirects.getListRequestsRedirect(group_entity, params),
                       "List Requests and Invites", 'any_access')
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (redirects.getEditRedirect(group_entity, params),
                       "Edit Organization Profile", 'any_access')
            submenus.append(submenu)

        if is_active_admin or is_active_mentor:
            submenu = (redirects.getCreateDocumentRedirect(
                group_entity, params['document_prefix']),
                       "Create a New Document", 'any_access')
            submenus.append(submenu)

            submenu = (redirects.getListDocumentsRedirect(
                group_entity,
                params['document_prefix']), "List Documents", 'any_access')
            submenus.append(submenu)

        if is_active_admin:
            # add a link to the resign page
            submenu = (redirects.getManageRedirect(
                roles['org_admin'], {'url_name': 'gsoc/org_admin'}),
                       "Resign as Admin", 'any_access')
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (redirects.getEditRedirect(
                roles['org_admin'], {'url_name': 'gsoc/org_admin'}),
                       "Edit My Admin Profile", 'any_access')
            submenus.append(submenu)

        if is_active_mentor:
            # add a link to the resign page
            submenu = (redirects.getManageRedirect(
                roles['mentor'],
                {'url_name': 'gsoc/mentor'}), "Resign as Mentor", 'any_access')
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (redirects.getEditRedirect(roles['mentor'],
                                                 {'url_name': 'gsoc/mentor'}),
                       "Edit My Mentor Profile", 'any_access')
            submenus.append(submenu)

        return submenus
Beispiel #5
0
  def _getExtraMenuItems(self, role_description, params=None):
    """Used to create the specific Organization menu entries.

    For args see group.View._getExtraMenuItems().
    """
    submenus = []

    group_entity = role_description['group']
    program_entity = group_entity.scope
    roles = role_description['roles']

    if roles.get('org_admin') or roles.get('mentor'):
      # add a link to view all the student proposals
      submenu = (redirects.getListProposalsRedirect(group_entity, params),
          "View all Student Proposals", 'any_access')
      submenus.append(submenu)


    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')
      submenus.append(submenu)

      # add a link to invite an org admin
      submenu = (redirects.getInviteRedirectForRole(group_entity, 'org_admin'),
          "Invite an Admin", 'any_access')
      submenus.append(submenu)

      # add a link to invite a member
      submenu = (redirects.getInviteRedirectForRole(group_entity, 'mentor'),
          "Invite a Mentor", 'any_access')
      submenus.append(submenu)

      # add a link to the request page
      submenu = (redirects.getListRequestsRedirect(group_entity, params),
          "List Requests and Invites", 'any_access')
      submenus.append(submenu)

      # add a link to the edit page
      submenu = (redirects.getEditRedirect(group_entity, params),
          "Edit Organization Profile", 'any_access')
      submenus.append(submenu)

    if roles.get('org_admin') or roles.get('mentor'):
      submenu = (redirects.getCreateDocumentRedirect(group_entity, 'org'),
          "Create a New Document", 'any_access')
      submenus.append(submenu)

      submenu = (redirects.getListDocumentsRedirect(group_entity, 'org'),
          "List Documents", 'any_access')
      submenus.append(submenu)


    if roles.get('org_admin'):
      # add a link to the resign page
      submenu = (redirects.getManageRedirect(roles['org_admin'],
          {'url_name': 'org_admin'}),
          "Resign as Admin", 'any_access')
      submenus.append(submenu)

      # add a link to the edit page
      submenu = (redirects.getEditRedirect(roles['org_admin'],
          {'url_name': 'org_admin'}),
          "Edit My Admin Profile", 'any_access')
      submenus.append(submenu)


    if roles.get('mentor'):
      # add a link to the resign page
      submenu = (redirects.getManageRedirect(roles['mentor'],
          {'url_name' : 'mentor'}),
          "Resign as Mentor", 'any_access')
      submenus.append(submenu)

      # add a link to the edit page
      submenu = (redirects.getEditRedirect(roles['mentor'],
          {'url_name': 'mentor'}),
          "Edit My Mentor Profile", 'any_access')
      submenus.append(submenu)

    return submenus
Beispiel #6
0
    def _getExtraMenuItems(self, role_description, params=None):
        """Used to create the specific club menu entries.

    For args see group.View._getExtraMenuItems().
    """

        submenus = []

        group_entity = role_description['group']
        roles = role_description['roles']

        if roles.get('club_admin'):
            # add a link to the management page
            submenu = (redirects.getListRolesRedirect(group_entity, params),
                       "Manage Admins and Members", 'any_access')
            submenus.append(submenu)

            # add a link to invite an admin
            submenu = (redirects.getInviteRedirectForRole(
                group_entity, 'club_admin'), "Invite an Admin", 'any_access')
            submenus.append(submenu)

            # add a link to invite a member
            submenu = (redirects.getInviteRedirectForRole(
                group_entity, 'club_member'), "Invite a Member", 'any_access')
            submenus.append(submenu)

            # add a link to the request page
            submenu = (redirects.getListRequestsRedirect(group_entity, params),
                       "List Requests and Invites", 'any_access')
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (redirects.getEditRedirect(group_entity, params),
                       "Edit Club Profile", 'any_access')
            submenus.append(submenu)

        if roles.get('club_member') or roles.get('club_admin'):
            submenu = (redirects.getCreateDocumentRedirect(
                group_entity, 'club'), "Create a New Document", 'any_access')
            submenus.append(submenu)

            submenu = (redirects.getListDocumentsRedirect(
                group_entity, 'club'), "List Documents", 'any_access')
            submenus.append(submenu)

        if roles.get('club_admin'):
            # add a link to resign as club admin
            submenu = (redirects.getManageRedirect(roles['club_admin'],
                                                   {'url_name': 'club_admin'}),
                       "Resign as Club Admin", 'any_access')
            submenus.append(submenu)

        if roles.get('club_member'):
            # add a link to resign as club member
            submenu = (redirects.getManageRedirect(
                roles['club_member'], {'url_name': 'club_member'}),
                       "Resign as Club Member", 'any_access')
            submenus.append(submenu)

        return submenus
Beispiel #7
0
  def _getExtraMenuItems(self, role_description, params=None):
    """Used to create the specific club menu entries.

    For args see group.View._getExtraMenuItems().
    """

    submenus = []

    group_entity = role_description['group']
    roles = role_description['roles']
  
    if roles.get('club_admin'):
      # add a link to the management page
      submenu = (redirects.getListRolesRedirect(group_entity, params),
          "Manage Admins and Members", 'any_access')
      submenus.append(submenu)

      # add a link to invite an admin
      submenu = (redirects.getInviteRedirectForRole(group_entity, 'club_admin'),
          "Invite an Admin", 'any_access')
      submenus.append(submenu)

      # add a link to invite a member
      submenu = (redirects.getInviteRedirectForRole(group_entity, 
          'club_member'), "Invite a Member", 'any_access')
      submenus.append(submenu)

      # add a link to the request page
      submenu = (redirects.getListRequestsRedirect(group_entity, params), 
          "List Requests and Invites", 'any_access')
      submenus.append(submenu)

      # add a link to the edit page
      submenu = (redirects.getEditRedirect(group_entity, params), 
          "Edit Club Profile", 'any_access')
      submenus.append(submenu)

    if roles.get('club_member') or roles.get('club_admin'):
      submenu = (redirects.getCreateDocumentRedirect(group_entity, 'club'),
          "Create a New Document", 'any_access')
      submenus.append(submenu)

      submenu = (redirects.getListDocumentsRedirect(group_entity, 'club'),
          "List Documents", 'any_access')
      submenus.append(submenu)

    if roles.get('club_admin'):
      # add a link to resign as club admin
      submenu = (redirects.getManageRedirect(roles['club_admin'], 
          {'url_name': 'club_admin'}), 
          "Resign as Club Admin", 'any_access')
      submenus.append(submenu)

    if roles.get('club_member'):
      # add a link to resign as club member
      submenu = (redirects.getManageRedirect(roles['club_member'], 
          {'url_name' : 'club_member'}), 
          "Resign as Club Member", 'any_access')
      submenus.append(submenu)

    return submenus
Beispiel #8
0
    def _getExtraMenuItems(self, role_description, params=None):
        """Used to create the specific GCI Organization menu entries.

    For args see soc.views.models.organization.View._getExtraMenuItems().
    """
        submenus = []

        group_entity = role_description['group']
        roles = role_description['roles']

        mentor_entity = roles.get('gci_mentor')
        admin_entity = roles.get('gci_org_admin')

        is_active_mentor = mentor_entity and mentor_entity.status == 'active'
        is_active_admin = admin_entity and admin_entity.status == 'active'

        if admin_entity or mentor_entity:
            # add a link to view all the organization tasks.
            submenu = (gci_redirects.getListTasksRedirect(
                group_entity,
                {'url_name': 'gci/task'}), "View all Tasks", 'any_access')
            submenus.append(submenu)

        if is_active_admin:
            # add a link to create task
            submenu = (redirects.getCreateRedirect(group_entity,
                                                   {'url_name': 'gci/task'}),
                       "Create a Task", 'any_access')
            submenus.append(submenu)

            # add a link to bulk create tasks
            submenu = (gci_redirects.getBulkCreateRedirect(
                group_entity,
                {'url_name': 'gci/task'}), "Bulk Create Tasks", 'any_access')
            submenus.append(submenu)

            # add a link to the management page
            submenu = (redirects.getListRolesRedirect(group_entity, params),
                       "Manage Admins and Mentors", 'any_access')
            submenus.append(submenu)

            # add a link to invite an org admin
            submenu = (redirects.getInviteRedirectForRole(
                group_entity,
                'gci/org_admin'), "Invite an Admin", 'any_access')
            submenus.append(submenu)

            # add a link to invite a member
            submenu = (redirects.getInviteRedirectForRole(
                group_entity, 'gci/mentor'), "Invite a Mentor", 'any_access')
            submenus.append(submenu)

            # add a link to the request page
            submenu = (redirects.getListRequestsRedirect(group_entity, params),
                       "List Requests and Invites", 'any_access')
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (redirects.getEditRedirect(group_entity, params),
                       "Edit Organization Profile", 'any_access')
            submenus.append(submenu)

        if is_active_mentor:
            # add a link to suggest task
            submenu = (gci_redirects.getSuggestTaskRedirect(
                group_entity,
                {'url_name': 'gci/task'}), "Suggest a Task", 'any_access')
            submenus.append(submenu)

        if is_active_admin or is_active_mentor:
            submenu = (redirects.getCreateDocumentRedirect(
                group_entity,
                'gci_org'), "Create a New Document", 'any_access')
            submenus.append(submenu)

            submenu = (redirects.getListDocumentsRedirect(
                group_entity, 'gci_org'), "List Documents", 'any_access')
            submenus.append(submenu)

        if is_active_admin:
            # add a link to the resign page
            submenu = (redirects.getManageRedirect(
                roles['gci_org_admin'], {'url_name': 'gci/org_admin'}),
                       "Resign as Admin", 'any_access')
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (redirects.getEditRedirect(
                roles['gci_org_admin'], {'url_name': 'gci/org_admin'}),
                       "Edit My Admin Profile", 'any_access')
            submenus.append(submenu)

        if is_active_mentor:
            # add a link to the resign page
            submenu = (redirects.getManageRedirect(roles['gci_mentor'],
                                                   {'url_name': 'gci/mentor'}),
                       "Resign as Mentor", 'any_access')
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (redirects.getEditRedirect(roles['gci_mentor'],
                                                 {'url_name': 'gci/mentor'}),
                       "Edit My Mentor Profile", 'any_access')
            submenus.append(submenu)

        return submenus