示例#1
0
    def testCreateTimelineDict(self):
        """Just a smoke test for now."""
        timeline_dict = timeline_logic.createTimelineDict(self.timeline_helper)
        self.assertIn('slices', timeline_dict)

        # Ensure that the dictionary serializes to something non-empty.
        self.assertTrue(json.dumps(timeline_dict))
示例#2
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
示例#3
0
  def testCreateTimelineDict(self):
    """Just a smoke test for now."""
    timeline_dict = timeline_logic.createTimelineDict(self.timeline_helper)
    self.assertIn('slices', timeline_dict)

    # Ensure that the dictionary serializes to something non-empty.
    self.assertTrue(json.dumps(timeline_dict))
示例#4
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