{% extends 'lti_app/base.html' %}

{% load static %}

{% block content %}
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb p-1">
            <li class="breadcrumb-item"><a href="{% url 'lti:lms' %}">
                <i class="fas fa-home"></i>
            </a></li>
            <li class="breadcrumb-item"><a href="{% url 'lti:wims' LMS.pk %}">{{ LMS.name }}</a>
            </li>
            <li class="breadcrumb-item active">{{ WIMS.name }}</li>
        </ol>
    </nav>
    
    <table class="table table-striped">
        <tbody>
            <tr>
                <td data-href="{% url 'lti:classes' LMS.pk WIMS.pk %}">{{ WIMS.name }}</td>
                <td><code>{{ WIMS.url }}</code></td>
                <td>
                    <code>{{ request.scheme }}://{{ request.get_host }}{% url 'lti:wims_class' WIMS.pk %}</code>
                </td>
            </tr>
        </tbody>
    </table>

    {% if classes %}
        <div id="filter-container" class="md-form active-cyan-2 mb-3">
            <input id="filter" class="form-control" type="text" placeholder="Search" aria-label="Search">
        </div>
        <table class="table table-striped">
            <thead class="thead-dark">
                <tr>
                    <th scope="col"><i class="fas fa-graduation-cap"></i></th>
                    <th scope="col">Classe</th>
                    <th scope="col">Name</th>
                    <th scope="col">ID LMS</th>
                    <th scope="col">ID WIMS</th>
                </tr>
            </thead>
            <tbody>
                {% for item in classes %}
                    <tr data-href="{% url 'lti:sheets' LMS.pk WIMS.pk item.pk %}">
                        <td><i class="fas fa-caret-down"></i></td>
                        <td>{{ item.pk }}</td>
                        <td>{{ item.name }}</td>
                        <td>{{ item.lms_guid }}</td>
                        <td>{{ item.qclass }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <div class="alert alert-warning" role="alert">
            No class has been created through LTI on this WIMS server.
        </div>
    {% endif %}
{% endblock %}

