<div class="ui two column stackable grid"> <div class="twelve wide rounded column"> <div class="ui raised segment"> <div class="ui black ribbon label" style="margin-left: -2px;"> <h4>Requests</h4> </div> <div class="pull-right"><?php echo Html::a('<i class="icon plus"></i>', ['create'], ['class' => 'ui large green icon button']); ?> </div> <br> <?php Pjax::begin(['id' => 'student-list', 'timeout' => 60000]); ?> <?php echo UiListView::widget(['dataProvider' => $dataProvider, 'itemView' => '_list']); ?> <?php Pjax::end(); ?> </div> </div> <div class="four wide column"> <?php echo $this->render('_search', ['model' => $searchModel]); ?> </div> </div> </div> <?php echo $this->render('/layouts/_toast');
use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; use app\models\UiListView; use app\models\BoardSearch; /* @var $this yii\web\View */ /* @var $searchModel app\models\BoardSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $searchModel = new BoardSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $this->title = 'Boards'; ?> <div id="a" style="width: 100%; top: 0; position: fixed;"> <div style="min-height: 74px; background: red;"></div> <div class="ui segment"> <div id="board-index" class="ui fluid container"> <div> <?php Pjax::begin(['id' => 'class-adviser-list', 'timeout' => 60000]); ?> <?php echo UiListView::widget(['layout' => '{items}', 'dataProvider' => $dataProvider, 'itemView' => '_board-list-dedicated']); ?> <?php Pjax::end(); ?> </div> </div> </div> </div>
if (AuthAssignment::getAssignment(Yii::$app->user->identity->id) === 'dev' || AuthAssignment::getAssignment(Yii::$app->user->identity->id) === 'master' || AuthAssignment::getAssignment(Yii::$app->user->identity->id) === 'admin' || AuthAssignment::getAssignment(Yii::$app->user->identity->id) === 'principal') { ?> <div id="announcement-wrap" class="menu" style="height: 475px;"> <?php } else { ?> <div id="announcement-wrap" class="menu" style="height: 360px;"> <?php } ?> <div id="announcement-ctr"> <?php Pjax::begin(['id' => 'anc-list-modal', 'timeout' => 360000]); ?> <?php echo UiListView::widget(['dataProvider' => DataCenter::recentAnnouncement(Yii::$app->session->get('announcementSize')), 'options' => ['class' => 'ui divided relaxed items', 'style' => 'padding-top: 10px;'], 'layout' => '{items}', 'itemView' => '_announcement-list']); ?> <?php Pjax::end(); ?> <div style="text-align: center; margin-bottom: -15px; margin-top: 10px; padding-bottom: 15px;"> <button id="view-more-announcement" class="ui fluid basic small circular icon button">View More</button> </div> <br> </div> <?php if (AuthAssignment::getAssignment(Yii::$app->user->identity->id) === 'dev' || AuthAssignment::getAssignment(Yii::$app->user->identity->id) === 'master' || AuthAssignment::getAssignment(Yii::$app->user->identity->id) === 'admin' || AuthAssignment::getAssignment(Yii::$app->user->identity->id) === 'principal') { ?> <div class="announcement-write"> <div class="ui fluid container"> <?php
<?php use yii\helpers\Html; use app\models\Board; use app\models\DataCenter; use app\models\UiListView; use yii\widgets\Pjax; ?> <div id="board-content" style="padding: 0 0 0 10px; width: 100%;"> <?php Pjax::begin(['id' => 'board-list']); ?> <?php echo UiListView::widget(['dataProvider' => DataCenter::recentBoard(Yii::$app->session->get('boardSize')), 'options' => ['class' => 'ui fitted items', 'id' => 'bm'], 'layout' => '{items}', 'itemView' => '_board-list']); ?> <?php Pjax::end(); ?> <div style="text-align: center; margin: 10px 0;"><button id="view-more-board" class="ui fluid basic small circular button">View More</button></div> </div>
public function actionFetchAnnouncement($data) { if (Yii::$app->request->isAjax && !Yii::$app->user->isGuest) { Yii::$app->response->format = Response::FORMAT_JSON; $object = json_decode($data); $announcement = DataCenter::countAnnouncement(); if ($count !== $object->poll) { $list = UiListView::widget(['dataProvider' => $announcement, 'options' => ['class' => 'ui divided relaxed items', 'style' => 'padding: 10px;'], 'layout' => '{items}', 'itemView' => function ($model) { if (\Carbon\Carbon::createFromTimestamp($model->created_at, 'Asia/Manila')->diffInDays() < 5) { $timestamp = DataHelper::carbonDateDiff($model->created_at); } else { $timestamp = ''; } return '<div class="ui top aligned content"> <div class="right floated"> <a id="#" class="anc-delete"><i class="remove icon" style="color: #767676;"></i></a> </div> <div class="description" style="margin-top: -2px;">' . $model->content . '</div> <div class="meta"> <div class="left aligned text"> <small>' . $timestamp . '</small> </div> </div> </div>'; }]); $begin = Html::tag('div', '', ['id' => 'anc-list-modal', 'data-pjax-container' => '', 'data-pjax-push-state' => '', 'data-pjax-timeout' => 360000]); $end = '</div>'; $content = Html::tag('div', $list, ['class' => 'ui divided relaxed items', 'style' => 'padding: 0 10px;']); $data = array('begin' => $begin, 'content' => $content, 'end' => $end); } return $data; } }