129 lines
4.6 KiB
HTML
129 lines
4.6 KiB
HTML
{% extends 'base.html' %}
|
|
{% load i18n %}
|
|
{% block title %} {% trans 'My Courses' %} | {% trans 'Learning management system' %}{% endblock title %}
|
|
{% load static %}
|
|
|
|
{% block content %}
|
|
|
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="/">{% trans 'Home' %}</a></li>
|
|
<li class="breadcrumb-item active" aria-current="page">{% trans 'My Courses' %}</li>
|
|
</ol>
|
|
</nav>
|
|
|
|
{% if request.user.is_student %}
|
|
<div class="title-1">{{ student.program.title }}</div>
|
|
{% if student.program.summary %}
|
|
<p>{{ student.program.summary }}</p>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if request.user.is_lecturer %}
|
|
<div class="title-1">{% trans 'My Courses' %}</div>
|
|
{% endif %}
|
|
|
|
{% include 'snippets/messages.html' %}
|
|
|
|
{% if request.user.is_student %}
|
|
<div class="table-responsive p-3 mt-3">
|
|
<h6 class="fw-bold text-primary"><u>{% trans 'Taken Courses:' %}</u></h6>
|
|
<div class="table-shadow">
|
|
<table class="table table-light">
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th> {% trans 'Course Name' %} </th>
|
|
<th> {% trans 'Course Code' %} </th>
|
|
<th> {% trans 'Cr.Hr' %} </th>
|
|
<th> {% trans 'Year' %} </th>
|
|
<th> {% trans 'Semester' %} </th>
|
|
<th> {% trans 'Current Semester' %} </th>
|
|
<th> {% trans 'Taken' %} </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for course in taken_courses %}
|
|
<tr>
|
|
<td>{{ forloop.counter }}.</td>
|
|
<td><a href="{{ course.get_absolute_url }}">
|
|
{{ course.course.title }}</a></td>
|
|
<td>{{ course.course.code }}</td>
|
|
<td>{{ course.course.credit }}</td>
|
|
<td>{{ course.course.year }}</td>
|
|
<td>{{ course.course.semester }}</td>
|
|
<th>
|
|
{% if course.course.is_current_semester == False %}
|
|
<i class="fas fa-times-circle fa-1-5x danger"></i>
|
|
{% else %}
|
|
<i class="fas fa-check-circle"></i>
|
|
{% endif %}
|
|
</th>
|
|
<td class="success">
|
|
<i class="fas fa-check-circle"></i> {% trans 'Taken' %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="table-responsive p-3">
|
|
<h6 class="fw-bold text-primary"><u>{% trans 'All Courses:' %}</u></h6>
|
|
<div class="table-shadow">
|
|
<table class="table table-light">
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th> {% trans 'Course Name' %} </th>
|
|
<th> {% trans 'Course Code' %} </th>
|
|
<th> {% trans 'Cr.Hr' %} </th>
|
|
<th> {% trans 'Year' %} </th>
|
|
<th> {% trans 'Semester' %} </th>
|
|
<th> {% trans 'Current Semester' %} </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for course in courses %}
|
|
<tr>
|
|
<td>{{ forloop.counter }}.</td>
|
|
<td><a href="{{ course.get_absolute_url }}">
|
|
{{ course.title }}</a></td>
|
|
<td>{{ course.code }}</td>
|
|
<td>{{ course.credit }}</td>
|
|
<td>{{ course.year }}</td>
|
|
<td>{{ course.semester }}</td>
|
|
<th>
|
|
{% if course.is_current_semester == False %}
|
|
<i class="fas fa-times-circle fa-1-5x danger"></i>
|
|
{% else %}
|
|
<i class="fas fa-check-circle"></i>
|
|
{% endif %}
|
|
</th>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
{% if courses.paginator.page_range|length > 1 %}
|
|
<div class="content-center">
|
|
<div class="pagination">
|
|
<a href="?page=1">«</a>
|
|
{% for i in courses.paginator.page_range %}
|
|
{% if i == courses.number %}
|
|
<a class="pagination-active" href="?page={{ i }}"><b>{{ i }}</b></a>
|
|
{% else %}
|
|
<a href="?page={{ i }}">{{ i }}</a>
|
|
{% endif %}
|
|
{% endfor %}
|
|
<a href="?page={{ courses.paginator.num_pages }}">»</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endblock content %}
|