improve trainee page
This commit is contained in:
@@ -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 %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user