This commit is contained in:
jozsef.b@aycode.com 2024-01-10 18:14:52 +01:00
commit 2aa129528f
31 changed files with 4986 additions and 142 deletions

View File

@ -6,6 +6,7 @@ using System.Resources;
using AyCode.Interfaces.StorageHandlers;
using TIAMWebApp.Shared.Application.Utility;
using TIAMWebApp.Shared.Application.Services;
using BlazorAnimation;
namespace TIAMMobileApp
{
@ -55,6 +56,8 @@ namespace TIAMMobileApp
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
builder.Services.AddScoped<IWizardProcessor, WizardProcessor>();
builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Shared.Application.Resources", typeof(Main).Assembly));
builder.Services.Configure<AnimationOptions>(Guid.NewGuid().ToString(), c => { });
return builder.Build();
}
}

View File

@ -32,6 +32,7 @@
</div>
<script src="_framework/blazor.webview.js" autostart="false"></script>
<script src="_content/BlazorAnimation/blazorAnimationInterop.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>

View File

@ -42,7 +42,7 @@ Loading....
logToBrowserConsole = new LogToBrowserConsole(JSRuntime);
//wait for 5 seconds
await Task.Delay(1000);
await Task.Delay(0001);
if (!string.IsNullOrWhiteSpace(userDetailsStr))
{

View File

@ -1,4 +1,5 @@

@using TIAMSharedUI.Shared.Components
<div style="position:fixed; background-color:black; color: white; bottom: 0px; width: 100%;">
<p>AuthComponent: </p><p>Logged in: @IsLoggedIn</p>

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TIAMSharedUI.Shared.Components;
using TIAMWebApp.Shared.Application.Interfaces;
namespace TIAMSharedUI.Pages.Components
@ -16,10 +17,21 @@ namespace TIAMSharedUI.Pages.Components
[Inject]
public IComponentUpdateService componentUpdateService { get; set; }
[CascadingParameter]
private PopupMessageBox PopupMessageBox { get; set; } = default!;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
IsLoggedIn = sessionService.IsAuthenticated;
await PopupMessageBox.ShowAsync("AuthComponent", "Initialized", null, null, null, PopupMessageBox.ButtonOk);
if (await PopupMessageBox.Show("Cancel", "Cancel this stuff",
PopupMessageBox.ButtonNo, PopupMessageBox.ButtonYes) == PopupMessageBox.ButtonNo)
{
//Something is cancelled
//args.Cancel = true;
}
componentUpdateService.CallRequestRefresh();
StateHasChanged();
}

View File

@ -342,12 +342,13 @@ namespace TIAMSharedUI.Pages.Components
else if (property.PropertyType == typeof(string) && string.Compare(attrList.CustomDataType, "TransferDestination", true) == 0)
{
editor.OpenComponent<SliderItemSelector>(j);
editor.OpenComponent<SliderItemSelector>(j);
editor.AddAttribute(j++, "OwlId", "owlSelector" + _stepID);
editor.AddAttribute(j++, "OnSliderChanged", EventCallback.Factory.Create<string>(this, result =>
{
LogToBrowserConsole.LogToBC($"Slider changed to {result}");
property.SetValue(Data, result);
LogToBrowserConsole.LogToBC($"Data.Destination = {property.GetValue(Data)}");
LogToBrowserConsole.LogToBC($"bleh: {property.Name} = {property.GetValue(Data)}");
StateHasChanged(); // Add this line to refresh the UI
}));
@ -357,7 +358,10 @@ namespace TIAMSharedUI.Pages.Components
editor.AddAttribute(j++, "NullText", "Slide or type");
editor.AddAttribute(j++, "Text", property.GetValue(Data));
editor.AddAttribute(j++, "TextExpression", lambda);
editor.AddAttribute(j++, "TextChanged", EventCallback.Factory.Create<string>(this, str => { property.SetValue(Data, str); }));
editor.AddAttribute(j++, "TextChanged", EventCallback.Factory.Create<string>(this, str => {
property.SetValue(Data, str);
LogToBrowserConsole.LogToBC($"bleh: {property.Name} = {property.GetValue(Data)}");
}));
editor.CloseComponent();
}

View File

@ -1,4 +1,4 @@
@page "/admin"
@page "/user/admin"
@using TIAMSharedUI.Shared
@using TIAMWebApp.Shared.Application.Models;
@using TIAMWebApp.Shared.Application.Interfaces;
@ -16,26 +16,26 @@
<!--We need to check if the user is owner of a swerviceprovider-->
<div class="container">
<!--App admin-->
<!--App admin-->
<SysAdminComponent></SysAdminComponent>
<!-- App admin end-->
<hr/>
<HotelComponent></HotelComponent>
<SysAdminComponent></SysAdminComponent>
<!-- App admin end-->
<hr />
<!-- Stats admin-->
<div class="row py-3">
<div class=" col-12 col-xl-3">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -85,7 +85,7 @@
</div>
</div>
<div class=" col-12 col-xl-3">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -135,7 +135,7 @@
</div>
</div>
<div class=" col-12 col-xl-3">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -185,7 +185,6 @@
</div>
</div>
<div class=" col-12 col-xl-3">
</div>
</div>
@ -195,8 +194,8 @@
@code {
bool isUserLoggedIn;
int userType = 0;
@ -206,11 +205,11 @@
protected override async Task OnInitializedAsync()
{
base.OnInitialized();
base.OnInitialized();
}
}

View File

@ -0,0 +1,198 @@
@page "/user/hoteladmin"
@using TIAMSharedUI.Shared
@using TIAMWebApp.Shared.Application.Models;
@using TIAMWebApp.Shared.Application.Interfaces;
@layout AdminLayout
@inject IPopulationStructureDataProvider DataProvider
@inject ISupplierService SupplierService
@inject IUserDataService UserDataService
<PageTitle>Transfer</PageTitle>
<div class="text-center m-5">
<h1>Dashboard</h1>
<h2 style="font-size:small">Have a nice day!</h2>
</div>
<!--We need to check if the user is owner of a swerviceprovider-->
<div class="container">
<HotelComponent Id="@Id"></HotelComponent>
<!-- Stats admin-->
<hr />
<div class="row py-3">
<div class=" col-12 col-xl-3">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
<span class="fw-bold text-body">Panel title</span>
<p class="text-muted mb-0">Subtitle</p>
</div>
<div>
<h6 class="mb-0"> <a href="#">All details</a> </h6>
</div>
</div>
</div>
<div class="card-body card-admin-body py-2 px-4">
<div class="d-flex flex-row mb-4 pb-2">
<div class="flex-fill">
<h5 class="bold">Some info</h5>
<p class="text-muted"> Budapest, Dózsa György út 35, 1146</p>
</div>
<div>
<!--img class="align-self-center img-fluid"
src="https://mdbcdn.b-cdn.net/img/Photos/Horizontal/E-commerce/Products/6.webp" width="250"-->
</div>
</div>
<ul id="progressbar-1" class="mx-0 mt-0 mb-5 px-0 pt-0 pb-4">
<li class="step0 active" id="step1">
<span style="margin-left: 22px; margin-top: 12px;">PLACED</span>
</li>
<li class="step0 active text-center" id="step2"><span>WAITING FOR PICK UP</span></li>
<li class="step0 text-muted text-end" id="step3">
<span style="margin-right: 22px;">FINISHED</span>
</li>
</ul>
<div class="d-flex flex-row mb-4 pb-2">
<h4> Some <span class="small text-muted"> conclusion </span></h4>
</div>
</div>
<div class="card-footer py-2 px-4">
<div class="d-flex justify-content-between">
<a href="#!">Modify</a>
<div class="border-start h-100"></div>
</div>
</div>
</div>
</div>
<div class=" col-12 col-xl-3">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
<span class="fw-bold text-body">Panel title</span>
<p class="text-muted mb-0">Subtitle</p>
</div>
<div>
<h6 class="mb-0"> <a href="#">All details</a> </h6>
</div>
</div>
</div>
<div class="card-body card-admin-body py-2 px-4">
<div class="d-flex flex-row mb-4 pb-2">
<div class="flex-fill">
<h5 class="bold">Some info</h5>
<p class="text-muted"> Budapest, Dózsa György út 35, 1146</p>
</div>
<div>
<!--img class="align-self-center img-fluid"
src="https://mdbcdn.b-cdn.net/img/Photos/Horizontal/E-commerce/Products/6.webp" width="250"-->
</div>
</div>
<ul id="progressbar-1" class="mx-0 mt-0 mb-5 px-0 pt-0 pb-4">
<li class="step0 active" id="step1">
<span style="margin-left: 22px; margin-top: 12px;">PLACED</span>
</li>
<li class="step0 active text-center" id="step2"><span>WAITING FOR PICK UP</span></li>
<li class="step0 text-muted text-end" id="step3">
<span style="margin-right: 22px;">FINISHED</span>
</li>
</ul>
<div class="d-flex flex-row mb-4 pb-2">
<h4> Some <span class="small text-muted"> conclusion </span></h4>
</div>
</div>
<div class="card-footer py-2 px-4">
<div class="d-flex justify-content-between">
<a href="#!">Modify</a>
<div class="border-start h-100"></div>
</div>
</div>
</div>
</div>
<div class=" col-12 col-xl-3">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
<span class="fw-bold text-body">Panel title</span>
<p class="text-muted mb-0">Subtitle</p>
</div>
<div>
<h6 class="mb-0"> <a href="#">All details</a> </h6>
</div>
</div>
</div>
<div class="card-body card-admin-body py-2 px-4">
<div class="d-flex flex-row mb-4 pb-2">
<div class="flex-fill">
<h5 class="bold">Some info</h5>
<p class="text-muted"> Budapest, Dózsa György út 35, 1146</p>
</div>
<div>
<!--img class="align-self-center img-fluid"
src="https://mdbcdn.b-cdn.net/img/Photos/Horizontal/E-commerce/Products/6.webp" width="250"-->
</div>
</div>
<ul id="progressbar-1" class="mx-0 mt-0 mb-5 px-0 pt-0 pb-4">
<li class="step0 active" id="step1">
<span style="margin-left: 22px; margin-top: 12px;">PLACED</span>
</li>
<li class="step0 active text-center" id="step2"><span>WAITING FOR PICK UP</span></li>
<li class="step0 text-muted text-end" id="step3">
<span style="margin-right: 22px;">FINISHED</span>
</li>
</ul>
<div class="d-flex flex-row mb-4 pb-2">
<h4> Some <span class="small text-muted"> conclusion </span></h4>
</div>
</div>
<div class="card-footer py-2 px-4">
<div class="d-flex justify-content-between">
<a href="#!">Modify</a>
<div class="border-start h-100"></div>
</div>
</div>
</div>
</div>
<div class=" col-12 col-xl-3">
</div>
</div>
</div>
@code {
string Id = "2312-32132121-32123";
bool isUserLoggedIn;
int userType = 0;
protected override async Task OnInitializedAsync()
{
base.OnInitialized();
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TIAMSharedUI.Pages.User
{
public partial class Home
{
}
}

View File

@ -8,7 +8,7 @@
<div class="row py-3">
<div class=" col-12 col-xl-3">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -51,7 +51,7 @@
</div>
</div>
<div class=" col-12 col-xl-3">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -100,7 +100,7 @@
</div>
</div>
<div class=" col-12 col-xl-3">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -129,7 +129,7 @@
</div>
<div class=" col-12 col-xl-3">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -179,7 +179,7 @@
</div>
</div>
<div class=" col-12">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>

View File

@ -13,7 +13,7 @@
<div class="container">
<div class="row">
<div class=" col-12 col-xl-6">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>

View File

@ -13,6 +13,10 @@
@inject IStringLocalizer<TIAMResources> localizer
<PageTitle>Transfers</PageTitle>
<div class="text-center m-5">
<h1>Transfer management</h1>
<h2 style="font-size:small">Manage transfers here!</h2>
</div>
<div class="container">
<div class="row">

View File

@ -0,0 +1,5 @@
<h3>PermissionsComponent</h3>
@code {
}

View File

@ -0,0 +1,5 @@
<h3>ProfileComponent</h3>
@code {
}

View File

@ -5,8 +5,14 @@
@layout AdminLayout
@inject NavigationManager navigationManager
<div class="text-center m-5">
<h1>Service provider: @Id</h1>
<h2 style="font-size:small">Manage your service provider details</h2>
</div>
<div class="container">
<HotelComponent Id="@Id"></HotelComponent>
<ProfileComponent></ProfileComponent>
<PermissionsComponent></PermissionsComponent>
</div>
@code {

View File

@ -1,4 +1,6 @@
@using TIAMSharedUI.Shared

@using BlazorAnimation
@using TIAMSharedUI.Shared
@using TIAMWebApp.Shared.Application.Models;
@using TIAMWebApp.Shared.Application.Interfaces;
@ -6,44 +8,49 @@
<div class="row py-3">
<div class=" col-12 col-xl-3 col-lg-6">
<div class="card card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
<span class="fw-bold text-body">Transfers</span>
<p class="text-muted mb-0">Summary</p>
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
<span class="fw-bold text-body">Transfers</span>
<p class="text-muted mb-0">Summary</p>
</div>
<div>
<h6 class="mb-0"> <a href="#">All details</a> </h6>
</div>
</div>
<div>
<h6 class="mb-0"> <a href="#">All details</a> </h6>
</div>
<div class="card-body card-admin-body py-2 px-4">
<h5>New</h5>
<p>12</p>
<h5>Scheduled</h5>
<p>182</p>
<h5>Finished</h5>
<p>15665</p>
</div>
<div class="card-footer py-2 px-4">
<div class="d-flex justify-content-between">
<a href="#!">Manage transgfers</a>
<div class="border-start h-100"></div>
</div>
</div>
</div>
<div class="card-body card-admin-body py-2 px-4">
<h5>New</h5>
<p>12</p>
<h5>Scheduled</h5>
<p>182</p>
<h5>Finished</h5>
<p>15665</p>
</div>
<div class="card-footer py-2 px-4">
<div class="d-flex justify-content-between">
<a href="#!">Manage transgfers</a>
<div class="border-start h-100"></div>
</div>
</div>
</div>
</Animation>
</div>
<div class=" col-12 col-xl-3 col-lg-6">
<div class="card card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -77,9 +84,11 @@
</div>
</div>
</div>
</Animation>
</div>
<div class=" col-12 col-xl-3 col-lg-6">
<div class="card card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -113,9 +122,11 @@
</div>
</div>
</div>
</Animation>
</div>
<div class=" col-12 col-xl-3 col-lg-6">
<div class="card card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -151,9 +162,11 @@
</div>
</div>
</div>
</Animation>
</div>
<div class="col-12 col-xl-6">
<div class="card card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -192,9 +205,11 @@
</div>
</div>
</div>
</Animation>
</div>
<div class="col-12 col-xl-6">
<div class="card card-admin" style="border-radius: 16px;">
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
<div class="card mycard card-admin" style="border-radius: 16px;">
<div class="card-header py-2 px-4">
<div class="d-flex justify-content-between align-items-center">
<div>
@ -266,10 +281,7 @@
</div>
</div>
</div>
</Animation>
</div>

View File

@ -53,23 +53,27 @@
</NavLink>
</li>
}
@if(hasProperty)
else
{
@if (hasProperty)
{
<li class="nav-item">
<NavLink class="nav-link" href="user/admin">
@localizer.GetString("NavMenu.Admin")
</NavLink>
</li>
}
<li class="nav-item">
<NavLink class="nav-link" href="admin">
@localizer.GetString("NavMenu.Admin")
</NavLink>
<div class="btn-nav">
<NavLink class="btn btn-primary btn-small navbar-btn" href="#" @onclick="SignOut">
@localizer.GetString("NavMenu.SignOut")
</NavLink>
</div>
</li>
}
<li class="nav-item">
<div class="btn-nav">
<NavLink class="btn btn-primary btn-small navbar-btn" href="#" @onclick="SignOut">
@localizer.GetString("NavMenu.SignOut")
</NavLink>
</div>
</li>
</ul>
</div>

View File

@ -0,0 +1,31 @@
<DxPopup @ref="MessageBoxPopup"
HeaderText="@HeaderText"
ShowFooter="true"
ShowCloseButton="true"
CloseOnEscape="true"
CloseOnOutsideClick="false"
Visible="false"
ZIndex="1000000"
Closed="@PopupClosed">
<BodyContentTemplate>
@(new MarkupString(@MessageHtml))
</BodyContentTemplate>
<FooterContentTemplate>
<DxButton RenderStyle="ButtonRenderStyle.Primary"
Text="@(ButtonText[0])"
Visible="@(ButtonVisible[0])"
Click="@Button0Click" />
<DxButton RenderStyle="ButtonRenderStyle.Secondary"
Text="@(ButtonText[1])"
Visible="@(ButtonVisible[1])"
Click="@Button1Click" />
<DxButton RenderStyle="ButtonRenderStyle.Secondary"
Text="@(ButtonText[2])"
Visible="@(ButtonVisible[2])"
Click="@Button2Click" />
<DxButton RenderStyle="ButtonRenderStyle.Secondary"
Text="@(ButtonText[3])"
Visible="@(ButtonVisible[3])"
Click="@Button3Click" />
</FooterContentTemplate>
</DxPopup>

View File

@ -0,0 +1,187 @@
using DevExpress.Blazor;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components;
namespace TIAMSharedUI.Shared.Components
{
/// <summary>
/// A MessageBox (async and synchronized) component to provide a way to show informational messages.
/// </summary>
public partial class PopupMessageBox
{
public static readonly string ButtonOk = "Ok";
public static readonly string ButtonCancel = "Cancel";
public static readonly string ButtonYes = "Yes";
public static readonly string ButtonNo = "No";
[Inject]
private NavigationManager Navigation { get; set; } = default!;
/// <summary>
/// The MessageBox popup. This is a DxPopup that is called asynchronously so it is displayed and control returns
/// to the caller.
/// </summary>
private DxPopup MessageBoxPopup { get; set; } = default!;
/// <summary>
/// The header text in the MessageBox popup. This is a MarkupString so do not put any user entered text in this!
/// </summary>
private string HeaderText { get; set; } = string.Empty;
/// <summary>
/// The message text in the MessageBox popup. This is a MarkupString so do not put any user entered text in this!
/// </summary>
private string MessageHtml { get; set; } = string.Empty;
private Func<string, object?, Task>? OnClick { get; set; }
private Func<object?, Task>? OnClose { get; set; }
/// <summary>
/// This is passed in in the call to Show() and returned in the calls to OnClick() and OnClose().
/// </summary>
private object? Tag { get; set; }
/// <summary>
/// Used to make the popup synchronous.
/// </summary>
private TaskCompletionSource<string> _taskCompletionSource = new();
/// <inheritdoc />
public PopupMessageBox()
{
ButtonVisible = new bool[4];
ButtonText = new string[4];
}
/// <summary>
/// Displays the MessageBox. This is a static object so you can't create multiple instances of it. But you
/// can create another instance in the onClick or onCLose calls as the existing instance will be closed by
/// then.
/// </summary>
/// <param name="header">The header text in the message box.</param>
/// <param name="message">The main message in the message box. This is treated as html
/// so use <code>HttpUtility.HtmlEncode()</code> on any user generated text in the message.</param>
/// <param name="tag">Caller defined data returned in the OnClick/OnClose calls.</param>
/// <param name="onClick">Will call this method when a button is clicked. Passes the button text as the parameter.</param>
/// <param name="onClose">Will call this when the popup is closed. Including after receiving the onClick call.</param>
/// <param name="buttonText">The text for the button(s). Can be 1 .. 4 buttons.</param>
/// <returns>The task for the underlying DxPopup.ShowAsync() call.</returns>
public Task<bool> ShowAsync(string header, string message, object? tag, Func<string, object?, Task>? onClick,
Func<object?, Task>? onClose, params string[] buttonText)
{
HeaderText = header;
MessageHtml = message;
Tag = tag;
OnClick = onClick;
OnClose = onClose;
if (buttonText.Length == 0 || buttonText.Length > 4)
throw new ArgumentOutOfRangeException(nameof(buttonText), "Must have between 1 and 4 buttons");
Array.Clear(ButtonVisible);
Array.Clear(ButtonText);
for (var index = 0; index < buttonText.Length; index++)
{
ButtonVisible[index] = true;
ButtonText[index] = buttonText[index];
}
StateHasChanged();
return MessageBoxPopup.ShowAsync();
}
/// <summary>
/// Displays the MessageBox. Then when click OK, goes to the url. This is a static object so you can't create
/// multiple instances of it.
/// </summary>
/// <param name="header">The header text in the message box.</param>
/// <param name="message">The main message in the message box. This is treated as html
/// so use <code>HttpUtility.HtmlEncode()</code> on any user generated text in the message.</param>
/// <param name="url">The url to navigate to when click OK.</param>
/// <returns>The task for the underlying DxPopup.ShowAsync() call.</returns>
public Task<bool> ShowThenRedirectAsync(string header, string message, string url)
{
return ShowAsync(header, message, null,
(_, _) =>
{
Navigation.NavigateTo(url, false);
return Task.CompletedTask;
},
null, PopupMessageBox.ButtonOk);
}
/// <summary>
/// Displays the MessageBox synchronously. Returns the text of the button clicked. This is a static object
/// so you can't create multiple instances of it. But you can create another instance when it returns as the
/// existing instance will be closed by then.
/// </summary>
/// <param name="header">The header text in the message box.</param>
/// <param name="message">The main message in the message box. This is treated as html
/// so use <code>HttpUtility.HtmlEncode()</code> on any user generated text in the message.</param>
/// <param name="buttonText">The text for the button(s). Can be 1 .. 4 buttons.</param>
/// <returns>The text of the button clicked.</returns>
public Task<string> Show(string header, string message, params string[] buttonText)
{
_taskCompletionSource = new TaskCompletionSource<string>();
ShowAsync(header, message, null, ShowOnClick, null, buttonText);
// we return the Task from the TaskCompletionSource that is not completed
return _taskCompletionSource.Task;
}
private Task ShowOnClick(string buttonText, object? tag)
{
// as this is called from the OnClick handler, the popup has been closed.
// sets the TaskCompletionSource to completed. Any await-ers will now complete
_taskCompletionSource.SetResult(buttonText);
return Task.FromResult(_taskCompletionSource);
}
private string[] ButtonText { get; }
private bool[] ButtonVisible { get; }
private async Task Button0Click(MouseEventArgs arg)
{
// need to close before calling OnClick because OnClick may call ShowAsync again
await MessageBoxPopup.CloseAsync();
if (OnClick != null)
await OnClick.Invoke(ButtonText[0], Tag);
}
private async Task Button1Click(MouseEventArgs arg)
{
// need to close before calling OnClick because OnClick may call ShowAsync again
await MessageBoxPopup.CloseAsync();
if (OnClick != null)
await OnClick.Invoke(ButtonText[1], Tag);
}
private async Task Button2Click(MouseEventArgs arg)
{
// need to close before calling OnClick because OnClick may call ShowAsync again
await MessageBoxPopup.CloseAsync();
if (OnClick != null)
await OnClick.Invoke(ButtonText[2], Tag);
}
private async Task Button3Click(MouseEventArgs arg)
{
// need to close before calling OnClick because OnClick may call ShowAsync again
await MessageBoxPopup.CloseAsync();
if (OnClick != null)
await OnClick.Invoke(ButtonText[3], Tag);
}
private async Task PopupClosed(PopupClosedEventArgs arg)
{
// need to close before calling OnClose because OnClose may call ShowAsync again
await MessageBoxPopup.CloseAsync();
if (OnClose != null)
await OnClose.Invoke(Tag);
}
}
}

View File

@ -24,17 +24,20 @@
<main>
<article class="content">
@Body
<CascadingValue Value=PopupMessageBox>
@Body
</CascadingValue>
</article>
</main>
<div class="footer">
</div>
<PopupMessageBox @ref="PopupMessageBox" />
</div>
@code {
public PopupMessageBox PopupMessageBox { get; private set; } = default!;
}

View File

@ -35,8 +35,7 @@
<NavLink class="nav-link" href="counter">
Counter
</NavLink>
</div-->
</div-->
<div class="nav-item px-3">
<NavLink class="nav-link" href="transfer">
@ -69,7 +68,7 @@
@code {
private bool collapseNavMenu = true;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()

View File

@ -14,9 +14,20 @@
border-bottom: 1px solid;
}
</style>
<input type="hidden" id="PassingToJavaScript1" value=@OwlId>
#@OwlId .item {
height: 30vh;
overflow-y: hidden;
vertical-align: middle;
align-content: center;
}
#@OwlId .item img {
display: block;
width: 100%;
height: auto;
}
</style>
<div id=@OwlId class="owl-carousel owl-theme">
@ -41,19 +52,15 @@
</div>
</div>
</div>
<h3>Please type an address or swipe to select from preset destinations!</h3>
<p>Please type an address or swipe to select from preset destinations!</p>
@{
var jsOwlId = OwlId;
logToBrowserConsole.LogToBC(jsOwlId);
}
<script>
var JsOwlId;
var owlId = p1;
console.log('OwlId is ' + owlId);
var owl = $('#' + owlId);
//var owl = $('#' + JsOwlId);
var i = 0;
@ -71,7 +78,7 @@
};*/
$(document).ready(function () {
/*$(document).ready(function () {
owl.owlCarousel({
@ -89,7 +96,26 @@
owl.trigger("to.owl.carousel", owl.maximum)
});
});*/
function InitOwl(id) {
JsOwlId= id;
owl = $('#' + JsOwlId);
owl.owlCarousel({
navigation: true, // Show next and prev buttons
loop: true,
slideSpeed: 300,
paginationSpeed: 400,
items: 1,
itemsDesktop: false,
itemsDesktopSmall: false,
itemsTablet: false,
itemsMobile: false
});
owl.trigger("to.owl.carousel", owl.maximum)
};
function CStoJSCall(dotNetObjRef) {
@ -113,6 +139,11 @@
objRef.invokeMethodAsync("ShowCoordinates", "Hugrabug" + i, itemId);
i++;
};
function setOwlId(id) {
JsOwlId = id;
console.log('SetOwlId called, value is ' + owlId);
};
</script>
@ -136,6 +167,7 @@
protected override void OnParametersSet()
{
logToBrowserConsole.LogToBC($"SliderItemSelector is initialized with OwlId: {OwlId}");
base.OnParametersSet();
}
@ -144,6 +176,8 @@
if(firstRender)
{
var dotNetObjRef = DotNetObjectReference.Create(this);
JSRuntime.InvokeVoidAsync("setOwlId", OwlId);
JSRuntime.InvokeVoidAsync("InitOwl", OwlId);
JSRuntime.InvokeVoidAsync("CStoJSCall", dotNetObjRef);
}

View File

@ -1,12 +1 @@
#owl-selector .item {
height: 30vh;
overflow-y: hidden;
vertical-align: middle;
align-content: center;
}
#owl-selector .item img {
display: block;
width: 100%;
height: auto;
}


View File

@ -29,41 +29,78 @@
Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user/properties">
Properties
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user/transfers">
Transfers
<NavLink class="nav-link" @onclick="()=>expandSysAdminNav = !expandSysAdminNav">
<span class="oi oi-list-rich" aria-hidden="true"></span> System Admin
</NavLink>
</div>
@if (expandSysAdminNav)
{
<hr />
<div class="nav-item px-3">
<NavLink class="nav-link" href="user/admin">
Dashboard
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user/transfers">
Transfers
</NavLink>
</div>
<hr />
}
<div class="nav-item px-3">
<NavLink class="nav-link" href="serviceprovider">
My profile
<NavLink class="nav-link" @onclick="()=>expandHotelAdminNav = !expandHotelAdminNav">
<span class="oi oi-list-rich" aria-hidden="true"></span> Hotel Admin
</NavLink>
</div>
@if (expandHotelAdminNav)
{
<hr />
<div class="nav-item px-3">
<NavLink class="nav-link" href="user/hoteladmin">
Hotel Dashboard
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user/serviceprovider">
Manage
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="serviceprovider">
Public profile
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
My earnings
</NavLink>
</div>
<hr />
}
<div class="nav-item px-3">
<NavLink class="nav-link" href="account">
Account
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="services">
My services
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
My earnings
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="settings">
Settings
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="#" @onclick="SignOut">
Signout
@ -74,7 +111,8 @@
@code {
private bool collapseNavMenu = true;
private bool expandSysAdminNav = false;
private bool expandHotelAdminNav = false;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()

View File

@ -12,7 +12,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Blazor" Version="23.2.3" />
<PackageReference Include="Blazor.AnimateOnScroll" Version="1.1.0" />
<PackageReference Include="BlazorAnimation" Version="2.2.0" />
<PackageReference Include="DevExpress.Blazor" Version="23.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.0" />
</ItemGroup>

View File

@ -0,0 +1,12 @@
document.getElementsByTagName("head")[0].insertAdjacentHTML(
"beforeend",
"<link rel=\"stylesheet\" href=\"_content/BlazorAnimation/animate.css\" />");
var AnimatedComponent = AnimatedComponent || {};
AnimatedComponent.animationend = function (element, dotNet) {
element.addEventListener('animationend', function(e) {
if(e.target === this)dotNet.invokeMethodAsync("OnAnimationEnd")
});
};

View File

@ -7,6 +7,10 @@ body {
max-width: 100%;
overflow-x: hidden;
background-color: #e7e6f7;
background: url('https://images.unsplash.com/photo-1641326038434-01b0217c18f1?q=80&w=1932&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
background-attachment: fixed;
background-position: center;
background-size: cover;
color: #58457b;
}
@ -57,19 +61,42 @@ select {
border-radius: 16px;
/*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;*/
overflow: hidden;
background-color: #d8dcef;
background-color: rgba( 255, 255, 255, 0.15 );
/*color: #58457b;*/
font-size: small;
}
.mycard {
border-radius: 16px;
/*box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;*/
overflow: hidden;
background: rgba( 255, 255, 255, 0.45 );
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
backdrop-filter: blur( 6px );
-webkit-backdrop-filter: blur( 6px );
border-radius: 10px;
border: 1px solid rgba( 255, 255, 255, 0.18 );
/*color: #58457b;*/
font-size: small;
}
.card .card-body {
padding: 10px;
}
/*My overrides end*/
/*my blazor overrides*/
.dxbl-modal > .dxbl-modal-root > .dxbl-popup > .dxbl-modal-content {
background: rgba( 255, 255, 255, 0.45 );
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
backdrop-filter: blur( 6px );
-webkit-backdrop-filter: blur( 6px );
border-radius: 10px;
border: 1px solid rgba( 255, 255, 255, 0.18 );
}
.dxbl-col {
padding-left:0px;
@ -81,7 +108,7 @@ select {
--dxbl-grid-font-size: 0.75rem !important;
--dxbl-grid-line-height: 1.3 !important;
--dxbl-grid-min-width: 240px;
--dxbl-grid-bg: #e7e6f7;
--dxbl-grid-bg: #ffffff;
--dxbl-grid-color: #58457b;
color: darkslategrey !important;
}

4250
TIAMSharedUI/wwwroot/css/animate.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
using AyCode.Interfaces.StorageHandlers;
using BlazorAnimation;
using Blazored.LocalStorage;
using DevExpress.Blazor;
using Microsoft.AspNetCore.Components.Web;
@ -37,4 +38,5 @@ builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Client.Resour
builder.Services.AddSingleton(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5);
builder.Services.Configure<AnimationOptions>(Guid.NewGuid().ToString(), c => { });
await builder.Build().RunAsync();

View File

@ -36,6 +36,8 @@ namespace TIAMWebApp.Client.Services
}
public async Task<UserSessionModel> IsLoggedInAsync(Guid id)
{
//api call to get user

View File

@ -13,6 +13,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" asp-append-version="true" rel="stylesheet" />
<link href="_content/TIAMSharedUI/css/app.css" rel="stylesheet" />
<link href="_content/TIAMSharedUI/css/animate.css" rel="stylesheet" />
<link href="_content/TIAMSharedUI/css/TourIAm.css" rel="stylesheet" />
<link rel="icon" type="image/png" href="_content/TIAMSharedUI/favicon.png" />
<link href="TIAMWebApp.Client.styles.css" rel="stylesheet" />
@ -33,7 +34,8 @@
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
<script src="_framework/blazor.webassembly.js"></script>
<script src="_content/TIAMSharedUI/blazorAnimationInterop.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>