2023-05-21 10:56:38 +02:00
|
|
|
@php require_frontend_packages(['datatables']); @endphp
|
|
|
|
|
2018-10-27 17:26:00 +02:00
|
|
|
@extends('layout.default')
|
|
|
|
|
2019-05-01 20:19:18 +02:00
|
|
|
@section('title', $__t('Batteries journal'))
|
2018-10-27 17:26:00 +02:00
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2020-04-19 08:51:02 -04:00
|
|
|
<h2 class="title">@yield('title')</h2>
|
2025-01-11 12:06:15 +01:00
|
|
|
<div class="float-right @if($embedded) pr-5 @endif">
|
2020-11-07 14:53:45 +01:00
|
|
|
<button class="btn btn-outline-dark d-md-none mt-2 order-1 order-md-3"
|
|
|
|
type="button"
|
|
|
|
data-toggle="collapse"
|
|
|
|
data-target="#table-filter-row">
|
2022-04-04 21:17:46 +02:00
|
|
|
<i class="fa-solid fa-filter"></i>
|
2020-11-07 14:53:45 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
2018-10-27 17:26:00 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-11-08 15:09:10 +01:00
|
|
|
<hr class="my-2">
|
2020-10-31 18:37:10 +01:00
|
|
|
|
2020-11-07 14:53:45 +01:00
|
|
|
<div class="row collapse d-md-flex"
|
|
|
|
id="table-filter-row">
|
2021-06-24 22:46:47 +02:00
|
|
|
<div class="col-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">
|
2022-04-04 21:17:46 +02:00
|
|
|
<span class="input-group-text"><i class="fa-solid 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>
|
2019-03-04 17:43:12 +01:00
|
|
|
</div>
|
2021-06-24 22:46:47 +02:00
|
|
|
<div class="col-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">
|
2022-04-04 21:17:46 +02:00
|
|
|
<span class="input-group-text"><i class="fa-solid fa-filter"></i> {{ $__t('Battery') }}</span>
|
2020-04-19 08:51:02 -04:00
|
|
|
</div>
|
2020-11-16 19:10:29 +01:00
|
|
|
<select class="custom-control custom-select"
|
2020-08-31 20:32:50 +02:00
|
|
|
id="battery-filter">
|
2020-04-19 08:51:02 -04:00
|
|
|
<option value="all">{{ $__t('All') }}</option>
|
2020-08-31 20:32:50 +02:00
|
|
|
@foreach($batteries as $battery)
|
2018-10-27 17:26:00 +02:00
|
|
|
<option value="{{ $battery->id }}">{{ $battery->name }}</option>
|
2020-08-31 20:32:50 +02:00
|
|
|
@endforeach
|
2020-04-19 08:51:02 -04:00
|
|
|
</select>
|
|
|
|
</div>
|
2018-10-27 17:26:00 +02:00
|
|
|
</div>
|
2021-07-13 19:29:23 +02:00
|
|
|
<div class="col-12 col-md-6 col-xl-3">
|
|
|
|
<div class="input-group">
|
|
|
|
<div class="input-group-prepend">
|
2022-04-04 21:17:46 +02:00
|
|
|
<span class="input-group-text"><i class="fa-solid fa-clock"></i> {{ $__t('Date range') }}</span>
|
2021-07-13 19:29:23 +02:00
|
|
|
</div>
|
|
|
|
<select class="custom-control custom-select"
|
|
|
|
id="daterange-filter">
|
|
|
|
<option value="1">{{ $__n(1, '%s month', '%s months') }}</option>
|
|
|
|
<option value="6">{{ $__n(6, '%s month', '%s months') }}</option>
|
|
|
|
<option value="12">{{ $__n(1, '%s year', '%s years') }}</option>
|
|
|
|
<option value="24"
|
|
|
|
selected>{{ $__n(2, '%s month', '%s years') }}</option>
|
|
|
|
<option value="9999">{{ $__t('All') }}</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-11-07 14:53:45 +01:00
|
|
|
<div class="col">
|
|
|
|
<div class="float-right">
|
2022-04-04 22:42:10 +02:00
|
|
|
<button id="clear-filter-button"
|
2020-11-07 14:53:45 +01:00
|
|
|
class="btn btn-sm btn-outline-info"
|
2022-04-04 21:07:14 +02:00
|
|
|
data-toggle="tooltip"
|
|
|
|
title="{{ $__t('Clear filter') }}">
|
|
|
|
<i class="fa-solid fa-filter-circle-xmark"></i>
|
2022-04-04 22:42:10 +02:00
|
|
|
</button>
|
2020-11-07 14:53:45 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-10-27 17:26:00 +02:00
|
|
|
</div>
|
|
|
|
|
2020-10-31 18:37:10 +01:00
|
|
|
<div class="row mt-2">
|
2018-10-27 17:26:00 +02:00
|
|
|
<div class="col">
|
2020-08-31 20:32:50 +02:00
|
|
|
<table id="batteries-journal-table"
|
2020-11-07 14:53:45 +01:00
|
|
|
class="table table-sm table-striped nowrap w-100">
|
2018-10-27 17:26:00 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2020-11-11 22:28:05 +01:00
|
|
|
<th class="border-right"><a class="text-muted change-table-columns-visibility-button"
|
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="#batteries-journal-table"
|
2022-04-04 21:17:46 +02:00
|
|
|
href="#"><i class="fa-solid fa-eye"></i></a>
|
2020-11-11 21:11:17 +01:00
|
|
|
</th>
|
2022-02-15 18:40:42 +01:00
|
|
|
<th class="allow-grouping">{{ $__t('Battery') }}</th>
|
2019-05-01 20:19:18 +02:00
|
|
|
<th>{{ $__t('Tracked time') }}</th>
|
2024-03-10 18:12:02 +01:00
|
|
|
|
|
|
|
@include('components.userfields_thead', array(
|
|
|
|
'userfields' => $userfields
|
|
|
|
))
|
2018-10-27 17:26:00 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2019-01-05 20:06:35 +01:00
|
|
|
<tbody class="d-none">
|
2018-10-27 17:26:00 +02:00
|
|
|
@foreach($chargeCycles as $chargeCycleEntry)
|
2020-08-31 20:32:50 +02:00
|
|
|
<tr id="charge-cycle-{{ $chargeCycleEntry->id }}-row"
|
|
|
|
class="@if($chargeCycleEntry->undone == 1) text-muted @endif">
|
2019-03-09 10:49:26 +01:00
|
|
|
<td class="fit-content border-right">
|
2021-07-13 19:29:23 +02:00
|
|
|
<a class="btn btn-secondary btn-xs undo-battery-execution-button @if($chargeCycleEntry->undone == 1) disabled @endif permission-BATTERIES_UNDO_CHARGE_CYCLE"
|
2020-08-31 20:32:50 +02:00
|
|
|
href="#"
|
|
|
|
data-charge-cycle-id="{{ $chargeCycleEntry->id }}"
|
|
|
|
data-toggle="tooltip"
|
|
|
|
data-placement="left"
|
|
|
|
title="{{ $__t('Undo charge cycle') }}">
|
2022-04-04 21:17:46 +02:00
|
|
|
<i class="fa-solid fa-undo"></i>
|
2018-10-27 17:26:00 +02:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td>
|
2018-11-18 12:58:15 +01:00
|
|
|
<span class="name-anchor @if($chargeCycleEntry->undone == 1) text-strike-through @endif">{{ FindObjectInArrayByPropertyValue($batteries, 'id', $chargeCycleEntry->battery_id)->name }}</span>
|
2018-10-27 17:26:00 +02:00
|
|
|
@if($chargeCycleEntry->undone == 1)
|
|
|
|
<br>
|
2019-05-01 20:19:18 +02:00
|
|
|
{{ $__t('Undone on') . ' ' . $chargeCycleEntry->undone_timestamp }}
|
2020-08-31 20:32:50 +02:00
|
|
|
<time class="timeago timeago-contextual"
|
|
|
|
datetime="{{ $chargeCycleEntry->undone_timestamp }}"></time>
|
2018-10-27 17:26:00 +02:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ $chargeCycleEntry->tracked_time }}
|
2020-08-31 20:32:50 +02:00
|
|
|
<time class="timeago timeago-contextual"
|
|
|
|
datetime="{{ $chargeCycleEntry->tracked_time }}"></time>
|
2018-10-27 17:26:00 +02:00
|
|
|
</td>
|
2024-03-10 18:12:02 +01:00
|
|
|
|
|
|
|
@include('components.userfields_tbody', array(
|
|
|
|
'userfields' => $userfields,
|
|
|
|
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $chargeCycleEntry->id)
|
|
|
|
))
|
2018-10-27 17:26:00 +02:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@stop
|