resources/views/type/edit.blade.php
@extends('layouts.default')

@section('header')
	@if ($type->id)
	{{--*/ $operation = 'update' /*--}}
	<span class="mdl-layout-title">{{$type->name}}</span>
	@else
	{{--*/ $operation = 'create' /*--}}
	<span class="mdl-layout-title">{{Lang::get("general.Type")}}</span>
	@endif
@stop

@section('content')

@permission($operation.'.type')

<div class="">
	<section class="demo-section demo-section--textfield demo-page--textfield mdl-upgraded">
		<div class="demo-preview-block">

@if (!$type->id)
{!! Form::open(['route' => 'type.store']) !!}
@else
{!! Form::model('$type', [
        'method'=>'PUT',
        'route' => ['type.update',$type->id]
    ]) !!}
@endif
			
			<div class="mdl-textfield mdl-js-textfield is-upgraded is-focused mdl-textfield--floating-label @if ($errors->has('name')) is-invalid is-dirty @endif"" data-upgraded="eP">
         		@if(!empty($type->locked))
         		{!!Form::text('name', $type->name, ['class' => 'mdl-textfield__input', 'disabled' => 'disabled'])!!}
         		@else
         		{!!Form::text('name', $type->name, ['class' => 'mdl-textfield__input'])!!}
         		@endif
				{!!Form::label('name', Lang::get('general.name'), ['class' => 'mdl-color-text--primary-contrast mdl-textfield__label is-dirty'])!!}
				<span class="mdl-textfield__error">{{ $errors->first('name') }}</span>
			</div>

			{!!Form::hidden('locked', $type->locked, ['id' => 'locked'])!!}
				
			<div class="mdl-textfield mdl-js-textfield is-upgraded is-focused mdl-textfield--floating-label @if ($errors->has('entity_key')) is-invalid is-dirty @endif"" data-upgraded="eP">
         		{!!Form::text('entity_key', $type->entity_key, ['class' => 'mdl-textfield__input'])!!}
				{!!Form::label('entity_key', Lang::get('general.entity_key'), ['class' => 'mdl-color-text--primary-contrast mdl-textfield__label is-dirty'])!!}
				<span class="mdl-textfield__error">{{ $errors->first('entity_key') }}</span>
			</div>

			<div class="mdl-card__actions">
				<button type="submit" class="mdl-button mdl-color--primary mdl-color-text--accent-contrast mdl-js-button mdl-button--raised mdl-button--colored">
                  {{ Lang::get('general.Send') }} 
                </button>
			</div>
	
{!! Form::close() !!}

		</div>
	</section>
</div>

@else
<div class="alert alert-info">
	{{Lang::get("general.accessdenied")}}
</div>
@endpermission

@stop