From 40fc65820c9ca048f00e360facf35bc037507f6e Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Fri, 17 May 2024 00:56:26 +0200 Subject: [PATCH] (#57) update event card to differ colors depend on status --- .../Components/RadzenEventCard.razor | 46 +++++++++++++++++ .../MiniSpace.Web/Pages/Events/Events.razor | 51 ++----------------- .../Pages/Events/EventsOrganize.razor | 28 +--------- .../Pages/Events/EventsSearch.razor | 32 +++--------- 4 files changed, 57 insertions(+), 100 deletions(-) create mode 100644 MiniSpace.Web/src/MiniSpace.Web/Components/RadzenEventCard.razor diff --git a/MiniSpace.Web/src/MiniSpace.Web/Components/RadzenEventCard.razor b/MiniSpace.Web/src/MiniSpace.Web/Components/RadzenEventCard.razor new file mode 100644 index 000000000..24e89a8a7 --- /dev/null +++ b/MiniSpace.Web/src/MiniSpace.Web/Components/RadzenEventCard.razor @@ -0,0 +1,46 @@ +@using MiniSpace.Web.DTO +@inject NavigationManager NavigationManager + + + + + Name + @(Event.Name) + + + Status + @switch (Event.Status) + { + case "Published": + @Event.Status + break; + case "Archived": + @Event.Status + break; + default: + @Event.Status + break; + } + + + + + Start date + @(Event.StartDate.ToLocalTime().ToString(dateFormat)) + + + End date + @(Event.EndDate.ToLocalTime().ToString(dateFormat)) + + +
+
+ +@code +{ + [Parameter] + public EventDto Event { get; set; } + + private const string dateFormat = "dd/MM/yyyy HH:mm"; +} diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Events.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Events.razor index c728a2e12..92b594267 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Events.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Events.razor @@ -2,6 +2,7 @@ @using MiniSpace.Web.Areas.Students @using MiniSpace.Web.DTO @using MiniSpace.Web.Areas.Events +@using MiniSpace.Web.Components @using MiniSpace.Web.Pages.Events.Dialogs @using Radzen @using DialogOptions = Radzen.DialogOptions @@ -30,30 +31,7 @@ } @@ -65,30 +43,7 @@ } diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsOrganize.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsOrganize.razor index 39a79e17f..31390f846 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsOrganize.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsOrganize.razor @@ -1,6 +1,7 @@ @page "/events/organize" @using MiniSpace.Web.Areas.Events @using MiniSpace.Web.Areas.Students +@using MiniSpace.Web.Components @using MiniSpace.Web.DTO @using MiniSpace.Web.DTO.Wrappers @using MiniSpace.Web.Models.Events @@ -48,30 +49,7 @@ @@ -85,8 +63,6 @@ } @code { - private const string dateFormat = "dd/MM/yyyy HH:mm"; - private SearchOrganizerEventsModel searchOrganizerEventsModel = new() { Name = "", diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsSearch.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsSearch.razor index d928ce3b2..fdf011728 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsSearch.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsSearch.razor @@ -2,6 +2,7 @@ @using MiniSpace.Web.Areas.Identity @using MiniSpace.Web.Areas.Events @using MiniSpace.Web.Areas.Students +@using MiniSpace.Web.Components @using MiniSpace.Web.DTO @using MiniSpace.Web.DTO.Wrappers @using MiniSpace.Web.Models.Events @@ -35,44 +36,23 @@ @if (pageInitialized && totalElements != 0) { - } @if (pageInitialized && totalElements != 0) { - }