improve trainee page

This commit is contained in:
Ross
2023-12-11 10:58:00 +00:00
parent 055840b6a4
commit 66ce7b42ac
2 changed files with 54 additions and 15 deletions
+53 -14
View File
@@ -5,25 +5,64 @@
{% endblock %}
{% block content %}
<a href='{% url "trainees" %}'>All, </a>
<a href='{% url "trainees" %}'>All, </a>
{% for i in "123456"|make_list %}
<a href='{% url "trainees_grade" "ST"|add:i %}'>ST{{i}}</a>{% if not forloop.last %}, {% endif %}
<a href='{% url "trainees_grade" "ST"|add:i %}'>ST{{i}}</a>{% if not forloop.last %}, {% endif %}
{% endfor %}
<h2>
{% if grade %}
{{grade}}
{% endif %}Trainees
<h2>
{% if grade %}
{{grade}}
{% endif %}Trainees
</h2>
<table>
<tr class="header"><th>Name</th><th>Grade</th><th>Email</th><th>Supervisor</th><th>Edit</th></tr>
<table>
<tr class="header"><th>Name</th><th>Grade</th><th>Email</th><th>Supervisor</th><th>Edit</th></tr>
{% for trainee in trainees %}
<tr class="trainee"><td>{{trainee.user.first_name}} {{trainee.user.last_name}}</td><td>{{trainee.grade}}</td><td>{{trainee.user.email}}</td><td>{{trainee.supervisor}}</td><td><a href="{% url 'account_update' trainee.user.username %}">User</a>/<a href="{% url 'account_profile_update' trainee.user.username %}">Profile</a></td></tr>
{% endfor %}
{% for trainee in trainees %}
<tr class="trainee">
<td>{{trainee.user.first_name}} {{trainee.user.last_name}}</td>
<td
{% if not trainee.grade %}
class="no-grade"
{% endif %}
>{{trainee.grade}}{% if not trainee.grade %}
<a href="{% url 'account_profile_update' trainee.user.username %}" class="add-grade">add</a>
{% endif %}
</td>
<td>{{trainee.user.email}}</td>
<td
{% if not trainee.supervisor %}
class="no-supervisor"
{% endif %}
>{{trainee.supervisor}}{% if not trainee.supervisor %}
<a href="{% url 'account_profile_update' trainee.user.username %}" class="add-supervisor">add</a>
{% endif %}
</td>
<td><a href="{% url 'account_update' trainee.user.username %}">User</a>/<a href="{% url 'account_profile_update' trainee.user.username %}">Profile</a></td>
</tr>
{% endfor %}
</table>
<div class="small-gray">Count: {{trainees|length}}</div>
</table>
<div class="small-gray">Count: {{trainees|length}}</div>
<style>
.add-supervisor, .add-grade {
font-size: small;
}
.no-supervisor, .no-grade {
color: red;
opacity: 50%;
}
td {
padding-right: 8px;
}
tr:hover {
box-shadow: 0 0 2px #ccc;
}
</style>
{% endblock %}