Esempio n. 1
0
  def context(self, data, check, mutator):
    """Handler to for GSoC Home page HTTP get request."""

    current_timeline = data.timeline.currentPeriod()
    next_deadline = data.timeline.nextDeadline()

    # TODO(mario): this is a temporary variable to switch between the old
    # image-based timeline to the new dynamic one. To be removed when the switch
    # is over: please remember to remove it from the Timeline widget class,
    # too.
    new_widget = True
    timeline_data = json.dumps(timeline_logic.createTimelineDict(data.timeline))

    context = {
        'timeline': Timeline(data, current_timeline, next_deadline, new_widget),
        'timeline_data': timeline_data,
        'apply': Apply(data),
        'connect_with_us': ConnectWithUs(data),
        'new_widget': new_widget,
        'page_name': '%s - Home page' % (data.program.name),
        'program': data.program,
        'program_select': base_templates.ProgramSelect(
            'modules/gsoc/homepage/_program_select.html', data,
            'gsoc_homepage'),
    }

    featured_project = project_logic.getFeaturedProject(
        current_timeline, data.program)

    if featured_project:
      context['featured_project'] = FeaturedProject(data, featured_project)

    return context
Esempio n. 2
0
  def context(self):
    """Handler to for GSoC Home page HTTP get request.
    """

    current_timeline = self.data.timeline.currentPeriod()
    next_deadline = self.data.timeline.nextDeadline()

    context = {
        'logged_in_msg': LoggedInMsg(self.data, apply_link=False,
                                     div_name='user-login'),
        'timeline': Timeline(self.data, current_timeline, next_deadline),
        'apply': Apply(self.data),
        'connect_with_us': ConnectWithUs(self.data),
        'page_name': '%s - Home page' % (self.data.program.name),
        'program': self.data.program,
    }

    featured_project = project_logic.getFeaturedProject(
        current_timeline, self.data.program)

    if featured_project:
      context['featured_project'] = FeaturedProject(
        self.data, featured_project)

    return context
Esempio n. 3
0
    def context(self, data, check, mutator):
        """Handler to for GSoC Home page HTTP get request."""

        current_timeline = data.timeline.currentPeriod()
        next_deadline = data.timeline.nextDeadline()

        # TODO(mario): this is a temporary variable to switch between the old
        # image-based timeline to the new dynamic one. To be removed when the switch
        # is over: please remember to remove it from the Timeline widget class,
        # too.
        new_widget = True
        timeline_data = json.dumps(
            timeline_logic.createTimelineDict(data.timeline))

        context = {
            'timeline':
            Timeline(data, current_timeline, next_deadline, new_widget),
            'timeline_data':
            timeline_data,
            'apply':
            Apply(data),
            'connect_with_us':
            ConnectWithUs(data),
            'new_widget':
            new_widget,
            'page_name':
            '%s - Home page' % (data.program.name),
            'program':
            data.program,
            'program_select':
            base_templates.ProgramSelect(
                'modules/gsoc/homepage/_program_select.html', data,
                'gsoc_homepage'),
        }

        featured_project = project_logic.getFeaturedProject(
            current_timeline, data.program)

        if featured_project:
            context['featured_project'] = FeaturedProject(
                data, featured_project)

        return context