diff --git a/includes/Partials/Header.php b/includes/Partials/Header.php index 5d1415db9..dc80f83fc 100644 --- a/includes/Partials/Header.php +++ b/includes/Partials/Header.php @@ -82,7 +82,22 @@ public function getUserInfoData( $userPageData ): array { */ private function getUserPageHTML( $isRegistered, $userPageData ): ?string { if ( $isRegistered ) { - $html = $userPageData['html-items']; + $realname = $this->user->getRealName(); + if ( !empty( $realname ) ) { + $username = $this->user->getName(); + $innerHtml = <<$realname +
$username
+ HTML; + // Dirty but it works + $html = str_replace( + ">" . $username . "<", + ">" . $innerHtml . "<", + $userPageData['html-items'] + ); + } else { + $html = $userPageData['html-items']; + } } else { // There must be a cleaner way to do this $msg = $this->skin->msg( 'notloggedin' )->text(); diff --git a/resources/skins.citizen.styles/components/Usermenu.less b/resources/skins.citizen.styles/components/Usermenu.less index beb636103..31889fa96 100644 --- a/resources/skins.citizen.styles/components/Usermenu.less +++ b/resources/skins.citizen.styles/components/Usermenu.less @@ -98,6 +98,16 @@ } } + &page { + &-username { + margin-top: var( --space-xxs ); + margin-bottom: var( --space-sm ); + color: var( --color-base--subtle ); + font-size: 0.8125rem; + font-weight: var( --font-weight-normal ); + } + } + &contris { font-weight: var( --font-weight-medium ); }