{% extends "admin/cms/page/plugin/change_form.html" %}
{% load staticfiles %}

{% block extrahead %}
    {{ block.super }}
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/codemirror.css">

    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/codemirror.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/mode/xml/xml.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/mode/htmlmixed/htmlmixed.js"></script>

    <script type="text/javascript">
        (function(){
            var $ = django.jQuery;
            $(document).ready(function(){
                $('textarea#id_body').each(function(idx, el){
                    CodeMirror.fromTextArea(el, {
                        lineNumbers: true,
                        mode: 'htmlmixed',
                        lineWrapping: true
                    });
                });
            });
        })();        
    </script>
{% endblock %}