intermediate commit

This commit is contained in:
iIronside
2022-01-07 15:04:11 +03:00
parent e16e72dcc1
commit d31a4757ff
32 changed files with 5163 additions and 270 deletions

View File

@ -11,11 +11,20 @@ use yii\grid\GridView;
/* @var $templateFieldDataProvider yii\data\ActiveDataProvider */
/* @var $model backend\modules\document\models\Template */
$this->title = $model->title;
$this->title = cut_title($model->title);
$this->params['breadcrumbs'][] = ['label' => 'Templates', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
YiiAsset::register($this);
function cut_title($str)
{
if(strlen($str) > 35){
return mb_substr($str, 0, 35, 'UTF-8') . '...';
}
return $str;
}
?>
<div class="template-view">
<p>
@ -35,34 +44,19 @@ YiiAsset::register($this);
'attributes' => [
'id',
[
'attribute'=>'title',
'format'=>'raw',
'value' => function($model){
return $model->title . Html::a(
'<i class="glyphicon glyphicon-pencil"></i>', ['update', 'id' => $model->id],
[
'title' => 'Update',
'class' => 'pull-right detail-button',
]
);
}
],
'title',
'created_at',
'updated_at',
[
'label'=>'template_file_name',
'format'=>'raw',
'value' => function($model){
return $model->template_file_name . Html::a('<i class="glyphicon glyphicon-pencil"></i>', Url::to(['actualizar', 'id' => $model->id]), [
'title' => 'Actualizar',
// 'class' => 'pull-right detail-button',
]);
}
'label'=>'template_file_name',
'format'=>'raw',
'value' => function($model){
return $model->template_file_name . Html::a(' <i class="glyphicon glyphicon-pencil"></i>',
Url::to(['actualizar', 'id' => $model->id]), [
'title' => 'Actualizar',
// 'class' => 'pull-right detail-button',
]);
}
]
],
]) ?>
@ -95,9 +89,13 @@ YiiAsset::register($this);
[
'attribute' => 'field_id',
'filter' => DocumentField::find()->select(['title', 'id'])->indexBy('id')->column(),
'value' => 'field.title',
],
[
'attribute' => 'field.field_template',
'value' => 'field.field_template',
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view}{delete}',