diff --git a/src/menus/DomainActionsMenu.php b/src/menus/DomainActionsMenu.php index 7d5d5489..4bce9bc0 100644 --- a/src/menus/DomainActionsMenu.php +++ b/src/menus/DomainActionsMenu.php @@ -11,7 +11,17 @@ class DomainActionsMenu extends \hiqdev\menumanager\Menu public function items() { + $url = 'http://' . $this->model->domain . '/'; + return [ + [ + 'icon' => 'globe', + 'label' => Yii::t('hipanel:domain', 'Go to site {link}', ['link' => \yii\helpers\StringHelper::truncate($url, 15)]), + 'url' => $url, + 'linkOptions' => [ + 'target' => '_blank', + ], + ], [ 'label' => ' ' . Yii::t('hipanel', 'View'), 'url' => ['@domain/view', 'id' => $this->model->id], diff --git a/src/menus/DomainDetailsMenu.php b/src/menus/DomainDetailsMenu.php new file mode 100644 index 00000000..532514e2 --- /dev/null +++ b/src/menus/DomainDetailsMenu.php @@ -0,0 +1,60 @@ + $this->model, + ])->items(); + + return array_merge($actions, [ + [ + 'label' => AjaxModal::widget([ + 'id' => 'push-modal-link', + 'header' => Html::tag('h4', Yii::t('hipanel:domain', 'Push domain') . ': ' . Html::tag('b', $this->title), ['class' => 'modal-title']), + 'scenario' => 'push', + 'actionUrl' => ['domain-push-modal', 'id' => $this->model->id], + 'size' => Modal::SIZE_DEFAULT, + 'toggleButton' => [ + 'label' => '' . Yii::t('hipanel:domain', 'Push domain'), + 'class' => 'clickable', + 'data-pjax' => 0, + 'tag' => 'a', + ], + ]), + 'encode' => false, + ], + [ + 'visible' => $this->model->canRenew() && Yii::$app->user->can('domain.pay'), + 'label' => Yii::t('hipanel:domain', 'Renew domain'), + 'icon' => 'forward', + 'url' => ['add-to-cart-renewal', 'model_id' => $this->model->id], + 'linkOptions' => [ + 'data-pjax' => 0, + ], + ], + [ + 'label' => Yii::t('hipanel', 'Delete'), + 'url' => ['@domain/delete', 'id' => $this->model->id], + 'linkOptions' => [ + 'data' => [ + 'confirm' => Yii::t('hipanel:domain', 'Are you sure you want to delete domain {domain}?', ['domain' => $this->model->domain]), + 'method' => 'post', + 'data-pjax' => '0', + ] + ], + ], + ]); + } +} diff --git a/src/views/domain/view.php b/src/views/domain/view.php index ead261e3..db060948 100644 --- a/src/views/domain/view.php +++ b/src/views/domain/view.php @@ -6,16 +6,14 @@ use hipanel\modules\dns\widgets\DnsZoneEditWidget; use hipanel\modules\domain\grid\DomainGridView; -use hipanel\modules\domain\menus\DomainActionsMenu; +use hipanel\modules\domain\menus\DomainDetailsMenu; use hipanel\widgets\DetailMenu; use hipanel\modules\domain\widgets\AuthCode; use hipanel\modules\domain\widgets\NsWidget; -use hipanel\widgets\AjaxModal; use hipanel\widgets\Box; use hipanel\widgets\ClientSellerLink; use hipanel\widgets\Pjax; use hiqdev\bootstrap_switch\BootstrapSwitchColumn; -use yii\bootstrap\Modal; use yii\data\ArrayDataProvider; use yii\helpers\Html; use yii\helpers\Url; @@ -52,7 +50,6 @@