Index.cshtml 8.7 KB

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