<?php

/**
 * Cafedra page view.
 *
 * @var \yii\web\View $this View
 * @var \romaten1\univer\models\frontend\Blog $model Model
 */
use romaten1\univer\Module;
use yii\helpers\Html;
$this->title = $model['title'];
$this->params['breadcrumbs'] = [['label' => Module::t('univer', 'BACKEND_INDEX_TITLE'), 'url' => ['index']], $this->title];
?>
<div class="row">
    <aside class="col-sm-4 col-sm-push-8">
        <div class="widget ads">
            <div class="row">
                <div class="col-xs-6">
                    <img class="img-responsive img-rounded" src="<?php 
echo $this->assetManager->publish('@frontend/themes/site/images/ads/ad1.png')[1];
?>
" alt="Ads" />
                </div>

                <div class="col-xs-6">
                    <img class="img-responsive img-rounded" src="<?php 
echo $this->assetManager->publish('@frontend/themes/site/images/ads/ad2.png')[1];
?>
" alt="Ads" />
                </div>
            </div>
 /**
  * @return array Status array.
  */
 public static function getStatusArray()
 {
     return [self::STATUS_UNPUBLISHED => Module::t('univer', 'STATUS_UNPUBLISHED'), self::STATUS_PUBLISHED => Module::t('univer', 'STATUS_PUBLISHED')];
 }
<?php

/**
 * Cafedra create view.
 *
 * @var \yii\base\View $this View
 * @var \romaten1\univer\models\backend\Cafedra $model Model
 * @var array $statusArray Statuses array
 */
use backend\themes\admin\widgets\Box;
use romaten1\univer\Module;
$this->title = Module::t('univer', 'BACKEND_CREATE_TITLE');
$this->params['subtitle'] = Module::t('univer', 'BACKEND_CREATE_SUBTITLE');
$this->params['breadcrumbs'] = [['label' => $this->title, 'url' => ['index']], $this->params['subtitle']];
?>
<div class="row">
    <div class="col-sm-12">
        <?php 
$box = Box::begin(['title' => $this->params['subtitle'], 'renderBody' => false, 'options' => ['class' => 'box-primary'], 'bodyOptions' => ['class' => 'table-responsive'], 'buttons' => [['url' => ['index'], 'icon' => 'fa-reply', 'options' => ['class' => 'btn-default', 'title' => Module::t('blogs', 'BACKEND_CANCEL_BTN_TITLE')]]]]);
echo $this->render('_form', ['model' => $model, 'statusArray' => $statusArray, 'box' => $box]);
Box::end();
?>
    </div>
</div>
/**
 * Cafedra list item view.
 *
 * @var \yii\web\View $this View
 * @var \romaten1\univer\models\frontend\Blog $model Model
 */
use romaten1\univer\Module;
use yii\helpers\Html;
if ($model->image_id) {
    ?>
    <?php 
    echo Html::a(Html::img($model->urlAttribute('image_id'), ['class' => 'img-responsive img-blog', 'width' => '100%', 'alt' => $model->title]), ['view', 'id' => $model->id, 'alias' => $model->title_en]);
}
?>

<div class="cafedra-content">
    <h3>
        <?php 
echo Html::a($model->title, ['view', 'id' => $model->id, 'alias' => $model->title_en]);
?>
    </h3>

    
    <?php 
echo $model->description;
?>
    <?php 
echo Html::a(Module::t('univer', 'FRONTEND_INDEX_READ_MORE_BTN') . ' <i class="icon-angle-right"></i>', ['view', 'id' => $model->id, 'alias' => $model->title_en], ['class' => 'btn btn-default']);
?>
</div>
    </div>
    
    <div class="row">
        <div class="col-sm-12">
            <?php 
echo $form->field($model, 'faculty_id');
?>

        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <?php 
echo $form->field($model, 'image_id')->widget(FileAPI::className(), ['settings' => ['url' => ['/univer/default/fileapi-upload']]]);
?>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <?php 
echo $form->field($model, 'description')->widget(Imperavi::className(), ['settings' => ['minHeight' => 200, 'imageGetJson' => Url::to(['/univer/default/imperavi-get']), 'imageUpload' => Url::to(['/univer/default/imperavi-image-upload']), 'fileUpload' => Url::to(['/univer/default/imperavi-file-upload'])]]);
?>
        </div>
    </div>
    
<?php 
$box->endBody();
$box->beginFooter();
echo Html::submitButton($model->isNewRecord ? Module::t('univer', 'BACKEND_CREATE_SUBMIT') : Module::t('univer', 'BACKEND_UPDATE_SUBMIT'), ['class' => $model->isNewRecord ? 'btn btn-primary btn-large' : 'btn btn-success btn-large']);
$box->endFooter();
ActiveForm::end();
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('univer', 'ATTR_ID'), 'faculty_id' => Module::t('univer', 'ATTR_FACULTY_ID'), 'title' => Module::t('univer', 'ATTR_TITLE'), 'title_en' => Module::t('univer', 'ATTR_TITLE_EN'), 'description' => Module::t('univer', 'ATTR_DESCRIPTION'), 'image_id' => Module::t('univer', 'ATTR_IMAGE_ID'), 'active' => Module::t('univer', 'ATTR_ACTIVE'), 'visited' => Module::t('univer', 'ATTR_VISITED')];
 }
 */
use backend\themes\admin\widgets\Box;
use backend\themes\admin\widgets\GridView;
use romaten1\univer\Module;
use yii\grid\ActionColumn;
use yii\grid\CheckboxColumn;
use yii\helpers\Html;
use yii\jui\DatePicker;
$this->title = Module::t('univer', 'BACKEND_INDEX_TITLE');
$this->params['subtitle'] = Module::t('univer', 'BACKEND_INDEX_SUBTITLE');
$this->params['breadcrumbs'] = [$this->title];
?>

<div class="row">
    <div class="col-xs-12">
        <?php 
Box::begin(['title' => $this->params['subtitle'], 'bodyOptions' => ['class' => 'table-responsive'], 'buttonsTemplate' => '{create} {batch-delete}', 'grid' => 'univer-grid']);
?>
        <?php 
echo GridView::widget(['id' => 'univer-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => CheckboxColumn::classname()], 'id', ['attribute' => 'title', 'format' => 'html', 'value' => function ($model) {
    return Html::a($model['title'], ['update', 'id' => $model['id']]);
}], ['attribute' => 'active', 'format' => 'html', 'value' => function ($model) {
    $class = $model->active === $model::STATUS_PUBLISHED ? 'label-success' : 'label-danger';
    return '<span class="label ' . $class . '">' . $model->active . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'active', $statusArray, ['class' => 'form-control', 'prompt' => Module::t('univer', 'BACKEND_PROMPT_STATUS')])], ['class' => ActionColumn::className(), 'template' => '{update} {delete}']]]);
?>
        <?php 
Box::end();
?>
    </div>
</div>
<?php

/**
 * Blog update view.
 *
 * @var yii\base\View $this View
 * @var romaten1\univer\models\backend\Cafedra $model Model
 * @var array $statusArray Statuses array
 * @var \backend\themes\admin\widgets\Box $box Box widget instance
 */
use backend\themes\admin\widgets\Box;
use romaten1\univer\Module;
$this->title = Module::t('univer', 'BACKEND_UPDATE_TITLE');
$this->params['subtitle'] = Module::t('univer', 'BACKEND_UPDATE_SUBTITLE');
$this->params['breadcrumbs'] = [['label' => $this->title, 'url' => ['index']], $this->params['subtitle']];
?>
<div class="row">
    <div class="col-sm-12">
        <?php 
$box = Box::begin(['title' => $this->params['subtitle'], 'renderBody' => false, 'options' => ['class' => 'box-success'], 'bodyOptions' => ['class' => 'table-responsive'], 'buttonsTemplate' => '{cancel} {delete}']);
echo $this->render('_form', ['model' => $model, 'statusArray' => $statusArray, 'box' => $box]);
Box::end();
?>
    </div>
</div>
<?php

/**
 * Blog list page view.
 *
 * @var \yii\web\View $this View
 * @var \yii\data\ActiveDataProvider $dataProvider DataProvider
 */
use romaten1\univer\Module;
use yii\widgets\ListView;
$this->title = Module::t('univer', 'FRONTEND_INDEX_TITLE');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">

    <aside class="col-sm-4 col-sm-push-8">
        <div class="widget ads">
            <div class="row">
                <div class="col-xs-6">
                    <img class="img-responsive img-rounded" src="<?php 
echo $this->assetManager->publish('@frontend/themes/site/images/ads/ad1.png')[1];
?>
" alt="Ads" />
                </div>

                <div class="col-xs-6">
                    <img class="img-responsive img-rounded" src="<?php 
echo $this->assetManager->publish('@frontend/themes/site/images/ads/ad2.png')[1];
?>
" alt="Ads" />
                </div>