From 1da30c15027e45db34dd47a43632d44b0ec88019 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 23 Sep 2023 19:49:35 +0200 Subject: [PATCH] Replace the legacy category binding of label groups --- com.woltlab.wcf/templates/articleAdd.tpl | 13 ++-- .../Core/Component/Article/LabelPicker.ts | 38 ++++++++++ .../files/acp/templates/articleAdd.tpl | 67 ++++++----------- wcfsetup/install/files/js/WCF.Label.js | 71 ------------------- .../Core/Component/Article/LabelPicker.js | 37 ++++++++++ .../lib/acp/form/ArticleAddForm.class.php | 9 --- 6 files changed, 105 insertions(+), 130 deletions(-) create mode 100644 ts/WoltLabSuite/Core/Component/Article/LabelPicker.ts create mode 100644 wcfsetup/install/files/js/WoltLabSuite/Core/Component/Article/LabelPicker.js diff --git a/com.woltlab.wcf/templates/articleAdd.tpl b/com.woltlab.wcf/templates/articleAdd.tpl index 5450ad8a7c..25396a0789 100644 --- a/com.woltlab.wcf/templates/articleAdd.tpl +++ b/com.woltlab.wcf/templates/articleAdd.tpl @@ -87,7 +87,7 @@ {/if} @@ -591,14 +597,9 @@ @@ -163,45 +169,23 @@ {event name='categoryFields'} - {if $labelGroups|count} - {foreach from=$labelGroups item=labelGroup} - {if $labelGroup|count} - groupID]|isset} class="formError"{/if}> -
-
-
    - -
- - {if $errorField == 'label' && $errorType[$labelGroup->groupID]|isset} - - {if $errorType[$labelGroup->groupID] == 'missing'} - {lang}wcf.label.error.missing{/lang} - {else} - {lang}wcf.label.error.invalid{/lang} - {/if} - + {foreach from=$labelPickers item=labelPicker} +
+
+
+ {@$labelPicker->toHtml()} + {if $errorField == 'label' && $errorType[$labelPicker->labelGroup->groupID]|isset} + + {if $errorType[$labelPicker->labelGroup->groupID] == 'missing'} + {lang}wcf.label.error.missing{/lang} + {else} + {lang}wcf.label.error.invalid{/lang} {/if} -
-
- {/if} - {/foreach} - {/if} + + {/if} +
+ + {/foreach}
@@ -614,14 +598,9 @@