81 lines
4.0 KiB
HTML
81 lines
4.0 KiB
HTML
{% extends 'base.html' %}
|
||
{% load static %}
|
||
|
||
{% block title %}Расписание | Автошкола{% endblock %}
|
||
|
||
{% block content %}
|
||
<div class="container">
|
||
<div class="row mb-4">
|
||
<div class="col">
|
||
<h2 class="text-center mb-4">Расписание занятий</h2>
|
||
</div>
|
||
</div>
|
||
|
||
{% if user.is_authenticated and user.instructor %}
|
||
<div class="row mb-4">
|
||
<div class="col">
|
||
<a href="{% url 'schedule:create' %}" class="btn btn-primary">
|
||
<i class="fas fa-plus me-2"></i>Добавить занятие
|
||
</a>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<div class="row">
|
||
<div class="col">
|
||
<div class="card shadow">
|
||
<div class="card-body">
|
||
{% if lessons %}
|
||
<div class="table-responsive">
|
||
<table class="table table-hover">
|
||
<thead>
|
||
<tr>
|
||
<th>Дата</th>
|
||
<th>Время</th>
|
||
<th>Курс</th>
|
||
<th>Инструктор</th>
|
||
<th>Место</th>
|
||
<th>Студенты</th>
|
||
<th>Действия</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for lesson in lessons %}
|
||
<tr>
|
||
<td>{{ lesson.date|date:"d.m.Y" }}</td>
|
||
<td>{{ lesson.start_time|time:"H:i" }} - {{ lesson.end_time|time:"H:i" }}</td>
|
||
<td>{{ lesson.course.title }}</td>
|
||
<td>{{ lesson.instructor.user.get_full_name }}</td>
|
||
<td>{{ lesson.location }}</td>
|
||
<td>{{ lesson.enrolled_students.count }}/{{ lesson.max_students }}</td>
|
||
<td>
|
||
{% if user.is_authenticated %}
|
||
<a href="{% url 'schedule:detail' lesson.pk %}" class="btn btn-sm btn-primary">
|
||
<i class="fas fa-info-circle"></i>
|
||
</a>
|
||
{% endif %}
|
||
{% if user.is_authenticated and user.instructor == lesson.instructor %}
|
||
<a href="{% url 'schedule:update' lesson.pk %}" class="btn btn-sm btn-warning">
|
||
<i class="fas fa-edit"></i>
|
||
</a>
|
||
<a href="{% url 'schedule:delete' lesson.pk %}" class="btn btn-sm btn-danger">
|
||
<i class="fas fa-trash"></i>
|
||
</a>
|
||
{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{% else %}
|
||
<div class="alert alert-info">
|
||
<i class="fas fa-info-circle me-2"></i>На данный момент нет запланированных занятий.
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endblock %} |