Skip to content

Commit e378fed

Browse files
committed
Use the user profile header template
1 parent f90b328 commit e378fed

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

com.woltlab.wcf/templates/userProfileHeader.tpl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
</div>
4040
{/if}
4141

42+
{if $view->user->canEditAvatar()}
43+
<button type="button" data-edit-avatar="{link controller="UserAvatar" id=$view->user->userID}{/link}" class="button small">
44+
{icon name='circle-user' type='solid'} {lang}wcf.user.avatar.edit{/lang}
45+
</button>
46+
{/if}
47+
4248
{if $view->canEditUser()}
4349
<button type="button" class="jsButtonEditProfile button small">{icon name='pencil'} <span>{lang}wcf.user.editProfile{/lang}</span></button>
4450
{/if}
@@ -51,7 +57,7 @@
5157
<div class="userProfileHeader__avatar">
5258
<div class="userProfileHeader__avatarBorder">
5359
{if $view->user->userID == $__wcf->user->userID}
54-
<a href="{link controller='AvatarEdit'}{/link}" class="userProfileHeader__avatarEditLink jsTooltip" title="{lang}wcf.user.avatar.edit{/lang}">{unsafe:$view->user->getAvatar()->getImageTag(128)}</a>
60+
<button type="button" data-edit-avatar="{link controller="UserAvatar" id=$view->user->userID}{/link}" class="userProfileHeader__avatarEditLink jsTooltip" title="{lang}wcf.user.avatar.edit{/lang}">{unsafe:$view->user->getAvatar()->getImageTag(128)}</button>
5561
{else}
5662
{unsafe:$view->user->getAvatar()->getImageTag(128)}
5763
{/if}

ts/WoltLabSuite/Core/Component/User/Avatar.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@ import { promiseMutex } from "WoltLabSuite/Core/Helper/PromiseMutex";
1212
import { wheneverFirstSeen } from "WoltLabSuite/Core/Helper/Selector";
1313
import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog";
1414
import { show as showNotification } from "WoltLabSuite/Core/Ui/Notification";
15-
import UiCloseOverlay from "WoltLabSuite/Core/Ui/CloseOverlay";
1615

1716
interface Result {
1817
avatar: string;
1918
}
2019

2120
async function editAvatar(button: HTMLElement): Promise<void> {
22-
// If the user is editing their own avatar, the control panel is open and can overlay the dialog.
23-
UiCloseOverlay.execute();
24-
2521
const { ok, result } = await dialogFactory().usingFormBuilder().fromEndpoint<Result>(button.dataset.editAvatar!);
2622

2723
if (ok) {

wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wcfsetup/install/files/js/WoltLabSuite/Core/Component/User/Avatar.js

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)