form improvements

This commit is contained in:
2018-07-21 19:24:00 +02:00
parent 3242ae9cbe
commit a9ffd378a0
17 changed files with 200 additions and 174 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="col-md-1 pl-0">
@if($w->help)
<i class="fa-question-circle"
<i class="fa-question-circle form-help"
data-toggle="tooltip"
data-placement="right"
@if(false!==strpos($w->help, '<'))
+22
View File
@@ -0,0 +1,22 @@
@php
/** @var \App\View\Widget $w */
@endphp
<div class="row form-group">
<div class="col-md-{{$w->fieldCols}} offset-md-{{$w->labelCols}}">
<div class="custom-control custom-checkbox{{ $errors->has($w->name) ? ' is-invalid' : '' }}">
<input type="checkbox" class="custom-control-input"
id="field-{{ $w->name }}"
{{+$w->value?'checked':''}}
name="{{ $w->name }}">
<label class="custom-control-label" for="field-{{ $w->name }}">{{ $w->label }}</label>
</div>
@if ($errors->has($w->name))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first($w->name) }}</strong>
</span>
@endif
</div>
@include('form._help')
</div>
+2 -2
View File
@@ -3,8 +3,8 @@
@endphp
<div class="row form-group">
<label for="field-{{ $w->name }}" class="col-md-3 col-form-label text-md-right">{{ $w->label }}</label>
<div class="col-md-8 pl-0">
<label for="field-{{ $w->name }}" class="col-md-{{$w->labelCols}} col-form-label text-md-right">{{ $w->label }}</label>
<div class="col-md-{{$w->fieldCols}}">
<input id="field-{{ $w->name }}"
name="{{ $w->name }}"
class="form-control{{ $errors->has($w->name) ? ' is-invalid' : '' }}"
+2 -2
View File
@@ -3,8 +3,8 @@
@endphp
<div class="row form-group">
<label for="field-{{ $w->name }}" class="col-md-3 col-form-label text-md-right">{{ $w->label }}</label>
<div class="col-md-8 pl-0">
<label for="field-{{ $w->name }}" class="col-md-{{$w->labelCols}} col-form-label text-md-right">{{ $w->label }}</label>
<div class="col-md-{{$w->fieldCols}}">
<textarea id="field-{{ $w->name }}"
name="{{ $w->name }}"
class="form-control{{ $errors->has($w->name) ? ' is-invalid' : '' }}"