From 64edb88f46da5787f6a6344a25f8aa8843e6ccf2 Mon Sep 17 00:00:00 2001 From: Djoufson CHE BENE Date: Sun, 29 Dec 2024 22:20:51 +0100 Subject: [PATCH] fix: some typos --- app.client/Components/NewActivityPopup.razor | 64 +++++++------ app.client/Pages/Admin/Events/NewOrEdit.razor | 96 ++++++++++++------- .../Pages/Admin/Events/NewOrEdit.razor.cs | 2 +- app/wwwroot/js/app.js | 4 +- 4 files changed, 99 insertions(+), 67 deletions(-) diff --git a/app.client/Components/NewActivityPopup.razor b/app.client/Components/NewActivityPopup.razor index b2d4886..99e5571 100644 --- a/app.client/Components/NewActivityPopup.razor +++ b/app.client/Components/NewActivityPopup.razor @@ -3,7 +3,8 @@
- +

Details

@@ -11,24 +12,30 @@ - +
-

Schedule

@@ -40,7 +47,8 @@ Host Picture
- @ActivityModel.HostName + @ActivityModel.HostName
@@ -48,13 +56,16 @@ - +
- +
@@ -66,7 +77,7 @@ -@code{ +@code { private const string ActiveClass = "active"; private string _class = string.Empty; [Parameter] @@ -85,17 +96,17 @@ private async Task Add() { Parent.AddActivity(new ActivityModel - { - Title = ActivityModel.Title, - Description = ActivityModel.Description, - Host = new HostModel { - Name = ActivityModel.HostName, - Email = ActivityModel.HostEmail, - ImageUrl = ActivityModel.HostImageUrl - }, - Schedule = ActivitySchedule.Create(ActivityModel.Start, ActivityModel.End) - }); + Title = ActivityModel.Title, + Description = ActivityModel.Description, + Host = new HostModel + { + Name = ActivityModel.HostName, + Email = ActivityModel.HostEmail, + ImageUrl = ActivityModel.HostImageUrl + }, + Schedule = ActivitySchedule.Create(ActivityModel.Start, ActivityModel.End) + }); ActivityModel.HostImageUrl = string.Empty; await JsInterop.InvokeVoidAsync("toggleActivityPopup"); } @@ -103,11 +114,6 @@ private async Task HandleFileSelected(InputFileChangeEventArgs e) { var file = e.File; - if (file is null) - { - return; - } - using var memoryStream = new MemoryStream(); await file.OpenReadStream().CopyToAsync(memoryStream); byte[] fileBytes = memoryStream.ToArray(); @@ -117,7 +123,7 @@ } private async Task CloseActivityPopup() - { + { ActivityModel.HostImageUrl = string.Empty; await JsInterop.InvokeVoidAsync("toggleActivityPopup"); } @@ -125,11 +131,11 @@ class Model { public string Title { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; + public string Description { get; set; } = string.Empty; public string HostName { get; set; } = string.Empty; public string HostEmail { get; set; } = string.Empty; public string HostImageUrl { get; set; } = string.Empty; - public TimeOnly Start { get; set; } = new(); - public TimeOnly End { get; set; } = new(); + public TimeOnly Start { get; set; } + public TimeOnly End { get; set; } } } diff --git a/app.client/Pages/Admin/Events/NewOrEdit.razor b/app.client/Pages/Admin/Events/NewOrEdit.razor index b5b0cc4..fa5196d 100644 --- a/app.client/Pages/Admin/Events/NewOrEdit.razor +++ b/app.client/Pages/Admin/Events/NewOrEdit.razor @@ -5,29 +5,34 @@ @attribute [Authorize] Admin | Edit Event - +

Create or Update Events

- Discard + + Discard - @if(Id != null) + @if (Id != null) { @switch (EventModel.Status) { case EventStatus.ComingSoon: - { - - }break; - case EventStatus.Draft: - { - - }break; - case EventStatus.Cancelled: - { - - }break; + { + + } + break; + case EventStatus.Draft: + { + + } + break; + case EventStatus.Cancelled: + { + + } + break; } }
@@ -43,13 +48,18 @@ - +
- +

Schedule

@@ -59,21 +69,25 @@ Start Date: - + - @if(!EventModel.Schedule.IsAllDay) + @if (!EventModel.Schedule.IsAllDay) { }
@@ -83,14 +97,17 @@ - +
- @foreach(var type in Enum.GetNames(typeof(EventType))) + @foreach (var type in Enum.GetNames(typeof(EventType))) { } @@ -100,8 +117,9 @@ - - @foreach(var type in Enum.GetNames(typeof(EventHostingModel))) + + @foreach (var type in Enum.GetNames(typeof(EventHostingModel))) { } @@ -112,24 +130,27 @@

Partners

-

Use the dropdow to pick a partner. It will automatically register the one picked to the partners list, and later on you can remove it

+

Use the dropdow to pick a partner. It will automatically register the one picked to the partners + list, and later on you can remove it

- @foreach(var partner in EventModel.Partners) + @foreach (var partner in EventModel.Partners) {
@partner.Name

@partner.Name

- +
} @@ -138,20 +159,25 @@

Activities

-

Use the dropdow to pick a partner. It will automatically register the one picked to the partners list, and later on you can remove it

+

Use the dropdow to pick a partner. It will automatically register the one picked to the partners + list, and later on you can remove it

- New activity + New activity
- @foreach(var activity in EventModel.Activities) + @foreach (var activity in EventModel.Activities) {
- @activity.Title + @activity.Title

@activity.Title

@* *@ - +
@@ -169,11 +195,11 @@

Banner picture

The picture will automatically be updated once you pick a new one

- @EventModel.Title + @EventModel.Title
-
+

Resources

Upload here a recap of the event, as pictures

diff --git a/app.client/Pages/Admin/Events/NewOrEdit.razor.cs b/app.client/Pages/Admin/Events/NewOrEdit.razor.cs index cf23687..94bb7d1 100644 --- a/app.client/Pages/Admin/Events/NewOrEdit.razor.cs +++ b/app.client/Pages/Admin/Events/NewOrEdit.razor.cs @@ -38,7 +38,7 @@ protected override async Task OnInitializedAsync() { await LoadPartners(); await LoadEvent(); - // await JSRuntime.InvokeVoidAsync("adjustTextareaHight", "description-input"); + // await JSRuntime.InvokeVoidAsync("adjustTextareaHeight", "description-input"); await base.OnInitializedAsync(); } diff --git a/app/wwwroot/js/app.js b/app/wwwroot/js/app.js index ee3cfe8..c47b804 100644 --- a/app/wwwroot/js/app.js +++ b/app/wwwroot/js/app.js @@ -57,7 +57,7 @@ function toggleActivityPopup() { body.scrollTo(0, 0); } -function adjustTextareaHight(id) { +function adjustTextareaHeight(id) { const textarea = document.getElementById(id); textarea.style.height = "auto"; textarea.style.height = textarea.scrollHeight + "px"; @@ -79,5 +79,5 @@ function saveDraft() { } function backToTop() { - window.scrollTo({ top: 0, behavior: 'smooth' }); + window.scrollTo({ top: 0, behavior: "smooth" }); }