<commit_before><div class="group-blog edit">
    <?php

        echo form_open(null, 'id="post-form"');
        echo '<input type="hidden" name="activeTab" value="' . set_value('activeTab') . '" id="activeTab" />';

    ?>
    <ul class="tabs">
    <?php

        $sActive = $this->input->post('activeTab') == 'tab-title-body' || !$this->input->post('activeTab') ? 'active' : '';

        ?>
        <li class="tab <?=$sActive?>">
            <a href="#" data-tab="tab-title-body" id="tabber-title-body">Title &amp; Body</a>
        </li>
        <?php

        $sActive = $this->input->post('activeTab') == 'tab-meta' ? 'active' : '';

        ?>
        <li class="tab <?=$sActive?>">
            <a href="#" data-tab="tab-meta" id="tabber-meta">Meta</a>
        </li>
        <?php

        if (app_setting('categories_enabled', 'blog-' . $blog->id)) {

            $sActive = $this->input->post('activeTab') == 'tab-categories' ? 'active' : '';

            ?>
            <li class="tab <?=$sActive?>">
                <a href="#" data-tab="tab-categories" id="tabber-categories">Categories</a>
            </li>
            <?php

        }

        if (app_setting('tags_enabled', 'blog-' . $blog->id)) {

            $sActive = $this->input->post('activeTab') == 'tab-tags' ? 'active' : '';

            ?>
            <li class="tab <?=$sActive?>">
                <a href="#" data-tab="tab-tags" id="tabber-tags">Tags</a>
            </li>
            <?php

        }

        if ($associations) {

            $sActive = $this->input->post('activeTab') == 'tab-associations' ? 'active' : '';

            ?>
            <li class="tab <?=$sActive?>">
                <a href="#" data-tab="tab-associations" id="tabber-associations">Associations</a>
            </li>
            <?php

        }

        if (app_setting('gallery_enabled', 'blog-' . $blog->id)) {

            $sActive = $this->input->post('activeTab') == 'tab-gallery' ? 'active' : '';

            ?>
            <li class="tab <?=$sActive?>">
                <a href="#" data-tab="tab-gallery" id="tabber-gallery">Gallery</a>
            </li>
            <?php

        }

        $sActive = $this->input->post('activeTab') == 'tab-seo' ? 'active' : '';

        ?>
        <li class="tab <?=$sActive?>">
            <a href="#" data-tab="tab-seo" id="tabber-seo">SEO</a>
        </li>
    </ul>
    <section class="tabs">
    <?php

        $sActive = $this->input->post('activeTab') == 'tab-title-body' || !$this->input->post('activeTab') ? 'active' : '';

        ?>
        <div class="tab-page tab-title-body <?=$sActive?> fieldset">
            <div class="row">
                <div class="col-md-10">
                <?php

                    //  Title
                    $aField                = array();
                    $aField['key']         = 'title';
                    $aField['label']       = 'Title';
                    $aField['required']    = true;
                    $aField['default']     = isset($post->title) ? $post->title : '';
                    $aField['placeholder'] = 'The title of the post';

                    echo form_field($aField);

                    // --------------------------------------------------------------------------

                    $aField                = array();
                    $aField['key']         = 'slug';
                    $aField['label']       = 'Slug';
                    $aField['default']     = isset($post->slug) ? $post->slug : '';
                    $aField['placeholder'] = 'The post\'s slug, leave blank to auto-generate';

                    echo form_field($aField);

                    // --------------------------------------------------------------------------

                    $aField                = array();
                    $aField['key']         = 'body';
                    $aField['label']       = 'Body';
                    $aField['default']     = isset($post->body) ? $post->body : '';
                    $aField['placeholder'] = 'The body of the post';

                    echo form_field_wysiwyg($aField);

                    // --------------------------------------------------------------------------

                    //  Excerpt
                    if (app_setting('use_excerpts', 'blog-' . $blog->id)) {

                        $aField                 = array();
                        $aField['id']           = 'post_excerpt';
                        $aField['key']          = 'excerpt';
                        $aField['class']        = 'wysiwyg-basic';
                        $aField['label']        = 'Excerpt';
                        $aField['default']      = isset($post->excerpt) ? $post->excerpt : '';
                        $aField['placeholder']  = 'A short excerpt of the post, this will be shown in locations where a ';
                        $aField['placeholder'] .= 'summary is required. If not specified the a truncated version of the main ';
                        $aField['placeholder'] .= 'body will be used instead.';

                        echo form_field_wysiwyg($aField);
                    }

                ?>
                </div>
                <div class="col-md-2">
                    <div id="post-type-area">
                        <strong>Post Type</strong>
                        <select name="type" class="select2" id="post-type">
                        <?php

                            $sDefault = !empty($post->type) ? $post->type : 'PHOTO';

                            foreach ($postTypes as $sValue => $sLabel) {

                                $sSelected = $sDefault == $sValue ? 'selected="selected"' : '';
                                echo '<option value="' . $sValue . '" ' . $sSelected . '>';
                                    echo $sLabel;
                                echo '</option>';
                            }

                        ?>
                        </select>
                        <div class="type-fields" id="post-type-fields-video">
                            <strong>Video URL</strong>
                            <?php

                                $sDefault = !empty($post->video->url) ? $post->video->url : '';

                                echo form_url(
                                    'video_url',
                                    set_value('video_url', $sDefault),
                                    'placeholder="Video Source URL"'
                                );

                                echo form_error('video_url', '<div class="system-alert error">', '</div>');
                            ?>
                            <small>
                                Copy and paste a URL from YouTube or Vimeo.
                            </small>
                        </div>
                        <div class="type-fields" id="post-type-fields-audio">
                            <strong>Audio URL</strong>
                            <?php

                                $sDefault = !empty($post->audio->url) ? $post->audio->url : '';

                                echo form_url(
                                    'audio_url',
                                    set_value('audio_url', $sDefault),
                                    'placeholder="Audio Source URL"'
                                );

                                echo form_error('audio_url', '<div class="system-alert error">', '</div>');
                            ?>
                            <small>
                                Copy and paste a URL for a track on Spotify.
                            </small>
                        </div>
                        <div
                            class="type-fields"
                            id="post-type-fields-photo"
                            data-manager-url="<?=cdnManageUrl('blog', array('_EDIT', 'typePhotoCdnManagerCallback'))?>"
                            data-url-scheme="<?=$this->cdn->url_scale_scheme()?>"
                        >
                            <strong>Featured Image</strong>
                            <?php

                            if ($this->input->post()) {

                                if ($this->input->post('image_id')) {

                                    $sSrc = cdn_scale($this->input->post('image_id'), 500, 500);

                                } else {<commit_msg>Added help modals<commit_after><div class="group-blog edit">
    <?php

        echo form_open(null, 'id="post-form"');
        echo '<input type="hidden" name="activeTab" value="' . set_value('activeTab') . '" id="activeTab" />';

    ?>
    <ul class="tabs">
    <?php

        $sActive = $this->input->post('activeTab') == 'tab-title-body' || !$this->input->post('activeTab') ? 'active' : '';

        ?>
        <li class="tab <?=$sActive?>">
            <a href="#" data-tab="tab-title-body" id="tabber-title-body">Main</a>
        </li>
        <?php

        $sActive = $this->input->post('activeTab') == 'tab-meta' ? 'active' : '';

        ?>
        <li class="tab <?=$sActive?>">
            <a href="#" data-tab="tab-meta" id="tabber-meta">Meta</a>
        </li>
        <?php

        if (app_setting('categories_enabled', 'blog-' . $blog->id)) {

            $sActive = $this->input->post('activeTab') == 'tab-categories' ? 'active' : '';

            ?>
            <li class="tab <?=$sActive?>">
                <a href="#" data-tab="tab-categories" id="tabber-categories">Categories</a>
            </li>
            <?php

        }

        if (app_setting('tags_enabled', 'blog-' . $blog->id)) {

            $sActive = $this->input->post('activeTab') == 'tab-tags' ? 'active' : '';

            ?>
            <li class="tab <?=$sActive?>">
                <a href="#" data-tab="tab-tags" id="tabber-tags">Tags</a>
            </li>
            <?php

        }

        if ($associations) {

            $sActive = $this->input->post('activeTab') == 'tab-associations' ? 'active' : '';

            ?>
            <li class="tab <?=$sActive?>">
                <a href="#" data-tab="tab-associations" id="tabber-associations">Associations</a>
            </li>
            <?php

        }

        if (app_setting('gallery_enabled', 'blog-' . $blog->id)) {

            $sActive = $this->input->post('activeTab') == 'tab-gallery' ? 'active' : '';

            ?>
            <li class="tab <?=$sActive?>">
                <a href="#" data-tab="tab-gallery" id="tabber-gallery">Gallery</a>
            </li>
            <?php

        }

        $sActive = $this->input->post('activeTab') == 'tab-seo' ? 'active' : '';

        ?>
        <li class="tab <?=$sActive?>">
            <a href="#" data-tab="tab-seo" id="tabber-seo">SEO</a>
        </li>
    </ul>
    <section class="tabs">
    <?php

        $sActive = $this->input->post('activeTab') == 'tab-title-body' || !$this->input->post('activeTab') ? 'active' : '';

        ?>
        <div class="tab-page tab-title-body <?=$sActive?> fieldset">
            <div class="row">
                <div class="col-md-10">
                <?php

                    //  Title
                    $aField                = array();
                    $aField['key']         = 'title';
                    $aField['label']       = 'Title';
                    $aField['required']    = true;
                    $aField['default']     = isset($post->title) ? $post->title : '';
                    $aField['placeholder'] = 'The title of the post';

                    echo form_field($aField);

                    // --------------------------------------------------------------------------

                    $aField                = array();
                    $aField['key']         = 'slug';
                    $aField['label']       = 'Slug';
                    $aField['default']     = isset($post->slug) ? $post->slug : '';
                    $aField['placeholder'] = 'The post\'s slug, leave blank to auto-generate';
                    $aField['tip']         = 'The slug is the posts unique identifier which is shown in the URL. Best ';
                    $aField['tip']        .= 'practice dictates that the slug be "pretty", i.e, human readable.';

                    echo form_field($aField);

                    // --------------------------------------------------------------------------

                    $aField                = array();
                    $aField['key']         = 'body';
                    $aField['label']       = 'Body';
                    $aField['default']     = isset($post->body) ? $post->body : '';
                    $aField['placeholder'] = 'The body of the post';

                    echo form_field_wysiwyg($aField);

                    // --------------------------------------------------------------------------

                    //  Excerpt
                    if (app_setting('use_excerpts', 'blog-' . $blog->id)) {

                        $aField                 = array();
                        $aField['id']           = 'post_excerpt';
                        $aField['key']          = 'excerpt';
                        $aField['class']        = 'wysiwyg-basic';
                        $aField['label']        = 'Excerpt';
                        $aField['default']      = isset($post->excerpt) ? $post->excerpt : '';
                        $aField['placeholder']  = 'A short excerpt of the post, this will be shown in locations where a ';
                        $aField['placeholder'] .= 'summary is required. If not specified the a truncated version of the main ';
                        $aField['placeholder'] .= 'body will be used instead.';

                        echo form_field_wysiwyg($aField);
                    }

                ?>
                </div>
                <div class="col-md-2">
                    <div id="post-type-area">
                        <strong>Post Type</strong>
                        <select name="type" class="select2" id="post-type">
                        <?php

                            $sDefault = !empty($post->type) ? $post->type : 'PHOTO';

                            foreach ($postTypes as $sValue => $sLabel) {

                                $sSelected = $sDefault == $sValue ? 'selected="selected"' : '';
                                echo '<option value="' . $sValue . '" ' . $sSelected . '>';
                                    echo $sLabel;
                                echo '</option>';
                            }

                        ?>
                        </select>
                        <div class="type-fields" id="post-type-fields-video">
                            <strong>Video URL</strong>
                            <?php

                                $sDefault = !empty($post->video->url) ? $post->video->url : '';

                                echo form_url(
                                    'video_url',
                                    set_value('video_url', $sDefault),
                                    'placeholder="Video Source URL"'
                                );

                                echo form_error('video_url', '<div class="system-alert error">', '</div>');
                            ?>
                            <small>
                                Copy and paste a URL from YouTube or Vimeo.
                                <a href="#post-help-video" class="fancybox">
                                    <b class="fa fa-question-circle fa-lg"></b>
                                </a>
                            </small>
                            <div id="post-help-video" style="display:none;width:400px;">
                                <p>
                                    <strong>Getting the video's URL</strong>
                                </p>
                                <ol>
                                    <li>Find the video you wish to embed on YouTube or Vimeo</li>
                                    <li>Copy the page's URL from the address bar</li>
                                    <li>Paste this link in the box on this page</li>
                                </ol>
                                <img src="">
                            </div>
                        </div>
                        <div class="type-fields" id="post-type-fields-audio">
                            <strong>Audio URL</strong>
                            <?php

                                $sDefault = !empty($post->audio->url) ? $post->audio->url : '';

                                echo form_url(
                                    'audio_url',
                                    set_value('audio_url', $sDefault),
                                    'placeholder="Audio Source URL"'
                                );

                                echo form_error('audio_url', '<div class="system-alert error">', '</div>');
                            ?>
                            <small>
                                Copy and paste a URL for a track on Spotify.
                                <a href="#post-help-audio" class="fancybox">
                                    <b class="fa fa-question-circle fa-lg"></b>
                                </a>
                            </small>
                            <div id="post-help-audio" style="display:none;width:400px;">
                                <p>
                                    <strong>Getting the track's URL</strong>
                                </p>
                                <ol>
                                    <li>Search for the track you wish to embed</li>
                                    <li>Right click the track</li>
                                    <li>click on "Copy Track Link"</li>
                                    <li>Paste this link in the box on this page</li>
                                </ol>
                                <img src="">
                            </div>
                        </div>
                        <div
                            class="type-fields"
                            id="post-type-fields-photo"
                            data-manager-url="<?=cdnManageUrl('blog', array('_EDIT', 'typePhotoCdnManagerCallback'))?>"
                            data-url-scheme="<?=$this->cdn->url_scale_scheme()?>"
                        >
                            <strong>Featured Image</strong>
                            <?php

                            if ($this->input->post()) {

                                if ($this->input->post('image_id')) {

                                    $sSrc = cdn_scale($this->input->post('image_id'), 500, 500);

                                } else {
{'fraction_non_alphanumeric': 0.171343537414966, 'fraction_numerical': 0.0013818027210884354, 'mean_word_length': 0.9695415532761147, 'pattern_counts': {'":': 0, '<': 219, '<?xml version=': 0, '>': 319, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 35, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2099937', 'n_tokens_mistral': 4887, 'n_tokens_neox': 4516, 'n_words': 882}