| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @extends('layout.default') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-12 21:13:38 +02:00
										 |  |  | @if($mode == 'edit') | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | @section('title', $__t('Edit quantity unit')) | 
					
						
							| 
									
										
										
										
											2018-04-12 21:13:38 +02:00
										 |  |  | @else | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | @section('title', $__t('Create quantity unit')) | 
					
						
							| 
									
										
										
										
											2018-04-12 21:13:38 +02:00
										 |  |  | @endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @section('viewJsName', 'quantityunitform') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @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-10 20:37:13 +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> | 
					
						
							| 
									
										
										
										
											2017-04-15 23:16:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 		@if($mode == 'edit') | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		<script> | 
					
						
							|  |  |  | 			Grocy.EditObjectId = {{ $quantityUnit->id }}; | 
					
						
							|  |  |  | 		</script> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 		@endif | 
					
						
							| 
									
										
										
										
											2017-04-15 23:16:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		<form id="quantityunit-form" | 
					
						
							|  |  |  | 			novalidate> | 
					
						
							| 
									
										
										
										
											2017-04-19 21:09:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="name">{{ $__t('Name') }} <span class="small text-muted">{{ $__t('in singular form') }}</span></label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="text" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					required | 
					
						
							|  |  |  | 					id="name" | 
					
						
							|  |  |  | 					name="name" | 
					
						
							|  |  |  | 					value="@if($mode == 'edit'){{ $quantityUnit->name }}@endif"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<div class="invalid-feedback">{{ $__t('A name is required') }}</div> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2017-04-19 21:09:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-27 19:39:34 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="name_plural">{{ $__t('Name') }} <span class="small text-muted">{{ $__t('in plural form') }}</span></label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<input type="text" | 
					
						
							|  |  |  | 					class="form-control" | 
					
						
							|  |  |  | 					id="name_plural" | 
					
						
							|  |  |  | 					name="name_plural" | 
					
						
							|  |  |  | 					value="@if($mode == 'edit'){{ $quantityUnit->name_plural }}@endif"> | 
					
						
							| 
									
										
										
										
											2018-07-27 19:39:34 +02:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-04 15:15:03 +02:00
										 |  |  | 			@if($pluralCount > 2) | 
					
						
							| 
									
										
										
										
											2019-05-02 20:20:18 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							|  |  |  | 				<label for="plural_forms"> | 
					
						
							|  |  |  | 					{{ $__t('Plural forms') }}<br> | 
					
						
							|  |  |  | 					<span class="small text-muted"> | 
					
						
							|  |  |  | 						{{ $__t('One plural form per line, the current language requires') }}:<br> | 
					
						
							|  |  |  | 						{{ $__t('Plural count') }}: {{ $pluralCount }}<br> | 
					
						
							|  |  |  | 						{{ $__t('Plural rule') }}: {{ $pluralRule }} | 
					
						
							|  |  |  | 					</span> | 
					
						
							|  |  |  | 				</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<textarea class="form-control" | 
					
						
							|  |  |  | 					rows="3" | 
					
						
							|  |  |  | 					id="plural_forms" | 
					
						
							|  |  |  | 					name="plural_forms">@if($mode == 'edit'){{ $quantityUnit->plural_forms }}@endif</textarea> | 
					
						
							| 
									
										
										
										
											2019-05-02 20:20:18 +02:00
										 |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2019-05-04 15:15:03 +02:00
										 |  |  | 			@endif | 
					
						
							| 
									
										
										
										
											2019-05-02 20:20:18 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<label for="description">{{ $__t('Description') }}</label> | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 				<textarea class="form-control" | 
					
						
							|  |  |  | 					rows="2" | 
					
						
							|  |  |  | 					id="description" | 
					
						
							|  |  |  | 					name="description">@if($mode == 'edit'){{ $quantityUnit->description }}@endif</textarea> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2017-04-19 21:09:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 			@include('components.userfieldsform', array( | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'userfields' => $userfields, | 
					
						
							|  |  |  | 			'entity' => 'quantity_units' | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 			)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-08 19:00:12 +01:00
										 |  |  | 			<small class="my-2 form-text text-muted @if($mode == 'edit') d-none @endif">{{ $__t('Save & continue to add conversions') }}</small> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			<button class="save-quantityunit-button btn btn-success mb-2" | 
					
						
							|  |  |  | 				data-location="continue">{{ $__t('Save & continue') }}</button> | 
					
						
							|  |  |  | 			<button class="save-quantityunit-button btn btn-info mb-2" | 
					
						
							|  |  |  | 				data-location="return">{{ $__t('Save & return to quantity units') }}</button> | 
					
						
							| 
									
										
										
										
											2019-09-20 10:33:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			@if(intval($pluralCount) > 2) | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			<button id="test-quantityunit-plural-forms-button" | 
					
						
							|  |  |  | 				class="btn btn-secondary">{{ $__t('Test plural forms') }}</button> | 
					
						
							| 
									
										
										
										
											2019-09-20 10:33:44 +02:00
										 |  |  | 			@endif | 
					
						
							| 
									
										
										
										
											2017-04-19 21:09:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 		</form> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2019-09-15 16:40:54 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-24 22:46:47 +02:00
										 |  |  | 	<div class="col-lg-6 col-12 @if($mode == 'create') d-none @endif"> | 
					
						
							| 
									
										
										
										
											2020-11-08 19:00:12 +01:00
										 |  |  | 		<div class="row"> | 
					
						
							|  |  |  | 			<div class="col"> | 
					
						
							|  |  |  | 				<div class="title-related-links"> | 
					
						
							|  |  |  | 					<h4> | 
					
						
							|  |  |  | 						{{ $__t('Default conversions') }} | 
					
						
							| 
									
										
										
										
											2020-11-17 19:11:02 +01:00
										 |  |  | 						<small id="qu-conversion-headline-info" | 
					
						
							|  |  |  | 							class="text-muted font-italic"></small> | 
					
						
							| 
									
										
										
										
											2020-11-08 19:00:12 +01:00
										 |  |  | 					</h4> | 
					
						
							|  |  |  | 					<button class="btn btn-outline-dark d-md-none mt-2 float-right order-1 order-md-3" | 
					
						
							|  |  |  | 						type="button" | 
					
						
							|  |  |  | 						data-toggle="collapse" | 
					
						
							|  |  |  | 						data-target="#related-links"> | 
					
						
							|  |  |  | 						<i class="fas fa-ellipsis-v"></i> | 
					
						
							|  |  |  | 					</button> | 
					
						
							|  |  |  | 					<div class="related-links collapse d-md-flex order-2 width-xs-sm-100" | 
					
						
							|  |  |  | 						id="related-links"> | 
					
						
							|  |  |  | 						<a class="btn btn-outline-primary btn-sm m-1 mt-md-0 mb-md-0 float-right show-as-dialog-link" | 
					
						
							|  |  |  | 							href="{{ $U('/quantityunitconversion/new?embedded&qu-unit=' . $quantityUnit->id ) }}"> | 
					
						
							|  |  |  | 							{{ $__t('Add') }} | 
					
						
							| 
									
										
										
										
											2019-09-15 16:40:54 +02:00
										 |  |  | 						</a> | 
					
						
							| 
									
										
										
										
											2020-11-08 19:00:12 +01:00
										 |  |  | 					</div> | 
					
						
							|  |  |  | 				</div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				<table id="qu-conversions-table" | 
					
						
							|  |  |  | 					class="table table-sm table-striped nowrap w-100"> | 
					
						
							|  |  |  | 					<thead> | 
					
						
							|  |  |  | 						<tr> | 
					
						
							| 
									
										
										
										
											2020-11-11 22:28:05 +01:00
										 |  |  | 							<th class="border-right"><a class="text-muted change-table-columns-visibility-button" | 
					
						
							|  |  |  | 									data-toggle="tooltip" | 
					
						
							| 
									
										
										
										
											2020-11-11 21:11:17 +01:00
										 |  |  | 									data-toggle="tooltip" | 
					
						
							| 
									
										
										
										
											2020-12-16 18:18:03 +01:00
										 |  |  | 									title="{{ $__t('Table options') }}" | 
					
						
							| 
									
										
										
										
											2020-11-11 21:11:17 +01:00
										 |  |  | 									data-table-selector="#qu-conversions-table" | 
					
						
							|  |  |  | 									href="#"><i class="fas fa-eye"></i></a> | 
					
						
							|  |  |  | 							</th> | 
					
						
							| 
									
										
										
										
											2020-11-08 19:00:12 +01:00
										 |  |  | 							<th>{{ $__t('Factor') }}</th> | 
					
						
							|  |  |  | 							<th>{{ $__t('Unit') }}</th> | 
					
						
							|  |  |  | 						</tr> | 
					
						
							|  |  |  | 					</thead> | 
					
						
							|  |  |  | 					<tbody class="d-none"> | 
					
						
							|  |  |  | 						@if($mode == "edit") | 
					
						
							|  |  |  | 						@foreach($defaultQuConversions as $defaultQuConversion) | 
					
						
							|  |  |  | 						<tr> | 
					
						
							|  |  |  | 							<td class="fit-content border-right"> | 
					
						
							|  |  |  | 								<a class="btn btn-sm btn-info show-as-dialog-link" | 
					
						
							|  |  |  | 									href="{{ $U('/quantityunitconversion/' . $defaultQuConversion->id . '?embedded&qu-unit=' . $quantityUnit->id ) }}" | 
					
						
							|  |  |  | 									data-qu-conversion-id="{{ $defaultQuConversion->id }}"> | 
					
						
							|  |  |  | 									<i class="fas fa-edit"></i> | 
					
						
							|  |  |  | 								</a> | 
					
						
							|  |  |  | 								<a class="btn btn-sm btn-danger qu-conversion-delete-button" | 
					
						
							|  |  |  | 									href="#" | 
					
						
							|  |  |  | 									data-qu-conversion-id="{{ $defaultQuConversion->id }}"> | 
					
						
							|  |  |  | 									<i class="fas fa-trash"></i> | 
					
						
							|  |  |  | 								</a> | 
					
						
							|  |  |  | 							</td> | 
					
						
							|  |  |  | 							<td> | 
					
						
							| 
									
										
										
										
											2020-11-17 19:11:02 +01:00
										 |  |  | 								<span class="locale-number locale-number-quantity-amount">{{ $defaultQuConversion->factor }}</span> | 
					
						
							| 
									
										
										
										
											2020-11-08 19:00:12 +01:00
										 |  |  | 							</td> | 
					
						
							|  |  |  | 							<td> | 
					
						
							|  |  |  | 								{{ FindObjectInArrayByPropertyValue($quantityUnits, 'id', $defaultQuConversion->to_qu_id)->name }} | 
					
						
							|  |  |  | 							</td> | 
					
						
							|  |  |  | 						</tr> | 
					
						
							|  |  |  | 						@endforeach | 
					
						
							|  |  |  | 						@endif | 
					
						
							|  |  |  | 					</tbody> | 
					
						
							|  |  |  | 				</table> | 
					
						
							|  |  |  | 			</div> | 
					
						
							|  |  |  | 		</div> | 
					
						
							| 
									
										
										
										
											2019-09-15 16:40:54 +02:00
										 |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2017-04-15 23:16:20 +02:00
										 |  |  | </div> | 
					
						
							| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @stop |