From 5fad939eb2fb63fed1b7af4aece08c2c5316fb7a Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 26 Sep 2025 11:40:38 +0200 Subject: [PATCH] ui fixes --- .../Pages/Components/LoginStep1.razor | 2 +- .../ToursFromTransferDestinations.razor | 159 ++++++++++++------ .../Shared/Components/ToursComponent.razor | 6 +- TIAMSharedUI/wwwroot/css/TourIAm.css | 21 +++ .../171fcca4-ffd5-4380-9402-f27447af1e08.json | 6 +- 5 files changed, 134 insertions(+), 60 deletions(-) diff --git a/TIAMSharedUI/Pages/Components/LoginStep1.razor b/TIAMSharedUI/Pages/Components/LoginStep1.razor index bee9c5af..0ab7f522 100644 --- a/TIAMSharedUI/Pages/Components/LoginStep1.razor +++ b/TIAMSharedUI/Pages/Components/LoginStep1.razor @@ -10,7 +10,7 @@
- - + + + + + +
- + + + + +
@@ -74,23 +89,55 @@

Existing Tours

@if (Tours.Any()) { -
    +
    @foreach (var tour in Tours) { var dest = TransferDestinations.FirstOrDefault(d => d.Id == tour.TransferDestinationId); -
  • - - - @tour?.Title — @tour.FancyDescription - - - @tour.Bio - - - -
  • +
    +
    + @if (!string.IsNullOrEmpty(tour.CoverImageUrl)) + { + Tour cover image + } +
    +
    @tour?.Title
    + + @if (!string.IsNullOrEmpty(tour.Bio)) + { +
    + Short Description: +
    + @((MarkupString)tour.Bio) +
    +
    + } + + @if (!string.IsNullOrEmpty(tour.FancyDescription)) + { +
    + Description: +
    + @((MarkupString)tour.FancyDescription) +
    +
    + } + + @if (dest != null) + { +
    + Destination: @dest.Name (@dest.AddressString) +
    + } + +
    + + +
    +
    +
    +
    } -
+
} else { @@ -99,6 +146,35 @@ + + @code { private List TransferDestinations = []; private List Tours = []; @@ -110,6 +186,13 @@ private bool IsEditing = false; private Guid? EditingTourId = null; + void OnCustomizeToolbar(IToolbar toolbar) + { + // Returns the first group + IBarGroup firstGroup = toolbar.Groups[0]; + // Returns the "Table" group + IBarGroup tableGroup = toolbar.Groups[HtmlEditorToolbarGroupNames.Table]; + } protected override async Task OnInitializedAsync() { @@ -123,8 +206,8 @@ { TransferDestinationId = tour.TransferDestinationId, Name = tour.Title, - Bio = tour.Bio, - Description = tour.FancyDescription, + Bio = tour.Bio ?? string.Empty, + Description = tour.FancyDescription ?? string.Empty, ImageBytes = null, ImageFileName = tour.CoverImageUrl }; @@ -142,35 +225,7 @@ EditingTourId = null; UploadStatus = string.Empty; } - - // private async Task SaveTourAsync() - // { - // if (uploadedFile is not null) - // { - // using var stream = uploadedFile.OpenReadStream(maxAllowedSize: 5 * 1024 * 1024); - // using var ms = new MemoryStream(); - // await stream.CopyToAsync(ms); - // newTour.ImageBytes = ms.ToArray(); - // newTour.ImageFileName = uploadedFile.Name; - // } - - // TourInfo tourToCreate = new TourInfo(); - // tourToCreate.TransferDestinationId = newTour.TransferDestinationId; - // tourToCreate.FancyDescription = newTour.Description; - // tourToCreate.Title = newTour.Name; - // tourToCreate.CoverImageUrl = ""; - // if (tourToCreate.TransferDestinationId == Guid.Empty) - // { - // throw new InvalidOperationException("Transfer Destination must be selected."); - // } - - // await TourService.CreateAsync(tourToCreate, uploadedFile); - // newTour = new(); - // uploadedFile = null; - // UploadStatus = string.Empty; - // Tours = (await TourService.GetAllAsync()).ToList(); - // } - + private async Task HandleSubmit() { if (uploadedFile is not null) @@ -181,7 +236,6 @@ newTour.ImageBytes = ms.ToArray(); newTour.ImageFileName = uploadedFile.Name; } - if (IsEditing && EditingTourId.HasValue) { @@ -203,6 +257,7 @@ { TransferDestinationId = newTour.TransferDestinationId, Title = newTour.Name, + Bio = newTour.Bio, FancyDescription = newTour.Description, CoverImageUrl = newTour.ImageFileName }; @@ -241,12 +296,10 @@ [StringLength(100, ErrorMessage = "Tour name cannot exceed 100 characters.")] public string Name { get; set; } = string.Empty; - public string? Bio { get; set; } - public string? Description { get; set; } + public string Bio { get; set; } = string.Empty; + public string Description { get; set; } = string.Empty; public byte[]? ImageBytes { get; set; } public string? ImageFileName { get; set; } } - -} - +} \ No newline at end of file diff --git a/TIAMSharedUI/Shared/Components/ToursComponent.razor b/TIAMSharedUI/Shared/Components/ToursComponent.razor index 88543fc5..8186e423 100644 --- a/TIAMSharedUI/Shared/Components/ToursComponent.razor +++ b/TIAMSharedUI/Shared/Components/ToursComponent.razor @@ -18,14 +18,14 @@ {
-
-

@item.Bio

+
+ @((MarkupString)item.Bio)
@*

@item.Created

*@
-

@item.FancyDescription

+ @((MarkupString)item.FancyDescription)
@*

@item.TransferDestinationId

*@
diff --git a/TIAMSharedUI/wwwroot/css/TourIAm.css b/TIAMSharedUI/wwwroot/css/TourIAm.css index c789a166..d7d0a6e3 100644 --- a/TIAMSharedUI/wwwroot/css/TourIAm.css +++ b/TIAMSharedUI/wwwroot/css/TourIAm.css @@ -171,6 +171,27 @@ select { background: no-repeat 50% / cover; } +/* ===== Scrollbar CSS ===== */ +/* Firefox */ +* { + scrollbar-width: auto; + scrollbar-color: #643172 rgba( 31, 38, 135, 0 ); +} + + /* Chrome, Edge, and Safari */ + *::-webkit-scrollbar { + width: 16px; + } + + *::-webkit-scrollbar-track { + background: rgba( 31, 38, 135, 0 ); + } + + *::-webkit-scrollbar-thumb { + background-color: #643172; + border-radius: 10px; + border: 0px solid #ffffff; + } .inputwizardwrapper { /*max-width: 450px;*/ diff --git a/TIAMWebApp/Server/wwwroot/data/tours/171fcca4-ffd5-4380-9402-f27447af1e08.json b/TIAMWebApp/Server/wwwroot/data/tours/171fcca4-ffd5-4380-9402-f27447af1e08.json index fc90c996..fada7f42 100644 --- a/TIAMWebApp/Server/wwwroot/data/tours/171fcca4-ffd5-4380-9402-f27447af1e08.json +++ b/TIAMWebApp/Server/wwwroot/data/tours/171fcca4-ffd5-4380-9402-f27447af1e08.json @@ -2,9 +2,9 @@ "Id": "00000000-0000-0000-0000-000000000000", "TransferDestinationId": "171fcca4-ffd5-4380-9402-f27447af1e08", "Title": "Downtown", - "Bio": "hjkh kh kjs dhasjkldhajk dhkasjdh sajkldh asjkldh asjkldhasjldh asjkldh askldh asjkdh aklsdhajkdhkalh djksahdjkashd jkalhal", - "FancyDescription": "fdshjklhsjfkslh dfjkhsjklfhd jkkslhfdsjkfh dskfh dsklhf dsjkl fdhjkl fdshjk fkjld hlkdskl dsjk fdjlfh dskh fdsjkfdshl khf dk hldsk hldskh dsjk hdslkf dhjkh dsfk fdslsk dksajdklaj dkla\u00E9jdksal\u00E9dj kasl\u00E9dj kasl\u00E9jdka l\u00E9djkasl\u00E9j dkla\u00E9sjdkl\u00E9 ajdklas\u00E9 jdkl\u00E9asj dklsaj dklsj dka dksa jdklas daklsj dklaj dklsaj dklasj dklaj dkl\u00E9a ldjfskl\u00E9fjk lds\u00E9jfksld\u00E9 fjklsd\u00E9jkfdl slkfj ldkfj kdfj kdfjksljfdklsjfdsl kfjdskljfkdslfjkdsl jkl", + "Bio": "\u003Cp\u003E\u003Cstrong\u003Ehjkh kh kjs dhasjkldhajk dhkasjdh sajkldh asjkldh\u003C/strong\u003E \u003C/p\u003E\u003Cp\u003E\u003Cbr\u003E\u003C/p\u003E\u003Cp\u003Easjkldhasjldh asjkldh askldh asjkdh aklsdhajkdhkalh djksahdjkashd jkalhal\u003C/p\u003E", + "FancyDescription": "\u003Cp\u003E\u003Cstrong\u003Efdshjklhsjfkslh dfjkhsjklfhd jkkslhfdsjkfh dskfh \u003C/strong\u003E\u003Cem\u003Edsklhf dsjkl fdhjkl fdshjk fkjld hl\u003C/em\u003Ek\u003C/p\u003E\u003Cp\u003E\u003Cbr\u003E\u003C/p\u003E\u003Cp\u003Edskl dsjk fdjlfh dskh fdsjkfdshl khf dk hldsk hldskh dsjk hdslkf dhjkh dsfk fdslsk dksajdklaj dkla\u00E9jdksal\u00E9dj kasl\u00E9dj kasl\u00E9jdka l\u00E9djkasl\u00E9j dkla\u00E9sjdkl\u00E9 ajdklas\u00E9 jdkl\u00E9asj dklsaj dklsj dka dksa jdklas daklsj dklaj dklsaj dklasj dklaj dkl\u00E9a ldjfskl\u00E9fjk lds\u00E9jfksld\u00E9 fjklsd\u00E9jkfdl slkfj ldkfj kdfj kdfjksljfdklsjfdsl kfjdskljfkdslfjkdsl jkl\u003C/p\u003E", "CoverImageUrl": "/uploads/tourcovers/171fcca4-ffd5-4380-9402-f27447af1e08.png", "Created": "0001-01-01T00:00:00", - "Modified": "2025-09-24T16:28:17.0140043Z" + "Modified": "2025-09-26T00:16:17.8690382Z" } \ No newline at end of file