From 2b87c919bcd879c7f356308bc522b95f33e35f3b Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Sat, 20 Jan 2024 02:25:23 +0100 Subject: Dictionary deinflections (#503) * wip * wip * fix v3 * wip * fix tests * fix maxitems * hide deinflection definitions * fix anki template * undo unnecessary change * delete console.log * refactor * add set false to handlebars * lint * fix tests * fix comments * fix * use Map in areArraysEqualIgnoreOrder * move inflection source icons to css * lint * improve naming * fix tests * add test * typescript * use for of * wip * comments * anki template upgrade * update descriptions --- .../anki-field-templates-upgrade-v24.handlebars | 52 ++++++++++++++++++++++ .../default-anki-field-templates.handlebars | 22 ++++++--- 2 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 ext/data/templates/anki-field-templates-upgrade-v24.handlebars (limited to 'ext/data/templates') diff --git a/ext/data/templates/anki-field-templates-upgrade-v24.handlebars b/ext/data/templates/anki-field-templates-upgrade-v24.handlebars new file mode 100644 index 00000000..2288737c --- /dev/null +++ b/ext/data/templates/anki-field-templates-upgrade-v24.handlebars @@ -0,0 +1,52 @@ +{{#*inline "phonetic-transcriptions"}} + {{~#if (op ">" definition.phoneticTranscriptions.length 0)~}} + + {{~/if~}} +{{/inline}} + +{{<<<<<<<}} +{{#*inline "conjugation"}} + {{~#if (op ">" definition.inflectionRuleChainCandidates.length 0)~}} + {{~set "multiple" false~}} + {{~#if (op ">" definition.inflectionRuleChainCandidates.length 1)~}} + {{~set "multiple" true~}} + {{~/if~}} + {{~#if (get "multiple")~}}{{/if~}} + {{~/if~}} +{{/inline}} +{{=======}} +{{#*inline "conjugation"}} + {{~#if definition.reasons~}} + {{~#each definition.reasons~}} + {{~#if (op ">" @index 0)}} « {{/if~}} + {{.}} + {{~/each~}} + {{~/if~}} +{{/inline}} +{{>>>>>>>>}} diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars index f23b9d0b..818677ce 100644 --- a/ext/data/templates/default-anki-field-templates.handlebars +++ b/ext/data/templates/default-anki-field-templates.handlebars @@ -261,11 +261,23 @@ {{/inline}} {{#*inline "conjugation"}} - {{~#if definition.reasons~}} - {{~#each definition.reasons~}} - {{~#if (op ">" @index 0)}} « {{/if~}} - {{.}} - {{~/each~}} + {{~#if (op ">" definition.inflectionRuleChainCandidates.length 0)~}} + {{~set "multiple" false~}} + {{~#if (op ">" definition.inflectionRuleChainCandidates.length 1)~}} + {{~set "multiple" true~}} + {{~/if~}} + {{~#if (get "multiple")~}}{{/if~}} {{~/if~}} {{/inline}} -- cgit v1.2.3