<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      lang="en"
      metal:use-macro="context/main_template/macros/master"
      i18n:domain="xmldirector.plonecore">
<body>

<metal:main fill-slot="content-core">
    <metal:content-core define-macro="content-core"
        tal:define="result view/validator_content">

        <h2 i18n:translate="">Validator Registry</h2>
        <div>
            <label i18n:translate="">Family</label>: <span tal:content="request/family"/>
            <br/>
            <label i18n:translate="">Name</label>: <span tal:content="request/name"/>
            <br/>
            <a i18n:translate="" href="@@validator-registry">Back to validator registry</a>
            <div id="editor" 
                style="width: 80%; min-height: 100px; height: 450px; max-height: 800px"
                tal:content="result/text"/>
        </div>

        <script type="text/javascript" tal:content="string:var ace_type='${result/ace_type}'"></script>

        <script type="text/javascript">

        if(require === undefined){
          require = function(reqs, torun){
            'use strict';
            return torun(window.ace);
          };
        }

        require([
          'ace/ace'
          ], function(ace){

            $(document).ready(function() {        
                var editor = ace.edit('editor');
                editor.setTheme("ace/theme/chrome");
                editor.getSession().setMode("ace/mode/" + ace_type);
                editor.setShowPrintMargin(false);
                editor.setReadOnly(true);
            });
        });        
        </script>

  </metal:content-core>
</metal:main>

</body>
</html>

