| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @extends('layout.default') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-12 21:13:38 +02:00
										 |  |  | @if($mode == 'edit') | 
					
						
							| 
									
										
										
										
											2018-04-16 19:11:32 +02:00
										 |  |  | 	@section('title', $L('Edit battery')) | 
					
						
							| 
									
										
										
										
											2018-04-12 21:13:38 +02:00
										 |  |  | @else | 
					
						
							| 
									
										
										
										
											2018-04-16 19:11:32 +02:00
										 |  |  | 	@section('title', $L('Create battery')) | 
					
						
							| 
									
										
										
										
											2018-04-12 21:13:38 +02:00
										 |  |  | @endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @section('viewJsName', 'batteryform') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @section('content') | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | <div class="row"> | 
					
						
							|  |  |  | 	<div class="col-lg-6 col-xs-12"> | 
					
						
							|  |  |  | 		<h1>@yield('title')</h1> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 		<script>Grocy.EditMode = '{{ $mode }}';</script> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 		@if($mode == 'edit') | 
					
						
							|  |  |  | 			<script>Grocy.EditObjectId = {{ $battery->id }}</script> | 
					
						
							|  |  |  | 		@endif | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-11 19:43:05 +02:00
										 |  |  | 		<form id="battery-form" novalidate> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							|  |  |  | 				<label for="name">{{ $L('Name') }}</label> | 
					
						
							|  |  |  | 				<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $battery->name }}@endif"> | 
					
						
							| 
									
										
										
										
											2018-07-11 19:43:05 +02:00
										 |  |  | 				<div class="invalid-feedback">{{ $L('A name is required') }}</div> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							|  |  |  | 				<label for="description">{{ $L('Description') }}</label> | 
					
						
							|  |  |  | 				<input type="text" class="form-control" id="description" name="description" value="@if($mode == 'edit'){{ $battery->description }}@endif"> | 
					
						
							|  |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			<div class="form-group"> | 
					
						
							|  |  |  | 				<label for="name">{{ $L('Used in') }}</label> | 
					
						
							|  |  |  | 				<input type="text" class="form-control" id="used_in" name="used_in" value="@if($mode == 'edit'){{ $battery->used_in }}@endif"> | 
					
						
							|  |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 12:04:31 +02:00
										 |  |  | 			@php if($mode == 'edit') { $value = $battery->charge_interval_days; } else { $value = 0; } @endphp | 
					
						
							|  |  |  | 			@include('components.numberpicker', array( | 
					
						
							|  |  |  | 				'id' => 'charge_interval_days', | 
					
						
							|  |  |  | 				'label' => 'Charge cycle interval (days)', | 
					
						
							|  |  |  | 				'value' => $value, | 
					
						
							|  |  |  | 				'min' => '0', | 
					
						
							|  |  |  | 				'hint' => $L('0 means suggestions for the next charge cycle are disabled'), | 
					
						
							|  |  |  | 				'invalidFeedback' => $L('This cannot be negative') | 
					
						
							|  |  |  | 			)) | 
					
						
							| 
									
										
										
										
											2018-07-26 17:28:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			<button id="save-battery-button" type="submit" class="btn btn-success">{{ $L('Save') }}</button> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 		</form> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | </div> | 
					
						
							| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @stop |