Index.cshtml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_LayoutHome.cshtml";
  5. }
  6. @using NEducation.Content.Texts;
  7. @using NEducation.Controllers;;
  8. @using NEducation.Models;
  9. @model EbookModel
  10. @section navMenu{
  11. <a href="/Home/" class="nav-link">@Lang.Home</a>
  12. <a href="/Voca/" class="nav-link">@Lang.Vocabulary</a>
  13. <a href="/Grammar/" class="nav-link">@Lang.Grammar</a>
  14. <a href="/Listening/" class="nav-link">@Lang.Listening</a>
  15. @*<a href="/Ebook/" class="nav-link">
  16. @Lang.Ebook
  17. <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
  18. </a>*@
  19. <li class="menu-item-has-children header-menu-link ">
  20. <a href="#" class="">
  21. E-Library
  22. <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
  23. </a>
  24. <ul class="" style=" margin-left: 20px;">
  25. <li><a href="/Ebook/">@Lang.Ebook</a></li>
  26. <li><a href="/Ebook/Video">Children's Video</a></li>
  27. </ul>
  28. </li>
  29. <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
  30. @*<a href="/Music/" class="nav-link">Music</a>*@
  31. }
  32. @section menu{
  33. <a href="/Common" class="header-menu-link ">@Lang.Home</a>
  34. <a href="/Common/Course" class="header-menu-link ">@Lang.Library</a>
  35. <a href="/Voca/" class="header-menu-link ">
  36. @Lang.Vocabulary
  37. </a>
  38. <a href="/Grammar/" class="header-menu-link ">
  39. @Lang.Grammar
  40. </a>
  41. <a href="/Listening/" class="header-menu-link ">
  42. @Lang.Listening
  43. </a>
  44. @*<a href="/Ebook/" class="header-menu-link">
  45. @Lang.Ebook
  46. <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
  47. </a>*@
  48. <li class="menu-item-has-children header-menu-link ">
  49. <a href="#" class="">
  50. E-Library
  51. <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
  52. </a>
  53. <ul class="" style=" margin-left: 20px;">
  54. <li><a href="/Ebook/">@Lang.Ebook</a></li>
  55. <li><a href="/Ebook/Video">Children's Video</a></li>
  56. </ul>
  57. </li>
  58. <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
  59. }
  60. <style>
  61. .button-event {
  62. margin: 10px 0 0 0 !important;
  63. padding: revert;
  64. height: 30px;
  65. min-width: 100px;
  66. width: 100%;
  67. }
  68. .card-show {
  69. margin: 5px;
  70. border-radius: 10px;
  71. }
  72. .nav-justified {
  73. margin-top: 50px;
  74. }
  75. .color-1 {
  76. background: #f26522 !important;
  77. color: white !important;
  78. }
  79. .color-2 {
  80. background: #F39C12 !important;
  81. color: white !important;
  82. }
  83. .color-3 {
  84. background: #ff6a00 !important;
  85. color: white !important;
  86. }
  87. </style>
  88. <form action="@Url.Action("Index", "Ebook")" method="post" id="form-show-event-list">
  89. <input type="hidden" name="id" id="id" value="" />
  90. </form>
  91. <div style="max-width:1200px; margin:auto">
  92. <ul class="nav nav-tabs nav-justified mb-4" role="tablist" style="max-width: 1180px; margin: auto;">
  93. @{
  94. for (int i = 0; i < Model.ebooks.Count; i++)
  95. {
  96. Ebook ebook = Model.ebooks[i];
  97. <li class="nav-item tab-@ebook.id" value="@ebook.id">
  98. <a class="tab-@ebook.id nav-link color" data-toggle="tab" href="#@ebook.name" style="text-transform: uppercase; font-size: 18px;">@ebook.name</a>
  99. </li>
  100. }
  101. }
  102. </ul>
  103. <div class="tab-content">
  104. <div id="@Model.id" class="container tab-pane fade in active show" style=" min-width: 100%; margin: 0; padding: 0; overflow: auto;">
  105. <table class="table table-striped table-bordered table-hover">
  106. <thead>
  107. <tr>
  108. <th scope="col" class="text-center">#</th>
  109. <th scope="col" class="text-center">Menu</th>
  110. <th scope="col" class="text-center">Book</th>
  111. <th scope="col" class="text-center">Description</th>
  112. <th scope="col" class="text-center">Download</th>
  113. </tr>
  114. </thead>
  115. <tbody>
  116. @{
  117. int count = 0;
  118. for (int i = 0; i < Model.now.menus.Count; i++)
  119. {
  120. Menu menu = Model.now.menus[i];
  121. for (int j = 0; j < menu.books.Count; j++)
  122. {
  123. Book book = menu.books[j];
  124. for (int k = 0; k < book.descriptions.Count; k++)
  125. {
  126. Description description = book.descriptions[k];
  127. for (int l = 0; l < description.downloads.Count; l++)
  128. {
  129. Download download = description.downloads[l];
  130. <tr>
  131. <td scope="row" class="text-center">@(count + 1)</td>
  132. <td class="text-center">@menu.name</td>
  133. <td class="text-center">@book.name</td>
  134. <td class="text-center">@description.name</td>
  135. <td class="text-left">
  136. <a href="@download.link">@download.name</a>
  137. </td>
  138. </tr>
  139. count++;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. </tbody>
  146. </table>
  147. </div>
  148. </div>
  149. <script>
  150. $(".nav-link").each(function () {
  151. $(this).removeClass("active");
  152. });
  153. $(".color").each(function () {
  154. $(this).removeClass("color-1");
  155. $(this).removeClass("color-2");
  156. $(this).removeClass("color-3");
  157. });
  158. $(".nav-item").each(function () {
  159. $(this).removeClass("active");
  160. });
  161. $(".tab-@Model.id").addClass("active");
  162. $(".tab-@Model.id").addClass("color-@Model.id");
  163. $(".nav-item").on("click", function (e) {
  164. e.preventDefault();
  165. $(this).addClass("active");
  166. $("#page").val("1");
  167. var id = $(this).attr("value");
  168. $("#id").val(id);
  169. $("#form-show-event-list").submit();
  170. })
  171. $(".edit-event").on("click", function () {
  172. var eventId = $(this).attr("value");
  173. console.log("id: ", eventId);
  174. $(".eventID").val(eventId);
  175. console.log("id con: ", $(".eventID").val());
  176. $("#form-edit-event").submit();
  177. })
  178. </script>
  179. <style>
  180. .pagination-ul {
  181. /*float: right;*/
  182. /* position: absolute; */
  183. /* right: 0; */
  184. margin-top: 20px;
  185. padding-right: 15px;
  186. }
  187. .pagination-active {
  188. background: #4c84ff !important;
  189. color: #ffffff !important;
  190. }
  191. .pagination-disable {
  192. pointer-events: none;
  193. }
  194. </style>
  195. @*<div class="category-post-pagination col-xs-12 pagination-style" style="text-align: center;">
  196. <ul class="pagination clearfix pagination-ul">
  197. <li class="pagination-prev">
  198. <a href="@Url.Action("Approves", "Event", new { page=1, status=status})">‹‹</a>
  199. </li>
  200. <li class="pagination-prev @(page == 1 ? "disabled pagination-disable" : "")">
  201. <a href="@Url.Action("Approves", "Event", new { page=page-1, status=status})">‹</a>
  202. </li>
  203. <li class="current"><a href="@Url.Action("Approves", "Event", new { page=page, status=status})" class="pagination-active">@(page)</a></li>
  204. <li><a href="@Url.Action("Approves", "Event", new { page=page+1, status=status})">@(page+1)</a></li>
  205. <li><a href="@Url.Action("Approves", "Event", new { page=page+2, status=status})">@(page+2)</a></li>
  206. <li><a href="@Url.Action("Approves", "Event", new { page=page+3, status=status})">@(page+3)</a></li>
  207. <li><a href="@Url.Action("Approves", "Event", new { page=page+4, status=status})">@(page+4)</a></li>
  208. <li class="pagination-next ">
  209. <a href="@Url.Action("Approves", "Event", new { page=page+1, status=status})">›</a>
  210. </li>
  211. <li class="pagination-next ">
  212. <a href="@Url.Action("Approves", "Event", new { page=page+1, status=status})">››</a>
  213. </li>
  214. </ul>
  215. </div>*@
  216. </div>