diff --git a/src/stubs/resources/views/full/index-formfield.stub b/src/stubs/resources/views/full/index-formfield.stub new file mode 100644 index 0000000..a10b0a0 --- /dev/null +++ b/src/stubs/resources/views/full/index-formfield.stub @@ -0,0 +1,58 @@ +@extends('layouts.app') + +@section('title', __('master.list')) + +@section('content') +

+
+ @can('create', new fullMstr) + {{ link_to_route('masters.create', __('master.create'), [], ['class' => 'btn btn-success']) }} + @endcan +
+ {{ __('master.list') }} + {{ __('app.total') }} : {{ $mstrCollections->total() }} {{ __('master.master') }} +

+
+
+
+
+ {{ Form::open(['method' => 'get','class' => 'form-inline']) }} + {!! FormField::text('q', ['label' => __('master.search'), 'placeholder' => __('master.search_text'), 'class' => 'input-sm']) !!} + {{ Form::submit(__('master.search'), ['class' => 'btn btn-sm']) }} + {{ link_to_route('masters.index', __('app.reset')) }} + {{ Form::close() }} +
+ + + + + + + + + + + @foreach($mstrCollections as $key => $singleMstr) + + + + + + + @endforeach + +
{{ __('app.table_no') }}{{ __('master.name') }}{{ __('master.description') }}{{ __('app.action') }}
{{ $mstrCollections->firstItem() + $key }}{{ $singleMstr->name_link }}{{ $singleMstr->description }} + @can('view', $singleMstr) + {!! link_to_route( + 'masters.show', + __('app.show'), + [$singleMstr], + ['class' => 'btn btn-default btn-xs', 'id' => 'show-master-' . $singleMstr->id] + ) !!} + @endcan +
+
{{ $mstrCollections->appends(Request::except('page'))->render() }}
+
+
+
+@endsection diff --git a/src/stubs/resources/views/full/index.stub b/src/stubs/resources/views/full/index.stub index a10b0a0..2cf3845 100644 --- a/src/stubs/resources/views/full/index.stub +++ b/src/stubs/resources/views/full/index.stub @@ -6,7 +6,7 @@

@can('create', new fullMstr) - {{ link_to_route('masters.create', __('master.create'), [], ['class' => 'btn btn-success']) }} + {{ __('master.create') }} @endcan
{{ __('master.list') }} @@ -16,11 +16,14 @@
- {{ Form::open(['method' => 'get','class' => 'form-inline']) }} - {!! FormField::text('q', ['label' => __('master.search'), 'placeholder' => __('master.search_text'), 'class' => 'input-sm']) !!} - {{ Form::submit(__('master.search'), ['class' => 'btn btn-sm']) }} - {{ link_to_route('masters.index', __('app.reset')) }} - {{ Form::close() }} +
+
+ + +
+ + Reset +
@@ -39,12 +42,7 @@ diff --git a/tests/Generators/ViewsGeneratorTest.php b/tests/Generators/ViewsGeneratorTest.php index 0dc7eec..6f9ba6b 100644 --- a/tests/Generators/ViewsGeneratorTest.php +++ b/tests/Generators/ViewsGeneratorTest.php @@ -22,7 +22,7 @@ class ViewsGeneratorTest extends TestCase

@can('create', new {$this->full_model_name}) - {{ link_to_route('{$this->table_name}.create', __('{$this->lang_name}.create'), [], ['class' => 'btn btn-success']) }} + table_name}.create') }}\" class=\"btn btn-success\">{{ __('{$this->lang_name}.create') }} @endcan
{{ __('{$this->lang_name}.list') }} @@ -32,11 +32,14 @@ class ViewsGeneratorTest extends TestCase
- {{ Form::open(['method' => 'get','class' => 'form-inline']) }} - {!! FormField::text('q', ['label' => __('{$this->lang_name}.search'), 'placeholder' => __('{$this->lang_name}.search_text'), 'class' => 'input-sm']) !!} - {{ Form::submit(__('{$this->lang_name}.search'), ['class' => 'btn btn-sm']) }} - {{ link_to_route('{$this->table_name}.index', __('app.reset')) }} - {{ Form::close() }} +
+
+ + lang_name}.search_text') }}\" name=\"q\" type=\"text\" id=\"q\" class=\"form-control input-sm\"> +
+ lang_name}.search') }}\" class=\"btn btn-sm\"> + table_name}.index') }}\">Reset +

{{ $singleMstr->description }} @can('view', $singleMstr) - {!! link_to_route( - 'masters.show', - __('app.show'), - [$singleMstr], - ['class' => 'btn btn-default btn-xs', 'id' => 'show-master-' . $singleMstr->id] - ) !!} + {{ __('app.show') }} @endcan
@@ -55,12 +58,7 @@ class ViewsGeneratorTest extends TestCase
{{ \${$this->single_model_var_name}->description }} @can('view', \${$this->single_model_var_name}) - {!! link_to_route( - '{$this->table_name}.show', - __('app.show'), - [\${$this->single_model_var_name}], - ['class' => 'btn btn-default btn-xs', 'id' => 'show-{$this->lang_name}-' . \${$this->single_model_var_name}->id] - ) !!} + table_name}.show', \${$this->single_model_var_name}) }}\" id=\"show-{$this->lang_name}-{{ \${$this->single_model_var_name}->id }}\" class=\"btn btn-default btn-xs\">{{ __('app.show') }} @endcan