mirror of
https://github.com/grocy/grocy.git
synced 2025-04-28 17:23:56 +00:00
Optimized tracking button handling on /choresoverview (closes #2186)
This commit is contained in:
parent
3d01854fa1
commit
98469248eb
@ -53,7 +53,10 @@
|
||||
|
||||
### Chores
|
||||
|
||||
- xxx
|
||||
- Changed the handling of the tracking buttons on the chores overview page:
|
||||
- The green button now tracks an execution of the corresponding chore on the next scheduled time, rather than for now/today
|
||||
- New context-/more menu option "Track chore execution now" to track an execution for now/today (so the same what the green button did before)
|
||||
- Removed the limitation on the chore tracking page that the tracked time couldn't be in the future
|
||||
|
||||
### Calendar
|
||||
|
||||
|
@ -1754,7 +1754,7 @@ msgstr ""
|
||||
msgid "Chore journal"
|
||||
msgstr ""
|
||||
|
||||
msgid "Track chore execution"
|
||||
msgid "Track next chore schedule"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mark task as completed"
|
||||
@ -2371,3 +2371,6 @@ msgstr ""
|
||||
|
||||
msgid "Quick open amount"
|
||||
msgstr ""
|
||||
|
||||
msgid "Track chore execution now"
|
||||
msgstr ""
|
||||
|
@ -93,19 +93,20 @@ $(document).on('click', '.track-chore-button', function(e)
|
||||
var choreId = $(e.currentTarget).attr('data-chore-id');
|
||||
var choreName = $(e.currentTarget).attr('data-chore-name');
|
||||
var skipped = $(e.currentTarget).hasClass("skip");
|
||||
var now = $(e.currentTarget).hasClass("now");
|
||||
|
||||
Grocy.Api.Get('chores/' + choreId,
|
||||
function(choreDetails)
|
||||
{
|
||||
var trackedTime = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||
if (skipped)
|
||||
if ((skipped || !now) && choreDetails.next_estimated_execution_time != null)
|
||||
{
|
||||
trackedTime = moment(choreDetails.next_estimated_execution_time).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
if (choreDetails.chore.track_date_only == 1)
|
||||
{
|
||||
if (skipped)
|
||||
if ((skipped || !now) && choreDetails.next_estimated_execution_time != null)
|
||||
{
|
||||
trackedTime = moment(choreDetails.next_estimated_execution_time).format('YYYY-MM-DD');
|
||||
}
|
||||
|
@ -145,7 +145,7 @@
|
||||
href="#"
|
||||
data-toggle="tooltip"
|
||||
data-placement="left"
|
||||
title="{{ $__t('Track chore execution') }}"
|
||||
title="{{ $__t('Track next chore schedule') }}"
|
||||
data-chore-id="{{ $curentChoreEntry->chore_id }}"
|
||||
data-chore-name="{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}">
|
||||
<i class="fa-solid fa-play"></i>
|
||||
@ -166,7 +166,13 @@
|
||||
<i class="fa-solid fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="table-inline-menu dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item reschedule-chore-button"
|
||||
<a class="dropdown-item track-chore-button now permission-CHORE_TRACK_EXECUTION"
|
||||
data-chore-id="{{ $curentChoreEntry->chore_id }}"
|
||||
type="button"
|
||||
href="#">
|
||||
<span>{{ $__t('Track chore execution now') }}</span>
|
||||
</a>
|
||||
<a class="dropdown-item reschedule-chore-button permission-CHORE_TRACK_EXECUTION"
|
||||
data-chore-id="{{ $curentChoreEntry->chore_id }}"
|
||||
type="button"
|
||||
href="#">
|
||||
|
@ -39,9 +39,9 @@
|
||||
'label' => 'Tracked time',
|
||||
'format' => 'YYYY-MM-DD HH:mm:ss',
|
||||
'initWithNow' => true,
|
||||
'limitEndToNow' => true,
|
||||
'limitEndToNow' => false,
|
||||
'limitStartToNow' => false,
|
||||
'invalidFeedback' => $__t('This can only be before now')
|
||||
'invalidFeedback' => $__t('A date is required')
|
||||
))
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user