{% extends "base.html" %}

{% block title %}
    批量导入分组
{% endblock %}

{% block content %}
    <div class="section section-breadcrumbs section-breadcrumbs-backend">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <h1>批量导入分组</h1>
                </div>
            </div>
        </div>
    </div>
    <div class="btn-toolbar">
        <div class="btn-group">
            {% url "addgroupurl" as theaddgroupurl %}
            <a class="btn btn-default {%if request.path = theaddgroupurl%} active {%endif%}" href={{ theaddgroupurl }}><span class="glyphicon glyphicon-edit"></span>新建分组</a>
            {% url "listgroupurl" as thelistgroupurl %}
            <a class="btn btn-default {%if request.path = thelistgroupurl%} active {%endif%}" href={{ thelistgroupurl }}><span class="glyphicon glyphicon-list"></span>分组列表</a>
            {% url "addxlsgroupurl" as theaddxlsgroupurl %}
            <a class="btn btn-default {%if request.path = theaddxlsgroupurl%} active {%endif%}" href={{ theaddxlsgroupurl }}><span class="glyphicon glyphicon-list"></span>批量导入</a>
            {% url "removegroupsurl" as theremovegroupsurl %}
            <a class="btn btn-default {%if request.path = theremovegroupsurl%} active {%endif%}" href={{ theremovegroupsurl }}><span class="glyphicon glyphicon-list"></span>批量删除</a>
        </div>
    </div>

    <hr/>
	<h2 class="col-md-offset-2">批量导入分组</h2>
	<br/>
	<h4 class="col-md-offset-1">请导入符合格式的XLS文件</h4>
	<h4 class="col-md-offset-1">XLS格式模板<a href='/static/class.xls'>下载</a></h4>
	<hr/>
    <form class="form-horizontal" role="form" action={% url "addxlsgroupurl" %} method="POST" enctype="multipart/form-data">
    {% csrf_token %}

        {% for item in form %}
            <div class="form-group">
                <label class="control-label col-md-2">{{item.label}}</label>
                <div class="col-md-2">
                    {{item}}
                </div>
                <div class="col-md-offset-2 col-md-10">
                    {{item.errors}}
                </div>
            </div>
        {% endfor %}

        <div class="col-md-offset-2">
                <button type="submit" class="btn btn-danger btn-sm">导 入</button>
        </div>
    </form>
{% endblock %}
