1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
@model IEnumerable<Project_Unite.Models.Contest>
@{
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);
}
<h2>Contests</h2>
<p>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!</p>
<p>Below is a list of all contests.</p>
<style>
.text-bronze{
color:#cd7f32;
}
.text-silver{
color:#C0C0C0;
}
.text-gold{
color:#FFD700;
}
</style>
@if (Request.IsAuthenticated)
{
if (User.Identity.IsAdmin())
{
<ul class="nav nav-tabs">
<li><a href="@Url.Action("CreateContest")"><span class="glyphicon glyphicon-plus"></span> Open a contest!</a></li>
</ul>
}
}
<div class="row">
<div class="col-xs-4">
<ul data-tabs="tabs" id="tabs" class="nav nav-pills nav-stacked">
<li class="active"><a href="#c_open" data-toggle="tab"><span class="glyphicon glyphicon-star"></span> Open [@open.Count()]</a></li>
<li><a href="#c_closed" data-toggle="tab"><span class="glyphicon glyphicon-star-empty"></span> Closed [@closed.Count()]</a></li>
</ul>
</div>
<div class="tab-content col-xs-8">
<div class="tab-pane fade in active" id="c_open">
<h3>Open contests</h3>
<p>Below is a list of all open contests.</p>
<div class="row">
<div class="col-xs-8"><strong>Contest</strong></div>
<div class="col-xs-4"><strong>Actions</strong></div>
</div>
@if(open.Count() < 1)
{
<div class="row">
<div class="col-xs-12">
<p><strong><em>Sadly, no contests are open at this time. Please check back later!</em></strong></p>
</div>
</div>
}
else
{
foreach(var c in open)
{
<div class="row">
<div class="col-xs-8">
@Html.ActionLink(c.Name, "ViewContest", "Contests", new { id=c.Id}, null) <br/>
<p>Started at @c.StartedAt • Ends at @c.EndsAt</p>
<p><strong>Rewards: </strong> <em class="text-gold">Gold: @c.CodepointReward1st CP</em> • <em class="text-silver">Silver: @c.CodepointReward2nd CP</em> • <em class="text-bronze">Bronze: @c.CodepointReward3rd CP</em></p>
</div>
<div class="col-xs-4">
@if (!string.IsNullOrWhiteSpace(c.VideoId))
{
<a href="http://youtube.com/[email protected]" class="btn btn-default"><span class="glyphicon glyphicon-hd-video"></span> Watch video</a>
}
@if (Request.IsAuthenticated)
{
if (User.Identity.IsAdmin())
{
<a href="@Url.Action("CloseContest", "Contests", new { id = c.Id })" class="btn btn-danger"><span class="close"></span> End contest</a>
}
}
</div>
</div>
}
}
</div>
<div class="tab-pane fade in" id="c_closed">
<h3>Closed contests</h3>
<p>These contests have been closed and you can no longer enter to win them.</p>
<div class="row">
<div class="col-xs-8"><strong>Contest</strong></div>
<div class="col-xs-4"><strong>Actions</strong></div>
</div>
@if (closed.Count() < 1)
{
<div class="row">
<div class="col-xs-12">
<p><strong><em>No closed contests yet, maybe there's an open one?</em></strong></p>
</div>
</div>
}
else
{
foreach (var c in closed)
{
<div class="row">
<div class="col-xs-8">
@Html.ActionLink(c.Name, "ViewContest", "Contests", new { id = c.Id }, null) <br />
<p>Started at @c.StartedAt • Ends at @c.EndsAt</p>
<p><strong>Rewards: </strong> <em class="text-gold">Gold: @c.CodepointReward1st CP</em> • <em class="text-silver">Silver: @c.CodepointReward2nd CP</em> • <em class="text-bronze">Bronze: @c.CodepointReward3rd CP</em></p>
</div>
<div class="col-xs-4">
@if (!string.IsNullOrWhiteSpace(c.VideoId))
{
<a href="http://youtube.com/[email protected]" class="btn btn-default"><span class="glyphicon glyphicon-hd-video"></span> Watch video</a>
}
</div>
</div>
}
}
</div>
</div>
</div>
|