Exemple #1
0
  def assignSlots(self, request, access_type, page_name=None,
                  params=None, **kwargs):
    """View that allows to assign slots to orgs.
    """

    from soc.modules.gsoc.views.models.organization import view as org_view

    program_entity = program_logic.getFromKeyFieldsOr404(kwargs)
    description = self.DEF_SLOTS_ALLOCATION_MSG

    org_params = org_view.getParams().copy()
    org_params['list_description'] = description
    org_params['list_template'] = "modules/gsoc/program/list/allocation.html"
    org_params['public_field_props'] = {
        "link_id": {
            "hidden": True,
        }
    }
    org_params['public_row_action'] = {}
    org_params['public_row_extra'] = lambda entity: {}
    org_params['public_conf_extra'] = {
        "rowNum": -1,
        "rowList": [],
    }
    org_params['public_field_keys'] = [
        "name", "slots_desired", "nr_applications", "nr_mentors",
        "locked", "slots_ass", "slots", "link_id",
    ]
    org_params['public_field_names'] = [
        "Name", "Desired", "#Proposals", "#Mentors",
        "Locked?", "Slots Assigned", "Slots Visible to Org", "Link ID",
    ]

    fields = {
        'scope': program_entity,
        'status': ['new', 'active', 'inactive']
        }

    return_url =  "http://%(host)s%(index)s" % {
      'host' : system.getHostname(),
      'index': redirects.getSlotsRedirect(program_entity, params)
      }

    context = {
        'total_slots': program_entity.slots,
        'uses_json': True,
        'uses_slot_allocator': True,
        'return_url': return_url,
        }

    return self.list(request, 'allow', page_name=page_name, params=org_params,
                     filter=fields, context=context)
Exemple #2
0
  def assignSlots(self, request, access_type, page_name=None,
                  params=None, **kwargs):
    """View that allows to assign slots to orgs.
    """

    from soc.views.models import organization as organization_view

    org_params = organization_view.view.getParams().copy()
    org_params['list_template'] = 'soc/program/allocation/allocation.html'
    org_params['list_heading'] = 'soc/program/allocation/heading.html'
    org_params['list_row'] = 'soc/program/allocation/row.html'
    org_params['list_pagination'] = 'soc/list/no_pagination.html'

    program = program_logic.logic.getFromKeyFieldsOr404(kwargs)

    description = self.DEF_SLOTS_ALLOCATION_MSG

    filter = {
        'scope': program,
        'status': 'active',
        }

    content = self._getAcceptedOrgsList(description, org_params, filter, False)

    contents = [content]

    return_url =  "http://%(host)s%(index)s" % {
      'host' : os.environ['HTTP_HOST'],
      'index': redirects.getSlotsRedirect(program, params)
      }

    context = {
        'total_slots': program.slots,
        'uses_json': True,
        'uses_slot_allocator': True,
        'return_url': return_url,
        }

    return self._list(request, org_params, contents, page_name, context)
Exemple #3
0
    def assignSlots(self,
                    request,
                    access_type,
                    page_name=None,
                    params=None,
                    **kwargs):
        """View that allows to assign slots to orgs.
    """

        from soc.modules.gsoc.views.models.organization import view as org_view

        org_params = org_view.getParams().copy()
        org_params['list_template'] = 'soc/program/allocation/allocation.html'
        org_params['list_heading'] = 'soc/program/allocation/heading.html'
        org_params['list_row'] = 'soc/program/allocation/row.html'
        org_params['list_pagination'] = 'soc/list/no_pagination.html'

        program_entity = program_logic.getFromKeyFieldsOr404(kwargs)

        description = self.DEF_SLOTS_ALLOCATION_MSG

        content = self._getOrgsWithProfilesList(program_entity, org_view,
                                                description, False)
        contents = [content]

        return_url = "http://%(host)s%(index)s" % {
            'host': system.getHostname(),
            'index': redirects.getSlotsRedirect(program_entity, params)
        }

        context = {
            'total_slots': program_entity.slots,
            'uses_json': True,
            'uses_slot_allocator': True,
            'return_url': return_url,
        }

        return self._list(request, org_params, contents, page_name, context)
Exemple #4
0
    def assignSlots(self,
                    request,
                    access_type,
                    page_name=None,
                    params=None,
                    **kwargs):
        """View that allows to assign slots to orgs.
    """

        from soc.modules.gsoc.views.models.organization import view as org_view

        program_entity = program_logic.getFromKeyFieldsOr404(kwargs)
        description = self.DEF_SLOTS_ALLOCATION_MSG

        org_params = org_view.getParams().copy()
        org_params['list_description'] = description
        org_params[
            'list_template'] = "modules/gsoc/program/list/allocation.html"
        org_params['public_field_props'] = {
            "link_id": {
                "hidden": True,
            }
        }
        org_params['public_row_action'] = {}
        org_params['public_row_extra'] = lambda entity: {}
        org_params['public_conf_extra'] = {
            "rowNum": -1,
            "rowList": [],
        }
        org_params['public_field_keys'] = [
            "name",
            "slots_desired",
            "nr_applications",
            "nr_mentors",
            "locked",
            "slots_ass",
            "slots",
            "link_id",
        ]
        org_params['public_field_names'] = [
            "Name",
            "Desired",
            "#Proposals",
            "#Mentors",
            "Locked?",
            "Slots Assigned",
            "Slots Visible to Org",
            "Link ID",
        ]

        fields = {
            'scope': program_entity,
            'status': ['new', 'active', 'inactive']
        }

        return_url = "http://%(host)s%(index)s" % {
            'host': system.getHostname(),
            'index': redirects.getSlotsRedirect(program_entity, params)
        }

        context = {
            'total_slots': program_entity.slots,
            'uses_json': True,
            'uses_slot_allocator': True,
            'return_url': return_url,
        }

        return self.list(request,
                         'allow',
                         page_name=page_name,
                         params=org_params,
                         filter=fields,
                         context=context)