<?php
$this->breadcrumbs=array(
	'Tip promene'=>array('index'),
	'Admin',
);

$this->menu=array(
	//array('label'=>'List Tip promene','url'=>array('index'),'icon'=>'list'),
	array('label'=>'Dodaj Tip promene','url'=>array('create'),'icon'=>'plus'),
);

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

<h1>Administracija Tipova promene</h1>

<script type="text/javascript">
    jQuery(function ($) {
        $("body").on("dblclick", ".grid-view tbody > tr", function (e) {
            window.location.href = $(this).find('.update').attr('href');
        });
    });
</script>


<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'tippromene-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		//'id',
		//'ulaz_izlaz',
        array(
            'name'=>'ulaz_izlaz',
            'value' => '($data->ulaz_izlaz == "1") ? Yii::t(\'translation\', \'+\') : Yii::t(\'translation\', \'-\')',
            'filter'=> array('1'=>Yii::t('translation', 'Ulaz'),'2'=>Yii::t('translation', 'Izlaz')),
        ),
		'naziv',
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
		),
	),
)); ?>
