<?php
 /* @var $this DepartmentController */
 /* @var $model Department */

 $this->breadcrumbs = array(
     yii::t('default', 'Configurations') => array('/dashboard/configuration'),
     yii::t('default', 'Backups') => array('index'),
 );


 Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('backup-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div id="flash-msg">
     <br>
    <?php $this->widget('bootstrap.widgets.TbAlert'); ?>
</div>


<?php
     $this->widget('ext.bootstrap.widgets.TbGridView', array(
         'id' => 'backup-grid',
         'type' => 'striped',
         'dataProvider' => $dataProvider,
         'template' => '{pager}{summary}{items}',
         'columns' => array(
             array(
                 'name' => 'name',
                 'value' => 'CHtml::link($data["name"], Yii::app()->createUrl("backup/download", array("file"=>$data["name"])))',
                 'type' => 'raw',
                 'header' => yii::t('default', 'Name'),
             ),
             array(
                 'name' => 'size',
                 'header' => yii::t('default', 'File Size')),
             array(
                 'name' => 'create_time',
                 'header' => yii::t('default', 'Created Time')),
             array(
                 'class' => 'CButtonColumn',
                 'template' => ' {delete} ',
                 'buttons' => array
                     (
                     'delete' => array
                         (
                         'url' => 'Yii::app()->createUrl("backup/delete", array("file"=>$data["name"]))',
                     ),
                 ),
             ),
         ),
     )); ?>