<?php

/* @var $this CmsCommentController */
/* @var $model CmsComment */
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#cms-comment-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Журнал коментариев</h1>


<?php 
echo CHtml::link('Расширеный поиск', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
echo CHtml::form();
echo "<br>";
echo CHtml::submitButton('Опубликовать', array('name' => 'opyblic', 'class' => 'btn btn-primary', 'style' => 'width : 200px'));
?>


<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'cms-comment-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'selectableRows' => 2, 'columns' => array('id' => array('name' => 'id', 'headerHtmlOptions' => array('width' => 30)), array('class' => 'CCheckBoxColumn', 'id' => 'page_id'), 'status' => array('name' => 'status', 'value' => '($data->status==0)?"Скрыт":"Опубликован"', 'filter' => array(0 => "Скрыт", 1 => "Опубликован")), 'content', 'page_id' => array('name' => 'page_id', 'value' => '$data->page->title', 'filter' => CmsPage::all()), 'created' => array('name' => 'created', 'value' => 'date("j.m.Y.H:i",$data->created)', 'filter' => false), 'user_id' => array('name' => 'user_id', 'value' => '$data->user->username', 'filter' => CmsUser::all()), 'guest', array('class' => 'CButtonColumn', 'updateButtonOptions' => array('style' => 'display:none')))));
	<div class="row">
		<?php 
echo $form->label($model, 'content');
?>
		<?php 
echo $form->textArea($model, 'content', array('rows' => 6, 'cols' => 50));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'page_id');
?>
		<?php 
echo $form->dropDownList($model, 'page_id', CmsPage::all(), array('empty' => ''));
?>
	</div>


	<div class="row">
		<?php 
echo $form->label($model, 'user_id');
?>
		<?php 
echo $form->dropDownList($model, 'user_id', CmsUser::all(), array('empty' => ''));
?>
	</div>

	<div class="row">
		<?php