mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
Show buried until daily limits in overview screen (#1664)
* Show buried until daily limits in overview screen This explains differences between the counts shown in the deck tree and those shown in the overview screen. Closes #1633. * interday learning cards can be buried too (dae) * add 'buried' tooltip to bury counts; generate row in helper fn (dae) * Use grey for buried counts
This commit is contained in:
parent
d4f27d1d56
commit
098881741b
2 changed files with 40 additions and 13 deletions
|
@ -221,25 +221,38 @@ class Overview:
|
|||
|
||||
def _table(self) -> str | None:
|
||||
counts = list(self.mw.col.sched.counts())
|
||||
tree_counts = self.mw.col.sched.deck_due_tree(
|
||||
self.mw.col.decks.get_current_id()
|
||||
)
|
||||
but = self.mw.button
|
||||
return """
|
||||
buried_new = tree_counts.new_count - counts[0]
|
||||
buried_learning = tree_counts.learn_count - counts[1]
|
||||
buried_review = tree_counts.review_count - counts[2]
|
||||
buried_label = tr.browsing_buried()
|
||||
|
||||
def number_row(title: str, klass: str, count: int, buried_count: int) -> str:
|
||||
return f"""
|
||||
<tr>
|
||||
<td>{title}:</td>
|
||||
<td>
|
||||
<b>
|
||||
<span class={klass}>{count}</span>
|
||||
<span class=bury-count title="{buried_label}">{buried_count or ""}</span>
|
||||
</b>
|
||||
</td>
|
||||
</tr>
|
||||
"""
|
||||
|
||||
return f"""
|
||||
<table width=400 cellpadding=5>
|
||||
<tr><td align=center valign=top>
|
||||
<table cellspacing=5>
|
||||
<tr><td>{}:</td><td><b><span class=new-count>{}</span></b></td></tr>
|
||||
<tr><td>{}:</td><td><b><span class=learn-count>{}</span></b></td></tr>
|
||||
<tr><td>{}:</td><td><b><span class=review-count>{}</span></b></td></tr>
|
||||
{number_row(tr.actions_new(), "new-count", counts[0], buried_new)}
|
||||
{number_row(tr.scheduling_learning(), "learn-count", counts[1], buried_learning)}
|
||||
{number_row(tr.studying_to_review(), "review-count", counts[2], buried_review)}
|
||||
</table>
|
||||
</td><td align=center>
|
||||
{}</td></tr></table>""".format(
|
||||
tr.actions_new(),
|
||||
counts[0],
|
||||
tr.scheduling_learning(),
|
||||
counts[1],
|
||||
tr.studying_to_review(),
|
||||
counts[2],
|
||||
but("study", tr.studying_study_now(), id="study", extra=" autofocus"),
|
||||
)
|
||||
{but("study", tr.studying_study_now(), id="study", extra=" autofocus")}</td></tr></table>"""
|
||||
|
||||
_body = """
|
||||
<center>
|
||||
|
|
|
@ -13,3 +13,17 @@
|
|||
.zero-count {
|
||||
color: var(--zero-count);
|
||||
}
|
||||
|
||||
.bury-count {
|
||||
color: var(--disabled);
|
||||
font-weight: bold;
|
||||
margin-inline-start: 2px;
|
||||
|
||||
&::before {
|
||||
content: "+";
|
||||
}
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue