From d62b17573596fcd6e0da729b853131dfbd9bfc1e Mon Sep 17 00:00:00 2001 From: Lambert Wang Date: Wed, 10 Oct 2018 20:02:48 -0700 Subject: [PATCH] Added event specific homepage --- ServerCore/Pages/EventIndex.cshtml | 8 ++++++++ ServerCore/Pages/EventIndex.cshtml.cs | 18 ++++++++++++++++++ ServerCore/Pages/Events/Index.cshtml | 4 +++- ServerCore/Pages/_Layout.cshtml | 13 ++++++++++++- 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 ServerCore/Pages/EventIndex.cshtml create mode 100644 ServerCore/Pages/EventIndex.cshtml.cs diff --git a/ServerCore/Pages/EventIndex.cshtml b/ServerCore/Pages/EventIndex.cshtml new file mode 100644 index 00000000..ffa739ba --- /dev/null +++ b/ServerCore/Pages/EventIndex.cshtml @@ -0,0 +1,8 @@ +@page "/{eventId}" +@model ServerCore.Pages.EventIndexModel +@{ + ViewData["Title"] = "EventIndex"; +} + +

@Model.Event.Name

+ diff --git a/ServerCore/Pages/EventIndex.cshtml.cs b/ServerCore/Pages/EventIndex.cshtml.cs new file mode 100644 index 00000000..87ae08c2 --- /dev/null +++ b/ServerCore/Pages/EventIndex.cshtml.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using ServerCore.ModelBases; + +namespace ServerCore.Pages +{ + public class EventIndexModel : EventSpecificPageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/ServerCore/Pages/Events/Index.cshtml b/ServerCore/Pages/Events/Index.cshtml index 6c5664ae..297f423e 100644 --- a/ServerCore/Pages/Events/Index.cshtml +++ b/ServerCore/Pages/Events/Index.cshtml @@ -29,7 +29,9 @@ @foreach (var item in Model.Events) { - @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.Name) + @Html.DisplayFor(modelItem => item.UrlString) diff --git a/ServerCore/Pages/_Layout.cshtml b/ServerCore/Pages/_Layout.cshtml index 7f4b003f..7f53b3c4 100644 --- a/ServerCore/Pages/_Layout.cshtml +++ b/ServerCore/Pages/_Layout.cshtml @@ -34,7 +34,18 @@ - @(Event?.Name ?? "Microsoft Puzzles") + @if (Event == null) + { + + Microsoft Puzzles + + } + else + { + + @(Event.Name) + + }