Skip to content

Commit

Permalink
Added hold button to domain view
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Nov 16, 2016
1 parent 6b95ae4 commit fc5deae
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/views/domain/_holdButtons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
use hipanel\modules\domain\models\Domain;
use yii\helpers\Html;
$options = [
'method' => 'post',
'data-pjax' => '0',
];
?>
<?php if (!($model->is_holded) || (Yii::$app->user->can('support') && Yii::$app->user->not($model->client_id) && Yii::$app->user->not($model->seller_id))) : ?>
<li>
<?= Html::a('<i class="fa fa-fw fa-bomb"></i> ' . Yii::t('hipanel:domain', 'Enable Hold'), ['@domain/enable-hold', 'id' => $model->id], $options) ?>
</li>
<?php elseif (($model->is_holded && in_array($model->state, ['ok', 'expired'], true) && Yii::$app->user->can('support') && Domain::notDomainOwner($model))) : ?>
<li>
<?= Html::a('<i class="fa fa-fw fa-link"></i> ' . Yii::t('hipanel:domain', 'Disable Hold'), ['@domain/disable-hold', 'id' => $this->model->id], $options) ?>
</li>
<?php endif; ?>
2 changes: 2 additions & 0 deletions src/views/domain/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use hipanel\modules\dns\widgets\DnsZoneEditWidget;
use hipanel\modules\domain\grid\DomainGridView;
use hipanel\modules\domain\models\Domain;
use hipanel\modules\domain\widgets\AuthCode;
use hipanel\modules\domain\widgets\NsWidget;
use hipanel\widgets\AjaxModal;
Expand Down Expand Up @@ -96,6 +97,7 @@
<?= Html::a('<i class="fa fa-fw fa-forward"></i>' . Yii::t('hipanel:domain', 'Renew domain'), ['add-to-cart-renewal', 'model_id' => $model->id], ['data-pjax' => 0]) ?>
</li>
<?php endif ?>
<?= $this->render('_holdButtons', compact('model')) ?>
<li>
<?= Html::a('<i class="fa fa-fw fa-trash"></i>' . Yii::t('hipanel', 'Delete'), ['@domain/delete', 'id' => $model->id], [
'data' => [
Expand Down

0 comments on commit fc5deae

Please sign in to comment.