{% extends "admin/master.html" %}

{% block body %}
    <div class="row">
        <!-- 默认用sm来定义适配性更好一些 -->
        <div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">
            <form action="" class="form-horizontal" method="post">
                <fieldset>
                    {{ form.csrf_token }}
                    <div class="form-group {% if form.username.errors %}has-error{% endif %}">
                        {{ form.username.label(class="col-sm-2 col-sm-offset-2 control-label") }}
                        <div class="col-sm-6">
                            {{ form.username(class='form-control') }}
                            {% if form.username.errors %}
                            <span class="help-block">{{ form.username.errors|first }}</span>
                            {% endif %}
                        </div>
                    </div>

                    <div class="form-group {% if form.password.errors %}has-error{% endif %}">
                        {{ form.password.label(class="col-sm-2 col-sm-offset-2 control-label") }}
                        <div class="col-sm-6">
                            {{ form.password(class='form-control') }}
                            {% if form.password.errors %}
                            <span class="help-block">{{ form.password.errors|first }}</span>
                            {% endif %}
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-offset-4 col-sm-6">
                            <button type="submit" class="btn btn-default">登录</button>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
{% endblock %}
