This commit is contained in:
aymm 2021-05-09 16:32:49 +02:00
parent f906d1dc00
commit 2173f122f8
Signed by: phlaym
GPG Key ID: A06651BAB6777237
2 changed files with 12 additions and 1 deletions

View File

@ -20,7 +20,10 @@ function get_page_header(
$newpoll_class = ''; $newpoll_class = '';
if ($api->isAuthenticated(false, true)) { if ($api->isAuthenticated(false, true)) {
$u = $api->getAuthorizedUser(); $u = $api->getAuthorizedUser();
$greeting = 'Welcome, ' . ($u->name ?? '@'.$u->username); $user_avatar_url = $u->getAvatarUrl(30);
$user_avatar_url_srcset = get_source_set($u, 30);
$avatar = '<img src="' . $user_avatar_url . '" class="avatar" srcset="' . $user_avatar_url_srcset . '"/>';
$greeting = $avatar . 'Welcome, ' . ($u->name ?? '@'.$u->username);
$logout_link = '<a href="logout.php" class="logout">Logout</a>'; $logout_link = '<a href="logout.php" class="logout">Logout</a>';
} else { } else {
$newpoll_class = 'disabled'; $newpoll_class = 'disabled';

View File

@ -107,6 +107,12 @@ header .newpolllink svg {
stroke-width: 1em; stroke-width: 1em;
} }
header .avatar {
width: 30px;
height: 30px;
margin-right: 4px;
}
/* Polls */ /* Polls */
.poll { .poll {
display: inline-block; display: inline-block;
@ -154,9 +160,11 @@ datewrapper time {
} }
.poll .header .user .avatar { .poll .header .user .avatar {
width: 50px; width: 50px;
height: 50px;
} }
.option-responses .avatar { .option-responses .avatar {
width: 20px; width: 20px;
height: 20px;
} }
/* Success banner */ /* Success banner */