@using Microsoft.AspNet.Identity @model Project_Unite.Models.ContestEntry @{ ViewBag.Title = Model.Name; string uvurl = Url.Action("Upvote", new { id = Model.Id }); string dvurl = Url.Action("Downvote", new { id = Model.Id }); if (Model.AuthorId == User.Identity.GetUserId()) { uvurl = "#"; dvurl = "#"; } string uid = User.Identity.GetUserId(); if(Model.Upvotes.FirstOrDefault(x=>x.User==uid) != null) { uvurl = uvurl.Replace("Upvote", "RemoveVote"); } if (Model.Downvotes.FirstOrDefault(x => x.User == uid) != null) { dvurl = dvurl.Replace("Upvote", "RemoveVote"); } }
Submitted by @Html.UserLink(Model.AuthorId) on @Model.PostedAt
@Html.Markdown(Model.Description)
We choose contest winners based on quality of the content and submission, as well as what the community thinks of the submission. If you get a lot of downvotes it is likely you will not win. However, if you are mass-downvoting to make yourself look better to the algorithm, you will be disqualified.
The author of this submission hasn't provided a download.
} @if (Model.Disqualified) {This submission has been disqualified and will not be able to win.
@Model.DisqualifiedReason
} else { if (User.Identity.IsAdmin()) {If this submission didn't meet the criteria for its contest, you may disqualify it using this button.
Disqualify } }