{% extends 'EspaceEtudiant/base_etudiant.html' %}
{% load static %}
{% load custom_tag_obj %}
{% block m-title %}Ajouter une photo{% endblock m-title %}
{% load widget_tweaks %}
{% block content %}
<section class="content">
    <div class="container-fluid">
        <!-- Small boxes (Stat box) -->

        <div class="container">
            <div class="card">
                <div class="card-header text-white" style="background: #21618C"><h3 class="card-title">AJOUTER UNE PHOTO</h3></div>
                <div class="card-body login-card-body">
                    <table class="table table-bordered">
                        <tr>
                            <td width="170">
                                {% if user.avatar %}
                                <img src="/media/{{ user.avatar }}" width="160" height="180" border="2">
                                {% else %}
                                <img src="/static/ac-img/user-default2.png" width="160" height="180" border="2">
                                {% endif %}
                            </td>
                            <td>
                                <div class="col-lg-8"><br/>
                                        <form action="#" method="post" enctype="multipart/form-data">
                                          {% csrf_token %}
                                          <input class="form-control" type="file" name="avatar" value="{{ user.avatar }}" required>
                                          <button type="submit" class="btn btn-primary mt-3">Modifier</button>
                                        </form>
                                    <br/>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
              <!-- DONUT CHART --><!-- /.card -->

        </div>

            
    </div>
  </section>

{% endblock content %}

{% block custom_js %}

{% endblock custom_js %}