extends baseLayout

block body
    #edit-paste
        .notice
            i.fa.fa-exclamation-triangle
            p editing a paste
            a.save save
            a.cancel(href="/" ~ paste.id) cancel

        form(method="post", action="/" ~ paste.id ~ "/edit")

            .paste-options
                - string titleValue = paste.title;
                - string defaultExpiresIn = paste.expiresIn;
                - bool hideExpiresIn = true;
                include components/titleEditable

                - import std.array : join;
                input(name="tags", placeholder="tags (separated by commas)", type="text", autocomplete="off", spellcheck="false", class="tags-input", value=paste.tags.join(", "), aria-label="tags")

            #pasty-editors
                - foreach (pasty; paste.pasties)
                    - string pastyTitle = pasty.title;
                    - string pastyLang = pasty.language;
                    - string pastyCode = pasty.code;
                    - string pastyId = pasty.id;
                    - bool autodetect = false;
                    include components/pastyEditor

            include components/addEditorButton

block scripts
    - import pastemyst.data : getVersion;

    script(type="module", src="/static/scripts/pages/editPaste.js?v=#{getVersion()}")
