From ee2842ab7978068d8082f5fd7c6b8d3a16c5477a Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 30 Aug 2025 11:58:15 +0200 Subject: [PATCH] Adam's last changes --- TIAM.Services.Server.Tests/appsettings.json | 2 +- TIAMResources/TIAMResources.Designer.cs | 54 +++ TIAMResources/TIAMResources.hu.resx | 15 + TIAMResources/TIAMResources.resx | 18 + TIAMSharedUI/Pages/AboutPage.razor | 4 - TIAMSharedUI/Pages/Blog/BlogListing.razor | 111 +++++ TIAMSharedUI/Pages/Blog/BlogPost.razor | 133 ++++++ .../Components/CallToActionComponent.razor | 8 +- TIAMSharedUI/Pages/Events.razor | 13 +- TIAMSharedUI/Pages/Index.razor | 154 ++++--- TIAMSharedUI/Pages/Tests/BackgroundTest.razor | 71 +++ .../Pages/Tests/BackgroundTest.razor.css | 179 ++++++++ TIAMSharedUI/Pages/Tours.razor | 72 --- TIAMSharedUI/Pages/Tours/TourEditor.razor | 39 ++ TIAMSharedUI/Pages/Tours_public.razor | 49 ++ ...Tours.razor.css => Tours_public.razor.css} | 0 TIAMSharedUI/Pages/TransferBookTourPage.razor | 419 ++++++++++++++++++ .../Pages/TransferBookTourPage.razor.css | 202 +++++++++ TIAMSharedUI/Pages/User/SysAdmins/Blog.razor | 183 ++++++++ .../User/SysAdmins/ManageTransfers.razor | 2 +- .../ToursFromTransferDestinations.razor | 240 ++++++++++ .../Shared/Components/BlogComponent.razor | 81 ++++ .../Shared/Components/FooterComponent.razor | 4 +- TIAMSharedUI/Shared/Components/Navbar.razor | 42 +- .../Shared/Components/Navbar.razor.css | 1 + .../Shared/Components/ToursComponent.razor | 84 ++++ .../Components/ToursComponent.razor.css | 288 ++++++++++++ TIAMSharedUI/Shared/HeroSlider.razor | 16 +- TIAMSharedUI/Shared/MainLayout.razor | 1 + TIAMSharedUI/Shared/Users/AdminNavMenu.razor | 2 + TIAMSharedUI/TIAMSharedUI.csproj | 3 + TIAMSharedUI/wwwroot/css/TourIAm.css | 232 +++++++++- TIAMSharedUI/wwwroot/images/car.png | Bin 0 -> 10233 bytes TIAMWebApp/Client/Program.cs | 2 + .../Server/Controllers/BlogAPIController.cs | 213 +++++++++ .../Server/Controllers/TourAPIController.cs | 174 ++++++++ .../Controllers/TransferDataAPIController.cs | 18 +- .../Server/TIAMWebApp.Server.csproj.user | 2 + TIAMWebApp/Server/appsettings.json | 2 +- .../38705566-2e31-4897-8677-ca776523673f.json | 1 + .../bce48760-9272-492b-8c88-db99cd4f55f0.json | 1 + .../171fcca4-ffd5-4380-9402-f27447af1e08.json | 9 + .../72a29052-0d99-49ec-a103-3b5ca86b5b4c.json | 9 + .../ac30e313-6752-4358-b686-65a57be7a030.json | 9 + .../ae7c3d59-e9fb-4393-a89c-3124ed5eba04.json | 9 + .../38705566-2e31-4897-8677-ca776523673f.jpg | Bin 0 -> 9000906 bytes .../bce48760-9272-492b-8c88-db99cd4f55f0.png | Bin 0 -> 3061075 bytes .../171fcca4-ffd5-4380-9402-f27447af1e08.png | Bin 0 -> 1350284 bytes .../72a29052-0d99-49ec-a103-3b5ca86b5b4c.jpeg | Bin 0 -> 191948 bytes .../ac30e313-6752-4358-b686-65a57be7a030.jpeg | Bin 0 -> 166820 bytes .../ae7c3d59-e9fb-4393-a89c-3124ed5eba04.jpeg | Bin 0 -> 179007 bytes .../Shared/Interfaces/ITransferDataService.cs | 1 + TIAMWebApp/Shared/Models/APIUrls.cs | 3 + TIAMWebApp/Shared/Models/BlogPostMetaData.cs | 18 + TIAMWebApp/Shared/Models/TourForm.cs | 17 + TIAMWebApp/Shared/Models/TourInfo.cs | 19 + TIAMWebApp/Shared/Services/BlogService.cs | 85 ++++ TIAMWebApp/Shared/Services/TourService.cs | 79 ++++ .../Shared/Services/TransferDataService.cs | 12 + .../TIAMWebApp.Shared.Application.csproj | 1 + 60 files changed, 3217 insertions(+), 189 deletions(-) create mode 100644 TIAMSharedUI/Pages/Blog/BlogListing.razor create mode 100644 TIAMSharedUI/Pages/Blog/BlogPost.razor create mode 100644 TIAMSharedUI/Pages/Tests/BackgroundTest.razor create mode 100644 TIAMSharedUI/Pages/Tests/BackgroundTest.razor.css delete mode 100644 TIAMSharedUI/Pages/Tours.razor create mode 100644 TIAMSharedUI/Pages/Tours/TourEditor.razor create mode 100644 TIAMSharedUI/Pages/Tours_public.razor rename TIAMSharedUI/Pages/{Tours.razor.css => Tours_public.razor.css} (100%) create mode 100644 TIAMSharedUI/Pages/TransferBookTourPage.razor create mode 100644 TIAMSharedUI/Pages/TransferBookTourPage.razor.css create mode 100644 TIAMSharedUI/Pages/User/SysAdmins/Blog.razor create mode 100644 TIAMSharedUI/Pages/User/SysAdmins/ToursFromTransferDestinations.razor create mode 100644 TIAMSharedUI/Shared/Components/BlogComponent.razor create mode 100644 TIAMSharedUI/Shared/Components/ToursComponent.razor create mode 100644 TIAMSharedUI/Shared/Components/ToursComponent.razor.css create mode 100644 TIAMSharedUI/wwwroot/images/car.png create mode 100644 TIAMWebApp/Server/Controllers/BlogAPIController.cs create mode 100644 TIAMWebApp/Server/Controllers/TourAPIController.cs create mode 100644 TIAMWebApp/Server/wwwroot/data/38705566-2e31-4897-8677-ca776523673f.json create mode 100644 TIAMWebApp/Server/wwwroot/data/bce48760-9272-492b-8c88-db99cd4f55f0.json create mode 100644 TIAMWebApp/Server/wwwroot/data/tours/171fcca4-ffd5-4380-9402-f27447af1e08.json create mode 100644 TIAMWebApp/Server/wwwroot/data/tours/72a29052-0d99-49ec-a103-3b5ca86b5b4c.json create mode 100644 TIAMWebApp/Server/wwwroot/data/tours/ac30e313-6752-4358-b686-65a57be7a030.json create mode 100644 TIAMWebApp/Server/wwwroot/data/tours/ae7c3d59-e9fb-4393-a89c-3124ed5eba04.json create mode 100644 TIAMWebApp/Server/wwwroot/uploads/covers/38705566-2e31-4897-8677-ca776523673f.jpg create mode 100644 TIAMWebApp/Server/wwwroot/uploads/covers/bce48760-9272-492b-8c88-db99cd4f55f0.png create mode 100644 TIAMWebApp/Server/wwwroot/uploads/tourcovers/171fcca4-ffd5-4380-9402-f27447af1e08.png create mode 100644 TIAMWebApp/Server/wwwroot/uploads/tourcovers/72a29052-0d99-49ec-a103-3b5ca86b5b4c.jpeg create mode 100644 TIAMWebApp/Server/wwwroot/uploads/tourcovers/ac30e313-6752-4358-b686-65a57be7a030.jpeg create mode 100644 TIAMWebApp/Server/wwwroot/uploads/tourcovers/ae7c3d59-e9fb-4393-a89c-3124ed5eba04.jpeg create mode 100644 TIAMWebApp/Shared/Models/BlogPostMetaData.cs create mode 100644 TIAMWebApp/Shared/Models/TourForm.cs create mode 100644 TIAMWebApp/Shared/Models/TourInfo.cs create mode 100644 TIAMWebApp/Shared/Services/BlogService.cs create mode 100644 TIAMWebApp/Shared/Services/TourService.cs diff --git a/TIAM.Services.Server.Tests/appsettings.json b/TIAM.Services.Server.Tests/appsettings.json index e9ee275d..a465b2e3 100644 --- a/TIAM.Services.Server.Tests/appsettings.json +++ b/TIAM.Services.Server.Tests/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DeveloperDbConnection": "Data Source=194.164.235.47;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true" + "DeveloperDbConnection": "Data Source=195.26.231.218;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=sa;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true" }, "Logging": { "LogLevel": { diff --git a/TIAMResources/TIAMResources.Designer.cs b/TIAMResources/TIAMResources.Designer.cs index f6b295db..6bb0f44b 100644 --- a/TIAMResources/TIAMResources.Designer.cs +++ b/TIAMResources/TIAMResources.Designer.cs @@ -384,6 +384,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Who we are. + /// + public static string Index_WhoWeAre { + get { + return ResourceManager.GetString("Index.WhoWeAre", resourceCulture); + } + } + /// /// Looks up a localized string similar to Login. /// @@ -456,6 +465,24 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Book now!. + /// + public static string NavMenu_BookNow { + get { + return ResourceManager.GetString("NavMenu.BookNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact. + /// + public static string NavMenu_Contact { + get { + return ResourceManager.GetString("NavMenu.Contact", resourceCulture); + } + } + /// /// Looks up a localized string similar to Events. /// @@ -465,6 +492,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Explore the region. + /// + public static string NavMenu_ExploreTheRegion { + get { + return ResourceManager.GetString("NavMenu.ExploreTheRegion", resourceCulture); + } + } + /// /// Looks up a localized string similar to FormulaOne. /// @@ -483,6 +519,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to How it works. + /// + public static string NavMenu_HowItWorks { + get { + return ResourceManager.GetString("NavMenu.HowItWorks", resourceCulture); + } + } + /// /// Looks up a localized string similar to Login. /// @@ -510,6 +555,15 @@ namespace TIAM.Resources { } } + /// + /// Looks up a localized string similar to Signature ride packages. + /// + public static string NavMenu_SignatureRidePackages { + get { + return ResourceManager.GetString("NavMenu.SignatureRidePackages", resourceCulture); + } + } + /// /// Looks up a localized string similar to Sign out. /// diff --git a/TIAMResources/TIAMResources.hu.resx b/TIAMResources/TIAMResources.hu.resx index 3954816d..1e07d28f 100644 --- a/TIAMResources/TIAMResources.hu.resx +++ b/TIAMResources/TIAMResources.hu.resx @@ -249,15 +249,27 @@ Adminisztráció + + Foglalj most! + + + Kapcsolat + Események + + Fedezd fel a térséget + Forma1 Főoldal + + Miben más a TourIam + Belépés @@ -267,6 +279,9 @@ Beállítások + + Túrák + Kijelentkezés diff --git a/TIAMResources/TIAMResources.resx b/TIAMResources/TIAMResources.resx index 786eb3e8..33c7abbe 100644 --- a/TIAMResources/TIAMResources.resx +++ b/TIAMResources/TIAMResources.resx @@ -225,6 +225,9 @@ Do you need a lift? Book a transfer now! + + Who we are + Login @@ -249,15 +252,27 @@ Admin + + Book now! + + + Contact + Events + + Explore the region + FormulaOne Home + + How it works + Login @@ -267,6 +282,9 @@ Settings + + Signature ride packages + Sign out diff --git a/TIAMSharedUI/Pages/AboutPage.razor b/TIAMSharedUI/Pages/AboutPage.razor index 768871a9..ec1eb036 100644 --- a/TIAMSharedUI/Pages/AboutPage.razor +++ b/TIAMSharedUI/Pages/AboutPage.razor @@ -19,10 +19,6 @@ At Tour I Am, we understand the importance of a seamless and comfortable journey for our valued customers. Whether you're arriving in Budapest for business or leisure, our dedicated team ensures that your transfer experience is hassle-free and enjoyable. - - - -

diff --git a/TIAMSharedUI/Pages/Blog/BlogListing.razor b/TIAMSharedUI/Pages/Blog/BlogListing.razor new file mode 100644 index 00000000..e071afef --- /dev/null +++ b/TIAMSharedUI/Pages/Blog/BlogListing.razor @@ -0,0 +1,111 @@ +@page "/explore-the-region" +@using TIAMSharedUI.Pages.Components +@using TIAMSharedUI.Shared +@using TIAMWebApp.Shared.Application.Models +@using TIAMWebApp.Shared.Application.Models.ClientSide.UI +@using TIAMWebApp.Shared.Application.Services +@inject BlogService BlogService + + + +

+

Blog Posts

+

+ Discover the hidden gems and breathtaking landscapes of Hungary! Our blog features inspiring destinations, scenic routes, and must-see spots that invite you to explore the natural beauty of this enchanting country. Whether you're planning your next adventure or simply dreaming of a getaway, let these stories guide your journey. +

+ + @if (posts == null) + { +

Loading blog posts...

+ } + else if (posts.Count == 0) + { +

No blog posts found.

+ } + else + { + @*
*@ +
+ @foreach (var post in posts) + { +
+
+ @if (!string.IsNullOrEmpty(post.CoverImage)) + { + @post.Title + } +
+
@post.Title
+ @if (!string.IsNullOrEmpty(post.Lead)) + { + +

@post.Lead

+ } + @if (post.Tags?.Count > 0) + { +

+ @string.Join(", ", post.Tags) +

+ } + Read More +
+
+
+ @* +
+
+

@post.Title

+

@post.Tags

+

@post.Lead

+

@post.Id

+
+ by + +
+
+
+
*@ + } + @*
*@ +
+ } + + + + +@code { + private List? posts; + + protected override async Task OnInitializedAsync() + { + posts = await BlogService.GetAllPostsAsync(); + } + + public List sliders = new() + { + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Explore Our Programs", + ButtonUrl= "/signature-ride-packages" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Book now", + ButtonUrl= "/transfer" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "", + ImageUrl = "https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "", + ButtonUrl= "" + } + }; +} diff --git a/TIAMSharedUI/Pages/Blog/BlogPost.razor b/TIAMSharedUI/Pages/Blog/BlogPost.razor new file mode 100644 index 00000000..f80ba31c --- /dev/null +++ b/TIAMSharedUI/Pages/Blog/BlogPost.razor @@ -0,0 +1,133 @@ +@page "/blogpost/{PostId}" +@using TIAMSharedUI.Pages.Components +@using TIAMSharedUI.Shared +@using TIAMWebApp.Shared.Application.Models.ClientSide.UI +@using TIAMWebApp.Shared.Application.Services +@inject HttpClient Http +@inject BlogService BlogService + + + +@if (Content == null) +{ +

Loading post...

+} +else +{ +
+ +
+ @((MarkupString)Content) +
+ + @if (Tags?.Count > 0) + { +

+ Tags: @string.Join(", ", Tags) +

+ } +
+} + + + +@code { + [Parameter] + public string PostId { get; set; } + + private string? Content; + private string? Title; + private string? CoverImage; + private List? Tags; + + + + + protected override async Task OnParametersSetAsync() + { + try + { + var post = await BlogService.GetPostByIdAsync(PostId); + if (post != null) + { + Title = post.Title; + CoverImage = post.CoverImage; + Tags = post.Tags; + + // ✅ Extract fileId from DriveLink: + var fileId = ExtractGoogleDriveFileId(post.DriveLink); + if (!string.IsNullOrEmpty(fileId)) + { + // string apiKey = "AIzaSyBLKx4XFpgX97sULTbtpyKA2Ca_ANrjxxs"; // your existing key + // // string downloadUrl = $"https://www.googleapis.com/drive/v3/files/{fileId}?alt=media&key={apiKey}"; + // string downloadUrl = $"https://drive.google.com/uc?export=download&id={fileId}"; + // Content = await Http.GetStringAsync(downloadUrl); + + Content = null; // Optional: clear previous content while loading new + + try + { + Content = await Http.GetStringAsync($"/api/blog/postcontent/{PostId}"); + } + catch + { + Content = "

Failed to load blog post.

"; + } + + } + else + { + Content = "

Invalid Google Drive link in post metadata.

"; + } + } + } + catch (Exception e) + { + + Content = "

Failed to load blog post. " + e.ToString()+ "

"; + } + } + + private string? ExtractGoogleDriveFileId(string driveLink) + { + try + { + // Works with typical Google Drive URLs + var match = System.Text.RegularExpressions.Regex.Match(driveLink, @"\/d\/([^\/]+)"); + return match.Success ? match.Groups[1].Value : null; + } + catch + { + return null; + } + } + + + public List sliders = new() + { + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Explore Our Programs", + ButtonUrl= "/signature-ride-packages" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Book now", + ButtonUrl= "/transfer" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "", + ImageUrl = "https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "", + ButtonUrl= "" + } + }; +} diff --git a/TIAMSharedUI/Pages/Components/CallToActionComponent.razor b/TIAMSharedUI/Pages/Components/CallToActionComponent.razor index 2a62e1ec..3fb36d09 100644 --- a/TIAMSharedUI/Pages/Components/CallToActionComponent.razor +++ b/TIAMSharedUI/Pages/Components/CallToActionComponent.razor @@ -1,10 +1,10 @@ -
-
+
+
-

JOIN OUR COMMUNITY

+

READY TO GO?

@@ -14,7 +14,7 @@
- +
diff --git a/TIAMSharedUI/Pages/Events.razor b/TIAMSharedUI/Pages/Events.razor index 1e1f1a78..2129e8a1 100644 --- a/TIAMSharedUI/Pages/Events.razor +++ b/TIAMSharedUI/Pages/Events.razor @@ -20,7 +20,7 @@
- +

@item.Name

@item.DateAndTime

@@ -37,14 +37,7 @@ } } - - - - - - - - +
@@ -102,4 +95,4 @@ }; - } \ No newline at end of file +} \ No newline at end of file diff --git a/TIAMSharedUI/Pages/Index.razor b/TIAMSharedUI/Pages/Index.razor index c2e934da..33d077aa 100644 --- a/TIAMSharedUI/Pages/Index.razor +++ b/TIAMSharedUI/Pages/Index.razor @@ -1,8 +1,10 @@ @page "/" @using AyCode.Interfaces.StorageHandlers; @using BlazorAnimation +@using TIAMSharedUI.Shared.Components @using TIAMSharedUI.Shared.Components.BaseComponents @using TIAMWebApp.Shared.Application.Interfaces +@using TIAMWebApp.Shared.Application.Models @using TIAMWebApp.Shared.Application.Models.ClientSide.UI @using AyCode.Services.Loggers @using TIAMSharedUI.Pages.Components; @@ -24,8 +26,8 @@ - -@*
+ +@*
@@ -42,9 +44,7 @@
*@ -
- - +@*
@@ -52,49 +52,49 @@

@localizer.GetString("Index.Subtitle")

-
+
*@ - - -
- Card image -
-

@localizer.GetString("Index.Transfer")

- -

@localizer.GetString("Index.Transfer.Desc")

- -
-
-
-
- - -
- Card image -
-

@localizer.GetString("Index.Tours")

-

@localizer.GetString("Index.Tours.Desc")

- -
-
-
-
- - -
- Card image -
-

@localizer.GetString("Index.Clubcards")

-

@localizer.GetString("Index.Clubcards.Desc")

- -
-
-
-
+
+
+
+ +
+

@localizer.GetString("Index.WhoWeAre")

+

We’re not here to take over your trip. We’re here to help shape it — with smooth rides, flexible options, and curated experiences you can actually enjoy.

+

Think of us as your private ride — whether you’re heading to the airport, a spa town, a winery, or somewhere off the map.

+

You can follow one of our signature routes, or create your own. We adapt. You decide. We take care of the road.

+

Our role changes with every guest. Sometimes we’re your calm in the chaos. Sometimes we’re your quiet local expert. Sometimes we’re just there — when you need someone who knows the way.

+
+ +
+ Who we are +
+
+
-
+
+ +
+
+ +
+ + + + @code { @@ -102,18 +102,27 @@ { new HeroSliderItem { - Title = "Welcome to TIAM", - ImageUrl = "https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Explore Our Programs", + ButtonUrl= "/signature-ride-packages" }, new HeroSliderItem { - Title = "Welcome to TIAM", - ImageUrl = "https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Book now", + ButtonUrl= "/transfer" }, new HeroSliderItem { - Title = "Welcome to TIAM", - ImageUrl = "https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" + Title = "Experience Hungary on Your Terms", + Subtitle = "", + ImageUrl = "https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "", + ButtonUrl= "" } }; @@ -122,8 +131,8 @@ public List TransferIgnorList = new List { "Id", - "UserId", - "ProductId", + "UserId", + "ProductId", "PaymentId", "FirstName", "LastName", @@ -134,24 +143,37 @@ "Revenue" }; - /*protected override void OnAfterRender(bool isFirst) - { - message = " Target destination is " + slider.SliderElementId.ToString(); - }*/ + /*protected override void OnAfterRender(bool isFirst) + { + message = " Target destination is " + slider.SliderElementId.ToString(); + }*/ public async Task SubmitForm(object Result) - { - TransferWizardModel transferWizardModel = Result as TransferWizardModel; - if(sessionService.IsAuthenticated) { - transferWizardModel.UserId = sessionService.User.UserModelDto.Id; - transferWizardModel.ProductId = sessionService.User.UserModelDto.Products.FirstOrDefault().Id; - } - transferWizardModel.Price = null; - var transfer = await WizardProcessor.ProcessWizardAsync(transferWizardModel.GetType(), transferWizardModel); - BrowserConsoleLogWriter.Info($"Submitted nested form: {Result.GetType().FullName}"); - navManager.NavigateTo("/transfer2/" + transfer.Id); + TransferWizardModel transferWizardModel = Result as TransferWizardModel; + if (sessionService.IsAuthenticated) + { + transferWizardModel.UserId = sessionService.User.UserModelDto.Id; + transferWizardModel.ProductId = sessionService.User.UserModelDto.Products.FirstOrDefault().Id; } + transferWizardModel.Price = null; + var transfer = await WizardProcessor.ProcessWizardAsync(transferWizardModel.GetType(), transferWizardModel); + BrowserConsoleLogWriter.Info($"Submitted nested form: {Result.GetType().FullName}"); + navManager.NavigateTo("/transfer2/" + transfer.Id); + } + + public List MockEvents = new List + { + new Event("HONEYBEAST", "A Honeybeast egyedisége abban rejlik, hogy a popzenét rengeteg különféle irányból közelítik meg - hol vidám, hol szomorú, hol pörgős, hogy lassú, koncertjükön az érzelmek széles skáláját élhetjük át együtt.", "2024.05.03", "Budapest Park", "https://tixa.hu/kepek/0027/320/27870-1_20231214141702.jpg"), + new Event("VAD FRUTTIK", "A kék a tenger és az ég színe, a nyílt terekkel, valamint a képzelettel és tágassággal társul - végtelen kékség május 3-án a Budapest Parkban!", "2024.04.26", "Budapest Park", "https://tixa.hu/kepek/0027/768/27692-1_20231129185842.jpg"), + new Event("DEBORAH DE LUCA", "DEBORAH DE LUCA 2024-ben Magyarországon csak a Budapest Park színpadán", "2024.08.19", "Budapest Park", "https://tixa.hu/kepek/0028/768/28535-1_20240118172423.jpg"), + new Event("TOTAL DANCE CABRIO", "Ha nyár, akkor Total Dance Cabrio! Ülj be mellénk a cabrioba, és hagyd, hogy visszarepítsünk a 90-es és 2000-es évekbe! ", "2024.04.26", "Budapest Park", "https://tixa.hu/kepek/0027/768/27829-1_20231206193253.jpg"), + new Event("HONEYBEAST", "A Honeybeast egyedisége abban rejlik, hogy a popzenét rengeteg különféle irányból közelítik meg - hol vidám, hol szomorú, hol pörgős, hogy lassú, koncertjükön az érzelmek széles skáláját élhetjük át együtt.", "2024.05.03", "Budapest Park", "https://tixa.hu/kepek/0027/320/27870-1_20231214141702.jpg"), + new Event("VAD FRUTTIK", "A kék a tenger és az ég színe, a nyílt terekkel, valamint a képzelettel és tágassággal társul - végtelen kékség május 3-án a Budapest Parkban!", "2024.04.26", "Budapest Park", "https://tixa.hu/kepek/0027/768/27692-1_20231129185842.jpg"), + new Event("DEBORAH DE LUCA", "DEBORAH DE LUCA 2024-ben Magyarországon csak a Budapest Park színpadán", "2024.08.19", "Budapest Park", "https://tixa.hu/kepek/0028/768/28535-1_20240118172423.jpg"), + new Event("TOTAL DANCE CABRIO", "Ha nyár, akkor Total Dance Cabrio! Ülj be mellénk a cabrioba, és hagyd, hogy visszarepítsünk a 90-es és 2000-es évekbe! ", "2024.04.26", "Budapest Park", "https://tixa.hu/kepek/0027/768/27829-1_20231206193253.jpg"), + + }; } diff --git a/TIAMSharedUI/Pages/Tests/BackgroundTest.razor b/TIAMSharedUI/Pages/Tests/BackgroundTest.razor new file mode 100644 index 00000000..2d9185ba --- /dev/null +++ b/TIAMSharedUI/Pages/Tests/BackgroundTest.razor @@ -0,0 +1,71 @@ +@page "/backgroundtest" +@inject IStringLocalizer localizer; +@using TIAM.Resources +@using TIAMSharedUI.Shared +@using TIAMWebApp.Shared.Application.Models.ClientSide.UI + +
+ +
+
+
+
+
+
+
+
+ +
+ + + +
+
+
+ +
+

@localizer.GetString("Index.WhoWeAre")

+

We’re not here to take over your trip. We’re here to help shape it — with smooth rides, flexible options, and curated experiences you can actually enjoy.

+

Think of us as your private ride — whether you’re heading to the airport, a spa town, a winery, or somewhere off the map.

+

You can follow one of our signature routes, or create your own. We adapt. You decide. We take care of the road.

+

Our role changes with every guest. Sometimes we’re your calm in the chaos. Sometimes we’re your quiet local expert. Sometimes we’re just there — when you need someone who knows the way.

+
+ +
+ Who we are +
+
+
+
+ +@code { + public List sliders = new List + { + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Explore Our Programs", + ButtonUrl= "/signature-ride-packages" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Book now", + ButtonUrl= "/transfer" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "", + ImageUrl = "https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "", + ButtonUrl= "" + } + }; +} diff --git a/TIAMSharedUI/Pages/Tests/BackgroundTest.razor.css b/TIAMSharedUI/Pages/Tests/BackgroundTest.razor.css new file mode 100644 index 00000000..c397eca6 --- /dev/null +++ b/TIAMSharedUI/Pages/Tests/BackgroundTest.razor.css @@ -0,0 +1,179 @@ +* { + box-sizing: border-box; +} + +body { + font-family: "Lato", sans-serif; +} + +.hero { + width: 100%; + min-height: 450px; + height: 100%; + position: absolute; + top: 0; + left: 0; + background-color: #d9edfd; + z-index: -1; +} + +.layer-1 { + -webkit-animation: parallax_fg linear 20s infinite both; + animation: parallax_fg linear 20s infinite both; + background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/1.png) 0 100% repeat-x; + z-index: 1; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background-size: auto 136px; +} + +.layer-2 { + -webkit-animation: parallax_fg linear 30s infinite both; + animation: parallax_fg linear 30s infinite both; + background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/2.png) 0 100% repeat-x; + z-index: 1; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background-size: auto 145px; +} + +.layer-3 { + -webkit-animation: parallax_fg linear 55s infinite both; + animation: parallax_fg linear 55s infinite both; + background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/3.png) 0 100% repeat-x; + z-index: 1; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background-size: auto 158px; +} + +.layer-4 { + -webkit-animation: parallax_fg linear 75s infinite both; + animation: parallax_fg linear 75s infinite both; + background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/4.png) 0 100% repeat-x; + z-index: 1; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background-size: auto 468px; +} + +.layer-5 { + -webkit-animation: parallax_fg linear 95s infinite both; + animation: parallax_fg linear 95s infinite both; + background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/5.png) 0 100% repeat-x; + z-index: 1; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background-size: auto 311px; +} + +.layer-6 { + -webkit-animation: parallax_fg linear 120s infinite both; + animation: parallax_fg linear 120s infinite both; + background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/6.png) 0 100% repeat-x; + z-index: 1; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background-size: auto 222px; +} + +.bike-1, +.bike-2 { + background: url(images/car.png) 0 100% no-repeat; + z-index: 1; + position: fixed; + bottom: 100px; + left: 0; + width: 100%; + height: 100%; + background-size: auto 75px; +} + +.bike-1 { + -webkit-animation: parallax_bike linear 10s infinite both; + animation: parallax_bike linear 10s infinite both; +} + +.bike-2 { + -webkit-animation: parallax_bike linear 15s infinite both; + animation: parallax_bike linear 15s infinite both; +} + +@-webkit-keyframes parallax_fg { + 0% { + background-position: 2765px 100%; + } + + 100% { + background-position: 550px 100%; + } +} + +@keyframes parallax_fg { + 0% { + background-position: 2765px 100%; + } + + 100% { + background-position: 550px 100%; + } +} + +@-webkit-keyframes parallax_bike { + 0% { + background-position: -300px 100%; + } + + 100% { + background-position: 2000px 100%; + } +} + +@keyframes parallax_bike { + 0% { + background-position: -300px 100%; + } + + 100% { + background-position: 2000px 100%; + } +} + +.logo { + margin: 70px auto; + position: absolute; + z-index: 2; + width: 100%; +} + + .logo img { + display: block; + margin: 0 auto; + max-width: 100%; + } + +@media (max-width: 700px) { + .logo img { + max-width: 90%; + } +} + + diff --git a/TIAMSharedUI/Pages/Tours.razor b/TIAMSharedUI/Pages/Tours.razor deleted file mode 100644 index d2a2800c..00000000 --- a/TIAMSharedUI/Pages/Tours.razor +++ /dev/null @@ -1,72 +0,0 @@ -@page "/tours" -@using TIAMSharedUI.Shared - - - -
-
-
- -

Tours

-

Please select!

-
- -
- - - -
- - \ No newline at end of file diff --git a/TIAMSharedUI/Pages/Tours/TourEditor.razor b/TIAMSharedUI/Pages/Tours/TourEditor.razor new file mode 100644 index 00000000..5e4def0b --- /dev/null +++ b/TIAMSharedUI/Pages/Tours/TourEditor.razor @@ -0,0 +1,39 @@ +@using TIAM.Entities.Transfers +@using TIAMWebApp.Shared.Application.Models + + + + + + +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +@code { + [Parameter] public TourInfo Tour { get; set; } = new(); + [Parameter] public EventCallback OnSave { get; set; } + [Parameter] public EventCallback OnCancel { get; set; } + + private async Task HandleValidSubmit() + { + await OnSave.InvokeAsync(Tour); + } + + private async Task HandleCancel() + { + await OnCancel.InvokeAsync(Tour); + } +} \ No newline at end of file diff --git a/TIAMSharedUI/Pages/Tours_public.razor b/TIAMSharedUI/Pages/Tours_public.razor new file mode 100644 index 00000000..1e33914b --- /dev/null +++ b/TIAMSharedUI/Pages/Tours_public.razor @@ -0,0 +1,49 @@ +@page "/signature-ride-packages" +@inject TourService TourService +@using TIAMSharedUI.Shared +@using TIAMSharedUI.Shared.Components +@using TIAMWebApp.Shared.Application.Models +@using TIAMWebApp.Shared.Application.Models.ClientSide.UI +@using TIAMWebApp.Shared.Application.Services + +@using Microsoft.AspNetCore.Components.Web + + + + + + + @* *@ + + +@code { + public List sliders = new() + { + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Explore Our Programs", + ButtonUrl= "/signature-ride-packages" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Book now", + ButtonUrl= "/transfer" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "", + ImageUrl = "https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "", + ButtonUrl= "" + } + }; +} + + diff --git a/TIAMSharedUI/Pages/Tours.razor.css b/TIAMSharedUI/Pages/Tours_public.razor.css similarity index 100% rename from TIAMSharedUI/Pages/Tours.razor.css rename to TIAMSharedUI/Pages/Tours_public.razor.css diff --git a/TIAMSharedUI/Pages/TransferBookTourPage.razor b/TIAMSharedUI/Pages/TransferBookTourPage.razor new file mode 100644 index 00000000..aade1915 --- /dev/null +++ b/TIAMSharedUI/Pages/TransferBookTourPage.razor @@ -0,0 +1,419 @@ +@page "/book-a-tour/{TransferDestinationId}/{PriceCategory:int}" +@using AyCode.Core.Consts +@using AyCode.Core.Helpers +@using TIAM.Models.Dtos.Users +@using TIAM.Services +@using TIAMSharedUI.Pages.Components +@using TIAMSharedUI.Pages.Components.EditComponents +@using TIAMSharedUI.Shared +@using TIAMSharedUI.Shared.Components.BaseComponents +@using TIAMWebApp.Shared.Application.Interfaces +@using TIAMWebApp.Shared.Application.Models +@using TIAMWebApp.Shared.Application.Models.ClientSide.UI +@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels +@using AyCode.Services.Loggers +@using TIAMSharedUI.Pages.User.Hotels +@using TIAMWebApp.Shared.Application.Models.PageModels +@using TIAMWebApp.Shared.Application.Services +@using TIAMWebApp.Shared.Application.Utility +@inherits BasePageComponent +@inject NavigationManager navManager +@inject IEnumerable LogWriters +@inject IWizardProcessor WizardProcessor +@inject IUserDataService UserDataService +@inject AdminSignalRClient _adminSignalRClient +@inject ITransferDataService TransferDataService +@inject TourService TourService + +Transfer + + +
+
+ + @{ + if (_displayHelp) + { +
+ +
+ +
+

+ Step 1: Choose Your Transfer Direction +

+

At the top of the form, select whether you need a transfer "To the Airport" or "From the Airport" by clicking on the corresponding tab.

+
+
+ + +
+ + +
+

+ + Step 2: Enter the Destination (or Pickup) Address + +

+

In the PickupAddress section, select your address:

+
    +
  • Preset addresses: Click on the dropdown menu under “Preset addresses” and choose an address from the list. For example, you may see options like "Széchenyi fürdő."
  • +
  • Custom address: If your address is not listed, click on the "Custom address" tab to manually enter your address.
  • +
+
+
+ + +
+ + +
+

+ Step 3: Confirm the Destination +

+

Once you select or enter the address, the form will display it as the "Selected address." Make sure this is correct before proceeding.

+
+
+ + +
+ + +
+

+ Step 4: Enter Flight Information (Optional) +

+

If applicable, fill in your FlightNumber. This is optional, so you can leave it blank if you don't have or don’t want to provide it.

+
+
+ + +
+ + +
+

+ Step 5: Specify the Number of Passengers +

+

In the NumberOfPassengers field, enter the number of people who will be traveling. The default is set to 1, but you can change it as needed.

+
+
+ + +
+ + +
+

+ Step 6: Indicate the Amount of Luggage +

+

In the NumberOfLuggage field, enter the total number of luggage items you will be bringing.

+
+
+ + +
+ + +
+

+ Step 7: Fill in Your Personal Information +

+

Under FullName, enter your first and last name in the respective fields. Provide your PhoneNumber in the designated field. The phone number appears to be pre-filled with a sample number ("+11234567890"), so be sure to update it with your actual contact number. Enter your EmailAddress to receive confirmation and any further communication regarding your transfer.

+
+
+ + +
+ + +
+

+ Step 8: Add Additional Comments (Optional) +

+

If you have any special requests or additional information you’d like to provide, use the Comment section to do so.

+
+
+ + +
+ + +
+

+ Step 9: Submit Your Request +

+

Once all fields are filled in correctly, click the Submit button at the bottom of the form to place your transfer order.

+
+
+ + +
+ + +
+

+ Step 10: Confirmation +

+ +

After submitting, you should receive a confirmation email or message. Ensure all the details are correct, and you’re all set!

+
+
+
+ } + } + +
+ + + + + +
+ @tourInfo.Title +
+ + + + + +
+ + +
+ + + +
+ +
+
+
+

Book an Airport Transfer

+

Welcome to Tour I Am! Book your airport transfer with us for a smooth and stress-free experience. Our professional drivers are ready to take you to and from the airport in comfort and style. We offer competitive rates and reliable service, ensuring you get to your destination on time.

+ +

Why Choose Tour I Am?

+
    +
  • Reliable Service: Punctual pickups and drop-offs.
  • +
  • Professional Drivers: Experienced and courteous drivers.
  • +
  • Affordable Rates: Competitive pricing with no hidden fees.
  • +
  • Comfortable Vehicles: Clean, modern, and well-maintained cars.
  • +
+ + +
+
+ +
+
+ +
+
+ +

How to Book

+

Booking your airport transfer is easy! Simply visit our booking page, enter your details, and confirm your reservation. You can also contact us at info@touriam.com or call us at (123) 456-7890 for assistance.

+ +

Experience the convenience and reliability of Tour I Am. Book your airport transfer today and travel with peace of mind!

+
+
+ +
+ + + + + +@code { + [Parameter] public string TransferDestinationId { get; set; } + [Parameter] public int PriceCategory { get; set; } = 1; + private LoggerClient _logger; + + private readonly TransferWizardModel _myModel = new TransferWizardModel(); + private TourInfo? tourInfo = new(); + + private bool _displayHelp = false; + + public List sliders = new List + { + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1551867633-194f125bddfa?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Explore Our Programs", + ButtonUrl= "/signature-ride-packages" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "Discover the freedom of personalized travel with expert private transfers and curated inspiration.", + ImageUrl = "https://images.unsplash.com/photo-1549877452-9c387954fbc2?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "Book now", + ButtonUrl= "/transfer" + }, + new HeroSliderItem + { + Title = "Experience Hungary on Your Terms", + Subtitle = "", + ImageUrl = "https://images.unsplash.com/photo-1507622560124-621e26755fb8?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + ButtonText = "", + ButtonUrl= "" + } + }; + + private readonly List _transferIgnorList1 = + [ + "Id", + "Destination", + "UserId", + "ProductId", + "PaymentId", + "FirstName", + "LastName", + "UserProductMappingId", + "UserProductToCarId", + "ReferralId", + "Price" + ]; + + + public async Task SubmitForm(object result) + { + var resModel = (TransferWizardModel)result; + + //let's check if user exists with this email + var user = await UserDataService.GetUserByEmailAsync(resModel.EmailAddress!); + if (user != null && user.Id != Guid.Empty) + { + resModel.UserId = user.Id; + //user exists already + + if (_sessionService.User != null) + { + if (_sessionService.User.UserId == user.Id) + { + + //I have ordered for myself + resModel.ReferralId = null; + } + else + { + //if I am logged in and different user I become referrer (if no referrer already) + var transferUserDetail = await UserDataService.GetUserDetailByIdAsync(user.Id); + var userDetail = await UserDataService.GetUserDetailByIdAsync(_sessionService.User.UserId); + + if (transferUserDetail.UserDto.RefferalId != null) + { + //user has aready a referrer so we use that + resModel.ReferralId = transferUserDetail.UserDto.RefferalId; + } + else + { + //user has no referrer so I am the referrer + resModel.ReferralId = userDetail.UserDto.RefferalId; + + } + } + } + } + else + { + //create a guest user and set referralId + var registration = new RegistrationModel(); + + var password = AcCharsGenerator.NewPassword(AcConst.MinPasswordLength, 16); + + registration.Email = resModel.EmailAddress; + registration.PhoneNumber = resModel.PhoneNumber; + registration.Password = password; + //get list with one member! + + var createResult = await UserDataService.CreateGuestUser(registration); + if (createResult.isSuccess) + { + if (createResult.user != null) + { + if (_sessionService.User != null) + { + //if I am logged in user I become referrer + var userDetail = await UserDataService.GetUserDetailByIdAsync(_sessionService.User.UserId); + var createdUserDetail = await UserDataService.GetUserDetailByIdAsync(createResult.user.Id); + if (createdUserDetail != null) + { + createdUserDetail.UserDto.RefferalId = userDetail.UserDto.RefferalId; + + var updatedNewUser = await _adminSignalRClient.UpdateUserModelDtoDetail(userDetail); + if (updatedNewUser != null) + { + //referral set + } + else + { + //something wrong + } + } + + resModel.ReferralId = userDetail.UserDto.RefferalId; + } + + resModel.UserId = createResult.user.Id; + + } + else + { + //some error handling + } + } + } + + var transfer = await WizardProcessor.ProcessWizardAsync(result.GetType(), result); + _logger.Info($"Submitted nested form: {result.GetType().FullName}"); + navManager.NavigateTo($"/mytransfers/{resModel.Id}"); + } + + protected override Task OnInitializedAsync() + { + _logger = new LoggerClient(LogWriters.ToArray()); + + + return base.OnInitializedAsync(); + } + + protected override async Task OnParametersSetAsync() + { + //get transferDestination + var destination = await TransferDataService.GetTransferDestinationbyIdAsync(Guid.Parse(TransferDestinationId)); + _myModel.Destination = destination.AddressString; + switch (PriceCategory) + { + case 1: + _myModel.Price = destination.Price; + break; + case 2: + _myModel.Price = destination.Price2; + break; + case 3: + _myModel.Price = destination.Price3; + break; + } + + tourInfo = await TourService.GetAsync(destination.Id); + + + + await base.OnParametersSetAsync(); + } + + private void ShowHelp_Click() + { + _displayHelp = !_displayHelp; + } + +} + diff --git a/TIAMSharedUI/Pages/TransferBookTourPage.razor.css b/TIAMSharedUI/Pages/TransferBookTourPage.razor.css new file mode 100644 index 00000000..83c30f41 --- /dev/null +++ b/TIAMSharedUI/Pages/TransferBookTourPage.razor.css @@ -0,0 +1,202 @@ +.container { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} + +@media (min-width: 768px) { + .container { + width: 750px; + } +} + +@media (min-width: 992px) { + .container { + width: 970px; + } +} + +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} + +@media (max-width: 767px) { + #featureContainer .carousel-inner .carousel-item > div { + display: none; + } + + #featureContainer .carousel-inner .carousel-item > div:first-child { + display: block; + } +} + +#featureContainer .carousel-inner .carousel-item.active, +#featureContainer .carousel-inner .carousel-item-next, +#featureContainer .carousel-inner .carousel-item-prev { + display: flex; +} + +@media (min-width: 768px) { + + #featureContainer .carousel-inner .carousel-item-end.active, + #featureContainer .carousel-inner .carousel-item-next { + transform: translateX(25%); + } + + #featureContainer .carousel-inner .carousel-item-start.active, + #featureContainer .carousel-inner .carousel-item-prev { + transform: translateX(-25%); + } + + #featureContainer .card img { + width: 90%; + height: 40vh; + } + + #featureContainer .carousel-item { + justify-content: space-between; + } +} + +@media (max-width: 767px) { + #featureContainer .card img { + width: 100%; + height: 75vh; + } +} + +#featureContainer .carousel-inner .carousel-item-end, +#featureContainer .carousel-inner .carousel-item-start { + transform: translateX(0); +} + +#featureContainer .card { + border: 0; +} + +#featureContainer .card { + position: relative; +} + + #featureContainer .card .card-img-overlays { + position: absolute; + bottom: 15%; + left: 10%; + } + +#featureContainer a { + text-decoration: none; +} + +#featureContainer .indicator { + border: 1px solid rgb(202, 202, 202); + padding: 3px 6px 3px 6px; +} + + #featureContainer .indicator:hover { + background-color: blue; + border: 1px solid blue; + transition: 200ms; + } + + #featureContainer .indicator:hover { + color: white; + transition: 200ms; + } + +#featureContainer .indicator { + color: lightgray; +} + +#featureContainer .float-end { + padding-top: 10px; +} + + + + +/* Reseting */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif; +} + +.wrapper { + max-width: 800px; + min-height: 500px; + margin: 10px auto; + padding: 30px 30px 30px 30px; + /*background-color: #ecf0f3;*/ + border-radius: 15px; + /*box-shadow: 13px 13px 20px #cbced1, -13px -13px 20px #fff;*/ +} + + + .wrapper .name { + font-weight: 600; + font-size: 1.4rem; + letter-spacing: 1.3px; + padding-left: 10px; + /*color: #555*/; + } + + .wrapper .form-field input { + width: 100%; + display: block; + border: none; + outline: none; + background: none; + font-size: 1.2rem; + color: #666; + padding: 10px 15px 10px 10px; + /* border: 1px solid red; */ + } + + .wrapper .form-field { + padding-left: 10px; + margin-bottom: 20px; + border-bottom: 1px solid; + /*border-radius: 20px;*/ + //*ox-shadow: inset 3px 3px 3px #cbced1, inset -3px -3px 3px #fff;*/ + } + + .wrapper .form-field .fas { + color: #555; + } + + .wrapper .btn { + box-shadow: none; + width: 100%; + height: 40px; + /*background-color: #03A9F4;*/ + color: #fff; + border-radius: 15px; + /*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;*/ + letter-spacing: 1.3px; + } + + .wrapper .btn:hover { + background-color: #039BE5; + } + + .wrapper a { + text-decoration: none; + font-size: 0.8rem; + color: #03A9F4; + } + + .wrapper a:hover { + color: #039BE5; + } + +@media(max-width: 380px) { + .wrapper { + margin: 30px 20px; + padding: 40px 15px 15px 15px; + } +} diff --git a/TIAMSharedUI/Pages/User/SysAdmins/Blog.razor b/TIAMSharedUI/Pages/User/SysAdmins/Blog.razor new file mode 100644 index 00000000..2b5646b0 --- /dev/null +++ b/TIAMSharedUI/Pages/User/SysAdmins/Blog.razor @@ -0,0 +1,183 @@ +@page "/sysadmin/blogs" +@using TIAMWebApp.Shared.Application.Models +@using TIAMWebApp.Shared.Application.Services +@using TIAMSharedUI.Shared +@layout AdminLayout +@inject BlogService BlogService + +
+

Manage Blog Posts

+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + + @if (IsEditMode) + { + + } +
+ + @if (SaveSuccess) + { +
Post saved successfully!
+ } + +

Existing Posts

+ + @if (Posts.Count == 0) + { +

No blog posts found.

+ } + else + { + + + + + + + + + + @foreach (var item in Posts) + { + + + + + + + } + +
TitleTagsActions
@item.Title@string.Join(", ", item.Tags) + + +
+ } + +
+ +@code { + private BlogPostMetadata Post = new(); + private List Posts = new(); + private IBrowserFile? CoverImage; + private string TagsCsv = ""; + private bool IsSaving = false; + private bool SaveSuccess = false; + private bool IsEditMode = false; + + protected override async Task OnInitializedAsync() + { + await LoadPosts(); + } + + private async Task LoadPosts() + { + Posts = await BlogService.GetAllPostsAsync(); + } + + private async Task HandleFileSelected(InputFileChangeEventArgs e) + { + CoverImage = e.File; + } + + private async Task SavePost() + { + IsSaving = true; + SaveSuccess = false; + + Post.Tags = TagsCsv.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToList(); + + if (IsEditMode) + { + await BlogService.UpdatePostAsync(Post, CoverImage); + } + else + { + await BlogService.CreatePostAsync(Post, CoverImage); + } + + IsSaving = false; + SaveSuccess = true; + + await LoadPosts(); + ResetForm(); + } + + private void EditPost(BlogPostMetadata post) + { + Post = new BlogPostMetadata + { + Id = post.Id, + Title = post.Title, + Lead = post.Lead, + DriveLink = post.DriveLink, + Tags = new List(post.Tags), + CoverImage = post.CoverImage + }; + TagsCsv = string.Join(", ", post.Tags); + IsEditMode = true; + SaveSuccess = false; + } + + private async Task DeletePost(string id) + { + if (await ConfirmDeleteAsync()) + { + await BlogService.DeletePostAsync(id); + await LoadPosts(); + } + } + + private async Task ConfirmDeleteAsync() + { + return await Task.FromResult(true); // Replace with real confirmation popup later + } + + private void CancelEdit() + { + ResetForm(); + } + + private void ResetForm() + { + Post = new BlogPostMetadata(); + TagsCsv = ""; + CoverImage = null; + IsEditMode = false; + } +} diff --git a/TIAMSharedUI/Pages/User/SysAdmins/ManageTransfers.razor b/TIAMSharedUI/Pages/User/SysAdmins/ManageTransfers.razor index 956244a6..bdc110b5 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/ManageTransfers.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/ManageTransfers.razor @@ -560,7 +560,7 @@ { if (x?.ResponseData == null) return Task.CompletedTask; - transfer.TransferToDrivers.UpdateCollection(x.ResponseData, false); + transfer.TransferToDrivers.UpdateCollection(x.ResponseData, false); callback?.Invoke(); return Task.CompletedTask; diff --git a/TIAMSharedUI/Pages/User/SysAdmins/ToursFromTransferDestinations.razor b/TIAMSharedUI/Pages/User/SysAdmins/ToursFromTransferDestinations.razor new file mode 100644 index 00000000..5ec96792 --- /dev/null +++ b/TIAMSharedUI/Pages/User/SysAdmins/ToursFromTransferDestinations.razor @@ -0,0 +1,240 @@ +@page "/sysadmin/manage-tours" +@using System.ComponentModel.DataAnnotations +@using TIAM.Entities.Transfers +@using TIAMWebApp.Shared.Application.Interfaces +@using TIAMWebApp.Shared.Application.Models +@using TIAMWebApp.Shared.Application.Services +@using TIAMSharedUI.Shared +@inject ITransferDataService TransferDataService +@inject TourService TourService +@inject NavigationManager Navigation + +@layout AdminLayout + +Manage Tours + +

Manage Tours

+ +
+
+

Create New Tour

+ + + + + +
+ + + + @foreach (var dest in TransferDestinations) + { + + } + +
+ +
+ + +
+ +
+ + +
+ +
+ + + @if (!string.IsNullOrEmpty(UploadStatus)) + { +
@UploadStatus
+ } +
+ + + @if (IsEditing) + { + + } +
+
+ +
+ +
+

Existing Tours

+ @if (Tours.Any()) + { +
    + @foreach (var tour in Tours) + { + var dest = TransferDestinations.FirstOrDefault(d => d.Id == tour.TransferDestinationId); +
  • + + + @tour?.Title — @tour.FancyDescription + + + +
  • + } +
+ } + else + { +

No tours available.

+ } +
+
+ +@code { + private List TransferDestinations = []; + private List Tours = []; + + private TourFormModel newTour = new(); + private IBrowserFile? uploadedFile; + private string UploadStatus = string.Empty; + + private bool IsEditing = false; + private Guid? EditingTourId = null; + + + protected override async Task OnInitializedAsync() + { + TransferDestinations = (await TransferDataService.GetDestinationsAsync()).ToList(); + Tours = (await TourService.GetAllAsync()).ToList(); + } + + private void EditTour(TourInfo tour) + { + newTour = new TourFormModel + { + TransferDestinationId = tour.TransferDestinationId, + Name = tour.Title, + Description = tour.FancyDescription, + ImageBytes = null, + ImageFileName = null + }; + + IsEditing = true; + EditingTourId = tour.Id; + UploadStatus = string.Empty; + } + + private void CancelEdit() + { + newTour = new TourFormModel(); + uploadedFile = null; + IsEditing = false; + 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) + { + 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; + } + + if (IsEditing && EditingTourId.HasValue) + { + var updatedTour = new TourInfo + { + Id = EditingTourId.Value, + TransferDestinationId = newTour.TransferDestinationId, + Title = newTour.Name, + FancyDescription = newTour.Description, + CoverImageUrl = "" // assume your service handles image URL logic + }; + + await TourService.UpdateAsync(updatedTour, uploadedFile); + } + else + { + var tourToCreate = new TourInfo + { + TransferDestinationId = newTour.TransferDestinationId, + Title = newTour.Name, + FancyDescription = newTour.Description, + CoverImageUrl = newTour.ImageFileName + }; + + await TourService.CreateAsync(tourToCreate, uploadedFile); + } + + // Reset form + newTour = new TourFormModel(); + uploadedFile = null; + IsEditing = false; + EditingTourId = null; + UploadStatus = string.Empty; + + Tours = (await TourService.GetAllAsync()).ToList(); + } + + private void HandleFileChange(InputFileChangeEventArgs e) + { + uploadedFile = e.File; + UploadStatus = $"Selected: {uploadedFile.Name}"; + } + + private async Task DeleteTourAsync(Guid id) + { + await TourService.DeleteAsync(id); + Tours = (await TourService.GetAllAsync()).ToList(); + } + + public class TourFormModel + { + [Required] + public Guid TransferDestinationId { get; set; } + + [Required] + [StringLength(100, ErrorMessage = "Tour name cannot exceed 100 characters.")] + public string Name { get; set; } = string.Empty; + + public string? Description { get; set; } + + public byte[]? ImageBytes { get; set; } + public string? ImageFileName { get; set; } + } + +} + diff --git a/TIAMSharedUI/Shared/Components/BlogComponent.razor b/TIAMSharedUI/Shared/Components/BlogComponent.razor new file mode 100644 index 00000000..134c4624 --- /dev/null +++ b/TIAMSharedUI/Shared/Components/BlogComponent.razor @@ -0,0 +1,81 @@ +@using TIAMWebApp.Shared.Application.Models +@using TIAMWebApp.Shared.Application.Services +@inject BlogService BlogService + +
+

Blog Posts

+

+ Discover the hidden gems and breathtaking landscapes of Hungary! Our blog features inspiring destinations, scenic routes, and must-see spots that invite you to explore the natural beauty of this enchanting country. Whether you're planning your next adventure or simply dreaming of a getaway, let these stories guide your journey. +

+ +@if (posts == null) +{ +

Loading blog posts...

+} +else if (posts.Count == 0) +{ +

No blog posts found.

+} +else +{ + @*
*@ +
+ @foreach (var post in posts) + { +
+
+ @if (!string.IsNullOrEmpty(post.CoverImage)) + { + @post.Title + } +
+
@post.Title
+ @if (!string.IsNullOrEmpty(post.Lead)) + { + +

@post.Lead

+ } + @if (post.Tags?.Count > 0) + { +

+ @string.Join(", ", post.Tags) +

+ } + Read More +
+
+
+ @* +
+
+

@post.Title

+

@post.Tags

+

@post.Lead

+

@post.Id

+
+ by + +
+
+
+
*@ + } + @*
*@ +
+} + +
+ +@code { + [Parameter] public int PreviewNumber { get; set; } = 4; + + private List? posts; + + protected override async Task OnInitializedAsync() + { + posts = (await BlogService.GetAllPostsAsync()).Take(PreviewNumber).ToList(); + } + + + +} diff --git a/TIAMSharedUI/Shared/Components/FooterComponent.razor b/TIAMSharedUI/Shared/Components/FooterComponent.razor index 3e522f92..33fc361e 100644 --- a/TIAMSharedUI/Shared/Components/FooterComponent.razor +++ b/TIAMSharedUI/Shared/Components/FooterComponent.razor @@ -1,11 +1,11 @@  -