for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace hipanel\modules\hosting\widgets\ip;
use Yii;
use yii\base\Widget;
use yii\helpers\Html;
use yii\web\View;
class ApplyPtrChange extends Widget
{
public function init()
$this->view->registerJs(
<<<'JS'
$('.apply-ptr-change').popover({html: true});
$(document).on('click', function (e) {
$('[data-toggle="popover"], [data-original-title]').each(function () {
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
(($(this).popover('hide').data('bs.popover')||{}).inState||{}).click = false
}
});
JS
,
View::POS_READY
);
$this->view->registerCss(
<<<'CSS'
.apply-ptr-change {
border-bottom: 1px #72afd2 dashed;
font-style: italic;
.apply-ptr-change:hover {
text-decoration: none;
CSS
public function run(): string
return Html::tag(
'a',
Yii::t('hipanel', 'Empty'),
[
'class' => 'apply-ptr-change',
'href' => '#',
'data' => [
'container' => 'body',
'toggle' => 'popover',
'title' => 'PTR',
'content' => Html::a(
Yii::t('hipanel:hosting', 'Apply for change of PTR records'),
['@ticket/create'],
['target' => '_blank']
),
'placement' => 'top',
],
]