2021-05-15 12:09:50 +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">
|
|
|
|
import * as tr from "lib/i18n";
|
2021-05-27 23:19:05 +02:00
|
|
|
import TitledContainer from "./TitledContainer.svelte";
|
2021-05-29 13:06:17 +02:00
|
|
|
import StepsInputRow from "./StepsInputRow.svelte";
|
|
|
|
import SpinBoxRow from "./SpinBoxRow.svelte";
|
|
|
|
import EnumSelectorRow from "./EnumSelectorRow.svelte";
|
2021-05-29 12:29:22 +02:00
|
|
|
import Warning from "./Warning.svelte";
|
2021-05-15 12:09:50 +02:00
|
|
|
import type { DeckOptionsState } from "./lib";
|
|
|
|
|
|
|
|
export let state: DeckOptionsState;
|
2021-05-29 17:32:12 +02:00
|
|
|
export let api = {};
|
|
|
|
|
2021-05-15 12:09:50 +02:00
|
|
|
let config = state.currentConfig;
|
|
|
|
let defaults = state.defaults;
|
|
|
|
|
|
|
|
let stepsExceedMinimumInterval: string;
|
|
|
|
$: {
|
|
|
|
const lastRelearnStepInDays = $config.relearnSteps.length
|
|
|
|
? $config.relearnSteps[$config.relearnSteps.length - 1] / 60 / 24
|
|
|
|
: 0;
|
|
|
|
stepsExceedMinimumInterval =
|
|
|
|
lastRelearnStepInDays > $config.minimumLapseInterval
|
|
|
|
? tr.deckConfigRelearningStepsAboveMinimumInterval()
|
|
|
|
: "";
|
|
|
|
}
|
|
|
|
|
|
|
|
const leechChoices = [tr.actionsSuspendCard(), tr.schedulingTagOnly()];
|
|
|
|
</script>
|
|
|
|
|
2021-05-29 17:32:12 +02:00
|
|
|
<TitledContainer title={tr.schedulingLapses()} {api}>
|
2021-05-29 13:06:17 +02:00
|
|
|
<StepsInputRow
|
|
|
|
bind:value={$config.relearnSteps}
|
|
|
|
defaultValue={defaults.relearnSteps}
|
|
|
|
markdownTooltip={tr.deckConfigRelearningStepsTooltip()}
|
|
|
|
>
|
|
|
|
{tr.deckConfigRelearningSteps()}
|
|
|
|
</StepsInputRow>
|
2021-05-15 12:09:50 +02:00
|
|
|
|
2021-05-29 13:06:17 +02:00
|
|
|
<SpinBoxRow
|
|
|
|
bind:value={$config.minimumLapseInterval}
|
|
|
|
defaultValue={defaults.minimumLapseInterval}
|
|
|
|
min={1}
|
|
|
|
markdownTooltip={tr.deckConfigMinimumIntervalTooltip()}
|
|
|
|
>
|
|
|
|
{tr.schedulingMinimumInterval()}
|
|
|
|
</SpinBoxRow>
|
2021-05-15 12:09:50 +02:00
|
|
|
|
2021-05-29 12:29:22 +02:00
|
|
|
<Warning warning={stepsExceedMinimumInterval} />
|
2021-05-15 12:09:50 +02:00
|
|
|
|
2021-05-29 13:06:17 +02:00
|
|
|
<SpinBoxRow
|
|
|
|
bind:value={$config.leechThreshold}
|
|
|
|
defaultValue={defaults.leechThreshold}
|
|
|
|
min={1}
|
|
|
|
markdownTooltip={tr.deckConfigLeechThresholdTooltip()}
|
|
|
|
>
|
|
|
|
{tr.schedulingLeechThreshold()}
|
|
|
|
</SpinBoxRow>
|
2021-05-28 01:41:53 +02:00
|
|
|
|
2021-05-29 13:06:17 +02:00
|
|
|
<EnumSelectorRow
|
|
|
|
bind:value={$config.leechAction}
|
|
|
|
defaultValue={defaults.leechAction}
|
|
|
|
choices={leechChoices}
|
|
|
|
breakpoint="sm"
|
|
|
|
markdownTooltip={tr.deckConfigLeechActionTooltip()}
|
|
|
|
>
|
|
|
|
{tr.schedulingLeechAction()}
|
|
|
|
</EnumSelectorRow>
|
2021-05-27 23:19:05 +02:00
|
|
|
</TitledContainer>
|