<commit_before><?php

namespace hipanel\modules\dashboard\widgets;

use Yii;
use yii\base\Widget;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Html;

class SearchForm extends Widget
{
    public $formOptions = [];

    protected $defaultFormOptions = [
        'method' => 'get',
    ];

    public $inputOptions = [];

    public $inputType = 'text';

    /**
     * @var string Widget class name
     */
    public $inputWidget;

    /**
     * @var \yii\base\Model Search model
     */
    public $model;

    /**
     * @var string
     */
    public $attribute;

    /** @var  string css class */
    public $buttonColor;

    public function run()
    {
        $formId = $this->formOptions['id'];
        $this->getView()->registerCss("#{$formId} button {-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);}");
        $form = ActiveForm::begin(array_merge($this->defaultFormOptions, $this->formOptions));
        print Html::beginTag('div', ['class' => 'row']);
        print Html::beginTag('div', ['class' => 'col-xs-9']);
        if ($this->inputWidget) {
            print $form->field($this->model, $this->attribute, ['template' => '{input}{error}'])->widget($this->inputWidget, $this->inputOptions);
        } else {
            print $form->field($this->model, $this->attribute, ['template' => '{input}{error}'])->input($this->inputType, array_merge([
                'placeholder' => $this->model->getAttributeLabel($this->attribute),
                'class' => 'form-control',
            ], $this->inputOptions));
        }
        print Html::endTag('div');
        print Html::beginTag('div', ['class' => 'col-xs-3']);
        print Html::submitButton(Yii::t('hipanel', 'Search'), ['class' => 'btn btn-flat ' . $this->buttonColor]);
        print Html::endTag('div');
        print Html::endTag('div');
        ActiveForm::end();
    }
}<commit_msg>Added all search elements to input-group<commit_after><?php

namespace hipanel\modules\dashboard\widgets;

use Yii;
use yii\base\Widget;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Html;

class SearchForm extends Widget
{
    public $formOptions = [];

    protected $defaultFormOptions = [
        'method' => 'get',
    ];

    public $inputOptions = [];

    public $inputType = 'text';

    /**
     * @var string Widget class name
     */
    public $inputWidget;

    /**
     * @var \yii\base\Model Search model
     */
    public $model;

    /**
     * @var string
     */
    public $attribute;

    /** @var  string css class */
    public $buttonColor;

    public function run()
    {
        $formId = $this->formOptions['id'];
        $this->getView()->registerCss("#{$formId} button {-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);}");
        $form = ActiveForm::begin(array_merge($this->defaultFormOptions, $this->formOptions));
        print Html::beginTag('div', ['class' => 'row']);
        print Html::beginTag('div', ['class' => 'col-xs-12']);
        print Html::beginTag('div', ['class' => 'input-group']);
        if ($this->inputWidget) {
            print $form->field($this->model, $this->attribute, ['template' => '{input}'])->widget($this->inputWidget, $this->inputOptions);
        } else {
            print $form->field($this->model, $this->attribute, ['template' => '{input}'])->input($this->inputType, array_merge([
                'placeholder' => $this->model->getAttributeLabel($this->attribute),
                'class' => 'form-control',
            ], $this->inputOptions));
        }
        print Html::beginTag('span', ['class' => 'input-group-btn']);
        print Html::submitButton(Yii::t('hipanel', 'Search'), ['class' => 'btn btn-flat ' . $this->buttonColor]);
        print Html::endTag('span');
        print Html::endTag('div');
        print Html::endTag('div');
        print Html::endTag('div');
        ActiveForm::end();
    }
}
{'fraction_non_alphanumeric': 0.19233677842198135, 'fraction_numerical': 0.011091504915553314, 'mean_word_length': 2.768281101614435, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 66, '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': '1523187', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1221, 'n_words': 255}