{% extends 'base/base.html' %}
{% import 'base/link.html' as link %}
{% block content %}
{{ breadcrumb(active='资料修改')}}
<style>
 .avatar {
     width: 100px;
     height: 100px;
 }
</style>
<div class="row">
    <div class="col-md-3" style="padding-right:0">
        <div class="list-group">
            <a href="{{ url_for('setting.setting')}}" class="list-group-item active">
                个人资料
            </a>
            <a href="{{ url_for('setting.password')}}" class="list-group-item">密码修改</a>
            <a href="{{ url_for('setting.privacy')}}" class="list-group-item">隐私设置</a>
        </div>
    </div>
    <div class="col-md-9">
        <div class="panel panel-default">
            <div class="panel-heading">
                资料修改
            </div>
            <div class="panel-body" style="border-bottom:1px solid #f6e1e1;">
                <form action="{{ url_for('upload.avatar')}}" method="POST" enctype=multipart/form-data>
                    {{ form.hidden_tag() }}
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{{ avatarform.avatar.label }}</label>
                            <div class="col-sm-10">
                                <span>
                                    <img alt="header" class="avatar img-circle" src="{{ link_base.avatar(current_user.infor)}}"/>
                                </span>
                                <span id="show-avatar">
                                </span>
                                {{ avatarform.avatar(class="form-control",onchange="loadFile(event)")}}
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-default btn-sm">确认上传</button>
                            </div>
                        </div>
                    </div>
                </form>
                <form action="{{ url_for('setting.setting')}}" method="POST">
                    {% from 'base/form.html' import forms %}
                    {{ forms(form) }}
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
