{% extends "admin/base_site.html" %}
{% load staticfiles i18n admin_urls django_simple_tags %}


{% block extrastyle %}
{{block.supper}}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "django-msms-admin/css/django-msms-admin.css" %}" />
<script type="text/javascript" src="{% static "jquery3/jquery.js" %}"></script>
<script type="text/javascript" src="{% static "django-msms-admin/js/django-msms-admin.js" %}"></script>
{% endblock %}



{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{opts.verbose_name}}</a>
&rsaquo; {{title}}
</div>
{% endblock %}
{% endif %}


{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}

{% block content %}
{% block object-tools %}{% endblock %}
<div id="content-main">
    <form>
        <div>
            <fieldset class="module aligned">
                <div class="form-row cascade-select-field-subclass_model">
                    {% if error_message %}<ul class="errorlist"><li>{{error_message}}</li></ul>{% endif %}
                    <div class="cascade-select">
                        <label class="required" for="id_subclass_model">类型</label>
                        {% if subclasses|length > 1 %}
                        <select class="cascade-select-level-1">
                            <option value="0">--------</option>
                            {% for item in subclasses %}
                            <option value="{{forloop.counter}}">{{item.title}}</option>
                            {% endfor %}
                        </select>
                        {% endif %}
                        {% for item1 in subclasses %}
                        <select class="cascade-select-level-2 cascade-select-level-2-{{forloop.counter}}" name="subclass_model">
                            <option value="0">--------</option>
                            {% for item2 in item1.children %}
                            {% if item1.children|length > 1%}<optgroup label="{{item2.title}}">{% endif %}
                                {% for item3 in item2.children %}
                                <option value="{{item3|get_model_fullname}}" description="{{item3.cascade_select_description}}" image="{{item3.cascade_select_image}}">{{item3|get_model_verbose_name}}</option>
                                {% endfor %}
                            {% if item1.children|length > 1%}</optgroup>{% endif %}
                            {% endfor %}
                        </select>
                        {% endfor %}
                    </div>
                </div>
                <div class="form-row cascade-select-field-description">
                    <div>
                        <label for="id_subclass_model">描述</label>
                        <p class="cascade-select-field-description-content"></p>
                    </div>
                </div>
                <div class="form-row cascade-select-field-image">
                    <div>
                        <label for="id_subclass_model">预览图</label>
                        <img class="cascade-select-field-image-content" src="" />
                    </div>
                </div>
                <div class="submit-row">
                    <input type="submit" value="创建" class="default" name="_save">
                </div>
            </fieldset>
        </div>
    </form>
</div>
{% endblock %}

