2017-08-23 13:08:42 -07:00
|
|
|
@if (($model) && ($model->fieldset))
|
2016-03-25 01:18:05 -07:00
|
|
|
@foreach($model->fieldset->fields AS $field)
|
2016-08-25 18:35:28 -07:00
|
|
|
<div class="form-group{{ $errors->has($field->db_column_name()) ? ' has-error' : '' }}">
|
|
|
|
<label for="{{ $field->db_column_name() }}" class="col-md-3 control-label">{{ $field->name }} </label>
|
|
|
|
<div class="col-md-7 col-sm-12{{ ($field->pivot->required=='1') ? ' required' : '' }}">
|
|
|
|
|
2018-06-21 09:35:04 -07:00
|
|
|
|
2016-08-25 18:35:28 -07:00
|
|
|
@if ($field->element!='text')
|
2016-08-25 21:03:24 -07:00
|
|
|
<!-- Listbox -->
|
2016-08-25 18:35:28 -07:00
|
|
|
@if ($field->element=='listbox')
|
2021-04-06 05:59:31 -07:00
|
|
|
{{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(),
|
2021-09-28 19:44:55 -07:00
|
|
|
Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, htmlspecialchars($item->{$field->db_column_name()}, ENT_QUOTES)) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }}
|
2016-08-25 18:35:28 -07:00
|
|
|
|
2018-06-21 09:35:04 -07:00
|
|
|
@elseif ($field->element=='textarea')
|
2022-05-18 00:47:22 -07:00
|
|
|
<textarea class="col-md-6 form-control" id="{{ $field->db_column_name() }}" name="{{ $field->db_column_name() }}">{{ Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}</textarea>
|
2018-06-21 09:35:04 -07:00
|
|
|
|
2016-08-25 21:03:24 -07:00
|
|
|
@elseif ($field->element=='checkbox')
|
|
|
|
<!-- Checkboxes -->
|
2016-08-25 18:35:28 -07:00
|
|
|
@foreach ($field->formatFieldValuesAsArray() as $key => $value)
|
|
|
|
<div>
|
2023-04-03 22:38:56 -07:00
|
|
|
<label class="form-control">
|
|
|
|
<input type="checkbox" value="{{ $value }}" name="{{ $field->db_column_name() }}[]" {{ isset($item) ? (in_array($value, array_map('trim', explode(',', $item->{$field->db_column_name()}))) ? ' checked="checked"' : '') : (Request::old($field->db_column_name()) != '' ? ' checked="checked"' : (in_array($key, array_map('trim', explode(',', $field->defaultValue($model->id)))) ? ' checked="checked"' : '')) }}>
|
2021-01-12 18:16:42 -08:00
|
|
|
{{ $value }}
|
2016-08-25 18:35:28 -07:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
|
2021-01-27 14:41:58 -08:00
|
|
|
@elseif ($field->element=='radio')
|
|
|
|
@foreach ($field->formatFieldValuesAsArray() as $value)
|
|
|
|
|
|
|
|
<div>
|
2023-04-03 22:38:56 -07:00
|
|
|
<label class="form-control">
|
|
|
|
<input type="radio" value="{{ $value }}" name="{{ $field->db_column_name() }}" {{ isset($item) ? ($item->{$field->db_column_name()} == $value ? ' checked="checked"' : '') : (Request::old($field->db_column_name()) != '' ? ' checked="checked"' : (in_array($value, explode(', ', $field->defaultValue($model->id))) ? ' checked="checked"' : '')) }}>
|
2021-01-27 14:41:58 -08:00
|
|
|
{{ $value }}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
|
2016-08-25 18:35:28 -07:00
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
@else
|
2016-11-29 01:59:18 -08:00
|
|
|
<!-- Date field -->
|
2016-08-25 21:03:24 -07:00
|
|
|
|
2016-10-25 05:16:41 -07:00
|
|
|
@if ($field->format=='DATE')
|
2016-11-29 01:59:18 -08:00
|
|
|
|
2022-09-26 14:34:35 -07:00
|
|
|
<div class="input-group col-md-5" style="padding-left: 0px;">
|
|
|
|
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
|
|
|
|
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="{{ $field->db_column_name() }}" id="{{ $field->db_column_name() }}" readonly value="{{ old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}" style="background-color:inherit">
|
2021-09-26 01:11:08 -07:00
|
|
|
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
2017-10-23 19:47:43 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2016-08-25 21:03:24 -07:00
|
|
|
@else
|
2023-07-19 18:52:03 -07:00
|
|
|
@if (($field->field_encrypted=='0') || (Gate::allows('assets.view.encrypted_custom_fields')))
|
2021-09-28 19:44:55 -07:00
|
|
|
<input type="text" value="{{ Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}" placeholder="Enter {{ strtolower($field->format) }} text">
|
2016-10-25 05:16:41 -07:00
|
|
|
@else
|
|
|
|
<input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled>
|
|
|
|
@endif
|
|
|
|
@endif
|
2016-08-25 18:35:28 -07:00
|
|
|
|
|
|
|
@endif
|
|
|
|
|
2017-01-26 04:52:11 -08:00
|
|
|
@if ($field->help_text!='')
|
|
|
|
<p class="help-block">{{ $field->help_text }}</p>
|
|
|
|
@endif
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
|
|
|
$errormessage=$errors->first($field->db_column_name());
|
|
|
|
if ($errormessage) {
|
|
|
|
$errormessage=preg_replace('/ snipeit /', '', $errormessage);
|
2021-09-26 01:11:08 -07:00
|
|
|
print('<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> '.$errormessage.'</span>');
|
2016-12-29 14:02:18 -08:00
|
|
|
}
|
2016-03-25 01:18:05 -07:00
|
|
|
?>
|
|
|
|
</div>
|
2016-08-25 21:03:24 -07:00
|
|
|
|
|
|
|
@if ($field->field_encrypted)
|
|
|
|
<div class="col-md-1 col-sm-1 text-left">
|
2023-04-18 02:44:50 -07:00
|
|
|
<i class="fas fa-lock" data-tooltip="true" data-placement="top" title="{{ trans('admin/custom_fields/general.value_encrypted') }}"></i>
|
2016-08-25 21:03:24 -07:00
|
|
|
</div>
|
|
|
|
@endif
|
2017-01-26 04:52:11 -08:00
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
@endif
|
2023-08-08 10:53:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
<script nonce="{{ csrf_token() }}">
|
|
|
|
// We have to re-call the tooltip since this is pulled in after the DOM has loaded
|
|
|
|
$('[data-tooltip="true"]').tooltip({
|
|
|
|
container: 'body',
|
|
|
|
animation: true,
|
|
|
|
});
|
|
|
|
</script>
|