SkyLearn-Test/templates/course/course_allocation_view.html
2024-01-07 21:20:58 +01:00

94 lines
3.2 KiB
HTML

{% extends 'base.html' %}
{% block title %}{{ title }} | Learning management system{% endblock title %}
{% block content %}
<div id="input-nav"><a href="{% url 'home' %}" class="primary1">Home</a> Allocation list</div>
{% if request.user.is_superuser %}
<div class="manage-wrap">
<a class="btn btn-primary" href="{% url 'course_allocation' %}"><i class="fas fa-plus"></i>Allocate Now</a>
</div>
{% endif %}
<div class="title-1"><i class="fas fa-tasks"></i>Course Allocations</div>
{% if messages %}
{% for message in messages %}
{% if message.tags == 'error' %}
<div class="alert alert-danger">
<i class="fas fa-exclamation-circle"></i>{{ message }}
</div>
{% else %}
<div class="alert alert-success">
<i class="fas fa-check-circle"></i>{{ message }}
</div>
{% endif %}
{% endfor %}
{% endif %}
<div class="content-center">
<form class="search-form" action="" method="GET">
{{ filter.form }}
<button class="btn btn-light" type="submit">
<i class="fas fa-search"></i> Filter
</button>
</form>
</div>
<div class="table-responsive table-shadow p-0 mt-5">
<table class="table table-light table-striped">
<thead>
<tr>
<th>#</th>
<th>Lecturer</th>
<th>Courses</th>
{% if request.user.is_superuser %}
<th>Action</th>
{% endif %}
</tr>
</thead>
{% for course in filter.qs %}
<tbody>
<tr>
<td> {{ forloop.counter }}.</td>
<td><a href="{{ course.lecturer.get_absolute_url }}">{{ course.lecturer.get_full_name }}</a></td>
<td><div class="flex">{% for i in course.courses.all %}
<div class="flex"><a class="edit-btn" href="{{ i.get_absolute_url }}">{{ i }}</a></div>
{% endfor %}</div>
</td>
{% if request.user.is_superuser %}
<td><div class="update-delete">
<a href="{% url 'edit_allocated_course' pk=course.pk %}" class="update" title="Edit or Update">
<i class="fas fa-edit"></i>
</a>
<a href="{% url 'course_deallocate' pk=course.pk %}" class="delete" title="Deallocate">
<i class="fas fa-trash-alt"></i>
</a>
</div>
</td>
{% endif %}
</tr>
{% empty %}
<tr>
<td></td>
<td></td>
<td>
<span class="text-danger">No Course Allocated.
{% if request.user.is_superuser %}
<a href="{% url 'course_allocation' %}">
<i class="primary" style="font-size: 22px;">
Allocate now
</i>
{% endif %}
</a>
</span>
</td>
<td></td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
{% endblock content %}