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

<!-- Title Heading -->
{% block title %}Resources{% endblock title %}

<!-- Start Content Block -->
{% block content %}

<div class="container-fluid">
    <h1>{{section.classroom.subject|upper}} : Assignments</h1>
    <!-- Start: break 4.0 --><br>
    <!-- End: break 4.0 -->
    <!-- Start: Duplicate this -->
    <div>
        <!-- Start: Collapsible Card -->
        {% for assignment in section.assignments.all|dictsortreversed:"created_timestamp" %}
        <div class="shadow card"><a class="btn btn-link text-left card-header font-weight-bold" data-toggle="collapse" aria-expanded="false" aria-controls="collapse-4-{{assignment.pk|slugify}}" href="#collapse-4-{{assignment.pk|slugify}}" role="button">{{assignment.title}}</a>
            <div class="collapse" id="collapse-4-{{assignment.pk|slugify}}">
                <div class="card-body">
                    <div class="alert alert-danger" role="alert"><span><strong>Deadline :&nbsp; {{assignment.deadline|date:"M d, Y"}}</strong></span></div>
                    <p class="m-0">{{assignment.text|linebreaksbr}}</p>
                    <!-- Start: break 4.0 -->
                    <!-- End: break 4.0 -->
                    <hr>
                    <div class="row">
                        <div class="col text-center">
                            {% if assignment.file %}
                            <!-- Start: Split Button Success -->
                            <a class="btn btn-success btn-icon-split" role="button" href="{{assignment.file.url}}" download>
                                <span class="text-white-50 icon">
                                    <i class="fas fa-arrow-circle-down"></i>
                                </span>
                                <span class="text-white text">Download Assignment</span>
                            </a>
                            <!-- End: Split Button Success -->
                            {% endif %}
                        </div>

                        <div class="col text-center">
                            <!-- Start: Split Button Info -->
                            <a class="btn btn-info btn-icon-split" role="button" href="{% url 'students:my_assignment' pk=assignment.pk %}">
                                <span class="text-white-50 icon">
                                    <i class="fas fa-info-circle"></i>
                                </span>
                                <span class="text-white text">Manage Submission</span>
                            </a>
                            <!-- End: Split Button Info -->
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <!-- End: Collapsible Card -->
        <!-- Start: break 4.0 --><br>
        <!-- End: break 4.0 -->
        {% endfor %}
    </div>
    <!-- End: Duplicate this -->
</div>


{% endblock content %}