Added: Answer button times

This commit is contained in:
Luc Mcgrady 2025-10-02 17:36:38 +01:00
parent eb6520520c
commit 32601abe1f
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C
3 changed files with 39 additions and 25 deletions

View file

@ -1272,6 +1272,9 @@ class SvelteReviewer(Reviewer):
self._remaining() self._remaining()
self.bottom.web.eval('showQuestion("",%d);' % (maxTime)) self.bottom.web.eval('showQuestion("",%d);' % (maxTime))
def _buttonTime(self, i: int, v3_labels: Sequence[str]) -> str:
return v3_labels[i - 1] if self.mw.col.conf["estTimes"] else ""
def _linkHandler(self, url: str) -> None: def _linkHandler(self, url: str) -> None:
if url == "bottomReady": if url == "bottomReady":
self._showQuestion() self._showQuestion()

View file

@ -9,6 +9,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let info: AnswerButtonInfo; export let info: AnswerButtonInfo;
</script> </script>
<span>
{info.due}
</span>
<button on:click={() => bridgeCommand(`ease${info.i}`)}> <button on:click={() => bridgeCommand(`ease${info.i}`)}>
{info.label} {info.label}
</button> </button>
<style>
span {
text-align: center;
}
</style>

View file

@ -28,7 +28,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</button> </button>
</div> </div>
<div class="review-buttons"> <div class="review-buttons">
<span> {#if $answerButtons.length}
{#each $answerButtons as answerButton}
<AnswerButton info={answerButton}></AnswerButton>
{/each}
{:else}
<span class="remaining-count">
<RemainingNumber cls="new-count" underlined={$remainingIndex === 0}> <RemainingNumber cls="new-count" underlined={$remainingIndex === 0}>
{$remaining[0]} {$remaining[0]}
</RemainingNumber> + </RemainingNumber> +
@ -39,18 +44,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{$remaining[2]} {$remaining[2]}
</RemainingNumber> </RemainingNumber>
</span> </span>
<div>
{#if $answerButtons.length}
{#each $answerButtons as answerButton}
<AnswerButton info={answerButton}></AnswerButton>
{/each}
{:else}
<button on:click={() => bridgeCommand("ans")}> <button on:click={() => bridgeCommand("ans")}>
{tr.studyingShowAnswer()} {tr.studyingShowAnswer()}
</button> </button>
{/if} {/if}
</div> </div>
</div>
<div> <div>
<button <button
on:click={() => bridgeCommand("more")} on:click={() => bridgeCommand("more")}
@ -72,8 +70,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
} }
.review-buttons { .review-buttons {
display: flex; display: grid;
flex-direction: column; grid-auto-flow: column;
align-items: center; grid-template-rows: auto auto;
}
.remaining-count {
text-align: center;
} }
</style> </style>