<commit_before><?php

namespace hiqdev\yii2\reminder\widgets;

use hipanel\assets\BootstrapDatetimepickerAsset;
use hipanel\widgets\AjaxModal;
use omnilight\assets\MomentAsset;
use Yii;
use yii\base\Widget;
use yii\bootstrap\Modal;
use yii\helpers\Html;
use yii\helpers\Url;

class ReminderButton extends Widget
{
    public $object_id;

    public $toggleButton = [];

    public function init()
    {
        $this->registerClientScript();
    }

    public function run()
    {
        $modalId = 'reminder-modal-' . $this->object_id;
        $this->getView()->registerCss("button[data-target='#{$modalId}'] {margin-top: -3px;}");
        return AjaxModal::widget([
            'bulkPage' => false,
            'id' => $modalId,
            'modalFormId' => 'reminder-form-' . $this->object_id,
            'scenario' => 'create',
            'actionUrl' => ['/reminder/reminder/create-modal', 'object_id' => $this->object_id],
            'handleSubmit' => Url::toRoute('/reminder/reminder/create'),
            'size' => Modal::SIZE_DEFAULT,
            'header' => Html::tag('h4', Yii::t('hiqdev/yii2/reminder', 'Create new reminder'), ['class' => 'modal-title']),
            'toggleButton' => $this->getToggleButton(),
        ]);
    }

    /**
     * @return mixed
     */
    public function getToggleButton()
    {
        return (!empty($this->toggleButton)) ?
            $this->toggleButton :
            [
                'label' => '<i class="fa fa-bell-o"></i>&nbsp;&nbsp;' . Yii::t('hiqdev/yii2/reminder', 'Create reminder'),
                'class' => 'btn margin-bottom btn-info pull-right'
            ];
    }

    /**
     * @param mixed $toggleButton
     */
    public function setToggleButton($toggleButton)
    {
        $this->toggleButton = $toggleButton;
    }

    public function registerClientScript()
    {
        $view = $this->getView();
        MomentAsset::register($view);
        BootstrapDatetimepickerAsset::register($view);
    }
}

<commit_msg>Changed reminder button size to xs<commit_after><?php

namespace hiqdev\yii2\reminder\widgets;

use hipanel\assets\BootstrapDatetimepickerAsset;
use hipanel\widgets\AjaxModal;
use omnilight\assets\MomentAsset;
use Yii;
use yii\base\Widget;
use yii\bootstrap\Modal;
use yii\helpers\Html;
use yii\helpers\Url;

class ReminderButton extends Widget
{
    public $object_id;

    public $toggleButton = [];

    public function init()
    {
        $this->registerClientScript();
    }

    public function run()
    {
        $modalId = 'reminder-modal-' . $this->object_id;
        $this->getView()->registerCss("button[data-target='#{$modalId}'] {margin-top: -3px;}");
        return AjaxModal::widget([
            'bulkPage' => false,
            'id' => $modalId,
            'modalFormId' => 'reminder-form-' . $this->object_id,
            'scenario' => 'create',
            'actionUrl' => ['/reminder/reminder/create-modal', 'object_id' => $this->object_id],
            'handleSubmit' => Url::toRoute('/reminder/reminder/create'),
            'size' => Modal::SIZE_DEFAULT,
            'header' => Html::tag('h4', Yii::t('hiqdev/yii2/reminder', 'Create new reminder'), ['class' => 'modal-title']),
            'toggleButton' => $this->getToggleButton(),
        ]);
    }

    /**
     * @return mixed
     */
    public function getToggleButton()
    {
        return (!empty($this->toggleButton)) ?
            $this->toggleButton :
            [
                'label' => '<i class="fa fa-bell-o"></i>&nbsp;&nbsp;' . Yii::t('hiqdev/yii2/reminder', 'Create reminder'),
                'class' => 'btn margin-bottom btn-info btn-xs pull-right',
            ];
    }

    /**
     * @param mixed $toggleButton
     */
    public function setToggleButton($toggleButton)
    {
        $this->toggleButton = $toggleButton;
    }

    public function registerClientScript()
    {
        $view = $this->getView();
        MomentAsset::register($view);
        BootstrapDatetimepickerAsset::register($view);
    }
}


{'fraction_non_alphanumeric': 0.16413070591169868, 'fraction_numerical': 0.002494387627837366, 'mean_word_length': 2.4930313588850175, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 55, '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': '3927290', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1267, 'n_words': 214}