1
0
www.mikescher.com/www/protected/views/log/_form.php
Mike Schwörer 6e39aefd52 Added various things
Translated Log + Short Prog Desc to Eng
Added Category filter to progs
2014-06-30 22:51:59 +02:00

57 lines
1.9 KiB
PHP

<?php
/* @var $this LogController */
/* @var $model Log */
/* @var $form TbActiveForm */
?>
<div class="form">
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id'=>'log-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// There is a call to performAjaxValidation() commented in generated controller code.
// See class documentation of CActiveForm for details on this.
'enableAjaxValidation'=>false,
)); ?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<?php
if ($model->isNewRecord)
echo $form->textFieldControlGroup($model,'date',array('span'=>5, 'value' => date('Y-m-d')));
else
echo $form->textFieldControlGroup($model,'date',array('span'=>5, ));
?>
<?php echo $form->textAreaControlGroup($model,'title',array('rows'=>6,'span'=>8)); ?>
<?php echo $form->textAreaControlGroup($model,'content',array('rows'=>6,'span'=>8)); ?>
<?php echo MsHtml::ajaxButton ("Preview", CController::createUrl('log/ajaxMarkdownPreview'),
[
'type'=>'POST',
'data' => ['content'=> 'js: $("#Log_content").val()'],
'update' => '#markdownAjaxContent',
'error'=>'function(msg){alert("An error has happened");}',
]); ?>
<br>
<br>
<div class="well markdownOwner" id="markdownAjaxContent">
<?php $this->renderPartial('_ajaxMarkdownPreview', ['content' => $model->content, ], false, true); ?>
</div>
<div class="form-actions">
<?php echo MsHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array(
'color'=>MsHtml::BUTTON_COLOR_PRIMARY,
'size'=>MsHtml::BUTTON_SIZE_LARGE,
)); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->