Add userfields to battery charge cycle tracking (#2490)

Co-authored-by: Manuel Worschech <mw@abot.xyz>
This commit is contained in:
TheDodger
2024-03-10 18:12:02 +01:00
committed by GitHub
parent e01e0f3abe
commit 477f333466
6 changed files with 41 additions and 15 deletions

View File

@@ -91,6 +91,10 @@
</th>
<th class="allow-grouping">{{ $__t('Battery') }}</th>
<th>{{ $__t('Tracked time') }}</th>
@include('components.userfields_thead', array(
'userfields' => $userfields
))
</tr>
</thead>
<tbody class="d-none">
@@ -121,6 +125,11 @@
<time class="timeago timeago-contextual"
datetime="{{ $chargeCycleEntry->tracked_time }}"></time>
</td>
@include('components.userfields_tbody', array(
'userfields' => $userfields,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $chargeCycleEntry->id)
))
</tr>
@endforeach
</tbody>

View File

@@ -44,6 +44,11 @@
'invalidFeedback' => $__t('This can only be before now')
))
@include('components.userfieldsform', array(
'userfields' => $userfields,
'entity' => 'battery_charge_cycles'
))
<button id="save-batterytracking-button"
class="btn btn-success">{{ $__t('OK') }}</button>