{% extends 'adminlte/base.html' %}

{% block header_tail %}
    <script type="text/javascript" charset="utf-8" src="/static/plugins/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/static/plugins/ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="/static/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
{% endblock %}

{% block content %}
    <div class="box">
        <!-- form start -->
        <form role="form" method="post">{% csrf_token %}
            <div class="box-body">
                <div class="form-group">
                    <label for="title">标题</label>
                    <input id="title" name="title" class="form-control" value="{{ page.title }}" />
                </div>
                <div class="form-group">
                    <label>正文</label>
                    <script id="editor" type="text/plain" style="width:768px;height:500px;">{{ page.content | safe }}</script>
                </div>
            </div>
            <!-- /.box-body -->

            <div class="box-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </form>
    </div>
    <!-- /.box -->
{% endblock %}

{% block body_tail %}
    <script>
        var ue = UE.getEditor('editor', {
            textarea: 'content',
            customstyle: [
                {
                    tag: 'img',
                    name: 'img',
                    label: '',
                    style: 'width: 100%;'
                }
            ]
        });
    </script>
{% endblock %}
