Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model OJS.Web.Areas.Contests.ViewModels.Contests.ContestCategoryViewModel
- @using Resource = Resources.Areas.Contests.Views.ListByCategory;
- <h3>@Model.CategoryName</h3>
- <div>
- @if (Model.Contests.Any())
- {
- <table class="table table-striped contests-by-category">
- @foreach (var contest in Model.Contests)
- {
- <tr>
- <td>
- <a href="@ContestsHelper.GetUrl(contest.Id, contest.Name)">@contest.Name</a>
- </td>
- @if (!contest.CanBePracticed)
- {
- if (contest.CanBeCompeted && contest.OfficialParticipants > 0)
- {
- <td colspan="2">
- @Html.RouteLink(Resource.Compete, "Contests_compete", new {id = contest.Id, action = GlobalConstants.Index}, new {@class = "btn btn-sm btn-success compete-button"})
- @if (contest.HasContestPassword)
- {
- <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_compete_password"></div>
- }
- @if (contest.HasContestQuestions)
- {
- <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
- }
- @if (contest.ResultsArePubliclyVisible || User.IsAdmin())
- {
- <div class="compete-results">
- <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div>
- <span>@contest.OfficialParticipants</span>
- <a class="btn-sm" href="/Contests/Compete/Results/Simple/@contest.Id">@Resource.Contest_results</a>
- </div>
- }
- </td>
- }
- }
- else
- {
- if (contest.CanBeCompeted && contest.OfficialParticipants > 0)
- {
- <td colspan="2">
- @Html.RouteLink(Resource.Compete, "Contests_compete", new {id = contest.Id, action = GlobalConstants.Index}, new {@class = "btn btn-sm btn-success compete-button"})
- @if (contest.HasContestPassword)
- {
- <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_compete_password"></div>
- }
- @if (contest.HasContestQuestions)
- {
- <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
- }
- @if (contest.ResultsArePubliclyVisible || User.IsAdmin())
- {
- <div class="compete-results">
- <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div>
- <span>@contest.OfficialParticipants</span>
- <a class="btn-sm" href="/Contests/Compete/Results/Simple/@contest.Id">@Resource.Contest_results</a>
- </div>
- }
- </td>
- <td colspan="2">
- @Html.RouteLink(Resource.Practice, "Contests_practice", new { id = contest.Id, action = GlobalConstants.Index }, new { @class = "btn btn-sm btn-primary only-practice-button" })
- @if (contest.HasPracticePassword)
- {
- <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_practice_password"></div>
- }
- @if (contest.HasPracticeQuestions)
- {
- <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
- }
- <div class="results">
- <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div> <span>@contest.PracticeParticipants</span>
- <a class="btn-sm" href="/Contests/Practice/Results/Simple/@contest.Id">@Resource.Practice_results</a>
- </div>
- </td>
- }
- else if (!contest.CanBeCompeted && contest.OfficialParticipants > 0)
- {
- <td>
- @if (contest.ResultsArePubliclyVisible || User.IsAdmin())
- {
- <div class="compete-results">
- <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div>
- <span>@contest.OfficialParticipants</span>
- <a class="btn-sm" href="/Contests/Compete/Results/Simple/@contest.Id">@Resource.Contest_results</a>
- </div>
- }
- </td>
- <td>
- @Html.RouteLink(Resource.Practice, "Contests_practice", new { id = contest.Id, action = GlobalConstants.Index }, new { @class = "btn btn-sm btn-primary only-practice-button" })
- @if (contest.HasPracticePassword)
- {
- <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_practice_password"></div>
- }
- @if (contest.HasPracticeQuestions)
- {
- <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
- }
- <div class="results">
- <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div> <span>@contest.PracticeParticipants</span>
- <a class="btn-sm" href="/Contests/Practice/Results/Simple/@contest.Id">@Resource.Practice_results</a>
- </div>
- </td>
- }
- else if (!contest.CanBeCompeted && contest.OfficialParticipants <= 0)
- {
- <td colspan="2">
- @Html.RouteLink(Resource.Practice, "Contests_practice", new { id = contest.Id, action = GlobalConstants.Index }, new { @class = "btn btn-sm btn-primary only-practice-button" })
- @if (contest.HasPracticePassword)
- {
- <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_practice_password"></div>
- }
- @if (contest.HasPracticeQuestions)
- {
- <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
- }
- <div class="results">
- <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div> <span>@contest.PracticeParticipants</span>
- <a class="btn-sm" href="/Contests/Practice/Results/Simple/@contest.Id">@Resource.Practice_results</a>
- </div>
- </td>
- }
- }
- <td>
- <div class="glyphicon glyphicon-file text-white" title="@Resource.Problems_count"></div> <span>@contest.ProblemsCount</span>
- @if (User.IsAdmin())
- {
- <a href="/Administration/Contests/Edit/@contest.Id"><span class='glyphicon glyphicon-pencil text-primary' title='@Resource.Edit'></span></a>
- <a href="/Administration/Problems/Contest/@contest.Id"><span class='glyphicon glyphicon-list text-primary' title='@Resource.Problems'></span></a>
- }
- </td>
- </tr>
- }
- </table>
- }
- else
- {
- if (Model.SubCategories.Count() != 0)
- {
- <table class="table table-striped">
- @foreach (var subCategory in Model.SubCategories)
- {
- string url;
- if (ViewBag.IsAjax)
- {
- url = string.Format("#!/List/ByCategory/{0}/{1}", subCategory.Id, subCategory.NameUrl);
- }
- else
- {
- url = string.Format("/Contests/List/ByCategory/{0}/{1}", subCategory.Id, subCategory.NameUrl);
- }
- <tr>
- <td>
- <a href="@url" class='subcategory' data-id="@subCategory.Id">@subCategory.Name</a>
- </td>
- </tr>
- }
- </table>
- }
- else
- {
- <p class="lead text-warning">@Resource.Category_is_empty</p>
- }
- }
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement