| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | @extends('layout.default') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @if($mode == 'edit') | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | @section('title', $__t('Edit user')) | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | @else | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | @section('title', $__t('Create user')) | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | @endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @section('viewJsName', 'userform') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +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> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		@if($mode == 'edit') | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		<script> | 
					
						
							|  |  |  | 			Grocy.EditObjectId = {{ $user->id }}; | 
					
						
							| 
									
										
										
										
											2020-12-20 22:08:50 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			@if(!empty($user->picture_file_name)) | 
					
						
							|  |  |  | 			Grocy.UserPictureFileName = '{{ $user->picture_file_name }}'; | 
					
						
							|  |  |  | 			@endif | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		</script> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 		@endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		<form id="user-form" | 
					
						
							|  |  |  | 			novalidate> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="username">{{ $__t('Username') }}</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="text" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					required | 
					
						
							|  |  |  | 					id="username" | 
					
						
							|  |  |  | 					name="username" | 
					
						
							|  |  |  | 					value="@if($mode == 'edit'){{ $user->username }}@endif"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<div class="invalid-feedback">{{ $__t('A username is required') }}</div> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="first_name">{{ $__t('First name') }}</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="text" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					id="first_name" | 
					
						
							|  |  |  | 					name="first_name" | 
					
						
							|  |  |  | 					value="@if($mode == 'edit'){{ $user->first_name }}@endif"> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="last_name">{{ $__t('Last name') }}</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="text" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					id="last_name" | 
					
						
							|  |  |  | 					name="last_name" | 
					
						
							|  |  |  | 					value="@if($mode == 'edit'){{ $user->last_name }}@endif"> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-03 19:40:42 +02:00
										 |  |  | 			@if(!defined('GROCY_EXTERNALLY_MANAGED_AUTHENTICATION')) | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="password">{{ $__t('Password') }}</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="password" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					required | 
					
						
							|  |  |  | 					id="password" | 
					
						
							|  |  |  | 					name="password"> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="password_confirm">{{ $__t('Confirm password') }}</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="password" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					required | 
					
						
							|  |  |  | 					id="password_confirm" | 
					
						
							|  |  |  | 					name="password_confirm"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<div class="invalid-feedback">{{ $__t('Passwords do not match') }}</div> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2021-07-03 19:40:42 +02:00
										 |  |  | 			@else | 
					
						
							|  |  |  | 			<input type="hidden" | 
					
						
							|  |  |  | 				name="password" | 
					
						
							|  |  |  | 				id="password" | 
					
						
							|  |  |  | 				value="x"> | 
					
						
							|  |  |  | 			<input type="hidden" | 
					
						
							|  |  |  | 				name="password_confirm" | 
					
						
							|  |  |  | 				id="password_confirm" | 
					
						
							|  |  |  | 				value="x"> | 
					
						
							|  |  |  | 			@endif | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-20 22:08:50 +01:00
										 |  |  | 			@include('components.userfieldsform', array( | 
					
						
							|  |  |  | 			'userfields' => $userfields, | 
					
						
							|  |  |  | 			'entity' => 'users' | 
					
						
							|  |  |  | 			)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			<button id="save-user-button" | 
					
						
							|  |  |  | 				class="btn btn-success">{{ $__t('Save') }}</button> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		</form> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2020-12-20 22:08:50 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-24 22:46:47 +02:00
										 |  |  | 	<div class="col-lg-6 col-12"> | 
					
						
							| 
									
										
										
										
											2020-12-20 22:08:50 +01:00
										 |  |  | 		<div class="title-related-links"> | 
					
						
							|  |  |  | 			<h4> | 
					
						
							|  |  |  | 				{{ $__t('Picture') }} | 
					
						
							|  |  |  | 			</h4> | 
					
						
							|  |  |  | 			<div class="form-group w-75 m-0"> | 
					
						
							|  |  |  | 				<div class="input-group"> | 
					
						
							|  |  |  | 					<div class="custom-file"> | 
					
						
							|  |  |  | 						<input type="file" | 
					
						
							|  |  |  | 							class="custom-file-input" | 
					
						
							|  |  |  | 							id="user-picture" | 
					
						
							|  |  |  | 							accept="image/*"> | 
					
						
							|  |  |  | 						<label id="user-picture-label" | 
					
						
							|  |  |  | 							class="custom-file-label @if(empty($user->picture_file_name)) d-none @endif" | 
					
						
							|  |  |  | 							for="user-picture"> | 
					
						
							|  |  |  | 							{{ $user->picture_file_name }} | 
					
						
							|  |  |  | 						</label> | 
					
						
							|  |  |  | 						<label id="user-picture-label-none" | 
					
						
							|  |  |  | 							class="custom-file-label @if(!empty($user->picture_file_name)) d-none @endif" | 
					
						
							|  |  |  | 							for="user-picture"> | 
					
						
							|  |  |  | 							{{ $__t('No file selected') }} | 
					
						
							|  |  |  | 						</label> | 
					
						
							|  |  |  | 					</div> | 
					
						
							|  |  |  | 					<div class="input-group-append"> | 
					
						
							|  |  |  | 						<span class="input-group-text"><i class="fas fa-trash" | 
					
						
							|  |  |  | 								id="delete-current-user-picture-button"></i></span> | 
					
						
							|  |  |  | 					</div> | 
					
						
							|  |  |  | 				</div> | 
					
						
							|  |  |  | 			</div> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 		@if(!empty($user->picture_file_name)) | 
					
						
							|  |  |  | 		<img id="current-user-picture" | 
					
						
							|  |  |  | 			data-src="{{ $U('/api/files/userpictures/' . base64_encode($user->picture_file_name) . '?force_serve_as=picture&best_fit_width=400') }}" | 
					
						
							|  |  |  | 			class="img-fluid img-thumbnail mt-2 lazy mb-5"> | 
					
						
							|  |  |  | 		<p id="delete-current-user-picture-on-save-hint" | 
					
						
							|  |  |  | 			class="form-text text-muted font-italic d-none mb-5">{{ $__t('The current picture will be deleted on save') }}</p> | 
					
						
							|  |  |  | 		@else | 
					
						
							|  |  |  | 		<p id="no-current-user-picture-hint" | 
					
						
							|  |  |  | 			class="form-text text-muted font-italic mb-5">{{ $__t('No picture available') }}</p> | 
					
						
							|  |  |  | 		@endif | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2018-07-24 19:31:43 +02:00
										 |  |  | </div> | 
					
						
							|  |  |  | @stop |