<?php

$this->actionsMenu = array(
    array('label' => 'Упорядочить акции', 'url' => array('order'), 'icon' => 'icon-resize-vertical', 'active' => '/' . $this->id . '\/order/'),
    array('label' => 'Добавить акцию', 'url' => array('create'), 'icon' => 'icon-plus', 'active' => '/' . $this->id . '\/create/'),
);

?>

<h1>Управление акциями</h1>
<br/>
<?php $this->widget('BGridView', array(
    'id' => 'action-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        array(
            'name' => 'action_category_id',
            'value' => '$data->actionCategory->i18n->name',
            'filter' => CHtml::activeDropDownList($model, 'action_category_id', array('' => 'Все') + CHtml::listData(ActionCategory::model()->with('i18n')->findAll(), 'id', 'i18n.name')),
        ),
        'i18n.name',
        array(
            'name' => 'is_finished',
            'value' => '$data->is_finished?"Да":"Нет"',
            'filter' => CHtml::activeDropDownList($model, 'is_finished', array('' => 'Все', '0' => 'Нет', '1' => 'Да')),
        ),
        array(
            'class' => 'CButtonColumn',
            'template' => '{update} {delete}',
        ),
    ),
)); ?>
