Commit 170e7dc8 authored by m-wynn's avatar m-wynn

viewファイルカスタマイズ

parent 08a9ac1d
<!-- 'Boolean {{ $fieldTitle }} Field' checked by default -->
<div class="form-group col-sm-6">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
<label class="checkbox-inline">
@{!! Form::checkbox('{{ $fieldName }}', 1, true) !!}
<!-- remove {, true} to make it unchecked by default -->
<input type="checkbox" name="{{ $fieldName }}" value="1" checked>
<!-- remove 'checked' attribute to make it unchecked by default -->
</label>
</div>
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6">
<div class="form-check">
@{!! Form::hidden('{{ $fieldName }}', 0, ['class' => 'form-check-input']) !!}
@{!! Form::checkbox('{{ $fieldName }}', '{{ $checkboxVal }}', null, ['class' => 'form-check-input']) !!}
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}', ['class' => 'form-check-label']) !!}
<input type="hidden" name="{{ $fieldName }}" value="0" class="form-check-input">
<input type="checkbox" name="{{ $fieldName }}" value="{{ $checkboxVal }}" class="form-check-input">
<label class="form-check-label" for="{{ $fieldName }}">{{ $fieldTitle }}</label>
</div>
</div>
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-12">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
{!! $checkboxes !!}
</div>
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
@{!! Form::text('{{ $fieldName }}', null, ['class' => 'form-control','id'=>'{{ $fieldName }}']) !!}
<input type="text" name="{{ $fieldName }}" class="form-control" id="{{ $fieldName }}">
</div>
@@push('page_scripts')
......
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
@{!! Form::email('{{ $fieldName }}', null, ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!}
<input type="email" name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}">
</div>
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
<div class="input-group">
<div class="custom-file">
@{!! Form::file('{{ $fieldName }}', ['class' => 'custom-file-input']) !!}
@{!! Form::label('{{ $fieldName }}', 'Choose file', ['class' => 'custom-file-label']) !!}
<input type="file" name="{{ $fieldName }}" class="custom-file-input">
<label class="custom-file-label" for="{{ $fieldName }}">Choose file</label>
</div>
</div>
</div>
......
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
@{!! Form::number('{{ $fieldName }}', null, ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!}
<input type="number" name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}">
</div>
<!-- {{ $fieldName }} Field -->
<div class="form-group col-sm-6">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
@{!! Form::password('{{ $fieldName }}', ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!}
<input type="password" name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}">
</div>
<label class="form-check">
@{!! Form::radio('{{ $fieldName }}', "{{ $value }}", null, ['class' => 'form-check-input']) !!} {{ $label }}
</label>
\ No newline at end of file
<label class="form-check">
<input type="radio" name="{{ $fieldName }}" value="{{ $value }}" class="form-check-input">
{{ $label }}
</label>
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-12">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}'), ['class' => 'form-check-label']) !!}
<label for="{{ $fieldName }}" class="form-check-label">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}', ['class' => 'form-check-label']) !!}
<label for="{{ $fieldName }}" class="form-check-label">{{ $fieldTitle }}</label>
@endif
{!! $radioButtons !!}
</div>
\ No newline at end of file
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
@{!! Form::select('{{ $fieldName }}', @php echo htmlspecialchars_decode($selectValues) @endphp, null, ['class' => 'form-control custom-select']) !!}
<select name="{{ $fieldName }}" class="form-control custom-select">
{!! html_entity_decode($selectValues) !!}
</select>
</div>
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
@{!! Form::text('{{ $fieldName }}', null, ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!}
<input type="text" name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}">
</div>
<!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-12 col-lg-12">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
@{!! Form::textarea('{{ $fieldName }}', null, ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!}
<textarea name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}"></textarea>
</div>
<!-- 'bootstrap / Toggle Switch {{ $fieldTitle }} Field' -->
<div class="form-group col-sm-6">
<div class="custom-control custom-switch">
@{!! Form::checkbox('{{ $fieldName }}', 1, null, ['class' => 'custom-control-input']) !!}
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':', ['class' => 'custom-control-label']) !!}
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:', ['class' => 'custom-control-label']) !!}
@endif
<input type="checkbox" name="{{ $fieldName }}" class="custom-control-input">
@if($config->options->localized)
<label class="custom-control-label" for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else
<label class="custom-control-label" for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
</div>
</div>
......@@ -23,8 +23,8 @@
<div class="card">
@{!! Form::open(['route' => '{{ $config->prefixes->getRoutePrefixWith('.') }}{{ $config->modelNames->camelPlural }}.store']) !!}
<form method="post" action="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.store') }}">
@@csrf
<div class="card-body">
<div class="row">
......@@ -34,11 +34,11 @@
</div>
<div class="card-footer">
@{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<button type="submit" class="btn btn-primary">Save</button>
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.index') }}" class="btn btn-default">@if($config->options->localized) @@lang('crud.cancel') @else Cancel @endif</a>
</div>
@{!! Form::close() !!}
</form>
</div>
</div>
......
......@@ -23,8 +23,9 @@
<div class="card">
@{!! Form::model(${{ $config->modelNames->camel }}, ['route' => ['{{ $config->prefixes->getRoutePrefixWith('.') }}{{ $config->modelNames->camelPlural }}.update', ${{ $config->modelNames->camel }}->{{ $config->primaryName }}], 'method' => 'patch']) !!}
<form method="POST" action="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.update', ${!! $config->modelNames->camel !!}->{!! $config->primaryName !!}) }}">
@@csrf
@@method('PATCH')
<div class="card-body">
<div class="row">
@@include('{{ $config->prefixes->getViewPrefixForInclude() }}{{ $config->modelNames->snakePlural }}.fields')
......@@ -32,11 +33,11 @@
</div>
<div class="card-footer">
@{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<button type="submit" class="btn btn-primary">Save</button>
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.index') }}" class="btn btn-default">@if($config->options->localized) @@lang('crud.cancel') @else Cancel @endif</a>
</div>
@{!! Form::close() !!}
</form>
</div>
</div>
......
<!-- {{ $fieldTitle }} Field -->
<div class="col-sm-12">
@if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!}
<label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . 'fields' . $fieldName) }}:</label>
@else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!}
<label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif
<p>@{{ ${!! $config->modelNames->camel !!}->{!! $fieldName !!} }}</p>
</div>
......@@ -16,7 +16,10 @@
<tr>
{!! $fieldBody !!}
<td style="width: 120px">
@{!! Form::open(['route' => ['{{ $config->prefixes->getRoutePrefixWith('.') }}{{ $config->modelNames->camelPlural }}.destroy', ${{ $config->modelNames->camel }}->{{ $config->primaryName }}], 'method' => 'delete']) !!}
<form method="POST" action="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.destroy', ${!! $config->modelNames->camel !!}->{!! $config->primaryName !!}) }}">
@@csrf
@method('DELETE')
<div class='btn-group'>
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.show', [${!! $config->modelNames->camel !!}->{!! $config->primaryName !!}]) }}"
class='btn btn-default btn-xs'>
......@@ -26,9 +29,11 @@
class='btn btn-default btn-xs'>
<i class="far fa-edit"></i>
</a>
@{!! Form::button('<i class="far fa-trash-alt"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!}
<button type="submit" class="btn btn-danger btn-xs" onclick="return confirm('Are you sure?')">
<i class="far fa-trash-alt"></i>
</button>
</div>
@{!! Form::close() !!}
</form>
</td>
</tr>
@@endforeach
......
@{!! Form::open(['route' => ['{{ $config->prefixes->getRoutePrefixWith('.') }}{{ $config->modelNames->camelPlural }}.destroy', ${{ $config->primaryName }}], 'method' => 'delete']) !!}
<form method="POST" action="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.destroy', {!! $config->primaryName !!}) }}">
@@csrf
@@method('DELETE')
<div class='btn-group'>
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.show', ${!! $config->primaryName !!}) }}" class='btn btn-default btn-xs'>
<i class="fa fa-eye"></i>
......@@ -6,15 +8,9 @@
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.edit', ${!! $config->primaryName !!}) }}" class='btn btn-default btn-xs'>
<i class="fa fa-edit"></i>
</a>
@{!! Form::button('<i class="fa fa-trash"></i>', [
'type' => 'submit',
'class' => 'btn btn-danger btn-xs',
@if($config->options->localized)
'onclick' => "return confirm('Are you sure?')"
@else
'onclick' => 'return confirm("'.__('crud.are_you_sure').'")'
@endif
<button type="submit" class="btn btn-danger btn-xs" onclick="<?php echo $config->options->localized ? "return confirm('Are you sure?')" : "return confirm('" . __('crud.are_you_sure') . "')"; ?>">
<i class="fa fa-trash"></i>
</button>
]) !!}
</div>
@{!! Form::close() !!}
</form>
......@@ -17,7 +17,8 @@
<div class="card">
{!! Form::open(['route' => 'users.store']) !!}
<form method="POST" action="@{{ route('users.store') }}">
@@csrf
<div class="card-body">
<div class="row">
......@@ -26,11 +27,11 @@
</div>
<div class="card-footer">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<button type="submit" class="btn btn-primary">Save</button>
<a href="{{ route('users.index') }}" class="btn btn-default">Cancel</a>
</div>
{!! Form::close() !!}
</form>
</div>
</div>
......
......@@ -17,7 +17,9 @@
<div class="card">
{!! Form::model($user, ['route' => ['users.update', $user->id], 'method' => 'patch']) !!}
<form method="POST" action="@{{ route('users.update', {!! $user->id !!}) }}">
@@csrf
@@method('PATCH')
<div class="card-body">
<div class="row">
......@@ -26,11 +28,11 @@
</div>
<div class="card-footer">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<button type="submit" class="btn btn-primary">Save</button>
<a href="{{ route('users.index') }}" class="btn btn-default">Cancel</a>
</div>
{!! Form::close() !!}
</form>
</div>
</div>
......
<!-- Name Field -->
<div class="form-group col-sm-6">
{!! Form::label('name', 'Name') !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!}
<label for="name">Name</label>
<input type="text" name="name" id="name" class="form-control">
</div>
<!-- Email Field -->
<div class="form-group col-sm-6">
{!! Form::label('email', 'Email') !!}
{!! Form::email('email', null, ['class' => 'form-control']) !!}
<label for="email">Email</label>
<input type="email" name="email" id="email" class="form-control">
</div>
<!-- Password Field -->
<div class="form-group col-sm-6">
{!! Form::label('password', 'Password') !!}
{!! Form::password('password', ['class' => 'form-control']) !!}
<label for="password">Password</label>
<input type="password" name="password" id="password" class="form-control">
</div>
<!-- Confirmation Password Field -->
<div class="form-group col-sm-6">
{!! Form::label('password', 'Password Confirmation') !!}
{!! Form::password('password_confirmation', ['class' => 'form-control']) !!}
<label for="password_confirmation">Password Confirmation</label>
<input type="password" name="password_confirmation" id="password_confirmation" class="form-control">
</div>
\ No newline at end of file
<!-- Name Field -->
<div class="col-sm-12">
{!! Form::label('name', 'Name:') !!}
<label for="name">Name:</label>
<p>{!! $user->name !!}</p>
</div>
<!-- Email Field -->
<div class="col-sm-12">
{!! Form::label('email', 'Email:') !!}
<label for="email">Email:</label>
<p>{!! $user->email !!}</p>
</div>
......@@ -13,7 +13,9 @@
<td>{!! $user->name !!}</td>
<td>{!! $user->email !!}</td>
<td>
{!! Form::open(['route' => ['users.destroy', $user->id], 'method' => 'delete']) !!}
<form action="@{{ route('users.destroy', $user->id) }}" method="post">
@@csrf
@@method('DELETE')
<div class='btn-group'>
<a href="{!! route('users.show', [$user->id]) !!}" class='btn btn-default btn-xs'>
<i class="fa fa-eye"></i>
......@@ -21,9 +23,11 @@
<a href="{!! route('users.edit', [$user->id]) !!}" class='btn btn-default btn-xs'>
<i class="fa fa-edit"></i>
</a>
{!! Form::button('<i class="fa fa-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!}
<button type="submit" class="btn btn-danger btn-xs" onclick="return confirm('Are you sure?')">
<i class="fa fa-trash"></i>
</button>
</div>
{!! Form::close() !!}
</form>
</td>
</tr>
@endforeach
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment