{% extends 'base.html' %}
{% load static %}
{% block content %}
{% include 'profile/header.html' %}
{% include 'profile/drawer.html' %}

<br />
<br />

<br />
<br />

<div class="container mt-5 animate__animated animate__delay-0.1s animate__fadeIn">
    <!-- اطلاعات شخص -->
    <div class="card mb-4 shadow-lg rounded border-primary">
        <div class="card-body">


            <div >
                {% if person.person_private_info.pic %}
                <img src="{{person.person_private_info.pic.url}}" alt="تصویر" class="d-flex float-right rounded-circle" width="80px" height="80px">
                {% else %}
                <img src="{% static 'media\users\default_profile.png' %}" alt="تصویر پیش‌فرض" width="80" height="80" class="d-flex float-right rounded-circle" />
                 {% endif %} 
            </div> 

            <h4 class="card-title text-primary">
                <strong>نام:</strong> {{ person.user.first_name }} {{ person.user.last_name }}
            </h4>
            <p class="card-text">
                <strong>کد ملی:</strong> {{ person.national_code }}
            </p>
            <p class="card-text">
                <strong>سردوشی:</strong> {{ sardoshi }}
            </p>
        </div>
    </div>
    
    <!-- لیست کارنامه‌ها -->
    <h4 class="mb-4 text-center">لیست کارنامه‌ها</h4>
    <div class="table-responsive shadow-lg rounded-lg overflow-hidden">
        <table class="table table-striped text-center table-bordered">
            <thead class="table-dark">
                <tr>
                    <th>بازه زمانی</th>
                    <th>مشاهده</th>
                </tr>
            </thead>
            <tbody>
                {% for card in report_cards %}
                    <tr>
                        
                        <td> {{ card.title.date}} </td>
                        <td>
                            <a href="{% url 'report_card_finaly' person.id %}?card_id={{ card.id }}" class="btn btn-info btn-sm">
                                مشاهده کارنامه
                            </a>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}
