2021-04-17 16:01:53 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
2021-04-22 19:55:26 +02:00
|
|
|
import * as tr from "lib/i18n";
|
2021-04-17 16:01:53 +02:00
|
|
|
import SpinBox from "./SpinBox.svelte";
|
2021-04-25 10:40:02 +02:00
|
|
|
import type { DeckOptionsState } from "./lib";
|
2021-04-17 16:01:53 +02:00
|
|
|
|
2021-04-25 10:40:02 +02:00
|
|
|
export let state: DeckOptionsState;
|
2021-04-17 16:01:53 +02:00
|
|
|
let config = state.currentConfig;
|
|
|
|
let defaults = state.defaults;
|
|
|
|
let parentLimits = state.parentLimits;
|
|
|
|
|
|
|
|
$: newCardsGreaterThanParent =
|
|
|
|
$config.newPerDay > $parentLimits.newCards
|
|
|
|
? `Daily limit will be capped to parent limit of ${$parentLimits.newCards}.`
|
|
|
|
: "";
|
|
|
|
|
2021-04-22 02:55:32 +02:00
|
|
|
// with the v2 scheduler, this no longer applies
|
|
|
|
// $: reviewsGreaterThanParent =
|
|
|
|
// $config.reviewsPerDay > $parentLimits.reviews
|
|
|
|
// ? `Daily limit will be capped to parent limit of ${$parentLimits.reviews}.`
|
|
|
|
// : "";
|
2021-04-17 16:01:53 +02:00
|
|
|
|
|
|
|
$: reviewsTooLow =
|
|
|
|
$config.newPerDay * 10 > $config.reviewsPerDay
|
|
|
|
? `If adding ${
|
|
|
|
$config.newPerDay
|
|
|
|
} new cards each day, your review limit should be at least ${
|
|
|
|
$config.newPerDay * 10
|
|
|
|
}`
|
|
|
|
: "";
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<h2>Daily Limits</h2>
|
|
|
|
|
|
|
|
<SpinBox
|
|
|
|
label={tr.schedulingNewCardsday()}
|
2021-04-25 13:37:21 +02:00
|
|
|
tooltip="The maximum number of new cards to introduce in a day."
|
2021-04-17 16:01:53 +02:00
|
|
|
min={0}
|
|
|
|
warnings={[newCardsGreaterThanParent]}
|
|
|
|
defaultValue={defaults.newPerDay}
|
|
|
|
bind:value={$config.newPerDay} />
|
|
|
|
|
|
|
|
<SpinBox
|
|
|
|
label={tr.schedulingMaximumReviewsday()}
|
2021-04-25 13:37:21 +02:00
|
|
|
tooltip="The maximum number of reviews cards to show in a day."
|
2021-04-17 16:01:53 +02:00
|
|
|
min={0}
|
2021-04-22 02:55:32 +02:00
|
|
|
warnings={[reviewsTooLow]}
|
2021-04-17 16:01:53 +02:00
|
|
|
defaultValue={defaults.reviewsPerDay}
|
|
|
|
bind:value={$config.reviewsPerDay} />
|
|
|
|
</div>
|