diff --git a/src/stubs/resources/views/simple/forms-formfield-bs3.stub b/src/stubs/resources/views/simple/forms-formfield-bs3.stub new file mode 100644 index 0000000..2d3f4fb --- /dev/null +++ b/src/stubs/resources/views/simple/forms-formfield-bs3.stub @@ -0,0 +1,63 @@ +@if (Request::get('action') == 'create') +@can('create', new fullMstr) + {{ Form::open(['route' => 'masters.store']) }} + {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} + {!! FormField::textarea('description', ['label' => __('master.description')]) !!} + {{ Form::submit(__('master.create'), ['class' => 'btn btn-success']) }} + {{ link_to_route('masters.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ Form::close() }} +@endcan +@endif +@if (Request::get('action') == 'edit' && $editableMaster) +@can('update', $editableMaster) + {{ Form::model($editableMaster, ['route' => ['masters.update', $editableMaster], 'method' => 'patch']) }} + {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} + {!! FormField::textarea('description', ['label' => __('master.description')]) !!} + @if (request('q')) + {{ Form::hidden('q', request('q')) }} + @endif + @if (request('page')) + {{ Form::hidden('page', request('page')) }} + @endif + {{ Form::submit(__('master.update'), ['class' => 'btn btn-success']) }} + {{ link_to_route('masters.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} + @can('delete', $editableMaster) + {{ link_to_route( + 'masters.index', + __('app.delete'), + ['action' => 'delete', 'id' => $editableMaster->id] + Request::only('page', 'q'), + ['id' => 'del-master-'.$editableMaster->id, 'class' => 'btn btn-danger pull-right'] + ) }} + @endcan + {{ Form::close() }} +@endcan +@endif +@if (Request::get('action') == 'delete' && $editableMaster) +@can('delete', $editableMaster) +
{{ $editableMaster->name }}
+ +{{ $editableMaster->description }}
+ {!! $errors->first('master_id', ':message') !!} +{{ $editableMaster->name }}
- +{{ $editableMaster->description }}
{!! $errors->first('master_id', ':message') !!}| {{ __('app.table_no') }} | +{{ __('master.name') }} | +{{ __('master.description') }} | +{{ __('app.action') }} | +
|---|---|---|---|
| {{ $mstrCollections->firstItem() + $key }} | +{{ $singleMstr->name }} | +{{ $singleMstr->description }} | ++ @can('update', $singleMstr) + {{ link_to_route( + 'masters.index', + __('app.edit'), + ['action' => 'edit', 'id' => $singleMstr->id] + Request::only('page', 'q'), + ['id' => 'edit-master-'.$singleMstr->id] + ) }} + @endcan + | +
| {{ __('app.table_no') }} | @@ -51,7 +51,7 @@ @endforeach
|---|
| {{ __('app.table_no') }} | +{{ __('{$this->lang_name}.name') }} | +{{ __('{$this->lang_name}.description') }} | +{{ __('app.action') }} | +
|---|---|---|---|
| {{ \${$this->collection_model_var_name}->firstItem() + \$key }} | +{{ \${$this->single_model_var_name}->name }} | +{{ \${$this->single_model_var_name}->description }} | ++ @can('update', \${$this->single_model_var_name}) + {{ link_to_route( + '{$this->table_name}.index', + __('app.edit'), + ['action' => 'edit', 'id' => \${$this->single_model_var_name}->id] + Request::only('page', 'q'), + ['id' => 'edit-{$this->lang_name}-'.\${$this->single_model_var_name}->id] + ) }} + @endcan + | +
{{ \$editable{$this->model_name}->name }}
+ +{{ \$editable{$this->model_name}->description }}
+ {!! \$errors->first('{$this->lang_name}_id', ':message') !!} +| {{ __('app.table_no') }} | @@ -93,7 +93,7 @@ class SimpleCrudFormfieldOptionsTest extends TestCase @endforeach
|---|
{{ \$editable{$this->model_name}->name }}
- +{{ \$editable{$this->model_name}->description }}
{!! \$errors->first('{$this->lang_name}_id', ':message') !!}