 <script>
    $(document).ready(function() {
        $(".to-hide").hide(); 

        $('#AdminForm_mute').live('keyup',function(){
           if ($(this).val().length === 0)
                $(".to-hide").hide();
           else
              $(".to-hide").show();
        });
    });
</script>
<div class="modal-dialog">
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'panel-form',
        'enableAjaxValidation'=>true,
        'htmlOptions'=>array(
          'class'=>'form-horizontal',
        ),
    ));
    ?>

    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">
                <span aria-hidden="true">&times;</span><span class="sr-only">Закрыть</span>
            </button>
            <h4 class="modal-title">Редактирование сообщения</h4>
        </div>
        <div class="modal-body">
            <div class="form-group">
                <?php echo $form->labelEx($model, 'id_user', array('class' => 'col-sm-3')); ?>
                <div class="col-sm-9">
                    <?php echo Users::getLoginWithLink($message->id_user); ?>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12">
                    <?php echo $form->textArea($model, 'message', array('class' => 'form-control', 'placeholder'=>$model->getAttributeLabel('message'))); ?>
                    <?php echo $form->error($model, 'message'); ?>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12">
                    <?php echo $form->textField($model, 'answer', array('class' => 'form-control', 'placeholder'=>$model->getAttributeLabel('answer'))); ?>
                    <?php echo $form->error($model, 'answer'); ?>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12">
                    <?php echo $form->textField($model, 'mute', array('class' => 'form-control', 'placeholder'=>$model->getAttributeLabel('mute'))); ?>
                    <?php echo $form->error($model, 'mute'); ?>
                </div>
            </div>
            <div class="form-group to-hide">
                <div class="col-sm-12">
                    <?php echo $form->textField($model, 'reason', array('class' => 'form-control', 'placeholder'=>$model->getAttributeLabel('reason'))); ?>
                    <?php echo $form->error($model, 'reason'); ?>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <?php echo CHtml::submitButton(Yii::t('layout', 'Редактировать'), array('class' => 'btn-block form-control sendModalForm')); ?>
        </div>
    </div>
    <?php $this->endWidget(); ?>
</div>