This commit is contained in:
Ludovic CANDELLIER
2022-11-11 13:05:40 +01:00
parent f89acd9399
commit 7df2421373
104 changed files with 1212 additions and 764 deletions

View File

@@ -21,13 +21,20 @@
</div>
@endif
@if($type === 'password')
{!! Form::password($name, array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
{!! Form::password($name, array_merge(['class' => 'form-control'.$errors->first($nameDot,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
@elseif($type === 'file')
{!! Form::file($name, array_merge(['class' => 'form-control-file'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
{!! Form::file($name, array_merge(['class' => 'form-control-file'.$errors->first($nameDot,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
@elseif($type === 'select')
{!! Form::select($name, $options ?? [], old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
{!! Form::select($name, $options ?? [], old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($nameDot,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
@else
{!! Form::{$type ?? 'text'}($name, old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
@if($clearable ?? false)
<div class="input-clearable">
<span class="fa fa-times fa-xs"{!! old($name, $value ?? '') !== '' ? ' style="display:block"' : '' !!}></span>
@endif
{!! Form::{$type ?? 'text'}($name, old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($nameDot,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!}
@if($clearable ?? false)
</div>
@endif
@endif
@if($append || $appendText)
<div class="input-group-append">
@@ -44,7 +51,7 @@
@if($help ?? false)
<small class="form-text text-muted">@lang($help)</small>
@endif
@error($name)
@error($nameDot)
<div class="error-bubble"><div>{{ $message }}</div></div>
@enderror
</div>

View File

@@ -5,7 +5,7 @@
@isset($label)
<label for="{{ $id }}">{!! __($label) !!}</label>
@endisset
<select id="{{ $id }}" name="{{ $name }}" class="form-control{{ $errors->first($name,' is-invalid') }}{{ isset($class) ? ' '.$class : '' }}"{!! !empty($attributes) ? ' '.$attributes : '' !!} style="visibility:hidden;height:1rem" autocomplete="off">
<select id="{{ $id }}" name="{{ $name }}" class="form-control{{ $errors->first($nameDot,' is-invalid') }}{{ isset($class) ? ' '.$class : '' }}"{!! !empty($attributes) ? ' '.$attributes : '' !!} style="visibility:hidden;height:1rem" autocomplete="off">
@if(!isset($multiple))
<option></option>
@endif
@@ -20,7 +20,7 @@
@if($help ?? false)
<small class="form-text text-muted">@lang($help)</small>
@endif
@error($name)
@error($nameDot)
<div class="error-bubble"><div>{{ $message }}</div></div>
@enderror
</div>
@@ -28,21 +28,36 @@
@component('boilerplate::minify')
<script>
whenAssetIsLoaded('select2', () => {
let parent = $('#{{ $id }}').parent();
$('#{{ $id }}').select2({
window.{{ 'S2_'.\Str::camel($id) }} = $('#{{ $id }}').select2({
placeholder: '{{ $placeholder ?? '' }}',
allowClear: {{ $allowClear }},
language: "{{ App::getLocale() }}",
direction: "@lang('boilerplate::layout.direction')",
minimumInputLength: {{ $minimumInputLength ?? 0 }},
minimumInputLength: {{ $minimumInputLength ?? intval(isset($model)) }},
minimumResultsForSearch: {{ $minimumResultsForSearch ?? 10 }},
width: '100%',
dropdownAutoWidth: true,
dropdownParent: parent,
dropdownParent: $('#{{ $id }}').parent(),
tags: {{ $tags ?? 0 }},
escapeMarkup: function(markup) { return markup },
@isset($ajax)
ajax: {
delay: 200,
url: '{{ $ajax }}',
data: function (param) {
return {
q: param.term,
length: {{ $maxLength ?? 10 }},
@isset($model)
m: "{{ $model }}",
@endisset
@if(!empty($ajaxParams))
@foreach ($ajaxParams as $k => $v)
{{ $k }}: "{{ $v }}",
@endforeach
@endif
}
},
method: 'post'
}
@endisset

View File

@@ -5,11 +5,11 @@
@isset($label)
<label for="{{ $id }}">{!! __($label) !!}</label>
@endisset
<textarea id="{{ $id }}" name="{{ $name }}"{!! !empty($attributes) ? ' '.$attributes : '' !!} style="visibility:hidden">{!! old($name, $value ?? $slot ?? '') !!}</textarea>
<textarea id="{{ $id }}" name="{{ $name }}"{!! !empty($attributes) ? ' '.$attributes : '' !!} style="visibility:hidden{{ $minHeight ?? false ? ';min-height:'.$minHeight.'px' : '' }}">{!! old($name, $value ?? $slot ?? '') !!}</textarea>
@if($help ?? false)
<small class="form-text text-muted">@lang($help)</small>
@endif
@error($name)
@error($nameDot)
<div class="error-bubble"><div>{{ $message }}</div></div>
@enderror
</div>
@@ -17,9 +17,11 @@
@component('boilerplate::minify')
<script>
whenAssetIsLoaded('{!! mix('/plugins/tinymce/tinymce.min.js', '/assets/vendor/boilerplate') !!}', () => {
tinymce.init({
window.{{ 'MCE_'.\Str::camel($id) }} = tinymce.init({
selector: '#{{ $id }}',
toolbar_sticky: {{ ($sticky ?? false) ? 'true' : 'false' }},
{{ $minHeight ?? false ? 'min_height:'.$minHeight.',' : '' }}
{{ $maxHeight ?? false ? 'max_height:'.$maxHeight.',' : '' }}
@if(setting('darkmode', false) && config('boilerplate.theme.darkmode'))
skin : "boilerplate-dark",
content_css: 'boilerplate-dark',
@@ -27,7 +29,7 @@
skin : "oxide",
content_css: null,
@endif
@if(App::getLocale() !== 'en')
@if(App::getLocale() !== 'en')
language: '{{ App::getLocale() }}'
@endif
});