
<?php $__env->startSection('title'); ?>
@parent
Редактирование новости
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
	<script src="<?php echo asset('js/tinymce/tinymce.min.js'); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
	<div>
		<?php echo Form::open(array('action' => array('ProjectNewsController@update', $project->id, $projectNews->id), 'method' => 'put')); ?>
		<h2>Редактирование новости №<?php echo $projectNews->id; ?></h2>

		<div class="form-group <?php echo ($errors->has('type')) ? 'has-error' : ''; ?>">
			<?php echo Form::label( 'type', 'Рубрика:', array('class' => 'control-label') ); ?>
			<?php echo Form::select('type', ProjectNewsTypes::getAllTypes(), $projectNews->type_id, array('class' => 'form-control')); ?>
			<?php echo ($errors->has('type') ? $errors->first('type') : ''); ?>
		</div>
		<div class="form-group <?php echo ($errors->has('name')) ? 'has-error' : ''; ?>">
			<?php echo Form::label( 'name', 'Название:', array('class' => 'control-label') ); ?>
			<?php echo Form::text('name', $projectNews->name, array('class' => 'form-control', 'autofocus')); ?>
			<?php echo ($errors->has('name') ? $errors->first('name') : ''); ?>
		</div>
		<div class="form-group <?php echo ($errors->has('content')) ? 'has-error' : ''; ?>">
			<?php echo Form::label( 'content', 'Содержание:', array('class' => 'control-label') ); ?>
			<?php echo Form::textarea('content', htmlspecialchars_decode($projectNews->content), array('class' => 'form-control tinyEditor')); ?>
			<?php echo ($errors->has('content') ? $errors->first('content') : ''); ?>
		</div>

		<?php echo Form::hidden('id', $projectNews->id); ?>
		<?php echo Form::submit('Сохранить изменения', array('class' => 'btn btn-primary')); ?>
		<?php echo Form::button('Отмена', array('class' => 'btn btn-default', 'onclick'=>'location="'.URL::to('projects').'/'.$project->id.'/project_news"')); ?>

    <?php echo Form::close(); ?>
	</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.default', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>