
"""This module contains the templates which are used across the views."""


from soc.views.template import Template


class Timeline(Template):
  """Timeline template.
  """

  def context(self):
    remaining = self.data.timeline.remainingTime()
    remaining_days = remaining.days
    remaining_hours = remaining.seconds / 3600
    complete_percentage = self.data.timeline.completePercentage()
    stopwatch_percentage = self.data.timeline.stopwatchPercentage()
    return {
        'remaining_days': remaining_days,
        'remaining_hours': remaining_hours,
        'complete_percentage': complete_percentage,
        'stopwatch_percentage': stopwatch_percentage
    }

  def templatePath(self):
    return "v2/modules/gci/common_templates/_timeline.html"


"""This module contains the templates which are used across the views."""


from soc.views.template import Template


class Timeline(Template):
  """Timeline template.
  """

  def context(self):
    rem_days, rem_hours, rem_mins = self.data.timeline.remainingTime()
    complete_percentage = self.data.timeline.completePercentage()
    stopwatch_percentage = self.data.timeline.stopwatchPercentage()
    return {
        'remaining_days': rem_days,
        'remaining_hours': rem_hours,
        'remaining_minutes': rem_mins,
        'complete_percentage': complete_percentage,
        'stopwatch_percentage': stopwatch_percentage
    }

  def templatePath(self):
    return "v2/modules/gci/common_templates/_timeline.html"

Use the refactored timeline helpers for remaining time.
Use the refactored timeline helpers for remaining time.

  
  """This module contains the templates which are used across the views."""
  
  
  from soc.views.template import Template
  
  
  class Timeline(Template):
    """Timeline template.
    """
  
    def context(self):
-     remaining = self.data.timeline.remainingTime()
+     rem_days, rem_hours, rem_mins = self.data.timeline.remainingTime()
-     remaining_days = remaining.days
-     remaining_hours = remaining.seconds / 3600
      complete_percentage = self.data.timeline.completePercentage()
      stopwatch_percentage = self.data.timeline.stopwatchPercentage()
      return {
-         'remaining_days': remaining_days,
+         'remaining_days': rem_days,
-         'remaining_hours': remaining_hours,
+         'remaining_hours': rem_hours,
+         'remaining_minutes': rem_mins,
          'complete_percentage': complete_percentage,
          'stopwatch_percentage': stopwatch_percentage
      }
  
    def templatePath(self):
      return "v2/modules/gci/common_templates/_timeline.html"
  
Use the refactored timeline helpers for remaining time.
## Code Before:

"""This module contains the templates which are used across the views."""


from soc.views.template import Template


class Timeline(Template):
  """Timeline template.
  """

  def context(self):
    remaining = self.data.timeline.remainingTime()
    remaining_days = remaining.days
    remaining_hours = remaining.seconds / 3600
    complete_percentage = self.data.timeline.completePercentage()
    stopwatch_percentage = self.data.timeline.stopwatchPercentage()
    return {
        'remaining_days': remaining_days,
        'remaining_hours': remaining_hours,
        'complete_percentage': complete_percentage,
        'stopwatch_percentage': stopwatch_percentage
    }

  def templatePath(self):
    return "v2/modules/gci/common_templates/_timeline.html"

## Instruction:
Use the refactored timeline helpers for remaining time.
## Code After:

"""This module contains the templates which are used across the views."""


from soc.views.template import Template


class Timeline(Template):
  """Timeline template.
  """

  def context(self):
    rem_days, rem_hours, rem_mins = self.data.timeline.remainingTime()
    complete_percentage = self.data.timeline.completePercentage()
    stopwatch_percentage = self.data.timeline.stopwatchPercentage()
    return {
        'remaining_days': rem_days,
        'remaining_hours': rem_hours,
        'remaining_minutes': rem_mins,
        'complete_percentage': complete_percentage,
        'stopwatch_percentage': stopwatch_percentage
    }

  def templatePath(self):
    return "v2/modules/gci/common_templates/_timeline.html"
