From: Alexander Ebert Date: Thu, 2 Jan 2025 15:29:01 +0000 (+0100) Subject: Merge branch '6.1' into 6.2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d2898b8b29d470ce28f17f04d76ef5cb72b03432;p=GitHub%2FWoltLab%2FWCF.git Merge branch '6.1' into 6.2 --- d2898b8b29d470ce28f17f04d76ef5cb72b03432 diff --cc com.woltlab.wcf/templates/userCard.tpl index 37491ac027,94758ddbb8..4c95609f81 --- a/com.woltlab.wcf/templates/userCard.tpl +++ b/com.woltlab.wcf/templates/userCard.tpl @@@ -3,8 -3,8 +3,8 @@@
+ alt="">
{user object=$user type='avatar64' ariaHidden='true' tabindex='-1'} diff --cc ts/WoltLabSuite/Core/Component/File/Upload.ts index 18b67b91cc,476a94d6f9..a232d3dfa8 --- a/ts/WoltLabSuite/Core/Component/File/Upload.ts +++ b/ts/WoltLabSuite/Core/Component/File/Upload.ts @@@ -269,30 -268,13 +269,34 @@@ export function setup(): void return; } - void resizeImage(element, file) + if (element.dataset.cropperConfiguration) { + const cropperConfiguration = JSON.parse(element.dataset.cropperConfiguration) as CropperConfiguration; + + void cropImage(element, file, cropperConfiguration) + .then((resizedFile) => { + void upload(element, resizedFile); + }) + .catch((e) => { + element.dispatchEvent(new CustomEvent("cancel")); + + if (e === undefined) { + // User closed the dialog. + return; + } + + if (e instanceof Error) { + innerError(element, e.message); + } + }); + } else { - void resizeImage(element, file).then((resizedFile) => { - void upload(element, resizedFile); ++ void resizeImage(element, file) + .then((resizedFile) => { - void upload(element, resizedFile); - }) ++ void upload(element, resizedFile); ++ }) + .catch(() => { + innerError(element, getPhrase("wcf.upload.error.damagedImageFile", { filename: file.name })); }); + } }); element.addEventListener("ckeditorDrop", (event: CustomEvent) => { diff --cc wcfsetup/install/files/acp/style/layout.scss index 0ae8dd7508,e2cc264855..3e0faa8929 --- a/wcfsetup/install/files/acp/style/layout.scss +++ b/wcfsetup/install/files/acp/style/layout.scss @@@ -1041,6 -1041,29 +1041,33 @@@ html[data-color-scheme="dark"] text-align: center; } +#acpDashboardSortableContainer .sortableNode { + border-bottom: none; +} ++ + .acpDashboardBox__usersAwaitingApproval { + display: flex; + flex-direction: column; + row-gap: 10px; + } + + .acpDashboardBox__usersAwaitingApproval__user { + position: relative; + } + + .acpDashboardBox__usersAwaitingApproval__avatar { + align-content: center; + } + + .acpDashboardBox__usersAwaitingApproval__link::after { + content: ""; + inset: 0; + position: absolute; + } + + .acpDashboardBox__usersAwaitingApproval__meta { + color: var(--wcfContentDimmedText); + margin-top: -5px; + + @include wcfFontSmall; + } diff --cc wcfsetup/install/files/js/WoltLabSuite/Core/Component/File/Upload.js index 9b00148b84,fc70bf44f2..c0cbee68c0 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/File/Upload.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/File/Upload.js @@@ -183,28 -183,13 +183,32 @@@ define(["require", "exports", "tslib", else if (!validateFileSize(element, file)) { return; } - void resizeImage(element, file) - .then((resizedFile) => { - void upload(element, resizedFile); - }) - .catch(() => { - (0, Util_1.innerError)(element, (0, Language_1.getPhrase)("wcf.upload.error.damagedImageFile", { filename: file.name })); - }); + if (element.dataset.cropperConfiguration) { + const cropperConfiguration = JSON.parse(element.dataset.cropperConfiguration); + void (0, Cropper_1.cropImage)(element, file, cropperConfiguration) + .then((resizedFile) => { + void upload(element, resizedFile); + }) + .catch((e) => { + element.dispatchEvent(new CustomEvent("cancel")); + if (e === undefined) { + // User closed the dialog. + return; + } + if (e instanceof Error) { + (0, Util_1.innerError)(element, e.message); + } + }); + } + else { - void resizeImage(element, file).then((resizedFile) => { ++ void resizeImage(element, file) ++ .then((resizedFile) => { + void upload(element, resizedFile); ++ }) ++ .catch(() => { ++ (0, Util_1.innerError)(element, (0, Language_1.getPhrase)("wcf.upload.error.damagedImageFile", { filename: file.name })); + }); + } }); element.addEventListener("ckeditorDrop", (event) => { const { file } = event.detail; diff --cc wcfsetup/install/files/lib/system/event/listener/PreloadPhrasesCollectingListener.class.php index 01f659eea1,13c7e60ae6..3c6626ee1f --- a/wcfsetup/install/files/lib/system/event/listener/PreloadPhrasesCollectingListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/PreloadPhrasesCollectingListener.class.php @@@ -150,10 -150,9 +150,11 @@@ final class PreloadPhrasesCollectingLis $event->preload('wcf.style.changeStyle'); + $event->preload('wcf.upload.crop.image'); + $event->preload('wcf.upload.error.damagedImageFile'); $event->preload('wcf.upload.error.fileExtensionNotPermitted'); $event->preload('wcf.upload.error.fileSizeTooLarge'); + $event->preload('wcf.upload.error.image.tooSmall'); $event->preload('wcf.upload.error.maximumCountReached'); $event->preload('wcf.upload.error.delete.permissionDenied'); $event->preload('wcf.upload.error.delete.unknownError'); diff --cc wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index d766b7f620,3d8f9be35e..a9f63fd2cc --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@@ -10,7 -11,9 +10,8 @@@ use wcf\data\user\cover\photo\UserCover use wcf\data\user\User; use wcf\data\user\UserEditor; use wcf\data\user\UserList; + use wcf\data\user\UserProfile; use wcf\data\user\UserProfileAction; -use wcf\data\user\UserProfileList; use wcf\system\bbcode\BBCodeHandler; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\SystemException; @@@ -48,8 -49,9 +49,9 @@@ final class UserRebuildDataWorker exten parent::initObjectList(); $this->objectList->sqlSelects = 'user_option_value.userOption' . User::getUserOptionID('aboutMe') . ' AS aboutMe'; + $this->objectList->sqlSelects .= ',user_option_value.userOption' . User::getUserOptionID('canViewOnlineStatus') . ' AS canViewOnlineStatus'; $this->objectList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; }