<form action="/admin/robots" method="post">
	<!-- Page header -->
    {capture name="buttons"}
	    <button class="btn btn-sm btn-primary" type="submit" name="action" value="save"><i class="icon-file-plus me-2"></i>{general:save}</button>
    {/capture}

    {capture name="breadcrumb"}
		<a href="{$adminUrl}/robots" class="breadcrumb-item">{$title}</a>
    {/capture}

    {capture name="showBy"}
    {/capture}

    {include file="components/page-header.tpl" buttons=$smarty.capture.buttons breadcrumb=$smarty.capture.breadcrumb showBy=$smarty.capture.showBy}
	<!-- /page header -->
    
    <div class="content">	
        <div class="row">
        	<div class="col-md-12">
                <div class="card">
                    <textarea id="codeEditor" name="robots" cols="102" rows="25" class="code" wrap="off">{$robots_txt|escape}</textarea>
                </div>
        	</div>
        </div>
    </div>
</form>

    {if isset($message_success)}<span id="savedMessage" onclick="new Noty({ text: '{$message_success}', type: 'success', timeout: 1500  }).show();"></span>{/if}
    {if isset($message_error)}<span id="writeError" onclick="new Noty({ text: '{$message_error}', type: 'error', timeout: 1500  }).show();"></span>{/if}

  
    <script type="text/javascript" src="/admin/assets/js/codemirror/codemirror.js"></script>
    <script>
        
       $(document).ready(function () {
            {if isset($message_error)} $('#writeError').click();{/if}
            {if isset($message_success)} $('#savedMessage').click();{/if}
        });
        
        var editor = CodeMirror.fromTextArea(document.getElementById("codeEditor"), {
            lineNumbers: true,
            matchBrackets: true,
            mode: "mixed",
            indentUnit: 4,
            indentWithTabs: true,
            enterMode: "keep",
            tabMode: "shift"
        });
        editor.setSize('100%','420px');
    </script>
    
    
 
    
    
    
    
    