<commit_before><?php

namespace hipanel\modules\domain\grid;

use hipanel\grid\ActionColumn;
use hipanel\widgets\ModalButton;
use Yii;
use yii\bootstrap\Progress;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\helpers\Url;

class PremiumActionColumn extends ActionColumn
{
    /**
     * @var boolean
     */
    public $is_premium;

    /**
     * @var int
     */
    public $fieldsCount = 4;

    public function init()
    {
        $this->template = '{update} {delete}';
        $this->visibleButtonsCount = 2;
        $this->options = [
            'style' => 'width: 15%',
        ];
        $this->buttons = [
            'update' => function ($url, $model, $key) {
                if (!$this->is_premium) {
                    $html = Html::button('<i class="fa fa-pencil"></i> ' . Yii::t('hipanel', 'Update'), [
                        'class' => 'btn btn-default btn-xs disabled',
                    ]);
                }

                $html = Html::button('<i class="fa fa-pencil"></i> ' . Yii::t('hipanel', 'Update'), [
                    'class' => 'btn btn-default btn-xs edit-premium-toggle',
                    'data' => [
                        'id' => $model->id,
                        'load-url' => Url::to([
                            '@domain/inline-premium-feature-form',
                            'domainId' => $model->domain_id,
                            'featureId' => $model->id,
                            'for' => $this->getFeatureName($model),
                        ]),
                    ],
                ]);

                $progress = Json::htmlEncode("<tr><td class='pf-update-from-td' colspan='{$this->fieldsCount}' style='padding: 4px 0;'>" . Progress::widget([
                        'id' => 'progress-bar',
                        'percent' => 100,
                        'barOptions' => ['class' => 'active progress-bar-striped', 'style' => 'width: 100%'],
                    ]) . '</td></tr>');

                Yii::$app->view->registerJs(/** @lang JavaScript */
                    "
                    $('.edit-premium-toggle').click(function () {
                        var id = $(this).data('id');

                        var currentRow = $(this).closest('tr');
                        var newRow = $($progress);<commit_msg>Fixed overflow for Premium inline update row<commit_after><?php

namespace hipanel\modules\domain\grid;

use hipanel\grid\ActionColumn;
use hipanel\widgets\ModalButton;
use Yii;
use yii\bootstrap\Progress;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\helpers\Url;

class PremiumActionColumn extends ActionColumn
{
    /**
     * @var boolean
     */
    public $is_premium;

    /**
     * @var int
     */
    public $fieldsCount = 4;

    public function init()
    {
        $this->template = '{update} {delete}';
        $this->visibleButtonsCount = 2;
        $this->options = [
            'style' => 'width: 15%',
        ];
        $this->buttons = [
            'update' => function ($url, $model, $key) {
                if (!$this->is_premium) {
                    $html = Html::button('<i class="fa fa-pencil"></i> ' . Yii::t('hipanel', 'Update'), [
                        'class' => 'btn btn-default btn-xs disabled',
                    ]);
                }

                $html = Html::button('<i class="fa fa-pencil"></i> ' . Yii::t('hipanel', 'Update'), [
                    'class' => 'btn btn-default btn-xs edit-premium-toggle',
                    'data' => [
                        'id' => $model->id,
                        'load-url' => Url::to([
                            '@domain/inline-premium-feature-form',
                            'domainId' => $model->domain_id,
                            'featureId' => $model->id,
                            'for' => $this->getFeatureName($model),
                        ]),
                    ],
                ]);

                $progress = Json::htmlEncode("<tr><td class='pf-update-from-td' colspan='{$this->fieldsCount}' style='overflow:hidden; padding: 4px 0;'>" . Progress::widget([
                        'id' => 'progress-bar',
                        'percent' => 100,
                        'barOptions' => ['class' => 'active progress-bar-striped', 'style' => 'width: 100%'],
                    ]) . '</td></tr>');

                Yii::$app->view->registerJs(/** @lang JavaScript */
                    "
                    $('.edit-premium-toggle').click(function () {
                        var id = $(this).data('id');

                        var currentRow = $(this).closest('tr');
                        var newRow = $($progress);
{'fraction_non_alphanumeric': 0.16860215053763442, 'fraction_numerical': 0.005161290322580645, 'mean_word_length': 1.3998968008255934, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 73, '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': '3376272', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1276, 'n_words': 240}