<!DOCTYPE html>
<html>
    <head>
        <title>Template Editor</title>
    </head>

    <body>
        <form>
            <select id='template_id' name='template_id' onchange="retrieveTemplate('template_id','template_value')">
                <option value='0'>-- Templates --</option>
                {% for t in templates %}
                <option value='{{ t.id }}'>{{ t.name }}</option>
                {% endfor %}
            </select>&nbsp;&nbsp;
            <input type='text' name='name' id='template_name' />&nbsp;&nbsp;
            <input type='button' name='submit' value='Save' onclick='saveTemplate()' />&nbsp;&nbsp;
            <a href='/index.php/'>Back</a>
            <br />

            <textarea id='template_value' name='template' wrap='hard' cols=100 rows=50></textarea>
        </form>

        <script src='/js/script.js'></script>
    </body>
</html>