Browse Source

Update form views to for syntax consistency

tags/1.0.2^0 1.0.2
Nafies Luthfi 8 years ago
parent
commit
bd45d63ccc
  1. 4
      src/stubs/view-edit.stub
  2. 4
      src/stubs/view-forms.stub
  3. 4
      tests/Generators/Simple/ViewsGeneratorTest.php
  4. 4
      tests/Generators/ViewsGeneratorTest.php

4
src/stubs/view-edit.stub

@ -21,7 +21,7 @@
<div class="panel-body">{{ trans('app.delete_confirm') }}</div>
<div class="panel-footer">
{!! FormField::delete(
['route'=>['masters.destroy', $singleMstr]],
['route' => ['masters.destroy', $singleMstr]],
trans('app.delete_confirm_button'),
['class'=>'btn btn-danger'],
[
@ -37,7 +37,7 @@
@else
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('master.edit') }}</h3></div>
{!! Form::model($singleMstr, ['route' => ['masters.update', $singleMstr->id],'method' => 'patch']) !!}
{!! Form::model($singleMstr, ['route' => ['masters.update', $singleMstr],'method' => 'patch']) !!}
<div class="panel-body">
{!! FormField::text('name', ['required' => true, 'label' => trans('master.name')]) !!}
{!! FormField::textarea('description', ['label' => trans('master.description')]) !!}

4
src/stubs/view-forms.stub

@ -10,7 +10,7 @@
@endif
@if (Request::get('action') == 'edit' && $editableMaster)
@can('update', $editableMaster)
{!! Form::model($editableMaster, ['route' => ['masters.update', $editableMaster->id],'method' => 'patch']) !!}
{!! Form::model($editableMaster, ['route' => ['masters.update', $editableMaster],'method' => 'patch']) !!}
{!! FormField::text('name', ['required' => true, 'label' => trans('master.name')]) !!}
{!! FormField::textarea('description', ['label' => trans('master.description')]) !!}
@if (request('q'))
@ -39,7 +39,7 @@
<div class="panel-body">{{ trans('app.delete_confirm') }}</div>
<div class="panel-footer">
{!! FormField::delete(
['route'=>['masters.destroy',$editableMaster->id]],
['route' => ['masters.destroy', $editableMaster]],
trans('app.delete_confirm_button'),
['class'=>'btn btn-danger'],
[

4
tests/Generators/Simple/ViewsGeneratorTest.php

@ -108,7 +108,7 @@ class ViewsGeneratorTest extends TestCase
@endif
@if (Request::get('action') == 'edit' && \$editable{$this->model_name})
@can('update', \$editable{$this->model_name})
{!! Form::model(\$editable{$this->model_name}, ['route' => ['{$this->table_name}.update', \$editable{$this->model_name}->id],'method' => 'patch']) !!}
{!! Form::model(\$editable{$this->model_name}, ['route' => ['{$this->table_name}.update', \$editable{$this->model_name}],'method' => 'patch']) !!}
{!! FormField::text('name', ['required' => true, 'label' => trans('{$this->lang_name}.name')]) !!}
{!! FormField::textarea('description', ['label' => trans('{$this->lang_name}.description')]) !!}
@if (request('q'))
@ -137,7 +137,7 @@ class ViewsGeneratorTest extends TestCase
<div class=\"panel-body\">{{ trans('app.delete_confirm') }}</div>
<div class=\"panel-footer\">
{!! FormField::delete(
['route'=>['{$this->table_name}.destroy',\$editable{$this->model_name}->id]],
['route' => ['{$this->table_name}.destroy', \$editable{$this->model_name}]],
trans('app.delete_confirm_button'),
['class'=>'btn btn-danger'],
[

4
tests/Generators/ViewsGeneratorTest.php

@ -182,7 +182,7 @@ class ViewsGeneratorTest extends TestCase
<div class=\"panel-body\">{{ trans('app.delete_confirm') }}</div>
<div class=\"panel-footer\">
{!! FormField::delete(
['route'=>['{$this->table_name}.destroy', \${$this->single_model_var_name}]],
['route' => ['{$this->table_name}.destroy', \${$this->single_model_var_name}]],
trans('app.delete_confirm_button'),
['class'=>'btn btn-danger'],
[
@ -198,7 +198,7 @@ class ViewsGeneratorTest extends TestCase
@else
<div class=\"panel panel-default\">
<div class=\"panel-heading\"><h3 class=\"panel-title\">{{ trans('{$this->lang_name}.edit') }}</h3></div>
{!! Form::model(\${$this->single_model_var_name}, ['route' => ['{$this->table_name}.update', \${$this->single_model_var_name}->id],'method' => 'patch']) !!}
{!! Form::model(\${$this->single_model_var_name}, ['route' => ['{$this->table_name}.update', \${$this->single_model_var_name}],'method' => 'patch']) !!}
<div class=\"panel-body\">
{!! FormField::text('name', ['required' => true, 'label' => trans('{$this->lang_name}.name')]) !!}
{!! FormField::textarea('description', ['label' => trans('{$this->lang_name}.description')]) !!}

Loading…
Cancel
Save