Skip to content

Commit fb9bbe7

Browse files
committed
Overhaul the user profile header
1 parent 569b239 commit fb9bbe7

35 files changed

+1074
-244
lines changed

com.woltlab.wcf/templates/header.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
{/hascontent}
7575

7676
<section id="main" class="main" role="main"{if !$__mainItemScope|empty} {@$__mainItemScope}{/if}>
77+
{if !$beforeMaincontent|empty}
78+
{unsafe:$beforeMaincontent}
79+
{/if}
80+
7781
<div class="layoutBoundary">
7882
{hascontent}
7983
{if !$__sidebarLeftShow|isset}{assign var='__sidebarLeftShow' value='wcf.global.button.showSidebarLeft'|phrase}{/if}

com.woltlab.wcf/templates/user.tpl

Lines changed: 5 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{event name='javascriptInclude'}
55
<script data-relocate="true">
66
{if $__wcf->getUser()->userID && $__wcf->getUser()->userID != $user->userID}
7-
require(['Language', 'WoltLabSuite/Core/Ui/User/Editor', 'WoltLabSuite/Core/Ui/User/Profile/Menu/Item/Ignore', 'WoltLabSuite/Core/Ui/User/Profile/Menu/Item/Follow'], function(Language, UiUserEditor, UiUserProfileMenuItemIgnore, UiUserProfileMenuItemFollow) {
7+
require(['Language', 'WoltLabSuite/Core/Ui/User/Editor'], function(Language, UiUserEditor) {
88
Language.addObject({
99
'wcf.acp.user.disable': '{jslang}wcf.acp.user.disable{/jslang}',
1010
'wcf.acp.user.enable': '{jslang}wcf.acp.user.enable{/jslang}',
@@ -15,10 +15,6 @@
1515
'wcf.user.ban.expires.description': '{jslang}wcf.user.ban.expires.description{/jslang}',
1616
'wcf.user.ban.neverExpires': '{jslang}wcf.user.ban.neverExpires{/jslang}',
1717
'wcf.user.ban.reason.description': '{jslang}wcf.user.ban.reason.description{/jslang}',
18-
'wcf.user.button.follow': '{jslang}wcf.user.button.follow{/jslang}',
19-
'wcf.user.button.unfollow': '{jslang}wcf.user.button.unfollow{/jslang}',
20-
'wcf.user.button.ignore': '{jslang}wcf.user.button.ignore{/jslang}',
21-
'wcf.user.button.unignore': '{jslang}wcf.user.button.unignore{/jslang}',
2218
'wcf.user.disableAvatar': '{jslang}wcf.user.disableAvatar{/jslang}',
2319
'wcf.user.disableAvatar.confirmMessage': '{jslang}wcf.user.disableAvatar.confirmMessage{/jslang}',
2420
'wcf.user.disableAvatar.expires': '{jslang}wcf.user.disableAvatar.expires{/jslang}',
@@ -44,14 +40,6 @@
4440
{if $isAccessible}
4541
UiUserEditor.init();
4642
{/if}
47-
48-
{if !$user->getPermission('user.profile.cannotBeIgnored') || $__wcf->getUserProfileHandler()->isIgnoredUser($user->userID)}
49-
new UiUserProfileMenuItemIgnore({@$user->userID}, {if $__wcf->getUserProfileHandler()->isIgnoredUser($user->userID)}true{else}false{/if});
50-
{/if}
51-
52-
{if !$user->isIgnoredUser($__wcf->user->userID)}
53-
new UiUserProfileMenuItemFollow({@$user->userID}, {if $__wcf->getUserProfileHandler()->isFollowing($user->userID)}true{else}false{/if});
54-
{/if}
5543
});
5644
{/if}
5745
@@ -93,196 +81,14 @@
9381
</noscript>
9482
{/capture}
9583

96-
{capture assign='contentHeader'}
97-
<header class="contentHeader userProfileUser userProfileUserWithCoverPhoto" data-object-id="{@$user->userID}"{if $isAccessible}
98-
{if $__wcf->session->getPermission('admin.user.canBanUser')}
99-
data-banned="{@$user->banned}"
100-
{/if}
101-
{if $__wcf->session->getPermission('admin.user.canDisableAvatar')}
102-
data-disable-avatar="{@$user->disableAvatar}"
103-
{/if}
104-
{if $__wcf->session->getPermission('admin.user.canDisableSignature')}
105-
data-disable-signature="{@$user->disableSignature}"
106-
{/if}
107-
{if $__wcf->session->getPermission('admin.user.canDisableCoverPhoto')}
108-
data-disable-cover-photo="{@$user->disableCoverPhoto}"
109-
{/if}
110-
{if $__wcf->session->getPermission('admin.user.canEnableUser')}
111-
data-is-disabled="{if $user->activationCode}true{else}false{/if}"
112-
{/if}
113-
{/if}>
114-
<div class="userProfileCoverPhoto" style="background-image: url({$user->getCoverPhoto()->getURL()})">
115-
{if ($user->userID == $__wcf->user->userID || $user->canEdit()) && ($__wcf->getSession()->getPermission('user.profile.coverPhoto.canUploadCoverPhoto') || $user->coverPhotoHash)}
116-
<div class="userProfileManageCoverPhoto dropdown jsOnly">
117-
<a href="#" class="button small dropdownToggle">{icon name='pencil'} {lang}wcf.user.coverPhoto.edit{/lang}</a>
118-
<ul class="dropdownMenu">
119-
{if $__wcf->getSession()->getPermission('user.profile.coverPhoto.canUploadCoverPhoto')}
120-
<li><a href="#" class="jsButtonUploadCoverPhoto jsStaticDialog" data-dialog-id="userProfileCoverPhotoUpload">{lang}wcf.user.coverPhoto.upload{/lang}</a></li>
121-
{/if}
122-
<li{if !$user->coverPhotoHash} style="display:none;"{/if}><a href="#" class="jsButtonDeleteCoverPhoto">{lang}wcf.user.coverPhoto.delete{/lang}</a></li>
123-
</ul>
124-
</div>
125-
{/if}
126-
</div>
127-
<div class="contentHeaderIcon">
128-
{if $user->userID == $__wcf->user->userID}
129-
<a href="{link controller='AvatarEdit'}{/link}" class="jsTooltip" title="{lang}wcf.user.avatar.edit{/lang}">{@$user->getAvatar()->getImageTag(128)}</a>
130-
{else}
131-
<span>{@$user->getAvatar()->getImageTag(128)}</span>
132-
{/if}
133-
{if $user->isOnline()}<span class="badge green badgeOnline">{lang}wcf.user.online{/lang}</span>{/if}
134-
</div>
135-
136-
<div class="contentHeaderTitle">
137-
<h1 class="contentTitle">
138-
<span class="userProfileUsername">{$user->username}</span>
139-
{if $user->banned}
140-
<span class="jsTooltip jsUserBanned" title="{lang}wcf.user.banned{/lang}">
141-
{icon size=24 name='lock'}
142-
</span>
143-
{/if}
144-
{if MODULE_USER_RANK}
145-
{if $user->getUserTitle()}
146-
<span class="badge userTitleBadge{if $user->getRank() && $user->getRank()->cssClassName} {@$user->getRank()->cssClassName}{/if}">{$user->getUserTitle()}</span>
147-
{/if}
148-
{if $user->getRank() && $user->getRank()->rankImage}
149-
<span class="userRankImage">{@$user->getRank()->getImage()}</span>
150-
{/if}
151-
{/if}
152-
153-
{event name='afterContentTitle'}
154-
</h1>
155-
156-
<div class="contentHeaderDescription">
157-
{if MODULE_TROPHY && $__wcf->session->getPermission('user.profile.trophy.canSeeTrophies') && ($user->isAccessible('canViewTrophies') || $user->userID == $__wcf->session->userID) && $specialTrophyCount}
158-
<div class="specialTrophyUserContainer">
159-
<ul>
160-
{foreach from=$user->getSpecialTrophies() item=trophy}
161-
<li><a href="{@$trophy->getLink()}">{@$trophy->renderTrophy(32, true)}</a></li>
162-
{/foreach}
163-
{if $user->trophyPoints > $specialTrophyCount}
164-
<li><a href="#" class="jsTooltip userTrophyOverlayList" data-user-id="{$user->userID}" title="{lang}wcf.user.trophy.showTrophies{/lang}" role="button">{lang trophyCount=$user->trophyPoints-$specialTrophyCount}wcf.user.trophy.showMoreTrophies{/lang}</a></li>
165-
{/if}
166-
</ul>
167-
</div>
168-
{/if}
169-
<ul class="inlineList commaSeparated">
170-
{if !$user->isProtected()}
171-
{if $user->isVisibleOption('gender') && $user->gender}<li>{$user->getFormattedUserOption('gender')}</li>{/if}
172-
{if $user->isVisibleOption('birthday') && $user->getAge()}<li>{@$user->getAge()}</li>{/if}
173-
{if $user->isVisibleOption('location') && $user->location}<li>{lang}wcf.user.membersList.location{/lang}</li>{/if}
174-
{/if}
175-
{if $user->getOldUsername()}<li>{lang}wcf.user.profile.oldUsername{/lang}</li>{/if}
176-
<li>{lang}wcf.user.membersList.registrationDate{/lang}</li>
177-
{event name='userDataRow1'}
178-
</ul>
179-
180-
{hascontent}
181-
<ul class="inlineList commaSeparated">
182-
{content}
183-
{if $user->canViewOnlineStatus() && $user->getLastActivityTime()}
184-
<li>{lang}wcf.user.usersOnline.lastActivity{/lang}: {@$user->getLastActivityTime()|time}</li>
185-
{if $user->getCurrentLocation()}<li>{@$user->getCurrentLocation()}</li>{/if}
186-
{/if}
187-
{if $__wcf->session->getPermission('admin.user.canViewIpAddress') && $user->registrationIpAddress}
188-
<li>{lang}wcf.user.registrationIpAddress{/lang}: <span class="userRegistrationIpAddress">{@$user->getRegistrationIpAddress()|ipSearch}</span></li>
189-
{/if}
190-
{/content}
191-
</ul>
192-
{/hascontent}
193-
194-
<dl class="plain inlineDataList">
195-
{include file='userInformationStatistics'}
196-
197-
{if $user->profileHits}
198-
<dt{if $user->getProfileAge() > 1} title="{lang}wcf.user.profileHits.hitsPerDay{/lang}"{/if}>{lang}wcf.user.profileHits{/lang}</dt>
199-
<dd>{#$user->profileHits}</dd>
200-
{/if}
201-
</dl>
202-
</div>
203-
</div>
204-
205-
{hascontent}
206-
<nav class="contentHeaderNavigation">
207-
<ul class="userProfileButtonContainer">
208-
{content}
209-
{if $user->canEdit() || ($__wcf->getUser()->userID == $user->userID && $user->canEditOwnProfile())}
210-
<li><a href="#" class="jsButtonEditProfile button buttonPrimary">{icon name='pencil'} <span>{lang}wcf.user.editProfile{/lang}</span></a></li>
211-
{/if}
212-
213-
{event name='contentHeaderNavigation'}
214-
{/content}
215-
</ul>
216-
</nav>
217-
{/hascontent}
218-
</header>
84+
{capture assign='beforeMaincontent'}
85+
<div class="layoutBoundary">
86+
{unsafe:$userProfileHeaderView}
87+
</div>
21988
{/capture}
22089

22190
{include file='userSidebar' assign='sidebarRight'}
22291

223-
{capture assign='__menuSearch'}
224-
{event name='menuSearch'}
225-
{* DEPRECATED *}{event name='quickSearchItems'}
226-
{/capture}
227-
{assign var='__menuSearch' value=$__menuSearch|trim}
228-
229-
{capture assign='__menuManagement'}
230-
{event name='menuManagement'}
231-
{if $isAccessible && $__wcf->user->userID != $user->userID && ($__wcf->session->getPermission('admin.user.canBanUser') || $__wcf->session->getPermission('admin.user.canDisableAvatar') || $__wcf->session->getPermission('admin.user.canDisableSignature') || $__wcf->session->getPermission('admin.user.canEnableUser') || ($__wcf->session->getPermission('admin.general.canUseAcp') && $__wcf->session->getPermission('admin.user.canEditUser')){event name='moderationDropdownPermissions'})}
232-
{if $__wcf->session->getPermission('admin.user.canBanUser')}<li><a href="#" class="jsButtonUserBan">{lang}wcf.user.{if $user->banned}un{/if}ban{/lang}</a></li>{/if}
233-
{if $__wcf->session->getPermission('admin.user.canDisableAvatar')}<li><a href="#" class="jsButtonUserDisableAvatar">{lang}wcf.user.{if $user->disableAvatar}enable{else}disable{/if}Avatar{/lang}</a></li>{/if}
234-
{if $__wcf->session->getPermission('admin.user.canDisableSignature')}<li><a href="#" class="jsButtonUserDisableSignature">{lang}wcf.user.{if $user->disableSignature}enable{else}disable{/if}Signature{/lang}</a></li>{/if}
235-
{if $__wcf->session->getPermission('admin.user.canDisableCoverPhoto')}<li><a href="#" class="jsButtonUserDisableCoverPhoto">{lang}wcf.user.{if $user->disableCoverPhoto}enable{else}disable{/if}CoverPhoto{/lang}</a></li>{/if}
236-
{if $__wcf->session->getPermission('admin.user.canEnableUser')}<li><a href="#" class="jsButtonUserEnable">{lang}wcf.acp.user.{if $user->pendingActivation()}enable{else}disable{/if}{/lang}</a></li>{/if}
237-
238-
{if $__wcf->session->getPermission('admin.general.canUseAcp') && $__wcf->session->getPermission('admin.user.canEditUser')}<li><a href="{link controller='UserEdit' object=$user isACP=true}{/link}" class="jsUserInlineEditor">{lang}wcf.user.edit{/lang}</a></li>{/if}
239-
{/if}
240-
{/capture}
241-
{assign var='__menuManagement' value=$__menuManagement|trim}
242-
243-
{capture assign='contentInteractionButtons'}
244-
{if $__menuSearch}
245-
<div class="contentInteractionButton dropdown jsOnly">
246-
<button type="button" class="button small dropdownToggle">{icon name='magnifying-glass'} <span>{lang}wcf.user.searchUserContent{/lang}</span></button>
247-
<ul class="dropdownMenu userProfileButtonMenu" data-menu="search">
248-
{@$__menuSearch}
249-
</ul>
250-
</div>
251-
{/if}
252-
{if $__menuManagement}
253-
<div class="contentInteractionButton dropdown jsOnly">
254-
<button type="button" class="button small dropdownToggle">{icon name='gear'} <span>{lang}wcf.user.profile.management{/lang}</span></button>
255-
<ul class="dropdownMenu userProfileButtonMenu" data-menu="management">
256-
{@$__menuManagement}
257-
</ul>
258-
</div>
259-
{/if}
260-
{/capture}
261-
262-
{capture assign='contentInteractionDropdownItems'}
263-
{* DEPRECATED *}{event name='menuCustomization'}
264-
{event name='menuInteraction'}
265-
266-
{if $user->userID != $__wcf->user->userID}
267-
{if $user->isAccessible('canViewEmailAddress') || $__wcf->session->getPermission('admin.user.canEditMailAddress')}
268-
<li><a href="mailto:{@$user->getEncodedEmail()}">{lang}wcf.user.button.mail{/lang}</a></li>
269-
{/if}
270-
{/if}
271-
272-
{if $user->userID != $__wcf->user->userID && $__wcf->session->getPermission('user.profile.canReportContent')}
273-
<li>
274-
<a
275-
href="#"
276-
role="button"
277-
data-report-content="com.woltlab.wcf.user"
278-
data-object-id="{$user->userID}"
279-
>
280-
{lang}wcf.user.profile.report{/lang}
281-
</a>
282-
</li>
283-
{/if}
284-
{/capture}
285-
28692
{include file='header'}
28793

28894
{if !$user->isProtected()}

com.woltlab.wcf/templates/userProfileAbout.tpl

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,58 @@
1+
{capture assign='miscInformation'}
2+
<dl>
3+
<dt>{lang}wcf.user.registrationDate{/lang}</dt>
4+
<dd>{time time=$user->registrationDate type='plainDate'}</dd>
5+
</dl>
6+
{if $user->getOldUsername()}
7+
<dl>
8+
<dt>{lang}wcf.user.oldUsername{/lang}</dt>
9+
<dd>{$user->getOldUsername()}</dd>
10+
</dl>
11+
{/if}
12+
{if $user->canViewOnlineStatus() && $user->getLastActivityTime()}
13+
<dl>
14+
<dt>{lang}wcf.user.usersOnline.lastActivity{/lang}</dt>
15+
<dd>
16+
{time time=$user->getLastActivityTime()}
17+
{if $user->getCurrentLocation()}<br>{unsafe:$user->getCurrentLocation()}{/if}
18+
</dd>
19+
</dl>
20+
{/if}
21+
{if $__wcf->session->getPermission('admin.user.canViewIpAddress') && $user->registrationIpAddress}
22+
<dl>
23+
<dt>{lang}wcf.user.registrationIpAddress{/lang}</dt>
24+
<dd>{unsafe:$user->getRegistrationIpAddress()|ipSearch}</dd>
25+
</dl>
26+
{/if}
27+
{/capture}
28+
129
{hascontent}
230
{content}
331
{event name='beforeUserOptions'}
432

533
{foreach from=$options item=category}
634
{foreach from=$category[categories] item=optionCategory}
735
<section class="section">
8-
<h2 class="sectionTitle">{lang}wcf.user.option.category.{@$optionCategory[object]->categoryName}{/lang}</h2>
36+
<h2 class="sectionTitle">{lang}wcf.user.option.category.{$optionCategory[object]->categoryName}{/lang}</h2>
937

1038
{foreach from=$optionCategory[options] item=userOption}
1139
<dl>
1240
<dt>{$userOption[object]->getTitle()}</dt>
13-
<dd>{@$userOption[object]->optionValue}</dd>
41+
<dd>{unsafe:$userOption[object]->optionValue}</dd>
1442
</dl>
1543
{/foreach}
1644
</section>
1745
{/foreach}
1846
{/foreach}
1947

48+
{if $miscInformation|trim}
49+
<section class="section">
50+
<h2 class="sectionTitle">{lang}wcf.user.profile.miscInformation{/lang}</h2>
51+
52+
{unsafe:$miscInformation}
53+
</section>
54+
{/if}
55+
2056
{event name='afterUserOptions'}
2157
{/content}
2258
{hascontentelse}

0 commit comments

Comments
 (0)