mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 04:03:34 -08:00
Make livewire less assy looking
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
ebb0aa5532
commit
576e605f73
|
@ -1,7 +1,7 @@
|
|||
<div>
|
||||
<div class="form-group {{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
|
||||
<div class="form-group{{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
|
||||
<label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label>
|
||||
<div class="col-md-7">
|
||||
<div class="col-md-9">
|
||||
{{ Form::select('custom_fieldset', \App\Helpers\Helper::customFieldsetList(),old('custom_fieldset', 0000 /*$item->fieldset_id*/), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset', 'wire:model' => 'fieldset_id')) }}
|
||||
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fa fa-times"></i> :message</span>') !!}
|
||||
<label class="m-l-xs">
|
||||
|
@ -15,10 +15,7 @@
|
|||
@if($this->add_default_values) {{-- 'if the checkbox is enabled *AND* there are more than 0 fields in the fieldsset' --}}
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<fieldset>
|
||||
<legend class="col-md-3 control-label">Default Values</legend>
|
||||
@livewire('custom-fields-for-fieldset',['fieldset_id' => $fieldset_id])
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
|
|
@ -1,34 +1,43 @@
|
|||
<div class="col-sm-8 col-xl-7">
|
||||
|
||||
|
||||
@empty($fields) {{-- There was an error? --}}
|
||||
<p>
|
||||
There was a problem retrieving the fields for this fieldset.
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-md-offset-3 has-error">
|
||||
<span class="help-block form-error">There was a problem retrieving the fields for this fieldset.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
{{-- NOTE: This stuff could work well also for the 'view this asset and do its custom fields' thing --}}
|
||||
{{-- I don't know if we break *here* or if we break per field element? --}}
|
||||
@foreach($fields as $field)
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">
|
||||
<label class="control-label" for="default-value{{ $field->id }}">{{ $field->name }}</label>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-6">
|
||||
@if($field->element == "text")
|
||||
<input b-if="field.type == 'text'" class="form-control m-b-xs" type="text" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'">
|
||||
@elseif($field->element == "textarea")
|
||||
<textarea x-if="field.type == 'textarea'" class="form-control" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'"></textarea><br>
|
||||
@elseif($field->element == "listbox")
|
||||
@foreach ($fields as $field)
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-md-3 control-label{{ $errors->has($field->name) ? ' has-error' : '' }}" for="default-value{{ $field->id }}">{{ $field->name }}</label>
|
||||
|
||||
<select Z-if="field.element == 'listbox'" class="form-control m-b-xs" :name="'default_values[' + field.id + ']'">
|
||||
<option value=""></option>
|
||||
@foreach($field->field_values as $field_value)
|
||||
<option Q-for="field_value in field.field_values_array" :value="field_value" :selected="getValue(field) == field_value">{{ $field_value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
Unknonown field element: {{ $field->element }}
|
||||
@endif
|
||||
<div class="col-md-7">
|
||||
|
||||
@if ($field->element == "text")
|
||||
<input b-if="field.type == 'text'" class="form-control m-b-xs" type="text" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'">
|
||||
@elseif($field->element == "textarea")
|
||||
<textarea x-if="field.type == 'textarea'" class="form-control" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'"></textarea><br>
|
||||
@elseif($field->element == "listbox")
|
||||
|
||||
<select Z-if="field.element == 'listbox'" class="form-control m-b-xs" :name="'default_values[' + field.id + ']'">
|
||||
<option value=""></option>
|
||||
@foreach($field->field_values as $field_value)
|
||||
<option Q-for="field_value in field.field_values_array" :value="field_value" :selected="getValue(field) == field_value">{{ $field_value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
<span class="help-block form-error">
|
||||
Unknown field element: {{ $field->element }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue