{% extends 'info/base.html' %}
{% block content %}
    <h1>List of Classes</h1>
    <div class="card mb-3">
            <div class="card-body">
              <div class="table-responsive">
                <table class="table table-bordered text-center" id="dataTable" width="100%" cellspacing="0">
                  <thead>
                    <tr>
                        <th>Class</th>
                        <th>Course</th>
                        <th></th>
                    </tr>
                  </thead>
                  <tbody>
                    {% for ass in teacher1.assign_set.all %}
                    <tr>
                        <td>{{ ass.class_id }}</td>
                        <td>{{ ass.course }}</td>
                        <td>
                            {% if choice == 1 %}
                                <a class="btn btn-primary" href="{% url 't_class_date' ass.id %}" role="button">Enter Attendance</a>
                                <a class="btn btn-warning" href="{% url 't_extra_class' ass.id %}">Extra Class</a>
                                <a class="btn btn-danger" href="{% url 't_student' ass.id %}">View Students</a>

                            {% elif choice == 2 %}
                                <a class="btn btn-primary" href="{% url 't_marks_list' ass.id %}" role="button">Enter Marks</a>
                                <a class="btn btn-danger" href="{% url 't_student_marks' ass.id %}">View Students</a>
                            {% elif choice == 3 %}
                                <a class="btn btn-danger" href="{% url 't_report' ass.id %}">Generate reports</a>
                            {% endif %}

                        </td>
                    </tr>
                    {% empty %}
                            <p>teacher has no courses</p>
                    {% endfor %}

                  </tbody>
                </table>
              </div>
    </div>
{% endblock %}