Fixed display of possibly long usernames when logged in

This commit is contained in:
nise.moe 2024-02-17 21:02:16 +01:00
parent 5c15066ebf
commit b8829bf892
2 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,9 @@
.user-details {
max-width: 100px;
margin-right: 5px;
white-space: nowrap;
text-overflow: clip ellipsis;
display: inline-block;
overflow: hidden;
vertical-align: bottom;
}

View File

@ -14,9 +14,9 @@
<form (ngSubmit)="onSubmit()">
<input type="text" [(ngModel)]="term" [ngModelOptions]="{standalone: true}" id="nise-osu-username" required minlength="2" maxlength="50" placeholder="Search for users...">
</form>
<div style="margin-top: 8px">
<div style="margin-top: 12px">
<ng-container *ngIf="this.userService.isUserLoggedIn()">
hi, {{this.userService.currentUser?.username}} <a [href]="this.userService.getLogoutUrl()">Logout</a>
hi, <span class="user-details" [title]="this.userService.currentUser?.username">{{this.userService.currentUser?.username}}</span> <a [href]="this.userService.getLogoutUrl()">Logout</a>
</ng-container>
<ng-container *ngIf="!this.userService.isUserLoggedIn()">
<a [href]="this.userService.getLoginUrl()">Login</a>
@ -26,5 +26,5 @@
</div>
<router-outlet></router-outlet>
<div class="text-center version">
v20240214
v20240217
</div>