include day/week info too

This commit is contained in:
Damien Elmes 2011-03-30 19:31:23 +09:00
parent ed9901a71d
commit be7794bb56

View file

@ -88,15 +88,19 @@ table * { font-size: 14px; }
return txt return txt
def _dueInfo(self, tot, num): def _dueInfo(self, tot, num):
avg = tot/float(num)
txt = _("Average reviews: %s")
if self.type == 0: if self.type == 0:
txt = txt % _("%d/day") % avg days = num
elif self.type == 1: elif self.type == 1:
txt = txt % _("%d/week") % avg days = num*7
else: else:
txt =txt % _("%d/month") % avg days = num*30
vals = []
vals.append(_("%d/day") % (tot/days))
if self.type > 0:
vals.append(_("%d/week") % (tot/(days/7)))
if self.type > 1:
vals.append(_("%d/month") % (tot/(days/30)))
txt = _("Average reviews: <b>%s</b>") % ", ".join(vals)
return txt return txt
def _due(self, start=None, end=None, chunk=1): def _due(self, start=None, end=None, chunk=1):