Skip to content

Commit 57ae33e

Browse files
committed
Unify events / CSS in user cards and user profile header
The status icons were also moved from the headline tags, as this was not accessible. ref #6518
1 parent 2deb923 commit 57ae33e

File tree

4 files changed

+48
-19
lines changed

4 files changed

+48
-19
lines changed

com.woltlab.wcf/templates/userCard.tpl

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,22 @@
4040
</div>
4141

4242
<div class="userCard__content">
43-
<h3 class="userCard__username">
44-
<a href="{$user->getLink()}" class="userCard__link">{unsafe:$user->getFormattedUsername()}</a>
43+
<div class="userCard__headline">
44+
<h3 class="userCard__username">
45+
<a href="{$user->getLink()}" class="userCard__link">{unsafe:$user->getFormattedUsername()}</a>
46+
</h3>
4547

46-
{if $user->banned}
47-
<span class="jsTooltip jsUserBanned" title="{lang}wcf.user.banned{/lang}">
48-
{icon name='lock'}
49-
</span>
50-
{/if}
51-
52-
{event name='icons'}
53-
</h3>
48+
<div class="userCard__statusIcons">
49+
{if $user->banned}
50+
<span class="jsTooltip jsUserBanned" role="status" title="{lang}wcf.user.banned{/lang}">
51+
{icon name='lock'}
52+
</span>
53+
{/if}
5454

55+
{event name='icons'}
56+
</div>
57+
</div>
58+
5559
{event name='afterUsername'}
5660

5761
{if MODULE_USER_RANK}

com.woltlab.wcf/templates/userProfileHeader.tpl

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,24 @@
6565
</div>
6666
</div>
6767
<div class="userProfileHeader__title">
68-
<h1 class="userProfileHeader__username">
69-
<span class="userProfileUsername">{$view->user->username}</span>
70-
{if $view->user->banned}
71-
<span class="jsTooltip jsUserBanned" title="{lang}wcf.user.banned{/lang}">
72-
{icon name='lock'}
73-
</span>
74-
{/if}
75-
</h1>
68+
<div class="userProfileHeader__headline">
69+
<h1 class="userProfileHeader__username">
70+
<span class="userProfileUsername">{$view->user->username}</span>
71+
</h1>
72+
73+
<div class="userProfileHeader__statusIcons">
74+
{if $view->user->banned}
75+
<span class="jsTooltip jsUserBanned" role="status" title="{lang}wcf.user.banned{/lang}">
76+
{icon name='lock'}
77+
</span>
78+
{/if}
79+
80+
{event name='icons'}
81+
</div>
82+
</div>
83+
84+
{event name='afterUsername'}
85+
7686
<div class="userProfileHeader__rank">
7787
{if MODULE_USER_RANK}
7888
{if $view->user->getUserTitle()}
@@ -83,7 +93,7 @@
8393
{/if}
8494
{/if}
8595
</div>
86-
{event name='afterTitle'}
96+
{event name='afterUserTitle'}
8797
</div>
8898
<div class="userProfileHeader__stats">
8999
{foreach from=$view->getStatItems() item='statItem'}

wcfsetup/install/files/style/ui/userCard.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@
126126
}
127127

128128
.userCard__username {
129+
display: inline;
130+
129131
@include wcfFontHeadline;
130132
@include wcfFontBold;
131133
}
@@ -145,6 +147,12 @@
145147
}
146148
}
147149

150+
.userCard__statusIcons {
151+
display: inline;
152+
position: relative;
153+
z-index: 1;
154+
}
155+
148156
.userCard__footer__stats {
149157
display: grid;
150158
grid-template-columns: repeat(3, 1fr);

wcfsetup/install/files/style/ui/userProfileHeader.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ body[data-page-identifier="com.woltlab.wcf.User"] .userProfileContent:first-chil
100100
}
101101

102102
.userProfileHeader__username {
103+
display: inline;
103104
font-size: var(--wcfFontSizeTitle);
104105
font-weight: 600;
105106
line-height: 1.05;
@@ -109,6 +110,12 @@ body[data-page-identifier="com.woltlab.wcf.User"] .userProfileContent:first-chil
109110
}
110111
}
111112

113+
.userProfileHeader__statusIcons {
114+
display: inline;
115+
position: relative;
116+
z-index: 1;
117+
}
118+
112119
.userProfileHeader__stats {
113120
display: flex;
114121
flex-wrap: wrap;

0 commit comments

Comments
 (0)