SkyLearn-Test/templates/accounts/student_list.html
2024-10-13 01:06:35 +03:00

91 lines
3.7 KiB
HTML

{% extends 'base.html' %}
{% load i18n %}
{% block title %}{{ title }} | {% trans 'Learning management system' %}{% endblock title %}
{% 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 'Students' %}</li>
</ol>
</nav>
<!-- <div id="input-nav"><a href="{% url 'home' %}" class="primary1">Home</a> Students</div> -->
{% if request.user.is_superuser %}
<div class="manage-wrap">
<a class="btn btn-sm btn-primary" href="{% url 'add_student' %}"><i class="fas fa-plus"></i>{% trans 'Add Student' %}</a>
<a class="btn btn-sm btn-primary" target="_blank" href="{% url 'student_list_pdf' %}"><i class="fas fa-download"></i>{% trans 'Download pdf' %}</a> <!--new-->
</div>
{% endif %}
<div class="title-1"><i class="fas fa-user-graduate"></i>{% trans 'Students' %}</div>
<br>
<br>
{% include 'snippets/messages.html' %}
{% include 'snippets/filter_form.html' %}
<div class="table-responsive table-shadow table-light table-striped m-0 mt-4">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>{% trans 'ID No.' %} </th>
<th> {% trans 'Full Name' %} </th>
<th> {% trans 'Email' %} </th>
<th> {% trans 'Program' %} </th>
{% if request.user.is_superuser %}
<th> {% trans 'Action' %} </th>
{% endif %}
</tr>
</thead>
<tbody>
{% for student in filter.qs %}
<tr>
<td> {{ forloop.counter }}.</td>
<td>{{ student.student.username }} </td>
<td><a href="{% url 'profile_single' student.student.id %}">{{ student.student.get_full_name }}</a></td>
<td>{{ student.student.email }} </td>
<td>{{ student.program }}</td>
{% if request.user.is_superuser %}
<td>
<div class="dropdown">
<button class="btn btn-sm" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa fa-ellipsis-vertical"></i>
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="{% url 'student_edit' student.student.pk %}"><i class="unstyled me-2 fas fa-edit"></i>{% trans 'Update' %}</a></li>
<li><a class="dropdown-item" target="_blank" href="{% url 'profile_single' student.student.id %}?download_pdf=1"><i class="unstyled me-2 fas fa-download"></i>{% trans 'Download PDF' %}</a></li>
<li><a class="dropdown-item text-danger" href="{% url 'student_delete' student.pk %}"><i class="unstyled me-2 fas fa-trash-alt"></i>{% trans 'Delete' %}</a></li>
</ul>
</div>
</td>
{% endif %}
{% empty %}
<tr>
<td colspan="6">
<span class="text-danger">
{% trans 'No Student.' %}
{% if request.user.is_superuser %}
<a href="{% url 'add_student' %}">
<i class="primary" style="font-size: 22px;">
{% trans 'Add Student Now.' %}
</i>
{% endif %}
</a>
</span>
</td>
</tr>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock content %}