extends baseLayout

block body
    #home
        #drop-area.hidden
            p drop text files here

        .paste-options
            - string titleValue = "";
            - static if (is(typeof(paste)))
                - titleValue = paste.title;
            - string defaultExpiresIn = "never";
            - bool hideExpiresIn = false;
            include components/titleEditable

            - if (session.loggedIn)
                input(name="tags", placeholder="tags (separated by commas)", type="text", autocomplete="off", spellcheck="false", class="tags-input", aria-label="tags")

        #pasty-editors
            - static if (is(typeof(paste)))
                - foreach (pasty; paste.pasties)
                    - string pastyTitle = pasty.title;
                    - string pastyLang = pasty.language;
                    - string pastyCode = pasty.code;
                    - string pastyId = "";
                    - bool autodetect = true;
                    include components/pastyEditor
            - else
                - string pastyTitle = "";
                - string pastyLang = user.defaultLang;
                - string pastyCode = "";
                - string pastyId = "";
                - bool autodetect = true;
                include components/pastyEditor

        include components/addEditorButton

        .paste-options-bottom
            .paste-buttons
                a#create-paste create paste

                #encrypt-options.hidden
                    input(type="password", id="encrypt-password", placeholder="password", aria-label="password")
                    p make sure to use a strong password!
                    p it's impossible to get your paste back if you forget the password! unless you have a lot of time (and can keep the universe alive while you do it)

            .paste-options-bottom-options
                div.tooltip
                    span.tooltip-text encrypts the paste with a password
                    input(type="checkbox", id="encrypt")
                    label(for="encrypt") encrypt
                - if (session.loggedIn)
                    div.tooltip
                        span.tooltip-text only you can view the paste
                        input(type="checkbox", id="private")
                        label(for="private") private
                    div.tooltip
                        span.tooltip-text will be displayed on your public profile
                        input(type="checkbox", id="public")
                        label(for="public") show on my profile
                    div.tooltip
                        span.tooltip-text won't be associated with your account so it won't be on your private or public profile
                        input(type="checkbox", id="anonymous")
                        label(for="anonymous") anonymous

        //- this is used for detecting when the .paste-options-bottom is in fixed position to apply different styles
        .paste-options-bottom-1px

        form#paste-create-form-hidden(action="/paste", method="post")
            input(type="text", name="title")
            input(type="text", name="tags")
            input(type="text", name="expiresIn")
            input(type="checkbox", name="isPrivate")
            input(type="checkbox", name="isPublic")
            input(type="checkbox", name="isAnonymous")
            input(type="text", name="pasties")
            input(type="checkbox", name="encrypt")
            input(type="text", name="password")
            input(type="submit")

block scripts
    - import pastemyst.data : getVersion;

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