Add button to edit publications on publication view page.

This commit is contained in:
Florian THIERRY
2024-08-25 12:02:52 +02:00
parent f00fb103ba
commit 4d20d5f8b8
5 changed files with 51 additions and 28 deletions

View File

@@ -1,14 +1,17 @@
<ng-container *ngIf="isLoading; else afterLoadingPart">
@if (isLoading) {
<mat-spinner></mat-spinner>
</ng-container>
<ng-template #afterLoadingPart>
<ng-container *ngIf="publication; else loadingFailedMessage">
} @else {
@if (publication) {
<div class="card">
<img src="/pictures/{{ publication.illustrationId }}" />
<header>
<h1>{{ publication.title }}</h1>
<h2>{{ publication.description }}</h2>
@if (isAuthorAndUserEquals) {
<a [routerLink]="['edit']" class="button action" matTooltip="Click to edit the publication">
<mat-icon>edit</mat-icon>
</a>
}
</header>
<main [innerHTML]="publication.parsedText"></main>
<footer>
@@ -19,11 +22,9 @@
</span>
</footer>
</div>
</ng-container>
<ng-template #loadingFailedMessage>
} @else {
<div class="loading-failed">
<h1>Publication failed to load...</h1>
</div>
</ng-template>
</ng-template>
}
}