Example #1
0
    public function run()
    {
        $header = Html::tag(ArrayHelper::remove($this->labelOptions, 'tag', 'h4'), 'Parents', $this->labelOptions);
        if (count($this->labelContainerOptions)) {
            $header = Html::tag(ArrayHelper::remove($this->labelContainerOptions, 'tag', 'div'), $header, $this->labelContainerOptions);
        }
        $list = ListView::widget(['summary' => false, 'emptyText' => Html::tag('ul', '', $this->options), 'options' => $this->options, 'itemOptions' => $this->itemOptions, 'dataProvider' => $this->dataProvider, 'itemView' => function ($model, $key, $index, $widget) {
            return $model->name . (!$this->viewOnly ? Html::tag('span', Html::a("Remove " . Icon::show('remove'), '/' . $this->model->isWhat() . "/remove-parent/" . $this->model->getId() . '/' . $model['id'], ['role' => 'parentListItem', 'style' => 'color:white']), ['class' => 'badge']) : '');
        }]);
        if (count($this->listOptions)) {
            $list = Html::tag(ArrayHelper::remove($this->listOptions, 'tag', 'div'), $list, $this->listOptions);
        }
        if (!$this->viewOnly) {
            $script = Html::tag('script', new \yii\web\jsExpression('$(document).ready(function () {
				$("#' . $this->options['id'] . '").find(\'[role="parentListItem"]\').each(function () {
					$(this).on("click", function (event) {
						event.preventDefault();
						var $element = $(this);
						$.post(this.href, function (result) {
							if(result) $element.parents("li").remove();
						});
					});
				});
			})'), ['type' => 'text/javascript']);
        } else {
            $script = '';
        }
        return Html::tag('div', $header . $list, $this->containerOptions) . $script;
    }
    public function run()
    {
        $chatModel = new \nitm\widgets\models\Replies(['constrain' => ['type' => 'chat']]);
        $notificationModel = new \nitm\widgets\models\Notification(['constrain' => ['user_id' => \Yii::$app->user->getId()], 'queryOptions' => ['read' => 0]]);
        $uniqid = uniqid();
        $chatWidget = Nav::widget(['encodeLabels' => false, 'options' => ['id' => 'communication-center-messages-wrapper' . $uniqid, 'class' => 'nav navbar-right navbar-nav'], 'items' => [['label' => Icon::show('comment') . Html::tag('span', $chatModel->hasNew(), ['class' => 'badge']), 'options' => ['class' => !$chatModel->hasNew() ? 'text-disabled' : 'text-success'], 'linkOptions' => ['id' => 'communication-center-messages-button' . $uniqid, 'title' => 'Click here again to refresh the info', 'role' => 'dynamicValue', 'data-run-once' => 1, 'data-animation-target' => '#chat' . $uniqid, 'data-animation-start-only' => 1, 'data-type' => 'html', 'data-id' => '#chat' . $uniqid, 'data-url' => \Yii::$app->urlManager->createUrl(['/reply/index/chat/0', '__format' => 'html', \nitm\widgets\models\Replies::FORM_PARAM => true])], 'items' => [['label' => Html::tag('div', Html::tag('h2', 'Loading Messages...', ['class' => 'text-center']) . Html::script('$("#communication-center-messages-button' . $uniqid . '").one("mouseover", function (event) {
								$(this).trigger("click");
							})', ['type' => 'text/javascript']), ['role' => 'chatParent', 'id' => 'chat' . $uniqid, 'class' => '']), 'options' => $this->contentOptions]]]]]);
        $alertWidget = Nav::widget(['encodeLabels' => false, 'options' => ['id' => 'communication-center-notifications-wrapper' . $uniqid, 'class' => 'nav navbar-right navbar-nav'], 'items' => [['label' => Icon::show('bell') . Html::tag('span', $notificationModel->count(), ['class' => 'badge']), 'options' => ['class' => !$notificationModel->count() ? 'bg-disabled' : 'bg-success'], 'linkOptions' => ['id' => 'communication-center-notifications-button' . $uniqid, 'title' => 'Click here again to refresh the info', 'role' => 'dynamicValue', 'data-run-once' => 1, 'data-animation-target' => '#communication-center-notifications' . $uniqid, 'data-animation-start-only' => 1, 'data-type' => 'html', 'data-id' => '#communication-center-notifications' . $uniqid, 'data-url' => \Yii::$app->urlManager->createUrl(['/alerts/notifications', '__format' => 'html'])], 'items' => [['label' => Html::tag('div', Html::tag('h2', 'Loading Alerts...', ['class' => 'text-center']) . Html::script('$("#communication-center-notifications-button' . $uniqid . '").one("mouseover", function (event) {
								$(this).trigger("click");
							})', ['type' => 'text/javascript']), ['id' => 'communication-center-notifications' . $uniqid, 'class' => '']), 'options' => $this->contentOptions]]]]]);
        $widget = $alertWidget . $chatWidget;
        //$js = "\$nitm.onModuleLoad('communication-center', function (module) {
        //	module.initChatTabs('#".$this->options['id']."');
        //});";
        $js = "";
        if ($this->chatUpdateOptions['enabled']) {
            $js .= "\$nitm.onModuleLoad('polling', function (module) {\r\n\t\t\t\tmodule.initPolling('chat', {\r\n\t\t\t\t\tenabled: true,\r\n\t\t\t\t\turl: '" . $this->chatUpdateOptions['url'] . "', \r\n\t\t\t\t\tinterval: " . $this->chatUpdateOptions['interval'] . ",\r\n\t\t\t\t\tcontainer: '#nitm-communication-center-widget" . $uniqid . "'\r\n\t\t\t\t}, {object: \$nitm.module('replies'), method: 'chatStatus'});\r\n\t\t\t});";
        }
        if ($this->notificationUpdateOptions['enabled']) {
            $js .= "\r\n\t\t\t\$nitm.onModuleLoad('polling', function (module) {\r\n\t\t\t\tmodule.initPolling('notifications', {\r\n\t\t\t\t\tenabled: true,\r\n\t\t\t\t\tinterval: " . $this->notificationUpdateOptions['interval'] . ",\r\n\t\t\t\t\turl: '" . $this->notificationUpdateOptions['url'] . "',\r\n\t\t\t\t\tcontainer: '#nitm-communication-center-widget" . $uniqid . "'\r\n\t\t\t\t}, {object: \$nitm.module('notifications'), method: 'notificationStatus'});\r\n\t\t\t});";
        }
        if ($js) {
            $js = Html::script($js, ['type' => 'text/javascript']);
        }
        return $widget . $js;
    }
Example #3
0
    echo " with id <b>" . $model->remote_id . "</b>";
}
?>
	</div>
	<div class="col-md-3 col-lg-3">
		that has a priority of <b><?php 
echo !empty($model->priority) ? $model->setting('priorities.' . $model->priority) : 'Normal';
?>
</b>
	</div>
	<div class="col-md-2 col-lg-2">
		alert me using <b><?php 
echo $model->methods;
?>
</b>
	</div>
	<div class="col-md-2 col-lg-2">
		<?php 
echo \nitm\widgets\modal\Modal::widget(['size' => 'large', 'toggleButton' => ['tag' => 'a', 'class' => 'btn btn-info', 'label' => Icon::forAction('update'), 'href' => \Yii::$app->urlManager->createUrl(['/alerts/form/update/' . $model->getId(), '__format' => 'modal']), 'title' => Yii::t('yii', 'Update '), 'role' => 'updateAlert']]);
?>
		<?php 
echo Html::a(Icon::forAction('delete'), '#', ['class' => 'btn btn-danger', 'role' => 'removeAlert', 'data-action' => '/alerts/delete/' . $model->getId(), 'data-parent' => "#alert" . $model->getId()]);
?>
	</div>
</div>
<?php 
if (!isset($notAsListItem)) {
    ?>
</li>
<?php 
}
Example #4
0
    </p>
    <p>
        <?php 
echo $filterButton;
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['format' => 'raw', 'attribute' => 'parent_ids', 'value' => function ($model) {
    return $model->url('parent_ids', [$model->parent(), 'name']);
    $select2 = \nitm\widgets\metadata\ParentListInput::widget(['model' => $model, 'name' => 'parent_id_autocomplete', 'data' => [['id' => $model->parent()->getId(), 'text' => $model->parent()->name]], 'options' => ['multiple' => false, 'class' => 'form-control', 'id' => 'categories_parent' . $model->getId(), 'role' => 'autocompleteSelect', 'data-real-input' => "#categories-parent_ids" . $model->getId()], 'url' => '/api/autocomplete/category/true']);
    $input = Html::hiddenInput('parent_ids', $model->parent()->getId(), ['title' => $model->parent()->name, 'id' => 'categories-parent_ids' . $model->getId()]);
    return $select2;
}], 'name', 'slug', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {form/update} {disable}', 'buttons' => ['form/update' => function ($url, $model) {
    return \nitm\widgets\modal\Modal::widget(['toggleButton' => ['tag' => 'a', 'label' => Icon::forAction('update'), 'href' => \Yii::$app->urlManager->createUrl([$url, '__format' => 'modal']), 'title' => Yii::t('yii', 'Edit '), 'role' => 'disabledOnClose', 'data-pjax' => 0, 'class' => $model->disabled ? 'hidden' : '']]);
}, 'view' => function ($url, $model) {
    return \nitm\widgets\modal\Modal::widget(['size' => 'large', 'toggleButton' => ['tag' => 'a', 'label' => Icon::forAction('view'), 'href' => \Yii::$app->urlManager->createUrl([$url, '__format' => 'modal']), 'title' => Yii::t('yii', 'View ' . $model->name), 'role' => 'disabledOnClose', 'data-pjax' => 0, 'class' => $model->disabled ? 'hidden' : '']]);
}, 'disable' => function ($url, $model) {
    return Html::a(Icon::forAction('disable', 'disabled', $model), $url, ['title' => Yii::t('yii', 'Disable category: ' . $model->name), 'role' => 'metaAction disableAction', 'data-parent' => '#' . $model->isWhat() . $model->getId(), 'data-pjax' => 0, 'data-method' => 'post']);
}], "urlCreator" => function ($action, $model) {
    $csrfVar = \Yii::$app->request->csrfParam;
    $csrfToken = \Yii::$app->request->getCsrfToken();
    $params = ["/" . $model->isWhat() . '/' . $action . "/" . $model->id];
    return \yii\helpers\Url::toRoute($params);
}]], 'options' => ['id' => 'categories'], 'rowOptions' => function ($model, $key, $index, $grid) {
    return ["class" => 'item'];
}, 'pager' => ['class' => \nitm\widgets\ias\ScrollPager::className(), 'overflowContainer' => '.content', 'container' => '#categories', 'item' => ".item", 'negativeMargin' => 150, 'delay' => 500]]);
?>

</div>
Example #5
0
 protected function getAsGrid()
 {
     return GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => $this->items]), 'options' => ['role' => 'metadata', 'id' => 'metadata' . $this->uniqid, 'role' => 'statusIndicator' . $this->uniqid], 'showHeader' => false, 'showFooter' => false, 'summary' => false, 'layout' => "{items}", 'columns' => array_merge($this->attributes, [['class' => 'yii\\grid\\ActionColumn', 'buttons' => ['form/update-metadata' => function ($url, $model) {
         return \nitm\widgets\modal\Modal::widget(['toggleButton' => ['tag' => 'a', 'label' => Icon::forAction('pencil'), 'href' => \Yii::$app->urlManager->createUrl([$url, '__format' => 'modal']), 'title' => \Yii::t('yii', 'Edit '), 'role' => 'dynamicAction updateAction disabledOnClose']]);
     }, 'delete-metadata' => function ($url, $model) {
         return Html::a(Icon::forAction('delete'), \Yii::$app->urlManager->createUrl([$url]), ['title' => \Yii::t('yii', 'Delete Metadata'), 'role' => 'metaAction deleteAction', 'data-depth' => 0, 'data-parent' => 'tr', 'data-pjax' => '0', 'data-force' => 1]);
     }], 'template' => "{form/update-metadata} {delete-metadata}", 'urlCreator' => function ($action, $model, $key, $index) {
         return (!MetadataInfo::$controllerRoute ? $model->isWhat() : MetadataInfo::$controllerRoute) . '/' . $action . '/' . $model->getId();
     }, 'options' => ['rowspan' => 2, 'class' => 'col-md-1 col-lg-1']]])]);
 }
Example #6
0
}], ['sortLinkOptions' => ['data-pjax' => 1], 'attribute' => 'rating', 'label' => '%', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
    return $this->context->voteWidget(['size' => 'large', 'model' => $model->voteModel(), 'parentType' => $model->isWhat(), 'parentId' => $model->getId()]);
}, 'options' => ['rowspan' => 3]], ['sortLinkOptions' => ['data-pjax' => 1], 'format' => 'raw', 'attribute' => 'type_id', 'label' => 'Type', 'value' => function ($model) {
    return $model->url('type_id', [$model->typeOf(), 'name']);
}], ['sortLinkOptions' => ['data-pjax' => 1], 'format' => 'raw', 'attribute' => 'request_for_id', 'label' => 'Request For', 'value' => function ($model) {
    return $model->url('request_for_id', [$model->requestFor(), 'name']);
}], ['sortLinkOptions' => ['data-pjax' => 1], 'format' => 'raw', 'attribute' => 'status', 'label' => 'Urgency', 'value' => function ($model, $index, $widget) {
    return $model->url('status', $model->getUrgency());
}, 'contentOptions' => ['class' => 'visible-lg visible-md'], 'headerOptions' => ['class' => 'visible-lg visible-md']], ['sortLinkOptions' => ['data-pjax' => 1], 'attribute' => 'author_id', 'label' => 'Author', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
    return $model->author()->url(\Yii::$app->getModule('nitm')->useFullnames, \Yii::$app->request->url, [$model->formname() . '[author]' => $model->author_id]);
}], ['sortLinkOptions' => ['data-pjax' => 1], 'attribute' => 'created_at', 'format' => 'datetime', 'contentOptions' => ['class' => 'visible-lg visible-md'], 'headerOptions' => ['class' => 'visible-lg visible-md']], ['class' => 'yii\\grid\\ActionColumn', 'buttons' => ['form/update' => function ($url, $model) {
    return \nitm\widgets\modal\Modal::widget(['size' => 'x-large', 'toggleButton' => ['tag' => 'a', 'label' => Icon::forAction('update'), 'href' => \Yii::$app->urlManager->createUrl([$url, '__format' => 'modal']), 'title' => Yii::t('yii', 'Edit '), 'class' => 'fa-2x', 'role' => 'dynamicAction updateAction disabledOnClose'], 'contentOptions' => ["class" => "modal-full"], 'dialogOptions' => ["class" => "modal-full"]]);
}, 'close' => function ($url, $model) {
    return Html::a(Icon::forAction('close', 'closed', $model), \Yii::$app->urlManager->createUrl([$url]), ['title' => Yii::t('yii', ($model->closed ? 'Open' : 'Close') . ' ' . $model->title), 'role' => 'metaAction closeAction', 'class' => 'fa-2x', 'data-parent' => 'tr', 'data-pjax' => '0']);
}, 'complete' => function ($url, $model) {
    return Html::a(Icon::forAction('complete', 'completed', $model), \Yii::$app->urlManager->createUrl([$url]), ['title' => Yii::t('yii', ($model->completed ? 'Incomplete' : 'Complete') . ' ' . $model->title), 'role' => 'metaAction resolveAction disabledOnClose', 'class' => 'fa-2x', 'data-parent' => 'tr', 'data-pjax' => '0']);
}], 'template' => "{form/update} {complete} {close}", 'urlCreator' => function ($action, $model, $key, $index) {
    return '/' . $model->isWhat() . '/' . $action . '/' . $model->getId();
}, 'options' => ['rowspan' => 3]]], 'tableOptions' => ['class' => 'table'], 'rowOptions' => function ($model, $key, $index, $grid) {
    return ["class" => 'item ' . \nitm\helpers\Statuses::getIndicator($model->getStatus()), "style" => "border-top:solid medium #CCC", 'id' => 'request' . $model->getId(), 'role' => 'statusIndicator' . $model->getId()];
}, 'afterRow' => function ($model, $key, $index, $grid) {
    $replies = $this->context->replyCountWidget(["model" => $model->replyModel(), 'fullDetails' => false]);
    $revisions = $this->context->revisionsCountWidget(['model' => $model->revisionModel(), "parentId" => $model->getId(), "parentType" => $model->isWhat(), 'fullDetails' => false]);
    $issues = $this->context->issueCountWidget(['model' => $model->issueModel(), 'enableComments' => true, "parentId" => $model->getId(), "parentType" => $model->isWhat(), 'fullDetails' => false]);
    $follow = \nitm\widgets\alerts\Follow::widget(['model' => $model->followModel(), 'buttonOptions' => ['size' => 'normal']]);
    $title = Html::tag('h4', $model->title);
    $activityInfo = Html::tag('div', Html::tag('div', $replies, ['class' => 'col-md-3 col-lg-3 center-block']) . Html::tag('div', $revisions, ['class' => 'col-md-3 col-lg-3 center-block']) . Html::tag('div', $issues, ['class' => 'col-md-3 col-lg-3 center-block']) . Html::tag('div', $follow, ['class' => 'col-md-3 col-lg-3 center-block']), ['class' => 'row']);
    $links = Html::tag('div', \nitm\widgets\metadata\ShortLink::widget(['label' => 'View', 'url' => \Yii::$app->urlManager->createAbsoluteUrl([$model->isWhat() . '/view/' . $model->getId()]), 'header' => $model->title, 'type' => 'modal', 'size' => 'large']));
    $links .= Html::tag('div', \nitm\widgets\metadata\ShortLink::widget(['label' => 'Update', 'url' => \Yii::$app->urlManager->createAbsoluteUrl([$model->isWhat() . '/form/update/' . $model->getId()]), 'header' => $model->title, 'type' => 'modal', 'size' => 'x-large', 'modalOptions' => ['dialogOptions' => ['class' => 'modal-full']]]));
    $statusInfo = \nitm\widgets\metadata\StatusInfo::widget(['items' => [['blamable' => $model->editor(), 'date' => $model->updated_at, 'value' => $model->edits, 'label' => ['true' => "Updated ", 'false' => "No updates"]], ['blamable' => $model->completedBy(), 'date' => $model->completed_at, 'value' => $model->completed, 'label' => ['true' => "Completed ", 'false' => "Not completed"]], ['blamable' => $model->closedBy(), 'date' => $model->closed_at, 'value' => $model->closed, 'label' => ['true' => "Closed ", 'false' => "Not closed"]]]]);
    $metaInfo = Html::tag('div', Html::tag('div', implode('<br>', [$title, $statusInfo, $activityInfo, $links])), ['class' => 'wrapper']);
 public function actionFollow($type, $id, $key)
 {
     $_REQUEST['do'] = true;
     \Yii::$app->request->setBodyParams([$this->model->formName() => ['remote_id' => $id, 'remote_type' => $type, 'methods' => $key, 'action' => 'any']]);
     $ret_val = ['message' => "There was an error following this " . $type . ". Please try again and report this if it keeps happening", 'success' => false];
     try {
         $ret_val = parent::actionCreate();
         $result['message'] = 'Successfully followed ' . $type;
         if (ArrayHelper::getValue((array) $ret_val, 'success', false) === true) {
             $ret_val['data'] = '';
             switch ($this->model->methods) {
                 case 'email':
                     $methods = 'envelope';
                     break;
                 case 'mobile':
                     $methods = 'mobile';
                     break;
                 default:
                     $methods = 'send';
                     break;
             }
             $ret_val['actionHtml'] = 'Unfollow ' . \nitm\helpers\Icon::show($methods);
             $ret_val['class'] = 'btn-success';
         }
     } catch (\Exception $e) {
         if (YII_DEBUG) {
             throw $e;
         }
     }
     if (ArrayHelper::getValue((array) $ret_val, 'success', false)) {
         \nitm\traits\Relations::setCachedRelationModel($this->model, ['remote_id', 'remote_type'], 'followModel');
     }
     return $ret_val;
 }
Example #8
0
$this->title = Yii::t('app', 'Alerts');
$this->params['breadcrumbs'][] = $this->title;
if (isset($contentOnly) && $contentOnly === false || !isset($contentOnly)) {
    ?>
<div id='notification-index' class="absolute full full-width full-height" role="notificationListForm">
	<div class="col-md-6 col-lg-6">
		<h1>
			<?php 
    echo Html::encode($this->title);
    ?>
		</h1>
	</div>
	<div class="col-md-6 col-lg-6">
		<h1>
			<?php 
    echo Html::a(Icon::show('refresh'), \Yii::$app->urlManager->createUrl(['/alerts/notifications', '__format' => 'html', '__contentOnly' => true]), ['role' => 'dynamicValue', 'data-id' => 'notification-list-container', 'data-type' => 'html', 'class' => 'pull-right']);
    ?>
		</h1>
	</div>
	<div class="col-md-12 col-lg-12">
	<?php 
}
?>
		<?php 
echo ListView::widget(['dataProvider' => $dataProvider, 'itemView' => function ($model, $key, $index, $widget) {
    return $this->render('view-notification', ['model' => $model]);
}, "layout" => "{summary}\n{items}{pager}", 'itemOptions' => ['class' => 'item'], 'options' => ['id' => 'notification-list-container', 'tag' => 'div', 'class' => 'list-group', 'role' => 'notificationList'], 'pager' => ['class' => \nitm\widgets\ias\ScrollPager::className(), 'overflowContainer' => '#notification-index', 'container' => '#notification-list-container', 'item' => ".item", 'negativeMargin' => 75, 'noneLeftText' => 'No more notifications', 'triggerText' => 'More notifications']]);
?>
	<?php 
if (isset($contentOnly) && $contentOnly === false) {
    ?>
Example #9
0
 protected function initializeMethods()
 {
     $this->followMethods = array_merge($this->_defaultFollowMethods, $this->followMethods);
     $supported = \nitm\helpers\alerts\DispatcherData::supportedMethods();
     foreach ($this->followMethods as $idx => $method) {
         switch (isset($supported[$method['method']])) {
             case true:
                 $method['label'] = Icon::show($method['icon']) . ' ' . $method['label'];
                 $method['url'] = '/alerts/follow/' . $this->model->remote_type . '/' . $this->model->remote_id . '/' . $method['method'];
                 $method['linkOptions'] = ['role' => 'dynamicValue', 'data-pjax' => 0, 'data-run-once' => true, 'data-type' => 'callback', 'data-ajax-method' => 'post', 'data-id' => '#' . $this->options['id'], 'data-callback' => "function (result, elem) { \$nitm.module('follow').afterAction(result, elem);}"];
                 $this->followMethods[$idx] = $method;
                 break;
             default:
                 unset($this->followMethods[$idx]);
                 break;
         }
     }
 }
Example #10
0
    echo $model->closed_at;
    ?>
</i>
			<?php 
}
?>
			</div>
		</div>
		<div class="col-md-4 col-lg-4 text-right">
			<?php 
echo Html::a(Icon::forAction('close', 'closed', $model), \Yii::$app->urlManager->createUrl(['/issue/close/' . $model->id]), ['title' => Yii::t('yii', ($model->closed ? 'Open' : 'Close') . ' '), 'class' => 'fa-2x', 'role' => 'metaAction closeAction', 'data-parent' => 'tr', 'data-pjax' => '0']);
echo Html::a(Icon::forAction('update', null, $model), \Yii::$app->urlManager->createUrl(['/issue/form/update/' . $model->id, Issues::COMMENT_PARAM => $enableComments, '__format' => 'html']), ['title' => Yii::t('yii', 'Edit '), 'class' => 'fa-2x' . ($model->closed ? ' hidden' : ''), 'role' => 'updateIssueTrigger disabledOnClose']);
echo Html::a(Icon::forAction('resolve', 'resolved', $model), \Yii::$app->urlManager->createUrl(['/issue/resolve/' . $model->id]), ['title' => Yii::t('yii', ($model->resolved ? 'Unresolve' : 'Resolve') . ' '), 'class' => 'fa-2x' . ($model->closed ? ' hidden' : ''), 'role' => 'metaAction resolveAction disabledOnClose', 'data-parent' => 'tr', 'data-pjax' => '0']);
echo Html::a(Icon::forAction('duplicate', 'duplicate', $model), \Yii::$app->urlManager->createUrl(['/issue/duplicate/' . $model->id]), ['title' => Yii::t('yii', ($model->duplicate ? 'Flag as not duplicate' : 'flag as duplicate') . ' '), 'class' => 'fa-2x', 'role' => 'metaAction duplicateAction']);
if ($enableComments == true) {
    echo Html::a(Icon::forAction('comment', null, null, ['size' => '2x']) . ActivityIndicator::widget(['position' => 'top right', 'size' => 'small', 'text' => $repliesModel->count(), 'type' => 'info']), \Yii::$app->urlManager->createUrl(['/reply/index/' . $model->isWhat() . '/' . $model->getId(), '__format' => 'html']), ['id' => 'issue-comment-link' . $uniqid, 'title' => 'See comments for this issue', 'data-id' => '#issue-comments' . $uniqid, 'onclick' => '(function (event) {event.preventDefault(); $nitm.module("tools").visibility("#issue-comment-link' . $uniqid . '", true);})(event)']);
}
?>
		</div>
		<?php 
if ($enableComments == true) {
    ?>
		<div class="col-lg-12 col-md-12">
			<div class="clear" style="display:none;" id="issue-comments<?php 
    echo $uniqid;
    ?>
">
			</div>
		</div>
		<?php 
}
Example #11
0
/**
 * @var yii\web\View $this
 * @var app\models\search\Issues $model
 * @var yii\widgets\ActiveForm $form
 */
$uniqid = uniqid();
?>

<div class="issues-search">
	
	<?php 
$form = ActiveForm::begin(['method' => 'get', "type" => ActiveForm::TYPE_VERTICAL, 'action' => \Yii::$app->urlManager->createUrl(["/issue/issues/{$parentType}/{$parentId}", Issues::COMMENT_PARAM => $enableComments, $model::SEARCH_PARAM => 1, $model::SEARCH_PARAM_BOOL => 1]), 'options' => ["role" => "searchIssue", 'id' => 'issue-search-form' . $uniqid, 'data-pjax' => 1], 'fieldConfig' => ['inputOptions' => ['class' => 'form-control input-sm'], 'template' => "{label}\n<div class=\"col-lg-12 col-md-12\">{input}</div>\n<div class=\"col-lg-12\">{error}</div>", 'labelOptions' => ['class' => 'control-label sr-only']], 'enableAjaxValidation' => true]);
?>

    <?php 
echo $form->field($model, 'text', ['addon' => ['append' => ['content' => Html::button(Icon::forAction('search'), ['class' => 'btn btn-primary btn-sm', 'data-pjax' => 1]), 'asButton' => true]]]);
?>

    <?php 
// echo $form->field($model, 'author')
?>

    <?php 
// echo $form->field($model, 'closed')
?>

    <?php 
// echo $form->field($model, 'duplicate')
?>

    <?php