Exemplo n.º 1
0
<?php

/**
 * @var $this TodoBackendController
 * @var $model Todo
 */
$this->pageTitle = 'ToDo - Список';
$this->breadcrumbs = [$this->pageTitle];
$this->menu = [['icon' => 'fa fa-fw fa-list-alt', 'label' => 'Список задач', 'url' => ['/todo/todoBackend/index']], ['icon' => 'fa fa-fw fa-plus-square', 'label' => 'Создать задачу', 'url' => ['/todo/todoBackend/create']]];
?>
<div class="page-header">
    <h1><?php 
echo $this->pageTitle;
?>
</h1>
</div>

<?php 
$this->widget('yupe\\widgets\\CustomGridView', ['id' => 'todo-grid', 'type' => 'condensed', 'sortableRows' => true, 'sortableAjaxSave' => true, 'sortableAttribute' => 'sort', 'sortableAction' => '/todo/todoBackend/sortable', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => ['id', 'description', ['name' => 'status', 'class' => 'yupe\\widgets\\EditableStatusColumn', 'url' => $this->createUrl('/todo/todoBackend/inline'), 'source' => TodoStatusHelper::getList(), 'options' => TodoStatusHelper::getStylesList(), 'filter' => CHtml::activeDropDownList($model, 'status', TodoStatusHelper::getList(), ['encode' => false, 'empty' => '', 'class' => 'form-control'])], ['class' => 'yupe\\widgets\\CustomButtonColumn', 'template' => '{update} {delete}']]]);
Exemplo n.º 2
0
$form = $this->beginWidget('\\yupe\\widgets\\ActiveForm', ['id' => 'todo-form', 'enableAjaxValidation' => false, 'enableClientValidation' => true, 'htmlOptions' => ['class' => 'well']]);
?>
    <div class="alert alert-info">Поля отмеченные <span class="required">*</span> обязательны для заполнения</div>

    <?php 
echo $form->errorSummary($model);
?>

    <div class="row">
        <div class="col-sm-8">
            <?php 
echo $form->textFieldGroup($model, 'description');
?>
        </div>
        <div class="col-sm-4">
            <?php 
echo $form->dropDownListGroup($model, 'status', ['widgetOptions' => ['data' => TodoStatusHelper::getList()]]);
?>
        </div>
    </div>

    <?php 
$this->widget('bootstrap.widgets.TbButton', ['buttonType' => 'submit', 'context' => 'primary', 'label' => $model->isNewRecord ? 'Создать задачу и продолжить' : 'Сохранить задачу и продолжить']);
?>

    <?php 
$this->widget('bootstrap.widgets.TbButton', ['buttonType' => 'submit', 'htmlOptions' => ['name' => 'submit-type', 'value' => 'index'], 'label' => $model->isNewRecord ? 'Создать задачу и закрыть' : 'Сохранить задачу и закрыть']);
?>

<?php 
$this->endWidget();