@extends('layouts.default')

@section('title')
@parent
Редактирование группы расходов :: Бюджет для "{{ $workProject->name }}"
@stop

@section('content')
<div class="row">
	<div class="col-md-6 col-md-offset-3">
		{{ Form::open(array('action' => array('BudgetCostGroupController@update', $budgetCostGroup->id), 'method' => 'put')) }}
		<h2>Редактирование группы расходов для "{{ $workProject->name }}"</h2>

		<div class="form-group {{ ($errors->has('name')) ? 'has-error' : '' }}">
			{{ Form::label( 'name', 'Название:', array('class' => 'control-label') ) }}
			{{ Form::text('name', $budgetCostGroup->name, array('class' => 'form-control', 'placeholder' => 'Название', 'autofocus')) }}
			{{ ($errors->has('name') ? $errors->first('name') : '') }}
		</div>

		<div class="form-group {{ ($errors->has('plan_amount')) ? 'has-error' : '' }}">
			{{ Form::label( 'plan_amount', 'Процент от общей суммы расходов:', array('class' => 'control-label') ) }}
			{{ Form::text('plan_amount', $budgetCostGroup->plan_amount, array('class' => 'form-control', 'placeholder' => 'Процент от общей суммы расходов')) }}
			{{ ($errors->has('plan_amount') ? $errors->first('plan_amount') : '') }}
		</div>

		{{ Form::submit('Сохранить группу расходов', array('class' => 'btn btn-primary')) }}
		{{ Form::button('Отмена', array('class' => 'btn btn-default', 'onclick'=>'location="'.URL::to('budget/cost_group').'"')) }}

    {{ Form::close() }}
	</div>
</div>

@stop