mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
allow creating deck via #deck:...
This commit is contained in:
parent
024a31f597
commit
1104ad8f84
2 changed files with 23 additions and 4 deletions
|
|
@ -48,6 +48,7 @@ importing-merge-notetypes-help =
|
|||
Warning: This will require a one-way sync, and may mark existing notes as modified.
|
||||
importing-mnemosyne-20-deck-db = Mnemosyne 2.0 Deck (*.db)
|
||||
importing-multicharacter-separators-are-not-supported-please = Multi-character separators are not supported. Please enter one character only.
|
||||
importing-new-deck-will-be-created = A new deck will be created: { $name }
|
||||
importing-notes-added-from-file = Notes added from file: { $val }
|
||||
importing-notes-found-in-file = Notes found in file: { $val }
|
||||
importing-notes-skipped-as-theyre-already-in = Notes skipped, as up-to-date copies are already in your collection: { $val }
|
||||
|
|
|
|||
|
|
@ -17,12 +17,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
import { dupeResolutionChoices, matchScopeChoices } from "./choices";
|
||||
import type { ImportCsvState } from "./lib";
|
||||
import Warning from "../deck-options/Warning.svelte";
|
||||
|
||||
export let state: ImportCsvState;
|
||||
|
||||
const metadata = state.metadata;
|
||||
const globalNotetype = state.globalNotetype;
|
||||
const deckId = state.deckId;
|
||||
const deckName = state.newDeckName;
|
||||
|
||||
const settings = {
|
||||
notetype: {
|
||||
|
|
@ -64,6 +66,22 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
modal.show();
|
||||
carousel.to(index);
|
||||
}
|
||||
|
||||
const choices = state.deckNameIds.map(({ id, name }) => {
|
||||
return { label: name, value: id };
|
||||
});
|
||||
|
||||
if (deckName) {
|
||||
choices.push({
|
||||
label: deckName,
|
||||
value: 0n,
|
||||
});
|
||||
}
|
||||
|
||||
$: newDeckCreationNotice =
|
||||
deckName && $deckId === 0n
|
||||
? tr.importingNewDeckWillBeCreated({ name: deckName })
|
||||
: "";
|
||||
</script>
|
||||
|
||||
<TitledContainer title={tr.importingImportOptions()}>
|
||||
|
|
@ -95,13 +113,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
</EnumSelectorRow>
|
||||
{/if}
|
||||
|
||||
{#if $deckId !== null}
|
||||
{#if deckName || $deckId}
|
||||
<EnumSelectorRow
|
||||
bind:value={$deckId}
|
||||
defaultValue={state.defaultDeckId}
|
||||
choices={state.deckNameIds.map(({ id, name }) => {
|
||||
return { label: name, value: id };
|
||||
})}
|
||||
{choices}
|
||||
>
|
||||
<SettingTitle
|
||||
on:click={() => openHelpModal(Object.keys(settings).indexOf("deck"))}
|
||||
|
|
@ -111,6 +127,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
</EnumSelectorRow>
|
||||
{/if}
|
||||
|
||||
<Warning warning={newDeckCreationNotice} className="alert-info" />
|
||||
|
||||
<EnumSelectorRow
|
||||
bind:value={$metadata.dupeResolution}
|
||||
defaultValue={0}
|
||||
|
|
|
|||
Loading…
Reference in a new issue