<commit_before><div class="thread-post-form"
    {% if post_box_id %}
        post_box_id="{{ post_box_id }}"
    {% endif %}
>

<div class="form-group row position-relative">
    <input type="hidden" name="csrf_token" value="{{ csrf_token }}" data-ays-ignore="true"/>

    {% if show_title %}
    <span class="edit_thread">
        Title: <input type="text" size="45" placeholder="Title" name="title" id="title" aria-label="Edit thread title" required/>
    </span>
    {% endif %}

</div>
<br/>
{% if show_post %}
    <div style="margin-bottom:10px;" class="form-group row position-relative">
        <div role="button" id="markdown_toggle_{{ post_box_id }}"
        class="markdown-toggle {{ render_markdown?"markdown-active":"markdown-inactive" }} key_to_click" tabindex="0"
        style="margin-right:10px;padding: unset;cursor: pointer; "
        title="Render markdown" onclick="$('#markdown_buttons_{{ post_box_id }}').toggle(); $(this).toggleClass('markdown-active'); $('#markdown_input_{{ post_box_id }}').val($('#markdown_input_{{ post_box_id }}').val() == 0? '1':'0');$('#markdown-info-{{ post_box_id }}').toggleClass('disabled');"><i class="fab fa-markdown fa-2x"></i></div>
        <input type="hidden" name="markdown_status" id="markdown_input_{{ post_box_id }}" value="{{ render_markdown?1:0 }}" />
        <a target=_blank href="https://submitty.org/student/discussion_forum#formatting-a-post-using-markdown/" aria-label="Markdown Info"><i id="markdown-info-{{ post_box_id }}" style="font-style:normal;" class="far fa-question-circle disabled"></i></a>
        &nbsp;&nbsp;
        <span style="display: {{ render_markdown?"block":"none" }}" id="markdown_buttons_{{ post_box_id }}">
            <button type="button" title="Insert a link" onclick="addMarkdownCode(1, $(this).closest('.thread-post-form').find('[name=thread_post_content]'))" class="btn btn-default btn_markdown key_to_click"  tabindex="0">Link <i class="fas fa-link fa-1x"></i></button>
            <button title="Insert a code segment" type="button" onclick="addMarkdownCode(0, $(this).closest('.thread-post-form').find('[name=thread_post_content]'))" class="btn btn-default btn_markdown key_to_click"  tabindex="0">Code <i class="fas fa-code fa-1x"></i></button>
            <button title="Insert bold text" type="button" onclick="addMarkdownCode(2, $(this).closest('.thread-post-form').find('[name=thread_post_content]'))" class="btn btn-default btn_markdown key_to_click"  tabindex="0">Bold <i class="fas fa-bold fa-1x"></i></button>
            <button title="Insert italic text" type="button" onclick="addMarkdownCode(3, $(this).closest('.thread-post-form').find('[name=thread_post_content]'))" class="btn btn-default btn_markdown key_to_click"  tabindex="0">Italics <i class="fas fa-italic fa-1x"></i></button>
        </span>
    {% if show_merge_thread_button and core.getUser().accessGrading() %}
        <a class="btn btn-primary key_to_click" tabindex = "0" id="merge-thread-btn" title="Merge Threads" onclick="$('#merge-threads').css('display', 'block');">Merge Threads</a>
    {% endif %}
    {% if show_lock_date and core.getUser().getGroup() <= 2 %}
        <label id="label_lock_thread" for="lock_thread_date"> Lock Thread Date
            <input class="date_picker" placeholder="Lock Thread Date" name="lock_thread_date" id="lock_thread_date" type="text">
        </label>
        <script>
            $(document).ready(function () {
                        flatpickr(".date_picker", {
                            plugins: [ShortcutButtonsPlugin(
                                    {
                                        button: [
                                            {
                                                label: "Now"
                                            },
                                            {
                                                label: "End of time"
                                            }
                                        ],
                                        label: "or",
                                        onClick: (index, fp) => {
                                            let date;
                                            switch (index) {
                                                case 0:
                                                    date = new Date();
                                                    break;
                                                case 1:
                                                    date = new Date("9998-01-01 00:00:00");
                                                    break;
                                            }
                                            fp.setDate(date, true);
                                        }
                                    }
                                )],
                            allowInput: true,
                            enableTime: true,
                            enableSeconds: true,
                            time_24hr: true,
                            dateFormat: "Y-m-d H:i:S",
                            onReady: (a, b, fp) => {
                              fp.calendarContainer.firstChild.childNodes[1].firstChild.firstChild.setAttribute('aria-label', 'Month');
                              fp.calendarContainer.childNodes[2].childNodes[4].firstChild.setAttribute('aria-label', 'Seconds');
                            }
                        });
            })
        </script><commit_msg>[Refactor:JS] Fix spacing on ThreadPostForm (#5199)<commit_after><div class="thread-post-form"
    {% if post_box_id %}
        post_box_id="{{ post_box_id }}"
    {% endif %}
>

<div class="form-group row position-relative">
    <input type="hidden" name="csrf_token" value="{{ csrf_token }}" data-ays-ignore="true"/>

    {% if show_title %}
    <span class="edit_thread">
        Title: <input type="text" size="45" placeholder="Title" name="title" id="title" aria-label="Edit thread title" required/>
    </span>
    {% endif %}

</div>
<br/>
{% if show_post %}
    <div style="margin-bottom:10px;" class="form-group row position-relative">
        <div role="button" id="markdown_toggle_{{ post_box_id }}"
        class="markdown-toggle {{ render_markdown?"markdown-active":"markdown-inactive" }} key_to_click" tabindex="0"
        style="margin-right:10px;padding: unset;cursor: pointer; "
        title="Render markdown" onclick="$('#markdown_buttons_{{ post_box_id }}').toggle(); $(this).toggleClass('markdown-active'); $('#markdown_input_{{ post_box_id }}').val($('#markdown_input_{{ post_box_id }}').val() == 0? '1':'0');$('#markdown-info-{{ post_box_id }}').toggleClass('disabled');"><i class="fab fa-markdown fa-2x"></i></div>
        <input type="hidden" name="markdown_status" id="markdown_input_{{ post_box_id }}" value="{{ render_markdown?1:0 }}" />
        <a target=_blank href="https://submitty.org/student/discussion_forum#formatting-a-post-using-markdown/" aria-label="Markdown Info"><i id="markdown-info-{{ post_box_id }}" style="font-style:normal;" class="far fa-question-circle disabled"></i></a>
        &nbsp;&nbsp;
        <span style="display: {{ render_markdown?"block":"none" }}" id="markdown_buttons_{{ post_box_id }}">
            <button type="button" title="Insert a link" onclick="addMarkdownCode(1, $(this).closest('.thread-post-form').find('[name=thread_post_content]'))" class="btn btn-default btn_markdown key_to_click"  tabindex="0">Link <i class="fas fa-link fa-1x"></i></button>
            <button title="Insert a code segment" type="button" onclick="addMarkdownCode(0, $(this).closest('.thread-post-form').find('[name=thread_post_content]'))" class="btn btn-default btn_markdown key_to_click"  tabindex="0">Code <i class="fas fa-code fa-1x"></i></button>
            <button title="Insert bold text" type="button" onclick="addMarkdownCode(2, $(this).closest('.thread-post-form').find('[name=thread_post_content]'))" class="btn btn-default btn_markdown key_to_click"  tabindex="0">Bold <i class="fas fa-bold fa-1x"></i></button>
            <button title="Insert italic text" type="button" onclick="addMarkdownCode(3, $(this).closest('.thread-post-form').find('[name=thread_post_content]'))" class="btn btn-default btn_markdown key_to_click"  tabindex="0">Italics <i class="fas fa-italic fa-1x"></i></button>
        </span>
    {% if show_merge_thread_button and core.getUser().accessGrading() %}
        <a class="btn btn-primary key_to_click" tabindex = "0" id="merge-thread-btn" title="Merge Threads" onclick="$('#merge-threads').css('display', 'block');">Merge Threads</a>
    {% endif %}
    {% if show_lock_date and core.getUser().getGroup() <= 2 %}
        <label id="label_lock_thread" for="lock_thread_date"> Lock Thread Date
            <input class="date_picker" placeholder="Lock Thread Date" name="lock_thread_date" id="lock_thread_date" type="text">
        </label>
        <script>
            $(document).ready(() => {
                flatpickr(".date_picker", {
                    plugins: [
                        ShortcutButtonsPlugin({
                            button: [
                                {
                                    label: "Now"
                                },
                                {
                                    label: "End of time"
                                }
                            ],
                            label: "or",
                            onClick: (index, fp) => {
                                let date;
                                switch (index) {
                                    case 0:
                                        date = new Date();
                                        break;
                                    case 1:
                                        date = new Date("9998-01-01 00:00:00");
                                        break;
                                }
                                fp.setDate(date, true);
                            }
                        })
                    ],
                    allowInput: true,
                    enableTime: true,
                    enableSeconds: true,
                    time_24hr: true,
                    dateFormat: "Y-m-d H:i:S",
                    onReady: (a, b, fp) => {
                        fp.calendarContainer.firstChild.childNodes[1].firstChild.firstChild.setAttribute('aria-label', 'Month');
                        fp.calendarContainer.childNodes[2].childNodes[4].firstChild.setAttribute('aria-label', 'Seconds');
                    }
                });
            });
        </script>
{'fraction_non_alphanumeric': 0.15238362836002622, 'fraction_numerical': 0.009365926758452749, 'mean_word_length': 1.8129610115911485, 'pattern_counts': {'":': 4, '<': 91, '<?xml version=': 0, '>': 94, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 50, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4882623', 'n_tokens_mistral': 2923, 'n_tokens_neox': 2770, 'n_words': 514}