diff --git a/WatchIt.Website/WatchIt.Website/Components/PersonEditPage/PersonEditFormComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/PersonEditPage/PersonEditFormComponent.razor.cs index ad07799..f9ffcd5 100644 --- a/WatchIt.Website/WatchIt.Website/Components/PersonEditPage/PersonEditFormComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/PersonEditPage/PersonEditFormComponent.razor.cs @@ -80,7 +80,7 @@ public partial class PersonEditFormComponent : ComponentBase void PostSuccess(PersonResponse data) { - NavigationManager.NavigateTo($"person/{data.Id}/edit"); + NavigationManager.NavigateTo($"person/{data.Id}/edit", true); } void BadRequest(IDictionary errors) diff --git a/WatchIt.Website/WatchIt.Website/Components/PictureEditorComponent.razor b/WatchIt.Website/WatchIt.Website/Components/PictureEditorComponent.razor index eab6080..8a3a505 100644 --- a/WatchIt.Website/WatchIt.Website/Components/PictureEditorComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/PictureEditorComponent.razor @@ -6,41 +6,43 @@ @if (_pictureChanged || _pictureSaved is not null) { -
+
@if (_pictureChanged) { -
- -
-
- +
+
+
+ +
+
+ +
+
} else if (_pictureSaved is not null) { -
- -
+ }
} @@ -60,6 +62,6 @@ /* CLASSES */ .content-width { - width: @(ContentWidth); + width: @(ContentWidth)px; } \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor index 3930c19..27ab84f 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor @@ -51,6 +51,7 @@ PictureGetTask="@(async (id, action) => await PersonsWebAPIService.GetPersonPhoto(id, action))" PicturePutTask="@(async (id, data, action) => await PersonsWebAPIService.PutPersonPhoto(id, new PersonPhotoRequest(data), action))" PictureDeleteTask="@(async (id, action) => await PersonsWebAPIService.DeletePersonPhoto(id, action))" + PicturePlaceholder="/assets/person_picture.png" Class="h-100"/>
diff --git a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.cs index 52b0d46..3efed3b 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.cs @@ -10,6 +10,7 @@ public partial class PersonEditPage : ComponentBase { #region SERVICES + [Inject] private NavigationManager NavigationManager { get; set; } = default!; [Inject] private IAuthenticationService AuthenticationService { get; set; } = default!; [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; @@ -61,7 +62,7 @@ public partial class PersonEditPage : ComponentBase { endTasks.AddRange( [ - PersonsWebAPIService.GetPerson(Id.Value, data => _person = data) + PersonsWebAPIService.GetPerson(Id.Value, data => _person = data, () => NavigationManager.NavigateTo("/person/new", true)) ]); } diff --git a/WatchIt.Website/WatchIt.Website/appsettings.json b/WatchIt.Website/WatchIt.Website/appsettings.json index 9961a07..b58c6b7 100644 --- a/WatchIt.Website/WatchIt.Website/appsettings.json +++ b/WatchIt.Website/WatchIt.Website/appsettings.json @@ -86,9 +86,9 @@ "PutPerson": "/{0}", "DeletePerson": "/{0}", "GetPersonsViewRank": "/view", - "GetPersonPhoto": "/{0}/poster", - "PutPersonPhoto": "/{0}/poster", - "DeletePersonPhoto": "/{0}/poster" + "GetPersonPhoto": "/{0}/photo", + "PutPersonPhoto": "/{0}/photo", + "DeletePersonPhoto": "/{0}/photo" } } } diff --git a/WatchIt.Website/WatchIt.Website/wwwroot/assets/person_picture.png b/WatchIt.Website/WatchIt.Website/wwwroot/assets/person_picture.png new file mode 100644 index 0000000..d305bd2 Binary files /dev/null and b/WatchIt.Website/WatchIt.Website/wwwroot/assets/person_picture.png differ