Advertisement
themaleem

module_details.html

Jul 14th, 2023 (edited)
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.17 KB | None | 0 0
  1. {% extends "studentregistration/base.html" %}
  2. {% block content %}
  3. {% load static %}
  4. <!-- =======================
  5. Page intro START -->
  6. <section class="bg-blue py-7">
  7. <div class="container">
  8. <div class="row justify-content-lg-between">
  9. <div class="col-lg-8">
  10. <!-- Title -->
  11. <h1 class="text-white">{{module.name}}</h1>
  12. <p class="text-white">{{module.description}}.</p>
  13.  
  14. <!-- Content -->
  15. <ul class="list-inline mb-5">
  16. <li class="list-inline-item h6 me-4 mb-1 mb-sm-0 text-white">
  17. <span class="fw-light">
  18. <i class="fas fa-book text-purple"></i>
  19. Code: </span
  20. >{{module.code}}
  21. </li>
  22. <li class="list-inline-item me-4 mb-1 mb-sm-0">
  23. <ul class="list-inline mb-0">
  24. <li class="list-inline-item ms-2 h6 text-white">
  25. <span class="fw-light"
  26. ><i class="fas fa-star text-purple"> </i> Credit: </span
  27. >{{module.credit}}
  28. </li>
  29. <li class="list-inline-item ms-2 h6 text-white">
  30. <span class="fw-light">
  31. <i class="fas fa-graduation-cap text-purple"></i>
  32. Category: {{module.category}}
  33. </span>
  34. </li>
  35. <li class="list-inline-item h6 mb-0 text-white">
  36. Availability:
  37. {% if module.available %}
  38. <i class="fas fa-lock-open text-success-emphasis"></i>
  39. Open
  40. {% else %}
  41. <i class="fas fa-lock text-danger"></i>
  42. Closed
  43. {% endif %}
  44. </li>
  45. </ul>
  46. </li>
  47. </ul>
  48. </div>
  49.  
  50. <div class="col-lg-3">
  51. <h6 class="text-white lead fw-light mb-3">
  52. <i class="fas fa-user-graduate text-purple me-2"></i>
  53. {{registrations_count}} {% if registrations_count == 1 %} student {% else %} students {% endif %} already enrolled
  54. </h6>
  55. <!-- Button -->
  56. {% if module.available %}
  57.  
  58. {% if user.is_authenticated %}
  59.  
  60. {% if can_register %}
  61.  
  62. {% if has_registration %}
  63. <a href="{% url 'studentregistration:unregister' module.code %}" class="btn btn-danger mb-3 w-100">
  64. Unregister
  65. </a>
  66. {% else %}
  67. <a href="{% url 'studentregistration:register' module.code %}" class="btn btn-purple mb-3 w-100">Register</a>
  68. {% endif %}
  69. {% else %}
  70. <p>You do not belong to a course offering this module.</p>
  71.  
  72. {% endif %}
  73.  
  74. {% else %}
  75. <a href="{% url 'login' %}?next={{ request.get_full_path|urlencode }}" class="btn btn-primary mb-3 w-100">
  76. Login to get started
  77. </a>
  78. {% endif %}
  79. {% else %}
  80. <p>
  81. This module is currently closed to new registrations.
  82. </p>
  83. {% endif %}
  84. </div>
  85. </div>
  86. </div>
  87. </section>
  88. <!-- =======================
  89. Page intro END -->
  90.  
  91.  
  92. <!-- =======================
  93. Page content START -->
  94. <section class="pt-0">
  95. <div class="container">
  96. <div class="row">
  97.  
  98. <!-- Main content START -->
  99. <div class="col-12">
  100. <div class="card shadow rounded-2 p-0 mt-n5">
  101. <!-- Tabs START -->
  102. <div class="card-header border-bottom px-4 pt-3 pb-0">
  103. <ul
  104. class="nav nav-bottom-line py-0"
  105. id="course-pills-tab"
  106. role="tablist"
  107. >
  108. <!-- Tab item -->
  109. <li class="nav-item me-2 me-sm-4" role="presentation">
  110. <button
  111. class="nav-link mb-2 mb-md-0 active"
  112. id="course-pills-tab-1"
  113. data-bs-toggle="pill"
  114. data-bs-target="#course-pills-1"
  115. type="button"
  116. role="tab"
  117. aria-controls="course-pills-1"
  118. aria-selected="true"
  119. >
  120. Student Registrations
  121. </button>
  122. </li>
  123. </ul>
  124. </div>
  125. <!-- Tabs END -->
  126.  
  127. <!-- Tab contents START -->
  128. <div class="card-body p-sm-4">
  129. <div class="tab-content" id="course-pills-tabContent">
  130. {% if user.is_authenticated %}
  131. {% if registrations_count %}
  132. {% if has_registration %}
  133. <div class="row">
  134. {% for registration in registrations %}
  135. <!-- Card item START -->
  136. <div class="col-md-6 col-xxl-4">
  137. <div class=" card bg-transparent border border-2 border-purple h-100">
  138. <!-- Card header -->
  139. <div class="card-header bg-transparent border-bottom d-flex justify-content-between">
  140. <div class="d-sm-flex align-items-center">
  141. <!-- Avatar -->
  142. <div class="avatar avatar-md flex-shrink-0">
  143. <img
  144. class="avatar-img rounded-circle"
  145. src="{{ registration.student.photo.url }}"
  146. alt="avatar"
  147. />
  148. </div>
  149. <!-- Info -->
  150. <div class="ms-0 ms-sm-2 mt-2 mt-sm-0">
  151. <h5 class="mb-0">
  152. <a href="#">
  153. {{registration.student.user.first_name}} {{registration.student.user.last_name}}
  154. </a>
  155. </h5>
  156. <span class="text-body small">
  157. <i class="fas fa-fw fa-map-marker-alt me-1 mt-1"></i>
  158. {{registration.student.city}}, {{registration.student.country}}
  159. </span>
  160. </div>
  161. </div>
  162. </div>
  163.  
  164. <!-- Card footer -->
  165. <div class="card-footer bg-transparent border-top border-purple">
  166. <div class="d-sm-flex justify-content-between align-items-center">
  167. <!-- Rating star -->
  168. <h6 class="mb-2 mb-sm-0">
  169. <i class="bi bi-calendar fa-fw text-purple me-2"></i>
  170. <span class="text-body">Registered on:</span>
  171. {{registration.date}}
  172. </h6>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. <!-- Card item END -->
  178. {% endfor %}
  179. </div>
  180. {% else %}
  181. <p>Register for module to see other registered student</p>
  182. {% endif %}
  183. {% else %}
  184. <p>Yay! You're about to be the first on the module. 🎉🎊</p>
  185. {% endif %}
  186. {% else %}
  187. <p>Login to see other registered student</p>
  188. {% endif %}
  189. </div>
  190. </div>
  191. <!-- Tab contents END -->
  192. </div>
  193. </div>
  194.  
  195. <!-- Main content END -->
  196. </div>
  197. <!-- Row END -->
  198. </div>
  199. </section>
  200. <!-- =======================
  201. Page content END -->
  202. {% endblock %}
  203.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement