| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | @extends('layout.default') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @if($mode == 'edit') | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | @section('title', $__t('Edit userfield')) | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | @else | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | @section('title', $__t('Create userfield')) | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | @endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @section('viewJsName', 'userfieldform') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @section('content') | 
					
						
							| 
									
										
										
										
											2020-04-19 08:51:02 -04:00
										 |  |  | <div class="row"> | 
					
						
							|  |  |  | 	<div class="col"> | 
					
						
							|  |  |  | 		<h2 class="title">@yield('title')</h2> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | </div> | 
					
						
							| 
									
										
										
										
											2020-10-31 18:37:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-08 15:09:10 +01:00
										 |  |  | <hr class="my-2"> | 
					
						
							| 
									
										
										
										
											2020-10-31 18:37:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | <div class="row"> | 
					
						
							| 
									
										
										
										
											2021-06-24 22:46:47 +02:00
										 |  |  | 	<div class="col-lg-6 col-12"> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		<script> | 
					
						
							|  |  |  | 			Grocy.EditMode = '{{ $mode }}'; | 
					
						
							|  |  |  | 		</script> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		@if($mode == 'edit') | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		<script> | 
					
						
							|  |  |  | 			Grocy.EditObjectId = {{ $userfield->id }}; | 
					
						
							|  |  |  | 		</script> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 		@endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		<form id="userfield-form" | 
					
						
							|  |  |  | 			novalidate> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="entity">{{ $__t('Entity') }}</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<select required | 
					
						
							| 
									
										
										
										
											2020-11-16 19:10:29 +01:00
										 |  |  | 					class="custom-control custom-select" | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 					id="entity" | 
					
						
							|  |  |  | 					name="entity"> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 					<option></option> | 
					
						
							|  |  |  | 					@foreach($entities as $entity) | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 					<option @if($mode=='edit' | 
					
						
							|  |  |  | 						&& | 
					
						
							|  |  |  | 						$userfield->entity == $entity) selected="selected" @endif value="{{ $entity }}">{{ $entity }}</option> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 					@endforeach | 
					
						
							|  |  |  | 				</select> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<div class="invalid-feedback">{{ $__t('A entity is required') }}</div> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2020-11-17 20:12:45 +01:00
										 |  |  | 				<label for="name"> | 
					
						
							|  |  |  | 					{{ $__t('Name') }} | 
					
						
							|  |  |  | 					<i class="fas fa-question-circle text-muted" | 
					
						
							|  |  |  | 						data-toggle="tooltip" | 
					
						
							| 
									
										
										
										
											2021-06-27 19:34:28 +02:00
										 |  |  | 						data-trigger="hover click" | 
					
						
							| 
									
										
										
										
											2020-11-17 20:12:45 +01:00
										 |  |  | 						title="{{ $__t('This is the internal field name, e. g. for the API') }}"></i> | 
					
						
							|  |  |  | 				</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="text" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					required | 
					
						
							|  |  |  | 					pattern="^[a-zA-Z0-9]*$" | 
					
						
							|  |  |  | 					id="name" | 
					
						
							|  |  |  | 					name="name" | 
					
						
							|  |  |  | 					value="@if($mode == 'edit'){{ $userfield->name }}@endif"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<div class="invalid-feedback">{{ $__t('This is required and can only contain letters and numbers') }}</div> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2020-11-17 20:12:45 +01:00
										 |  |  | 				<label for="name"> | 
					
						
							|  |  |  | 					{{ $__t('Caption') }} | 
					
						
							|  |  |  | 					<i class="fas fa-question-circle text-muted" | 
					
						
							|  |  |  | 						data-toggle="tooltip" | 
					
						
							| 
									
										
										
										
											2021-06-27 19:34:28 +02:00
										 |  |  | 						data-trigger="hover click" | 
					
						
							| 
									
										
										
										
											2020-11-17 20:12:45 +01:00
										 |  |  | 						title="{{ $__t('This is used to display the field on the frontend') }}"></i> | 
					
						
							|  |  |  | 				</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="text" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					required | 
					
						
							|  |  |  | 					id="caption" | 
					
						
							|  |  |  | 					name="caption" | 
					
						
							|  |  |  | 					value="@if($mode == 'edit'){{ $userfield->caption }}@endif"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<div class="invalid-feedback">{{ $__t('A caption is required') }}</div> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-17 20:28:26 +01:00
										 |  |  | 			@php if($mode == 'edit' && !empty($userfield->sort_number)) { $value = $userfield->sort_number; } else { $value = ''; } @endphp | 
					
						
							| 
									
										
										
										
											2020-11-17 20:12:45 +01:00
										 |  |  | 			@include('components.numberpicker', array( | 
					
						
							|  |  |  | 			'id' => 'sort_number', | 
					
						
							|  |  |  | 			'label' => 'Sort number', | 
					
						
							|  |  |  | 			'min' => 0, | 
					
						
							| 
									
										
										
										
											2020-11-17 20:28:26 +01:00
										 |  |  | 			'value' => $value, | 
					
						
							| 
									
										
										
										
											2020-11-17 20:12:45 +01:00
										 |  |  | 			'isRequired' => false, | 
					
						
							|  |  |  | 			'hint' => $__t('Multiple Userfields will be ordered by that number on the input form') | 
					
						
							|  |  |  | 			)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-07 21:24:59 +02:00
										 |  |  | 				<label for="type">{{ $__t('Type') }}</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<select required | 
					
						
							| 
									
										
										
										
											2020-11-16 19:10:29 +01:00
										 |  |  | 					class="custom-control custom-select" | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 					id="type" | 
					
						
							|  |  |  | 					name="type"> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 					<option></option> | 
					
						
							|  |  |  | 					@foreach($userfieldTypes as $userfieldType) | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 					<option @if($mode=='edit' | 
					
						
							|  |  |  | 						&& | 
					
						
							|  |  |  | 						$userfield->type == $userfieldType) selected="selected" @endif value="{{ $userfieldType }}">{{ $__t($userfieldType) }}</option> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 					@endforeach | 
					
						
							|  |  |  | 				</select> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<div class="invalid-feedback">{{ $__t('A type is required') }}</div> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-07 21:24:59 +02:00
										 |  |  | 			<div class="form-group d-none"> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<label for="config">{{ $__t('Configuration') }} <span id="config-hint" | 
					
						
							|  |  |  | 						class="small text-muted"></span></label> | 
					
						
							|  |  |  | 				<textarea class="form-control" | 
					
						
							|  |  |  | 					rows="10" | 
					
						
							|  |  |  | 					id="config" | 
					
						
							|  |  |  | 					name="config">@if($mode == 'edit'){{ $userfield->config }}@endif</textarea> | 
					
						
							| 
									
										
										
										
											2019-05-07 21:24:59 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2020-11-08 19:00:12 +01:00
										 |  |  | 				<div class="custom-control custom-checkbox"> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 					<input @if($mode=='edit' | 
					
						
							|  |  |  | 						&& | 
					
						
							| 
									
										
										
										
											2020-11-08 19:00:12 +01:00
										 |  |  | 						$userfield->show_as_column_in_tables == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="show_as_column_in_tables" name="show_as_column_in_tables" value="1"> | 
					
						
							|  |  |  | 					<label class="form-check-label custom-control-label" | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 						for="show_as_column_in_tables">{{ $__t('Show as column in tables') }}</label> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 				</div> | 
					
						
							|  |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-11 22:05:08 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							|  |  |  | 				<div class="custom-control custom-checkbox"> | 
					
						
							|  |  |  | 					<input @if($mode=='edit' | 
					
						
							|  |  |  | 						&& | 
					
						
							|  |  |  | 						$userfield->input_required == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="input_required" name="input_required" value="1"> | 
					
						
							|  |  |  | 					<label class="form-check-label custom-control-label" | 
					
						
							|  |  |  | 						for="input_required"> | 
					
						
							|  |  |  | 						{{ $__t('Mandatory') }} | 
					
						
							|  |  |  | 						 <i class="fas fa-question-circle text-muted" | 
					
						
							|  |  |  | 							data-toggle="tooltip" | 
					
						
							|  |  |  | 							data-trigger="hover click" | 
					
						
							|  |  |  | 							title="{{ $__t('When enabled, then this field must be filled on the destination form') }}"></i> | 
					
						
							|  |  |  | 					</label> | 
					
						
							|  |  |  | 				</div> | 
					
						
							|  |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			<button id="save-userfield-button" | 
					
						
							|  |  |  | 				class="btn btn-success">{{ $__t('Save') }}</button> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		</form> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | @stop |