| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @extends('layout.default') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | @section('title', $__t('Batteries overview')) | 
					
						
							| 
									
										
										
										
											2018-04-12 21:13:38 +02:00
										 |  |  | @section('activeNav', 'batteriesoverview') | 
					
						
							|  |  |  | @section('viewJsName', 'batteriesoverview') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-13 09:38:22 +02:00
										 |  |  | @push('pageScripts') | 
					
						
							| 
									
										
										
										
											2018-07-08 21:36:07 +02:00
										 |  |  | 	<script src="{{ $U('/node_modules/jquery-ui-dist/jquery-ui.min.js?v=', true) }}{{ $version }}"></script> | 
					
						
							| 
									
										
										
										
											2018-05-13 09:38:22 +02:00
										 |  |  | @endpush | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @section('content') | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | <div class="row"> | 
					
						
							|  |  |  | 	<div class="col"> | 
					
						
							| 
									
										
										
										
											2018-10-27 17:26:00 +02:00
										 |  |  | 		<h1>@yield('title') | 
					
						
							|  |  |  | 			<a class="btn btn-outline-dark responsive-button" href="{{ $U('/batteriesjournal') }}"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<i class="fas fa-file-alt"></i> {{ $__t('Journal') }} | 
					
						
							| 
									
										
										
										
											2018-10-27 17:26:00 +02:00
										 |  |  | 			</a> | 
					
						
							|  |  |  | 		</h1> | 
					
						
							| 
									
										
										
										
											2018-09-24 19:13:53 +02:00
										 |  |  | 		<p id="info-due-batteries" data-status-filter="duesoon" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning status-filter-button responsive-button mr-2"></p> | 
					
						
							|  |  |  | 		<p id="info-overdue-batteries" data-status-filter="overdue" class="btn btn-lg btn-danger status-filter-button responsive-button"></p> | 
					
						
							| 
									
										
										
										
											2018-05-12 15:30:13 +02:00
										 |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <div class="row mt-3"> | 
					
						
							| 
									
										
										
										
											2018-11-24 19:40:50 +01:00
										 |  |  | 	<div class="col-xs-12 col-md-6 col-xl-3"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 		<label for="search">{{ $__t('Search') }}</label> <i class="fas fa-search"></i> | 
					
						
							| 
									
										
										
										
											2018-11-24 19:40:50 +01:00
										 |  |  | 		<input type="text" class="form-control" id="search"> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2018-09-24 19:13:53 +02:00
										 |  |  | 	<div class="col-xs-12 col-md-6 col-xl-3"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 		<label for="status-filter">{{ $__t('Filter by status') }}</label> <i class="fas fa-filter"></i> | 
					
						
							| 
									
										
										
										
											2018-09-24 19:13:53 +02:00
										 |  |  | 		<select class="form-control" id="status-filter"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 			<option class="bg-white" value="all">{{ $__t('All') }}</option> | 
					
						
							|  |  |  | 			<option class="bg-warning" value="duesoon">{{ $__t('Due soon') }}</option> | 
					
						
							|  |  |  | 			<option class="bg-danger" value="overdue">{{ $__t('Overdue') }}</option> | 
					
						
							| 
									
										
										
										
											2018-09-24 19:13:53 +02:00
										 |  |  | 		</select> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2018-05-12 15:30:13 +02:00
										 |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | <div class="row"> | 
					
						
							|  |  |  | 	<div class="col"> | 
					
						
							|  |  |  | 		<table id="batteries-overview-table" class="table table-sm table-striped dt-responsive"> | 
					
						
							|  |  |  | 			<thead> | 
					
						
							|  |  |  | 				<tr> | 
					
						
							| 
									
										
										
										
											2019-03-09 10:49:26 +01:00
										 |  |  | 					<th class="border-right"></th> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 					<th>{{ $__t('Battery') }}</th> | 
					
						
							|  |  |  | 					<th>{{ $__t('Last charged') }}</th> | 
					
						
							|  |  |  | 					<th>{{ $__t('Next planned charge cycle') }}</th> | 
					
						
							| 
									
										
										
										
											2018-09-24 19:13:53 +02:00
										 |  |  | 					<th class="d-none">Hidden status</th> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 					@include('components.userfields_thead', array( | 
					
						
							|  |  |  | 						'userfields' => $userfields | 
					
						
							|  |  |  | 					)) | 
					
						
							|  |  |  | 					 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 				</tr> | 
					
						
							|  |  |  | 			</thead> | 
					
						
							| 
									
										
										
										
											2019-01-05 20:06:35 +01:00
										 |  |  | 			<tbody class="d-none"> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 				@foreach($current as $curentBatteryEntry) | 
					
						
							| 
									
										
										
										
											2018-08-07 20:11:08 +02:00
										 |  |  | 				<tr id="battery-{{ $curentBatteryEntry->battery_id }}-row" class="@if(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0 && $curentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s')) table-danger @elseif(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0 && $curentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) table-warning @endif"> | 
					
						
							| 
									
										
										
										
											2019-03-09 10:49:26 +01:00
										 |  |  | 					<td class="fit-content border-right"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 						<a class="btn btn-success btn-sm track-charge-cycle-button" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Track charge cycle of battery %s', FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name) }}" | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 							data-battery-id="{{ $curentBatteryEntry->battery_id }}" | 
					
						
							|  |  |  | 							data-battery-name="{{ FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name }}"> | 
					
						
							| 
									
										
										
										
											2018-07-11 19:43:05 +02:00
										 |  |  | 							<i class="fas fa-fire"></i> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 						</a> | 
					
						
							| 
									
										
										
										
											2019-03-09 13:11:50 +01:00
										 |  |  | 						<div class="dropdown d-inline-block"> | 
					
						
							|  |  |  | 							<button class="btn btn-sm btn-light text-secondary" type="button" data-toggle="dropdown"> | 
					
						
							|  |  |  | 								<i class="fas fa-ellipsis-v"></i> | 
					
						
							|  |  |  | 							</button> | 
					
						
							|  |  |  | 							<div class="dropdown-menu"> | 
					
						
							|  |  |  | 								<a class="dropdown-item battery-name-cell" data-chore-id="{{ $curentBatteryEntry->battery_id }}" type="button" href="#"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 									<i class="fas fa-info"></i> {{ $__t('Show battery details') }} | 
					
						
							| 
									
										
										
										
											2019-03-09 13:11:50 +01:00
										 |  |  | 								</a> | 
					
						
							|  |  |  | 								<a class="dropdown-item" type="button" href="{{ $U('/batteriesjournal?battery=') }}{{ $curentBatteryEntry->battery_id }}"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 									<i class="fas fa-file-alt"></i> {{ $__t('Journal for this battery') }} | 
					
						
							| 
									
										
										
										
											2019-03-09 13:11:50 +01:00
										 |  |  | 								</a> | 
					
						
							|  |  |  | 								<a class="dropdown-item" type="button" href="{{ $U('/battery/') }}{{ $curentBatteryEntry->battery_id }}"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 									<i class="fas fa-edit"></i> {{ $__t('Edit battery') }} | 
					
						
							| 
									
										
										
										
											2019-03-09 13:11:50 +01:00
										 |  |  | 								</a> | 
					
						
							|  |  |  | 							</div> | 
					
						
							|  |  |  | 						</div> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 					</td> | 
					
						
							| 
									
										
										
										
											2019-03-09 13:11:50 +01:00
										 |  |  | 					<td class="battery-name-cell cursor-link" data-battery-id="{{ $curentBatteryEntry->battery_id }}"> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 						{{ FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name }} | 
					
						
							|  |  |  | 					</td> | 
					
						
							|  |  |  | 					<td> | 
					
						
							|  |  |  | 						<span id="battery-{{ $curentBatteryEntry->battery_id }}-last-tracked-time">{{ $curentBatteryEntry->last_tracked_time }}</span> | 
					
						
							|  |  |  | 						<time id="battery-{{ $curentBatteryEntry->battery_id }}-last-tracked-time-timeago" class="timeago timeago-contextual" datetime="{{ $curentBatteryEntry->last_tracked_time }}"></time> | 
					
						
							|  |  |  | 					</td> | 
					
						
							|  |  |  | 					<td> | 
					
						
							|  |  |  | 						@if(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0) | 
					
						
							| 
									
										
										
										
											2018-08-07 20:11:08 +02:00
										 |  |  | 							<span id="battery-{{ $curentBatteryEntry->battery_id }}-next-charge-time">{{ $curentBatteryEntry->next_estimated_charge_time }}</span> | 
					
						
							|  |  |  | 							<time id="battery-{{ $curentBatteryEntry->battery_id }}-next-charge-time-timeago" class="timeago timeago-contextual" datetime="{{ $curentBatteryEntry->next_estimated_charge_time }}"></time> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 						@else | 
					
						
							|  |  |  | 							... | 
					
						
							|  |  |  | 						@endif | 
					
						
							|  |  |  | 					</td> | 
					
						
							| 
									
										
										
										
											2018-09-24 19:13:53 +02:00
										 |  |  | 					<td class="d-none"> | 
					
						
							|  |  |  | 						"@if(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0 && $curentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s')) overdue @elseif(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0 && $curentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) duesoon @endif
 | 
					
						
							|  |  |  | 					</td> | 
					
						
							| 
									
										
										
										
											2019-04-22 22:16:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 					@include('components.userfields_tbody', array( | 
					
						
							|  |  |  | 						'userfields' => $userfields, | 
					
						
							|  |  |  | 						'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $curentBatteryEntry->battery_id) | 
					
						
							|  |  |  | 					)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 				</tr> | 
					
						
							|  |  |  | 				@endforeach | 
					
						
							|  |  |  | 			</tbody> | 
					
						
							|  |  |  | 		</table> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2017-11-05 12:41:00 +01:00
										 |  |  | </div> | 
					
						
							| 
									
										
										
										
											2019-03-09 13:11:50 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | <div class="modal fade" id="batteriesoverview-batterycard-modal" tabindex="-1"> | 
					
						
							|  |  |  | 	<div class="modal-dialog"> | 
					
						
							|  |  |  | 		<div class="modal-content text-center"> | 
					
						
							|  |  |  | 			<div class="modal-body"> | 
					
						
							|  |  |  | 				@include('components.batterycard') | 
					
						
							|  |  |  | 			</div> | 
					
						
							|  |  |  | 			<div class="modal-footer"> | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | 				<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $__t('Close') }}</button> | 
					
						
							| 
									
										
										
										
											2019-03-09 13:11:50 +01:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | </div> | 
					
						
							| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @stop |