Advertisement
Guest User

Untitled

a guest
Dec 10th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.19 KB | None | 0 0
  1. @model OJS.Web.Areas.Contests.ViewModels.Contests.ContestCategoryViewModel
  2.  
  3. @using Resource = Resources.Areas.Contests.Views.ListByCategory;
  4.  
  5. <h3>@Model.CategoryName</h3>
  6. <div>
  7. @if (Model.Contests.Any())
  8. {
  9. <table class="table table-striped contests-by-category">
  10. @foreach (var contest in Model.Contests)
  11. {
  12. <tr>
  13. <td>
  14. <a href="@ContestsHelper.GetUrl(contest.Id, contest.Name)">@contest.Name</a>
  15. </td>
  16. @if (!contest.CanBePracticed)
  17. {
  18. if (contest.CanBeCompeted && contest.OfficialParticipants > 0)
  19. {
  20. <td colspan="2">
  21. @Html.RouteLink(Resource.Compete, "Contests_compete", new {id = contest.Id, action = GlobalConstants.Index}, new {@class = "btn btn-sm btn-success compete-button"})
  22.  
  23. @if (contest.HasContestPassword)
  24. {
  25. <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_compete_password"></div>
  26. }
  27.  
  28. @if (contest.HasContestQuestions)
  29. {
  30. <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
  31. }
  32.  
  33. @if (contest.ResultsArePubliclyVisible || User.IsAdmin())
  34. {
  35. <div class="compete-results">
  36. <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div>
  37. <span>@contest.OfficialParticipants</span>
  38. <a class="btn-sm" href="/Contests/Compete/Results/Simple/@contest.Id">@Resource.Contest_results</a>
  39. </div>
  40. }
  41. </td>
  42. }
  43. }
  44. else
  45. {
  46. if (contest.CanBeCompeted && contest.OfficialParticipants > 0)
  47. {
  48. <td colspan="2">
  49. @Html.RouteLink(Resource.Compete, "Contests_compete", new {id = contest.Id, action = GlobalConstants.Index}, new {@class = "btn btn-sm btn-success compete-button"})
  50.  
  51. @if (contest.HasContestPassword)
  52. {
  53. <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_compete_password"></div>
  54. }
  55.  
  56. @if (contest.HasContestQuestions)
  57. {
  58. <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
  59. }
  60.  
  61. @if (contest.ResultsArePubliclyVisible || User.IsAdmin())
  62. {
  63. <div class="compete-results">
  64. <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div>
  65. <span>@contest.OfficialParticipants</span>
  66. <a class="btn-sm" href="/Contests/Compete/Results/Simple/@contest.Id">@Resource.Contest_results</a>
  67. </div>
  68. }
  69. </td>
  70.  
  71. <td colspan="2">
  72. @Html.RouteLink(Resource.Practice, "Contests_practice", new { id = contest.Id, action = GlobalConstants.Index }, new { @class = "btn btn-sm btn-primary only-practice-button" })
  73.  
  74. @if (contest.HasPracticePassword)
  75. {
  76. <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_practice_password"></div>
  77. }
  78.  
  79. @if (contest.HasPracticeQuestions)
  80. {
  81. <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
  82. }
  83.  
  84. <div class="results">
  85. <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div> <span>@contest.PracticeParticipants</span>
  86. <a class="btn-sm" href="/Contests/Practice/Results/Simple/@contest.Id">@Resource.Practice_results</a>
  87. </div>
  88. </td>
  89. }
  90. else if (!contest.CanBeCompeted && contest.OfficialParticipants > 0)
  91. {
  92. <td>
  93. @if (contest.ResultsArePubliclyVisible || User.IsAdmin())
  94. {
  95. <div class="compete-results">
  96. <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div>
  97. <span>@contest.OfficialParticipants</span>
  98. <a class="btn-sm" href="/Contests/Compete/Results/Simple/@contest.Id">@Resource.Contest_results</a>
  99. </div>
  100. }
  101. </td>
  102.  
  103. <td>
  104. @Html.RouteLink(Resource.Practice, "Contests_practice", new { id = contest.Id, action = GlobalConstants.Index }, new { @class = "btn btn-sm btn-primary only-practice-button" })
  105.  
  106. @if (contest.HasPracticePassword)
  107. {
  108. <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_practice_password"></div>
  109. }
  110.  
  111. @if (contest.HasPracticeQuestions)
  112. {
  113. <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
  114. }
  115.  
  116. <div class="results">
  117. <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div> <span>@contest.PracticeParticipants</span>
  118. <a class="btn-sm" href="/Contests/Practice/Results/Simple/@contest.Id">@Resource.Practice_results</a>
  119. </div>
  120. </td>
  121. }
  122. else if (!contest.CanBeCompeted && contest.OfficialParticipants <= 0)
  123. {
  124. <td colspan="2">
  125. @Html.RouteLink(Resource.Practice, "Contests_practice", new { id = contest.Id, action = GlobalConstants.Index }, new { @class = "btn btn-sm btn-primary only-practice-button" })
  126.  
  127. @if (contest.HasPracticePassword)
  128. {
  129. <div class="glyphicon glyphicon-lock text-white" title="@Resource.Has_practice_password"></div>
  130. }
  131.  
  132. @if (contest.HasPracticeQuestions)
  133. {
  134. <div class="glyphicon glyphicon-question-sign text-white" title="@Resource.Has_questions_to_be_answered"></div>
  135. }
  136.  
  137. <div class="results">
  138. <div class="glyphicon glyphicon-user text-white" title="@Resource.Participant_count"></div> <span>@contest.PracticeParticipants</span>
  139. <a class="btn-sm" href="/Contests/Practice/Results/Simple/@contest.Id">@Resource.Practice_results</a>
  140. </div>
  141. </td>
  142. }
  143. }
  144.  
  145. <td>
  146. <div class="glyphicon glyphicon-file text-white" title="@Resource.Problems_count"></div> <span>@contest.ProblemsCount</span>
  147. @if (User.IsAdmin())
  148. {
  149. <a href="/Administration/Contests/Edit/@contest.Id"><span class='glyphicon glyphicon-pencil text-primary' title='@Resource.Edit'></span></a>
  150. <a href="/Administration/Problems/Contest/@contest.Id"><span class='glyphicon glyphicon-list text-primary' title='@Resource.Problems'></span></a>
  151. }
  152. </td>
  153. </tr>
  154. }
  155. </table>
  156. }
  157. else
  158. {
  159. if (Model.SubCategories.Count() != 0)
  160. {
  161. <table class="table table-striped">
  162. @foreach (var subCategory in Model.SubCategories)
  163. {
  164. string url;
  165. if (ViewBag.IsAjax)
  166. {
  167. url = string.Format("#!/List/ByCategory/{0}/{1}", subCategory.Id, subCategory.NameUrl);
  168. }
  169. else
  170. {
  171. url = string.Format("/Contests/List/ByCategory/{0}/{1}", subCategory.Id, subCategory.NameUrl);
  172. }
  173. <tr>
  174. <td>
  175. <a href="@url" class='subcategory' data-id="@subCategory.Id">@subCategory.Name</a>
  176. </td>
  177. </tr>
  178. }
  179. </table>
  180. }
  181. else
  182. {
  183. <p class="lead text-warning">@Resource.Category_is_empty</p>
  184. }
  185. }
  186. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement