{% if assigned_user_results %}
    <div class="card mt-4">
        <div class="card-header">
            <h2>Assigned Users</h2>
        </div>
        <div class="card-body">
            <table class="table table-striped table-hover">
                <thead>
                    <tr>
                        <td>Username</td>
                        <td>First Name</td>
                        <td>Last Name</td>
                        <td>Email</td>
                    </tr>
                </thead>
                {% for row in assigned_user_results %}
                    <tr>
                        <td>{{ row.username }}</td>
                        <td>{{ row.first_name }}</td>
                        <td>{{ row.last_name }}</td>
                        <td>{{ row.email }}</td>
                    </tr>
                {% endfor %}
            </table>
        </div>
    </div>
{% endif %}

{% if qa_user_results %}
    <div class="card mt-4">
        <div class="card-header">
            <h2>QA Users</h2>
        </div>
        <div class="card-body">
            <table class="table table-striped table-hover">
                <thead>
                    <tr>
                        <td>Username</td>
                        <td>First Name</td>
                        <td>Last Name</td>
                        <td>Email</td>
                    </tr>
                </thead>
                {% for row in qa_user_results %}
                    <tr>
                        <td>{{ row.username }}</td>
                        <td>{{ row.first_name }}</td>
                        <td>{{ row.last_name }}</td>
                        <td>{{ row.email }}</td>
                    </tr>
                {% endfor %}
            </table>
        </div>
    </div>
{% endif %}

<div class="card mt-4">
    <div class="card-header">
        <h2>Run Sheet</h2>
    </div>
    <div class="card-body">
        {% if rfc_status == 1 %}
            <a href="{% url 'new_change_task' rfc_id %}">Create new Change Task</a>
        {% endif %}
        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <td class="col-md-1">Start</td>
                    <td class="col-md-1">End</td>
                    <td class="col-md-5">Title</td>
                    <td class="col-md-2">Assigned User</td>
                    <td class="col-md-2">QA User</td>
                    <td class="col-md-1">Status</td>
                </tr>
            </thead>
            {% for row in change_task_results %}
                <tr>
                    <td>{{ row.change_task_start_date }}</td>
                    <td>{{ row.change_task_end_date }}</td>
                    <td>
                        {% if row.change_task_status == 1 %}
                            <a href="{% url 'change_task_edit' row.change_task_id %}">{{ row.change_task_title }}</a>
                        {% else %}
                            <a href="{% url 'change_task_information' row.change_task_id %}">{{ row.change_task_title }}</a>
                        {% endif %}
                    </td>
                    <td>{{ row.change_task_assigned_user }}</td>
                    <td>{{ row.change_task_qa_user }}</td>
                    {% if rfc_status == 4 %}
                        <td>
                            {% if row.change_task_status == 1 %}
                                <a href="javascript:void(0)" onclick="change_task_start({{ row.change_task_id }})">{{ row.get_change_task_status_display }}</a>
                            {% elif row.change_task_status == 4 %}
                                <a href="javascript:void(0)" onclick="change_task_finish({{ row.change_task_id }})">{{ row.get_change_task_status_display }}</a>
                            {% else %}
                                {{ row.get_change_task_status_display }}
                            {% endif %}
                        </td>
                    {% else %}
                        <td>{{ row.get_change_task_status_display }}</td>
                    {% endif %}
                </tr>
            {% endfor %}
        </table>
        <div class="alert alert-success">
            Complete Time: {{ change_task_seconds }}
        </div>
    </div>
</div>