Files
Student-Management-System-I…/templates/Hod/staff.html
T
2025-01-10 14:09:32 +05:45

121 lines
3.2 KiB
HTML

{% extends "admin/base_site.html" %}
{% load static %}
{% block content %}
<div class="container p-4">
<!-- Add Staff Button -->
<div class="mb-4">
<a href="{% url 'admin:app_staff_add' %}" class="btn btn-primary">
<i class="fas fa-user-plus"></i> Add New Staff
</a>
</div>
<!-- Staff List Table -->
<table class="table table-striped text-center">
<thead class="thead-dark">
<tr>
<th>S.N</th>
<th>Full Name</th>
<th>Email</th>
<th>Phone</th>
<th>Position</th>
<th>Date of Joining</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for staff in staff_members %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ staff.first_name }} {{ staff.middle_name|default:'' }} {{ staff.last_name }}</td>
<td>{{ staff.email }}</td>
<td>{{ staff.phone }}</td>
<td>{{ staff.position }}</td>
<td>{{ staff.date_of_joining }}</td>
<td>
<!-- View Button -->
<a href="{% url 'admin:app_staff_change' staff.id %}" class="btn btn-info btn-sm">
<i class="fas fa-eye"></i> View
</a>
<!-- Delete Button -->
<a href="{% url 'admin:app_staff_delete' staff.id %}" class="btn btn-danger btn-sm"
onclick="return confirm('Are you sure you want to delete this staff member?');">
<i class="fas fa-trash-alt"></i> Delete
</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="7" class="text-center">No staff members found.</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Custom Styles -->
<style>
.btn {
padding: 6px 12px;
margin: 2px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
.btn-primary {
background-color: #007bff;
color: white;
}
.btn-info {
background-color: #17a2b8;
color: white;
}
.btn-danger {
background-color: #dc3545;
color: white;
}
.btn:hover {
opacity: 0.8;
}
/* Table Styling */
.table {
width: 100%;
border-collapse: collapse;
}
.table th, .table td {
padding: 12px;
border: 1px solid #dee2e6;
}
.table thead th {
background-color: #343a40;
color: white;
}
.table-striped tbody tr:nth-of-type(odd) {
background-color: #f8f9fa;
}
.table-responsive {
overflow-x: auto;
}
td,th {
white-space: nowrap;
}
/* Print-Friendly Styles */
@media print {
.container {
padding: 0;
}
.table th, .table td {
padding: 8px;
}
.btn {
display: none;
}
}
/* Container Padding */
.container {
padding: 20px;
}
</style>
{% endblock %}