<commit_before><?php

use vr\api\components\filters\TokenAuth;
use vr\api\doc\widgets\ControllersListView;
use vr\api\doc\widgets\InputParamsView;
use vr\api\doc\models\ActionModel;
use vr\api\doc\models\ControllerModel;
use yii\helpers\Url;

/** @var ActionModel $model */
/** @var ControllerModel[] $controllers */
/** @var bool $includeMeta */

?>

<div class="row">
    <div class="col-sm-2">
        <div class="form-group">
            <input class="methods-filter form-control" placeholder="Filter actions..." type="text">
        </div>
        <?= ControllersListView::widget([
            'models' => $controllers,
        ]) ?>
    </div>

    <div class="col-sm-10">
        <div class="row">
            <div class="col-sm-12">
                <h4 class="float-left  pull-left">
                    <?php if ($model->getAuthLevel() > TokenAuth::AUTH_LEVEL_NONE): ?>
                        <span class="glyphicon glyphicon-lock"></span>

                        <?php if ($model->getAuthLevel() == TokenAuth::AUTH_LEVEL_OPTIONAL): ?>
                            (optional)
                        <?php endif ?>
                    <?php endif ?>

                    <?= $model->route ?>
                </h4>

                <div class="btn-group float-right btn-group-sm pull-right" role="group" aria-label="...">
                    <button class="btn btn-default btn-light" data-clipboard-target="#request-text">
                        Copy
                    </button>

                    <button id="execute" class="btn btn-success"
                            data-url="<?= Url::to(['/' . $model->route], true) ?>"
                            data-loading-text="Executing...">
                        Execute
                    </button>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <p>
                    <?= $model->description ?>
                </p>

                <pre><code class="json editable bg-light" contenteditable="true" id="request-text"><?=
                        InputParamsView::widget([
                            'params'      => $model->getInputParams(),
                            'includeMeta' => $includeMeta,
                        ]) ?></code></pre>
            </div>
        </div>

        <div class="response-wrapper hidden">
            <div class="row mt-3">
                <div class="col-sm-12">
                    <h4 class="float-left pull-left">
                        Response
                        <small>received in <span class="exec-time"></span> sec.</small>
                    </h4>

                    <button class="btn btn-default btn-light float-right btn-xs pull-right" data-clipboard-target="#response-text">
                        Copy
                    </button>
                </div>
            </div>

            <div class="row mt-3 response-block">
                <div class="col-sm-12">
                    <pre><code class="json bg-light" id="response-text"></code></pre>
                </div>
            </div>
        </div>

    </div>
</div><commit_msg>Add sticky position for request and response heading panels<commit_after><?php

use vr\api\components\filters\TokenAuth;
use vr\api\doc\widgets\ControllersListView;
use vr\api\doc\widgets\InputParamsView;
use vr\api\doc\models\ActionModel;
use vr\api\doc\models\ControllerModel;
use yii\helpers\Url;

/** @var ActionModel $model */
/** @var ControllerModel[] $controllers */
/** @var bool $includeMeta */

?>

<div class="row">
    <div class="col-sm-2">
        <div class="form-group">
            <input class="methods-filter form-control" placeholder="Filter actions..." type="text">
        </div>
        <?= ControllersListView::widget([
            'models' => $controllers,
        ]) ?>
    </div>

    <div class="col-sm-10">
        <div class="row bg-white sticky-top">
            <div class="col-sm-12">
                <h4 class="float-left  pull-left">
                    <?php if ($model->getAuthLevel() > TokenAuth::AUTH_LEVEL_NONE): ?>
                        <span class="glyphicon glyphicon-lock"></span>

                        <?php if ($model->getAuthLevel() == TokenAuth::AUTH_LEVEL_OPTIONAL): ?>
                            (optional)
                        <?php endif ?>
                    <?php endif ?>

                    <?= $model->route ?>
                </h4>

                <div class="btn-group float-right btn-group-sm pull-right" role="group" aria-label="...">
                    <button class="btn btn-default btn-light" data-clipboard-target="#request-text">
                        Copy
                    </button>

                    <button id="execute" class="btn btn-success"
                            data-url="<?= Url::to(['/' . $model->route], true) ?>"
                            data-loading-text="Executing...">
                        Execute
                    </button>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <p>
                    <?= $model->description ?>
                </p>

                <pre><code class="json editable bg-light" contenteditable="true" id="request-text"><?=
                        InputParamsView::widget([
                            'params'      => $model->getInputParams(),
                            'includeMeta' => $includeMeta,
                        ]) ?></code></pre>
            </div>
        </div>

        <div class="response-wrapper hidden">
            <div class="row mt-3 bg-white sticky-top">
                <div class="col-sm-12">
                    <h4 class="float-left pull-left">
                        Response
                        <small>received in <span class="exec-time"></span> sec.</small>
                    </h4>

                    <button class="btn btn-default btn-light float-right btn-sm pull-right" data-clipboard-target="#response-text">
                        Copy
                    </button>
                </div>
            </div>

            <div class="row mt-3 response-block">
                <div class="col-sm-12">
                    <pre><code class="json bg-light" id="response-text"></code></pre>
                </div>
            </div>
        </div>

    </div>
</div>

{'fraction_non_alphanumeric': 0.1529319781078968, 'fraction_numerical': 0.0053166536356528534, 'mean_word_length': 1.3309037900874636, 'pattern_counts': {'":': 0, '<': 133, '<?xml version=': 0, '>': 153, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3713861', 'n_tokens_mistral': 1762, 'n_tokens_neox': 1666, 'n_words': 331}