From 92bda00b054276e09f0f80b01af91bc3fedbd5b6 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 20 May 2017 19:23:42 -0400 Subject: Contests index page --- Project-Unite/Views/Contests/Index.cshtml | 130 ++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 Project-Unite/Views/Contests/Index.cshtml (limited to 'Project-Unite/Views') diff --git a/Project-Unite/Views/Contests/Index.cshtml b/Project-Unite/Views/Contests/Index.cshtml new file mode 100644 index 0000000..b234340 --- /dev/null +++ b/Project-Unite/Views/Contests/Index.cshtml @@ -0,0 +1,130 @@ +@model IEnumerable +@{ + ViewBag.Title = "Contests"; + var open = Model.Where(x => x.IsEnded == false).OrderByDescending(x=>x.StartedAt); + var closed = Model.Where(x => x.IsEnded == true).OrderByDescending(x => x.StartedAt); + +} + +

Contests

+ +

ShiftOS may have a team of developers behind it, but we like getting you guys, the community, involved as well. Contests are a fun and competitive way to get involved with the development of ShiftOS, whether it be through coding, art or anything else!

+ +

Below is a list of all contests.

+ + + +@if (Request.IsAuthenticated) +{ + if (User.Identity.IsDeveloper()) + { + + } +} + +
+ +
+
+

Open contests

+

Below is a list of all open contests.

+ +
+
Contest
+
Actions
+
+ @if(open.Count() < 1) + { +
+
+

Sadly, no contests are open at this time. Please check back later!

+
+
+ } + else + { + foreach(var c in open) + { +
+
+ @Html.ActionLink(c.Name, "ViewContest", "Contests", new { id=c.Id}, null)
+

Started at @c.StartedAt • Ends at @c.EndsAt

+

Rewards: Gold: @c.CodepointReward1st CPGold: @c.CodepointReward2nd CPBronze: @c.CodepointReward3rd CP

+
+
+ @if (!string.IsNullOrWhiteSpace(c.VideoId)) + { + Watch video + } + @if (Request.IsAuthenticated) + { + if (User.Identity.IsDeveloper()) + { + End contest + } + } +
+
+ + } + } + +
+
+

Closed contests

+

These contests have been closed and you can no longer enter to win them.

+ +
+
Contest
+
Actions
+
+ @if (closed.Count() < 1) + { +
+
+

No closed contests yet, maybe there's an open one?

+
+
+ } + else + { + foreach (var c in closed) + { +
+
+ @Html.ActionLink(c.Name, "ViewContest", "Contests", new { id = c.Id }, null)
+

Started at @c.StartedAt • Ends at @c.EndsAt

+

Rewards: Gold: @c.CodepointReward1st CPGold: @c.CodepointReward2nd CPBronze: @c.CodepointReward3rd CP

+
+
+ @if (!string.IsNullOrWhiteSpace(c.VideoId)) + { + Watch video + } +
+
+ + } + } + +
+
+
\ No newline at end of file -- cgit v1.2.3