fix new count where cards are suspended, highlight type in blue too

This commit is contained in:
Damien Elmes 2009-04-22 21:37:42 +09:00
parent bc8b7f45da
commit cd87adbe71

View file

@ -647,7 +647,10 @@ type = 0 and isDue = 1 and combinedDue <= :now""", now=time.time())
def nextDueMsg(self): def nextDueMsg(self):
next = self.earliestTime() next = self.earliestTime()
if next: if next:
newCardsTomorrow = min(self.newCount, self.newCardsPerDay) newCount = self.s.scalar("""
select count() from cards where type = 2
and priority in (1,2,3,4)""")
newCardsTomorrow = min(newCount, self.newCardsPerDay)
cards = self.cardsDueBy(time.time() + 86400) cards = self.cardsDueBy(time.time() + 86400)
msg = _('''\ msg = _('''\
<style>b { color: #00f; }</style> <style>b { color: #00f; }</style>
@ -696,15 +699,15 @@ and priority in (1,2,3,4) and type in (0, 1)""", time=time)
spaceSusp = "" spaceSusp = ""
c= self.newSpacedCount() c= self.newSpacedCount()
if c: if c:
spaceSusp += ngettext('There is <b>%d</b> delayed new card.', spaceSusp += ngettext('There is <b>%d delayed</b> new card.',
'There are <b>%d</b> delayed new cards.', 'There are <b>%d delayed</b> new cards.',
c) % c c) % c
c2 = self.suspendedCardCount() c2 = self.suspendedCardCount()
if c2: if c2:
if c: if c:
spaceSusp += "<br>" spaceSusp += "<br>"
spaceSusp += ngettext('There is <b>%d</b> suspended card.', spaceSusp += ngettext('There is <b>%d suspended</b> card.',
'There are <b>%d</b> suspended cards.', 'There are <b>%d suspended</b> cards.',
c2) % c2 c2) % c2
if spaceSusp: if spaceSusp:
spaceSusp = "<br><br>" + spaceSusp spaceSusp = "<br><br>" + spaceSusp