{% extends "generic-base.html" %}

    {% block title %}IMPACT - Edit Departments{% endblock %}

{% block content %}

    <main role="main" class="content">
	<div class="container">

    <div class="form-group">
    <div class="card generic-card-card">
        <div class="card-header generic-card-header">
            <h4>My Departments</h4>
        </div>
        <table class="table table-bordered table-container mb-0">
            <thead class="generic-table-card">
            <tr>
                <th style="width: 90%;">Department</th>
                <th style="width: 10%; text-align: center">Leave</th>
            </tr>

            </thead>
            <tbody>
            {% for faculty in user_faculties %}

                <tr>
                    <td style="width: 90%;vertical-align: middle;">{{ faculty.faculty_name }}</td>
                    <td style="width: 10%;vertical-align: middle;" align="center">
                        {% if faculty != current_user_faculty %}
                            <a href="{% url 'schools:user-leave-department' faculty.id %}"
                                class="btn btn-secondary btn-sm" role="button"><i class="material-icons">remove_circle</i>
                            </a>
                        {% else %}
                            <a href="{% url 'schools:user-leave-department' faculty.id %}"
                                class="btn btn-secondary btn-sm disabled" role="button"><i class="material-icons">remove_circle</i>
                            </a>
                        {% endif %}
                    </td>

                </tr>
            {% empty %}
                <tr>
                <td style="width: 90%;vertical-align: middle;">You are not currently linked with any other Departments</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    </div>


    <div class="form-group">
        <a href="{% url 'schools:user-join-department' %}" class="btn btn-primary" role="button">Join Department</a>
        <a href="{% url 'core_nav:settings' %}" class="btn btn-primary" role="button">Done</a>
    </div>

    </div>


    </main>

{% endblock %}

