mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 22:13:58 -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.
|
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-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-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-added-from-file = Notes added from file: { $val }
|
||||||
importing-notes-found-in-file = Notes found in 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 }
|
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 { dupeResolutionChoices, matchScopeChoices } from "./choices";
|
||||||
import type { ImportCsvState } from "./lib";
|
import type { ImportCsvState } from "./lib";
|
||||||
|
import Warning from "../deck-options/Warning.svelte";
|
||||||
|
|
||||||
export let state: ImportCsvState;
|
export let state: ImportCsvState;
|
||||||
|
|
||||||
const metadata = state.metadata;
|
const metadata = state.metadata;
|
||||||
const globalNotetype = state.globalNotetype;
|
const globalNotetype = state.globalNotetype;
|
||||||
const deckId = state.deckId;
|
const deckId = state.deckId;
|
||||||
|
const deckName = state.newDeckName;
|
||||||
|
|
||||||
const settings = {
|
const settings = {
|
||||||
notetype: {
|
notetype: {
|
||||||
|
|
@ -64,6 +66,22 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
modal.show();
|
modal.show();
|
||||||
carousel.to(index);
|
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>
|
</script>
|
||||||
|
|
||||||
<TitledContainer title={tr.importingImportOptions()}>
|
<TitledContainer title={tr.importingImportOptions()}>
|
||||||
|
|
@ -95,13 +113,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</EnumSelectorRow>
|
</EnumSelectorRow>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $deckId !== null}
|
{#if deckName || $deckId}
|
||||||
<EnumSelectorRow
|
<EnumSelectorRow
|
||||||
bind:value={$deckId}
|
bind:value={$deckId}
|
||||||
defaultValue={state.defaultDeckId}
|
defaultValue={state.defaultDeckId}
|
||||||
choices={state.deckNameIds.map(({ id, name }) => {
|
{choices}
|
||||||
return { label: name, value: id };
|
|
||||||
})}
|
|
||||||
>
|
>
|
||||||
<SettingTitle
|
<SettingTitle
|
||||||
on:click={() => openHelpModal(Object.keys(settings).indexOf("deck"))}
|
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>
|
</EnumSelectorRow>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<Warning warning={newDeckCreationNotice} className="alert-info" />
|
||||||
|
|
||||||
<EnumSelectorRow
|
<EnumSelectorRow
|
||||||
bind:value={$metadata.dupeResolution}
|
bind:value={$metadata.dupeResolution}
|
||||||
defaultValue={0}
|
defaultValue={0}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue