Skip to content

Commit

Permalink
Show level photo was taken in
Browse files Browse the repository at this point in the history
  • Loading branch information
jvyden committed Oct 30, 2023
1 parent ff42449 commit affa4a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/app/api/types/photo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { User } from "./user";
import {PhotoSubject} from "./photo-subject";
import {Level} from "./level";

export interface Photo {
photoId: number;
Expand All @@ -12,5 +13,10 @@ export interface Photo {
smallHash: string;
largeHash: string;

level: Level | undefined;
levelName: string;
levelType: string;
levelId: number;

subjects: PhotoSubject[];
}
8 changes: 7 additions & 1 deletion src/app/components/photo/photo.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
<img [src]="GetPhotoLink(_photo)" class="rounded-md w-full drop-shadow-lg" alt="Photo">
</div>

<div class="pt-2.5"><span>Taken by <user-link [user]="_photo.publisher"></user-link></span></div>
<div class="pt-2.5">
<span>
Taken by <user-link [user]="_photo.publisher" class="font-bold"></user-link>
<ng-container *ngIf="_photo.level">
in <level-link [level]="_photo.level" class="font-bold"></level-link>
</ng-container>
</span></div>
<div class="text-sm text-gentle">
<span *ngIf="_photo.subjects.length > 0">with </span>
<span *ngFor="let subject of _photo.subjects; let last = last">
Expand Down
1 change: 1 addition & 0 deletions src/app/components/photo/photo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export class PhotoComponent {
}

protected readonly GetPhotoLink = GetPhotoLink;
protected readonly undefined = undefined;
}

0 comments on commit affa4a9

Please sign in to comment.