Use userId for /u/ route links

This commit is contained in:
Stedoss 2024-07-05 00:47:26 +01:00
parent 9719853302
commit cfcab7d7cf
5 changed files with 7 additions and 7 deletions

View File

@ -157,7 +157,7 @@
<ng-container *ngIf="column.type == 'string'">
<ng-container *ngIf="column.name == 'user_username'; else stringField">
<a [href]="'/u/' + getValue(entry, column.name)" target="_blank">{{ getValue(entry, column.name) }}</a>
<a [href]="'/u/' + getValue(entry, 'user_id')" target="_blank">{{ getValue(entry, column.name) }}</a>
</ng-container>
<ng-template #stringField>
{{ getValue(entry, column.name) }}

View File

@ -346,7 +346,7 @@ export class SearchComponent implements OnInit {
getLink(entry: any): any {
if(this.searchType === 'user') {
return "/u/" + this.getValue(entry, 'username');
return "/u/" + this.getValue(entry, 'user_id');
} else {
return "/s/" + this.getValue(entry, 'replay_id');
}

View File

@ -62,11 +62,11 @@
<tr>
<td>Player</td>
<td>
<a [routerLink]="['/u/' + this.pair.replays[0].username]">{{ this.pair.replays[0].username }}</a>
<a [routerLink]="['/u/' + this.pair.replays[0].user_id]">{{ this.pair.replays[0].username }}</a>
<a class="btn" style="margin-left: 5px" href="https://osu.ppy.sh/users/{{ this.pair.replays[0].user_id }}" target="_blank">osu!web</a>
</td>
<td>
<a [routerLink]="['/u/' + this.pair.replays[1].username]">{{ this.pair.replays[1].username }}</a>
<a [routerLink]="['/u/' + this.pair.replays[1].user_id]">{{ this.pair.replays[1].username }}</a>
<a class="btn" style="margin-left: 5px" href="https://osu.ppy.sh/users/{{ this.pair.replays[1].user_id }}" target="_blank">osu!web</a>
</td>
</tr>

View File

@ -33,7 +33,7 @@
</div>
</div>
<div class="score-player__row score-player__row--player mt-2">
Played by <a [routerLink]="['/u/' + this.replayData.username]">{{ this.replayData.username }}</a> <a *ngIf="this.replayData.user_id" class="btn" style="margin-left: 5px" href="https://osu.ppy.sh/users/{{ this.replayData.user_id }}" target="_blank">osu!web</a>
Played by <a [routerLink]="['/u/' + this.replayData.user_id ?? this.replayData.username]">{{ this.replayData.username }}</a> <a *ngIf="this.replayData.user_id" class="btn" style="margin-left: 5px" href="https://osu.ppy.sh/users/{{ this.replayData.user_id }}" target="_blank">osu!web</a>
<ng-container *ngIf="!this.isUserScore">
<br>
Submitted on <strong>{{ this.replayData.date }}</strong>
@ -196,7 +196,7 @@
<tbody>
<tr *ngFor="let score of this.replayData.similar_scores">
<td class="text-center">
<a [routerLink]="['/u/' + score.username]">{{ score.username }}</a>
<a [routerLink]="['/u/' + score.user_id]">{{ score.username }}</a>
</td>
<td class="text-center">
{{ score.pp | number: '1.2-2' }}

View File

@ -98,7 +98,7 @@
<tbody style="font-size: 14px;">
<tr *ngFor="let score of this.getCurrentPage()">
<td>
<a [routerLink]="['/u/' + score.username]">
<a [routerLink]="['/u/' + score.user_id]">
{{ score.username }}
</a>
</td>