@extends('layouts.default')

{{-- Web site Title --}}
@section('title')
@parent
Создание нового проекта
@stop

{{-- Content --}}
@section('content')
<div class="row">
	<div class="col-md-6 col-md-offset-3">
		{{ Form::open(array('action' => 'ProjectsController@store')) }}
		<h2>Создание нового проекта</h2>

		<div class="form-group {{ ($errors->has('name')) ? 'has-error' : '' }}">
			{{ Form::label( 'name', 'Название:', array('class' => 'control-label') ) }}
			{{ Form::text('name', null, array('class' => 'form-control', 'placeholder' => 'Название', 'autofocus')) }}
			{{ ($errors->has('name') ? $errors->first('name') : '') }}
		</div>

		<div class="form-group">
			<label class="checkbox-inline">
				{{ Form::checkbox('usecrm', 1) }} использовать CRM систему
			</label>
		</div>

		{{ Form::label('Участники проекта') }}
		<div class="form-group">
			@foreach ($users as $user)
			<label class="checkbox-inline">
				{{ Form::checkbox('projectUsers['.$user->id.']', 1) }} {{ $user->first_name }} {{ $user->last_name }}
			</label>
			<br/>
			@endforeach
		</div>

		{{ Form::submit('Создать проект', array('class' => 'btn btn-primary')) }}
		{{ Form::button('Отмена', array('class' => 'btn btn-default', 'onclick'=>'location="'.URL::to('projects').'"')) }}

    {{ Form::close() }}
	</div>
</div>

@stop