{% extends "layout.html" %}
{% block body %}
<h2 class="p-2 text-left display-5">Former workers</h2>
<p>
List of workers who no longer appear to have contracts.
</p>
<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th scope="col">Name</th>
            <th scope="col">Department</th>
            <th scope="col">Last Contract</th>
        </tr>
    </thead>
    <tbody>
        {% for user in  former %}
        <tr>
            <td scope="row">
                <a href="{{ url_for('worker', worker_id=user.id) }}">
		    {%- if user.preferred_name %}
		    {{ user.preferred_name }} ({{ user.name }})
		    {% else %}
		    {{ user.name }}
		    {% endif %}
                </a>
            </td>
	    <td scope="row"> {{ user.department_name }} </td>
	    <td scope="row"> {{ user.updated }} </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}
