<!DOCTYPE html>
<html lang=fr>
    <head>
        % include('head.html')
        <script src="/assets/scripts/newform.js" defer></script>
    </head>
    <body>
        <form id=post-snippet name=post-snippet action="/new" method=POST accept-charset=utf-8>
            <textarea spellcheck=false placeholder="\\
            % include('howto.txt')
" name=code autofocus required>{{code}}</textarea>
            <input type=hidden name=parentid value="{{parentid}}">

            <div class="controls">
                <input class="control" list=maxusage-presets type="number" min="0" title="Nombre d'utilisation maximum : 0 ou 10, ect." placeholder="Nombre d'utilisation maximum : 0 ou 10, ect." name=maxusage>
                <datalist id=maxusage-presets>
                    <option value="0">
                    <option value="2">
                    <option value="10">
                    <option value="100">
                </datalist>

                <input pattern="[0-9dhms]+" list=durations-preset placeholder="Expiration : 0 ou 1d1h1m1s" class="control" title="Expiration : 0 ou 1d1h1m1s" name=lifetime>
                <datalist id=durations-preset>
                    <option value="0">
                    <option value="7d">
                    <option value="1d">
                    <option value="6h">
                    <option value="1h">
                    <option value="10m">
                </datalist>

                <select class="control" title="Langage" name=lang>
                    <option disabled>Langage</option>
                    % for _, lang in languages:
                    % if lang == default_language:
                        <option value="{{lang}}" selected>{{lang.title()}}</option>
                    % else:
                        <option value="{{lang}}">{{lang.title()}}</option>
                    % end
                    % end
                </select>

                <button class="control" title="Enregistrer" type=submit>
                    % include('svg.html', name='new')
                </button>
            </div>
        </form>
    </body>
</html>
