From 51531f262b2b20aac58a706409b8be677a7116db Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Fri, 7 Sep 2018 14:45:10 +0800 Subject: [PATCH] Update full formfield view stubs to bootstrap 4 Save old full formfield views stubs as bootstrap 3 stub --- .../resources/views/full/create-formfield-bs3.stub | 23 ++ .../resources/views/full/create-formfield.stub | 14 +- .../resources/views/full/edit-formfield-bs3.stub | 56 +++++ src/stubs/resources/views/full/edit-formfield.stub | 34 +-- .../resources/views/full/index-formfield-bs3.stub | 58 +++++ .../resources/views/full/index-formfield.stub | 18 +- .../resources/views/full/show-formfield-bs3.stub | 25 +++ src/stubs/resources/views/full/show-formfield.stub | 14 +- .../FullCrudFormfieldBs3OptionsTest.php | 245 +++++++++++++++++++++ .../FullCrudFormfieldOptionsTest.php | 80 +++---- 10 files changed, 487 insertions(+), 80 deletions(-) create mode 100644 src/stubs/resources/views/full/create-formfield-bs3.stub create mode 100644 src/stubs/resources/views/full/edit-formfield-bs3.stub create mode 100644 src/stubs/resources/views/full/index-formfield-bs3.stub create mode 100644 src/stubs/resources/views/full/show-formfield-bs3.stub create mode 100644 tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php diff --git a/src/stubs/resources/views/full/create-formfield-bs3.stub b/src/stubs/resources/views/full/create-formfield-bs3.stub new file mode 100644 index 0000000..9cd22ca --- /dev/null +++ b/src/stubs/resources/views/full/create-formfield-bs3.stub @@ -0,0 +1,23 @@ +@extends('layouts.app') + +@section('title', __('master.create')) + +@section('content') +
+
+
+

{{ __('master.create') }}

+ {{ Form::open(['route' => 'masters.store']) }} +
+ {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} + {!! FormField::textarea('description', ['label' => __('master.description')]) !!} +
+ + {{ Form::close() }} +
+
+
+@endsection diff --git a/src/stubs/resources/views/full/create-formfield.stub b/src/stubs/resources/views/full/create-formfield.stub index 9cd22ca..ae33530 100644 --- a/src/stubs/resources/views/full/create-formfield.stub +++ b/src/stubs/resources/views/full/create-formfield.stub @@ -3,18 +3,18 @@ @section('title', __('master.create')) @section('content') -
-
-
-

{{ __('master.create') }}

+
+
+
+
{{ __('master.create') }}
{{ Form::open(['route' => 'masters.store']) }} -
+
{!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} {!! FormField::textarea('description', ['label' => __('master.description')]) !!}
- diff --git a/src/stubs/resources/views/full/edit-formfield-bs3.stub b/src/stubs/resources/views/full/edit-formfield-bs3.stub new file mode 100644 index 0000000..60928e0 --- /dev/null +++ b/src/stubs/resources/views/full/edit-formfield-bs3.stub @@ -0,0 +1,56 @@ +@extends('layouts.app') + +@section('title', __('master.edit')) + +@section('content') +
+
+ @if (request('action') == 'delete' && $singleMstr) + @can('delete', $singleMstr) +
+

{{ __('master.delete') }}

+
+ +

{{ $singleMstr->name }}

+ +

{{ $singleMstr->description }}

+ {!! $errors->first('master_id', ':message') !!} +
+
+
{{ __('master.delete_confirm') }}
+ +
+ @endcan + @else +
+

{{ __('master.edit') }}

+ {{ Form::model($singleMstr, ['route' => ['masters.update', $singleMstr], 'method' => 'patch']) }} +
+ {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} + {!! FormField::textarea('description', ['label' => __('master.description')]) !!} +
+ + {{ Form::close() }} +
+
+
+@endif +@endsection diff --git a/src/stubs/resources/views/full/edit-formfield.stub b/src/stubs/resources/views/full/edit-formfield.stub index 71d02ad..9b010ee 100644 --- a/src/stubs/resources/views/full/edit-formfield.stub +++ b/src/stubs/resources/views/full/edit-formfield.stub @@ -3,22 +3,22 @@ @section('title', __('master.edit')) @section('content') -
-
+
+
@if (request('action') == 'delete' && $singleMstr) @can('delete', $singleMstr) -
-

{{ __('master.delete') }}

-
- +
+
{{ __('master.delete') }}
+
+

{{ $singleMstr->name }}

- +

{{ $singleMstr->description }}

{!! $errors->first('master_id', ':message') !!}

-
{{ __('master.delete_confirm') }}
- @endcan @else -
-

{{ __('master.edit') }}

- {{ Form::model($singleMstr, ['route' => ['masters.update', $singleMstr],'method' => 'patch']) }} -
+
+
{{ __('master.edit') }}
+ {{ Form::model($singleMstr, ['route' => ['masters.update', $singleMstr], 'method' => 'patch']) }} +
{!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} {!! FormField::textarea('description', ['label' => __('master.description')]) !!}
-