<?php use esoftslimited\blog\Module; use pendalf89\tree\TreeWidget; /* @var $this yii\web\View */ /* @var $models array */ /* @var $model esoftslimited\blog\models\Category */ $this->title = Module::t('main', 'Category tree'); $this->params['breadcrumbs'][] = ['label' => Module::t('main', 'Blog'), 'url' => ['default/index']]; $this->params['breadcrumbs'][] = ['label' => Module::t('main', 'Categories'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="category-index"> <h1><?php echo $this->title; ?> </h1> <?php $data = TreeWidget::widget(['models' => $models, 'value' => function ($model) { return $model->title; }]); ?> <?php echo \talma\widgets\JsTree::widget(['attribute' => 'title', 'model' => $model, 'core' => ['data' => $data], 'plugins' => ['dnd', 'contextmenu', 'wholerow', 'state']]); ?> </div>
<?php echo $form->field($product, 'short_desc')->textarea(['rows' => 3, 'placeholder' => 'Краткое описание товара']); ?> <?php echo $form->field($product, 'description')->textarea(['rows' => 8, 'placeholder' => 'Полное описание товара']); ?> <?php echo ProductHelper::getPricesFields($form, $product); ?> </div> <div class="col-md-3"> <?php echo \talma\widgets\JsTree::widget(['id' => 'cat_tree', 'name' => 'js_tree', 'core' => ['data' => ['url' => \yii\helpers\Url::to(['categories/ajax', 'prod_id' => $product->id])]], 'types' => ['default' => ['icon' => 'fa fa-folder text-warning fa-lg'], 'file' => ['icon' => 'fa fa-file text-warning fa-lg']], 'plugins' => ['types', 'dnd', 'contextmenu', 'wholerow', 'state', 'checkbox']]); ?> </div> </div> </div> <div class="tab-pane fade" id="parameters"> <br> <?php echo ProductHelper::getParameterFields($form, $product); ?> </div> <div class="tab-pane fade" id="images_upload"> <br> <?php echo FileInput::widget(['model' => $product_image, 'attribute' => 'image_url[]', 'options' => ['multiple' => true], 'pluginOptions' => ['initialPreview' => ProductHelper::getImages($product), 'initialPreviewConfig' => ProductHelper::getImagesExtra($product), 'initialPreviewShowDelete' => true, 'overwriteInitial' => false]]);
$panelButtons[] = '{mass-delete}'; $actions[] = '{delete}'; } if (Yii::$app->user->can('ACPCategoriesView')) { $actions[] = '{view}'; } $gridActionsColumn = ['class' => ActionColumn::className(), 'template' => implode(' ', $actions)]; $panelButtons = !empty($panelButtons) ? implode(' ', $panelButtons) : null; ?> <?php Panel::begin(['title' => $this->title, 'buttonsTemplate' => $panelButtons, 'grid' => $gridId]); ?> <?php echo \talma\widgets\JsTree::widget(['name' => 'js_tree', 'core' => ['data' => ['url' => \yii\helpers\Url::to(['ajax'])]], 'types' => ['default' => ['icon' => 'fa fa-folder text-warning fa-lg'], 'file' => ['icon' => 'fa fa-file text-warning fa-lg']], 'plugins' => ['types', 'dnd', 'contextmenu', 'wholerow', 'state']]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => CheckboxColumn::classname()], 'name', 'slug', ['attribute' => 'parent', 'format' => 'html', 'value' => function ($model) { if ($model->categoriesParent) { return $model->categoriesParent->name; } else { return ''; } }], 'description:ntext', ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) { switch ($model->status) { case $model::STATUS_INACTIVE: $class = 'label-danger'; break; case $model::STATUS_ACTIVE: