This commit is contained in:
2024-11-20 16:40:08 +03:00
commit c24d319159
13 changed files with 918 additions and 0 deletions

36
views/default/_form.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\MailType */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="mole-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'project'); ?>
<?= $form->field($model, 'name'); ?>
<?= $form->field($model, 'dateAdd'); ?>
<?= $form->field($model, 'dateStart'); ?>
<?= $form->field($model, 'dateEnd'); ?>
<?= $form->field($model, 'module'); ?>
<?= $form->field($model, 'controller'); ?>
<?= $form->field($model, 'params'); ?>
<?= $form->field($model, 'period'); ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('mole', 'Save'), ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

30
views/default/create.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model app\models\MailType */
$this->title = Yii::t('mole', 'Create Task');
$this->params['breadcrumbs'][] = ['label' => Yii::t('mole', 'Task List'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-12">
<div class="tabs-container">
<div class="tab-content">
<div class="tab-pane active">
<div class="panel-body">
<?=
$this->render('_form', [
'model' => $model,
])
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

93
views/default/index.php Normal file
View File

@@ -0,0 +1,93 @@
<?php
/*
* This file is part of the Dektrium project.
*
* (c) Dektrium project <http://github.com/dektrium>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
use yii\grid\GridView;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\web\View;
use yii\widgets\Pjax;
/**
* @var \yii\web\View $this
* @var \yii\data\ActiveDataProvider $dataProvider
* @var \dektrium\user\models\UserSearch $searchModel
*/
$this->title = Yii::t('mole', 'Task List');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-12">
<div class="tabs-container">
<div class="tab-content">
<div class="tab-pane active">
<div class="panel-body">
<p>
<?= Html::a(Yii::t('mole', 'Create Task'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?=
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'layout' => "{items}\n{pager}",
'columns' => [
'id',
'project',
'name',
// 'parentId',
'dateAdd:datetime',
'dateStart:datetime',
'dateEnd:datetime',
//'module',
'controller',
// 'type',
//'params',
[
'attribute' => 'isReady',
'value' => function($model)
{
return $model->isReady ? Yii::t('mole', 'Yes') : Yii::t('mole', 'No');
},
// 'filter' => [0 => Yii::t('mole', 'No'), 1 => Yii::t('mole', 'Yes')]
],
[
'attribute' => 'completed',
'value' => function($model)
{
return $model->completed ? Yii::t('mole', 'Yes') : Yii::t('mole', 'No');
},
// 'filter' => [0 => Yii::t('mole', 'No'), 1 => Yii::t('mole', 'Yes')]
],
'priority',
[
'attribute' => 'period',
'value' => function($model)
{
return $model->period > 0 ? $model->period : Yii::t('mole', 'No');
},
],
//'childsTotalCount',
//'childsCompleted',
// 'status',
[
'class' => 'yii\grid\ActionColumn',
],
],
]);
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

35
views/default/update.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model app\models\MailType */
$this->title = Yii::t('mole', 'Update Task: {nameAttribute}', [
'nameAttribute' => $model->name,
]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('mole', 'Task List'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('mole', 'Update');
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-12">
<div class="tabs-container">
<div class="tab-content">
<div class="tab-pane active">
<div class="panel-body">
<?=
$this->render('_form', [
'model' => $model,
])
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

92
views/default/view.php Normal file
View File

@@ -0,0 +1,92 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\grid\GridView;
use app\components\Helper;
/* @var $this yii\web\View */
/* @var $model app\models\MailType */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('mole', 'Task List'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-12">
<div class="tabs-container">
<div class="tab-content">
<div class="tab-pane active">
<div class="panel-body">
<p>
<?= Html::a(Yii::t('mole', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?=
Html::a(Yii::t('mole', 'Delete'), ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('mole', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
])
?>
</p>
<?=
DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'project',
'name',
'parentId',
'dateAdd:datetime',
'dateStart:datetime',
'dateEnd:datetime',
'module',
'controller',
'type',
[
'attribute' => 'params',
'value' => function($model)
{
return print_r(json_decode($model->params, true), true);
},
],
[
'attribute' => 'isReady',
'value' => function($model)
{
return $model->isReady ? Yii::t('mole', 'Yes') : Yii::t('mole', 'No');
},
],
[
'attribute' => 'completed',
'value' => function($model)
{
return $model->completed ? Yii::t('mole', 'Yes') : Yii::t('mole', 'No');
},
],
'priority',
'status',
[
'attribute' => 'period',
'value' => function($model)
{
return $model->period > 0 ? $model->period : Yii::t('mole', 'No');
},
],
],
])
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>