From 70c63c6ccd79adab9d1cb5897fb14024be33960b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sun, 24 Jan 2021 18:30:14 +0300 Subject: [PATCH] Extract widgets --- .../Components/AttendeesArea/Default.cshtml | 8 +++++++ .../RegistrationAreaViewComponent.cs | 21 +++++++++++++++++++ .../RegistrationArea/Default.cshtml | 8 +++++++ .../RegistrationAreaViewComponent.cs | 16 ++++++++++++-- .../EventHub.Web/Pages/Events/Detail.cshtml | 17 ++++----------- 5 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 eventhub/src/EventHub.Web/Pages/Events/Components/AttendeesArea/Default.cshtml create mode 100644 eventhub/src/EventHub.Web/Pages/Events/Components/AttendeesArea/RegistrationAreaViewComponent.cs create mode 100644 eventhub/src/EventHub.Web/Pages/Events/Components/RegistrationArea/Default.cshtml diff --git a/eventhub/src/EventHub.Web/Pages/Events/Components/AttendeesArea/Default.cshtml b/eventhub/src/EventHub.Web/Pages/Events/Components/AttendeesArea/Default.cshtml new file mode 100644 index 0000000..f092a88 --- /dev/null +++ b/eventhub/src/EventHub.Web/Pages/Events/Components/AttendeesArea/Default.cshtml @@ -0,0 +1,8 @@ + + + Attendees + + TODO + + + diff --git a/eventhub/src/EventHub.Web/Pages/Events/Components/AttendeesArea/RegistrationAreaViewComponent.cs b/eventhub/src/EventHub.Web/Pages/Events/Components/AttendeesArea/RegistrationAreaViewComponent.cs new file mode 100644 index 0000000..569c114 --- /dev/null +++ b/eventhub/src/EventHub.Web/Pages/Events/Components/AttendeesArea/RegistrationAreaViewComponent.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace EventHub.Web.Pages.Events.Components.AttendeesArea +{ + [Widget] + public class AttendeesAreaViewComponent : AbpViewComponent + { + public AttendeesAreaViewComponent() + { + + } + + public async Task InvokeAsync() + { + return View(); + } + } +} diff --git a/eventhub/src/EventHub.Web/Pages/Events/Components/RegistrationArea/Default.cshtml b/eventhub/src/EventHub.Web/Pages/Events/Components/RegistrationArea/Default.cshtml new file mode 100644 index 0000000..5f94acb --- /dev/null +++ b/eventhub/src/EventHub.Web/Pages/Events/Components/RegistrationArea/Default.cshtml @@ -0,0 +1,8 @@ +@using EventHub.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@inject IHtmlLocalizer L + + + @L["RegisterNow"] + + diff --git a/eventhub/src/EventHub.Web/Pages/Events/Components/RegistrationArea/RegistrationAreaViewComponent.cs b/eventhub/src/EventHub.Web/Pages/Events/Components/RegistrationArea/RegistrationAreaViewComponent.cs index 7460d5d..9ea2854 100644 --- a/eventhub/src/EventHub.Web/Pages/Events/Components/RegistrationArea/RegistrationAreaViewComponent.cs +++ b/eventhub/src/EventHub.Web/Pages/Events/Components/RegistrationArea/RegistrationAreaViewComponent.cs @@ -1,9 +1,21 @@ -using Volo.Abp.AspNetCore.Mvc; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; namespace EventHub.Web.Pages.Events.Components.RegistrationArea { + [Widget] public class RegistrationAreaViewComponent : AbpViewComponent { - + public RegistrationAreaViewComponent() + { + + } + + public async Task InvokeAsync() + { + return View(); + } } } diff --git a/eventhub/src/EventHub.Web/Pages/Events/Detail.cshtml b/eventhub/src/EventHub.Web/Pages/Events/Detail.cshtml index 9b95047..ef549e5 100644 --- a/eventhub/src/EventHub.Web/Pages/Events/Detail.cshtml +++ b/eventhub/src/EventHub.Web/Pages/Events/Detail.cshtml @@ -1,6 +1,8 @@ @page "/events/{url}" @inject IHtmlLocalizer L @using EventHub.Localization +@using EventHub.Web.Pages.Events.Components.AttendeesArea +@using EventHub.Web.Pages.Events.Components.RegistrationArea @using Microsoft.AspNetCore.Mvc.Localization @model EventHub.Web.Pages.Events.Detail @@ -17,18 +19,7 @@ - - - @L["RegisterNow"] - - - - - Attendees - - TODO - - - + @await Component.InvokeAsync(typeof(RegistrationAreaViewComponent)) + @await Component.InvokeAsync(typeof(AttendeesAreaViewComponent))