{% extends "base.html" %}
{% load static %}
{% block title %}
    用户信息
{% endblock title %}
{% block content %}
    <div class="container">
        <div class="row">
            <div class="col-12">
                <br>
                <div class="col-md-4">
                    用户名:{{ user.username }}
                </div>
                {% if profile.avatar %}
                    <div class="col-md-4">
                        头像
                    </div>
                    <img src="{{ profile.avatar.url }}" styl="max-width: 20%; border-radius: 15%;" class="col-md-4">
                {% else %}
                    <h5 class="col-md-4">
                        暂无头像
                    </h5>
                {% endif %}
                <br>
                <br>
                <form method="post" action="." enctype="multipart/form-data">
                    {% csrf_token %}
                    <div class="form-group">
                        <label for="avatar">上传头像</label>
                        <input type="file" class="form-control-file" name="avatar" id="avatar">
                    </div>
                    <div class="form-group col-md-4">
                        <label for="phone">
                            电话
                        </label>
                        <input type="text" class="form-control" id="phone" name="phone" value="{{ profile.phone }}">
                    </div>
                    <div class="form-group col-md-4">
                        <label for="bio">
                            简介
                        </label>
                        <textarea type="text" class="form-control" id="bio" name="bio" rows="12">
                        {{ profile.bio }}
                    </textarea>
                    </div>
                    <button type="submit" class="btn btn-primary">
                        提交
                    </button>
                </form>
            </div>
        </div>
    </div>
{% endblock content %}