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')
|
|
|
|
|
2020-01-28 19:27:18 +01:00
|
|
|
@push('pageStyles')
|
2020-08-31 20:32:50 +02:00
|
|
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
|
|
|
|
rel="stylesheet">
|
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">
|
2020-04-19 08:51:02 -04:00
|
|
|
<div class="title-related-links">
|
|
|
|
<h2 class="title">@yield('title')</h2>
|
|
|
|
<div class="related-links">
|
2020-08-31 20:32:50 +02:00
|
|
|
<a class="btn btn-outline-dark responsive-button"
|
|
|
|
href="{{ $U('/batteriesjournal') }}">
|
|
|
|
{{ $__t('Journal') }}
|
2020-04-19 08:51:02 -04:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-10-31 18:37:10 +01:00
|
|
|
<div class="border-top border-bottom my-2 py-1">
|
|
|
|
<div id="info-due-batteries"
|
|
|
|
data-status-filter="duesoon"
|
|
|
|
data-next-x-days="{{ $nextXDays }}"
|
|
|
|
class="warning-message status-filter-message responsive-button mr-2"></div>
|
|
|
|
<div id="info-overdue-batteries"
|
|
|
|
data-status-filter="overdue"
|
|
|
|
class="error-message status-filter-message responsive-button"></div>
|
|
|
|
</div>
|
2018-05-12 15:30:13 +02:00
|
|
|
</div>
|
2018-07-10 20:37:13 +02:00
|
|
|
</div>
|
|
|
|
|
2020-10-31 18:37:10 +01:00
|
|
|
<div class="row">
|
2018-11-24 19:40:50 +01:00
|
|
|
<div class="col-xs-12 col-md-6 col-xl-3">
|
2020-10-31 18:37:10 +01:00
|
|
|
<div class="input-group">
|
2020-04-19 08:51:02 -04:00
|
|
|
<div class="input-group-prepend">
|
2020-08-31 20:32:50 +02:00
|
|
|
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
2020-04-19 08:51:02 -04:00
|
|
|
</div>
|
2020-08-31 20:32:50 +02:00
|
|
|
<input type="text"
|
|
|
|
id="search"
|
|
|
|
class="form-control"
|
|
|
|
placeholder="{{ $__t('Search') }}">
|
2020-04-19 08:51:02 -04:00
|
|
|
</div>
|
2018-11-24 19:40:50 +01:00
|
|
|
</div>
|
2018-09-24 19:13:53 +02:00
|
|
|
<div class="col-xs-12 col-md-6 col-xl-3">
|
2020-10-31 18:37:10 +01:00
|
|
|
<div class="input-group">
|
2020-04-19 08:51:02 -04:00
|
|
|
<div class="input-group-prepend">
|
2020-10-31 18:37:10 +01:00
|
|
|
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Status') }}</span>
|
2020-04-19 08:51:02 -04:00
|
|
|
</div>
|
2020-08-31 20:32:50 +02:00
|
|
|
<select class="form-control"
|
|
|
|
id="status-filter">
|
2020-04-19 08:51:02 -04:00
|
|
|
<option value="all">{{ $__t('All') }}</option>
|
|
|
|
<option value="duesoon">{{ $__t('Due soon') }}</option>
|
|
|
|
<option value="overdue">{{ $__t('Overdue') }}</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2018-09-24 19:13:53 +02:00
|
|
|
</div>
|
2018-05-12 15:30:13 +02:00
|
|
|
</div>
|
|
|
|
|
2018-07-10 20:37:13 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2020-08-31 20:32:50 +02:00
|
|
|
<table id="batteries-overview-table"
|
|
|
|
class="table table-sm table-striped dt-responsive">
|
2018-07-10 20:37:13 +02:00
|
|
|
<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(
|
2020-08-31 20:32:50 +02:00
|
|
|
'userfields' => $userfields
|
2019-04-22 22:16:35 +02:00
|
|
|
))
|
2020-08-29 16:41:27 +02:00
|
|
|
|
2018-07-10 20:37:13 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2019-01-05 20:06:35 +01:00
|
|
|
<tbody class="d-none">
|
2020-01-28 01:44:25 -06:00
|
|
|
@foreach($current as $currentBatteryEntry)
|
2020-08-31 20:32:50 +02:00
|
|
|
<tr id="battery-{{ $currentBatteryEntry->battery_id }}-row"
|
2020-10-18 15:08:09 +02:00
|
|
|
class="@if(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s')) table-danger @elseif(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s', strtotime('+' . $nextXDays . ' days')))
|
2020-08-31 20:32:50 +02:00
|
|
|
table-warning
|
|
|
|
@endif">
|
2019-03-09 10:49:26 +01:00
|
|
|
<td class="fit-content border-right">
|
2020-08-31 20:32:50 +02:00
|
|
|
<a class="btn btn-success btn-sm track-charge-cycle-button permission-BATTERIES_TRACK_CHARGE_CYCLE"
|
|
|
|
href="#"
|
|
|
|
data-toggle="tooltip"
|
|
|
|
data-placement="left"
|
|
|
|
title="{{ $__t('Track charge cycle of battery %s', FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name) }}"
|
2020-01-28 01:44:25 -06:00
|
|
|
data-battery-id="{{ $currentBatteryEntry->battery_id }}"
|
|
|
|
data-battery-name="{{ FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->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">
|
2020-08-31 20:32:50 +02:00
|
|
|
<button class="btn btn-sm btn-light text-secondary"
|
|
|
|
type="button"
|
|
|
|
data-toggle="dropdown">
|
2019-03-09 13:11:50 +01:00
|
|
|
<i class="fas fa-ellipsis-v"></i>
|
|
|
|
</button>
|
2020-03-21 15:52:51 +01:00
|
|
|
<div class="table-inline-menu dropdown-menu dropdown-menu-right">
|
2020-08-31 20:32:50 +02:00
|
|
|
<a class="dropdown-item battery-name-cell"
|
|
|
|
data-battery-id="{{ $currentBatteryEntry->battery_id }}"
|
|
|
|
type="button"
|
|
|
|
href="#">
|
2020-03-21 15:52:51 +01:00
|
|
|
<span class="dropdown-item-icon"><i class="fas fa-info"></i></span> <span class="dropdown-item-text">{{ $__t('Show battery details') }}</span>
|
2019-03-09 13:11:50 +01:00
|
|
|
</a>
|
2020-08-31 20:32:50 +02:00
|
|
|
<a class="dropdown-item"
|
|
|
|
type="button"
|
|
|
|
href="{{ $U('/batteriesjournal?battery=') }}{{ $currentBatteryEntry->battery_id }}">
|
2020-03-21 15:52:51 +01:00
|
|
|
<span class="dropdown-item-icon"><i class="fas fa-file-alt"></i></span> <span class="dropdown-item-text">{{ $__t('Journal for this battery') }}</span>
|
2019-03-09 13:11:50 +01:00
|
|
|
</a>
|
2020-08-31 20:32:50 +02:00
|
|
|
<a class="dropdown-item permission-MASTER_DATA_EDIT"
|
|
|
|
type="button"
|
|
|
|
href="{{ $U('/battery/') }}{{ $currentBatteryEntry->battery_id }}">
|
2020-03-21 15:52:51 +01:00
|
|
|
<span class="dropdown-item-icon"><i class="fas fa-edit"></i></span> <span class="dropdown-item-text">{{ $__t('Edit battery') }}</span>
|
2019-03-09 13:11:50 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-10 20:37:13 +02:00
|
|
|
</td>
|
2020-08-31 20:32:50 +02:00
|
|
|
<td class="battery-name-cell cursor-link"
|
|
|
|
data-battery-id="{{ $currentBatteryEntry->battery_id }}">
|
2020-01-28 01:44:25 -06:00
|
|
|
{{ FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name }}
|
2018-07-10 20:37:13 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
2020-01-28 01:44:25 -06:00
|
|
|
<span id="battery-{{ $currentBatteryEntry->battery_id }}-last-tracked-time">{{ $currentBatteryEntry->last_tracked_time }}</span>
|
2020-08-31 20:32:50 +02:00
|
|
|
<time id="battery-{{ $currentBatteryEntry->battery_id }}-last-tracked-time-timeago"
|
|
|
|
class="timeago timeago-contextual"
|
|
|
|
datetime="{{ $currentBatteryEntry->last_tracked_time }}"></time>
|
2018-07-10 20:37:13 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
2020-01-28 01:44:25 -06:00
|
|
|
@if(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0)
|
2020-08-31 20:32:50 +02:00
|
|
|
<span id="battery-{{ $currentBatteryEntry->battery_id }}-next-charge-time">{{ $currentBatteryEntry->next_estimated_charge_time }}</span>
|
|
|
|
<time id="battery-{{ $currentBatteryEntry->battery_id }}-next-charge-time-timeago"
|
|
|
|
class="timeago timeago-contextual"
|
|
|
|
datetime="{{ $currentBatteryEntry->next_estimated_charge_time }}"></time>
|
2018-07-10 20:37:13 +02:00
|
|
|
@else
|
2020-08-31 20:32:50 +02:00
|
|
|
...
|
2018-07-10 20:37:13 +02:00
|
|
|
@endif
|
|
|
|
</td>
|
2018-09-24 19:13:53 +02:00
|
|
|
<td class="d-none">
|
2020-08-31 20:32:50 +02:00
|
|
|
"@if(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d
|
|
|
|
H:i:s'))
|
|
|
|
overdue
|
|
|
|
@elseif(FindObjectInArrayByPropertyValue($batteries, 'id'
|
|
|
|
,
|
|
|
|
$currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d
|
|
|
|
H:i:s',
|
2020-10-18 15:08:09 +02:00
|
|
|
strtotime('+'
|
|
|
|
.
|
|
|
|
$nextXDays
|
|
|
|
. ' days'
|
|
|
|
)))
|
2020-08-31 20:32:50 +02:00
|
|
|
duesoon
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
@include('components.userfields_tbody',
|
|
|
|
array( 'userfields'=> $userfields,
|
|
|
|
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $currentBatteryEntry->battery_id)
|
|
|
|
))
|
2019-04-22 22:16:35 +02:00
|
|
|
|
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
|
|
|
|
2020-08-31 20:32:50 +02:00
|
|
|
<div class="modal fade"
|
|
|
|
id="batteriesoverview-batterycard-modal"
|
|
|
|
tabindex="-1">
|
2019-03-09 13:11:50 +01:00
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content text-center">
|
|
|
|
<div class="modal-body">
|
|
|
|
@include('components.batterycard')
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2020-08-31 20:32:50 +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
|