<commit_before><?php

use yii\helpers\Html;
use app\components\grid\GridView;
use yii\widgets\Pjax;
use yii\helpers\ArrayHelper;
use app\models\Organizer;

/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var app\models\search\UserSearch $searchModel
 */

$columns = [
        ['class' => 'app\components\grid\ActionColumn'],
        //['class' => 'yii\grid\SerialColumn'],
        //'id',
        'username',
        // 'password_hash',
        // 'auth_key',
        'is_admin:boolean',
        // 'organizer_id',
        // 'created_at',
        // 'updated_at',
        // 'created_by',
        // 'updated_by',
        // [
        //         'attribute' => 'organizer_id',
        //         'format' => 'raw',
        //         'value' => $model->isOrganizer() ? Html::a(Html::encode($model->organizer), ['/organizer/view', 'id' => $model->organizer->getPrimaryKey()]) : 'None'
        //         //'value' => $model->isOrganizer() ? Html::a(Html::encode($model->getOrganizer()->one()->name), ['/organizer/view', 'id' => $model->getOrganizer()->one()->id]) : 'None'
        // ],
        //'organizer',
        //
        [
            'attribute'=>'organizer_id',
            'vAlign'=>'middle',
            'width'=>'180px',
            'value'=>function ($model, $key, $index, $widget) {
                return Html::a(
                    $model->organizer,
                    ['/organizer/view', 'id' => $model->organizer->getPrimaryKey()],
                    ['title'=>'View organizer detail']
                );
            },
            'filterType'=>GridView::FILTER_SELECT2,
            'filter'=>ArrayHelper::map(Organizer::find()->orderBy('name')->asArray()->all(), 'id', 'name'),
            'filterWidgetOptions'=>[
                'pluginOptions'=>['allowClear'=>true],
            ],
            'filterInputOptions' => ['placeholder' => 'Any Organizer'],

            /*
            'filterType'=>GridView::FILTER_TYPEAHEAD,
            'filterWidgetOptions'=>[<commit_msg>fix on user grid when user has  no organization<commit_after><?php

use yii\helpers\Html;
use app\components\grid\GridView;
use yii\widgets\Pjax;
use yii\helpers\ArrayHelper;
use app\models\Organizer;

/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var app\models\search\UserSearch $searchModel
 */

$columns = [
        ['class' => 'app\components\grid\ActionColumn'],
        //['class' => 'yii\grid\SerialColumn'],
        //'id',
        'username',
        // 'password_hash',
        // 'auth_key',
        'is_admin:boolean',
        // 'organizer_id',
        // 'created_at',
        // 'updated_at',
        // 'created_by',
        // 'updated_by',
        // [
        //         'attribute' => 'organizer_id',
        //         'format' => 'raw',
        //         'value' => $model->isOrganizer() ? Html::a(Html::encode($model->organizer), ['/organizer/view', 'id' => $model->organizer->getPrimaryKey()]) : 'None'
        //         //'value' => $model->isOrganizer() ? Html::a(Html::encode($model->getOrganizer()->one()->name), ['/organizer/view', 'id' => $model->getOrganizer()->one()->id]) : 'None'
        // ],
        //'organizer',
        //
        [
            'attribute'=>'organizer_id',
            'vAlign'=>'middle',
            'width'=>'180px',
            'value'=>function ($model, $key, $index, $widget) {
                if ($model->organizer) {
                    return Html::a(
                        $model->organizer,
                        ['/organizer/view', 'id' => $model->organizer->getPrimaryKey()],
                        ['title'=>'View organizer detail']
                    );
                }
            },
            'filterType'=>GridView::FILTER_SELECT2,
            'filter'=>ArrayHelper::map(Organizer::find()->orderBy('name')->asArray()->all(), 'id', 'name'),
            'filterWidgetOptions'=>[
                'pluginOptions'=>['allowClear'=>true],
            ],
            'filterInputOptions' => ['placeholder' => 'Any Organizer'],

            /*
            'filterType'=>GridView::FILTER_TYPEAHEAD,
            'filterWidgetOptions'=>[
{'fraction_non_alphanumeric': 0.19847145927871984, 'fraction_numerical': 0.0019106759016001911, 'mean_word_length': 1.9225401256106072, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 84, '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': '1265400', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1222, 'n_words': 175}