Conditions | 3 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
40 | public function run() |
||
41 | { |
||
42 | if ($this->current > 0 || $this->next > 0) { |
||
43 | $this->getView()->registerJs("$('.discount-popover').popover();", \yii\web\View::POS_READY, 'discount-popover'); |
||
44 | |||
45 | return Html::a(Yii::$app->formatter->asPercent($this->current / 100), '#', [ |
||
46 | 'onClick' => 'return false', |
||
47 | 'title' => Yii::t('hipanel:server', 'Next discount'), |
||
48 | 'class' => 'btn btn-default btn-xs discount-popover', |
||
49 | 'data-trigger' => 'focus', |
||
50 | 'data-content' => Yii::$app->formatter->asPercent($this->next / 100), |
||
51 | ]); |
||
52 | } |
||
53 | |||
54 | return ''; |
||
55 | } |
||
57 |