Example #1
0
/*
                    <?= Html::tag('b', $model->getAttributeLabel('nameservers') . ': '); ?>
                    <?= XEditable::widget([
                        'model' => $model,
                        'attribute' => 'nameservers',
                        'pluginOptions' => [
                            'placement' => 'bottom',
                            'type' => 'textarea',
                            'emptytext' => Yii::t('hipanel:domain', 'There are no NS. Domain may not work properly'),
                            'url' => Url::to('set-nss'),
                        ],
                    ]); ?>
*/
?>
                    <?php 
echo NsWidget::widget(['model' => $model, 'attribute' => 'nsips']);
?>

                </div>

                <!-- Authorization code -->
                <!--                    <div class=" tab-pane" id="authorization-code"></div>-->

                <!-- DNS records -->
                <div class="tab-pane" id="dns-records">
                    <?php 
echo DomainGridView::detailView(['model' => $model, 'boxed' => false, 'dataProvider' => new ArrayDataProvider(['allModels' => [$config['model'], 'pagination' => false]]), 'columns' => ['is_premium' => ['label' => Yii::t('hipanel:domain', 'Premium package'), 'value' => function ($model) {
    $enablePremiumLink = Html::a(Yii::t('hipanel:domain', 'Enable premium'), Url::toRoute(''), ['class' => 'btn btn-success btn-xs pull-right']);
    return $model->is_premium === 't' ? Yii::t('hipanel', 'Activated to') . Yii::$app->formatter->asDatetime($model->prem_expires) : sprintf('%s %s', Yii::t('hipanel', 'Not enabled'), $enablePremiumLink);
}, 'format' => 'raw'], 'premium_autorenewal' => ['class' => BootstrapSwitchColumn::class, 'attribute' => 'premium_autorenewal', 'label' => Yii::t('hipanel:domain', 'Premium package autorenewal'), 'filter' => false, 'url' => Url::toRoute(['@hdomain/set-paid-feature-autorenewal']), 'popover' => Yii::t('hipanel:domain', 'The domain will be autorenewed for one year in a week before it expires if you have enough credit on your account'), 'visible' => $model->is_premium === 't' ? true : false, 'pluginOptions' => ['onColor' => 'info']]]]);
?>
echo Yii::t('hipanel', 'Set for all');
?>
</a></li>
        <li role="presentation"><a href="#by-one" aria-controls="profile" role="tab" data-toggle="tab"><?php 
echo Yii::t('hipanel', 'Set by one');
?>
</a></li>
    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="bulk">
            <div class="row" style="margin-top: 15pt;">
                <div class="col-md-12">
                    <?php 
echo NsWidget::widget(['model' => $models, 'attribute' => 'nsips', 'actionUrl' => 'bulk-set-nss']);
?>
                    <br>
                    <div class="panel panel-default">
                        <div class="panel-heading"><?php 
echo Yii::t('hipanel:domain', 'Affected domains');
?>
</div>
                        <div class="panel-body">
                            <?php 
echo \hipanel\widgets\ArraySpoiler::widget(['data' => $models, 'visibleCount' => count($models), 'formatter' => function ($model) {
    return $model->domain;
}, 'delimiter' => ',&nbsp; ']);
?>
                        </div>
                    </div>