mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Make track now / next schedule buttons on /choresoverview swappable (closes #2424)
This commit is contained in:
parent
11d28622e8
commit
9cac3b2311
@ -42,7 +42,7 @@
|
||||
|
||||
### Chores
|
||||
|
||||
- xxx
|
||||
- Added a new option "Swap track next schedule / track now buttons" (stock settings / top right corner settings menu) to swap the "Track next chore schedule" and "Track chore execution now" buttons/menu items on the chores overview page (defaults to disabled, so no changed behavior when not configured)
|
||||
|
||||
### Calendar
|
||||
|
||||
|
@ -207,6 +207,7 @@ DefaultUserSetting('recipes_show_ingredient_checkbox', false); // When enabled,
|
||||
|
||||
// Chores settings
|
||||
DefaultUserSetting('chores_due_soon_days', 5); // The "due soon" days
|
||||
DefaultUserSetting('chores_overview_swap_tracking_buttons', false); // When enabled, the "Track next chore schedule" and "Track chore execution now" buttons/menu items are swapped
|
||||
|
||||
// Batteries settings
|
||||
DefaultUserSetting('batteries_due_soon_days', 5); // The "due soon" days
|
||||
|
@ -2437,3 +2437,6 @@ msgstr ""
|
||||
|
||||
msgid "Configure colors"
|
||||
msgstr ""
|
||||
|
||||
msgid "Swap track next schedule / track now buttons"
|
||||
msgstr ""
|
||||
|
@ -1,3 +1,8 @@
|
||||
$("#chores_due_soon_days").val(Grocy.UserSettings.chores_due_soon_days);
|
||||
|
||||
if (BoolVal(Grocy.UserSettings.chores_overview_swap_tracking_buttons))
|
||||
{
|
||||
$("#chores_overview_swap_tracking_buttons").prop("checked", true);
|
||||
}
|
||||
|
||||
RefreshLocaleNumberInput();
|
||||
|
@ -136,11 +136,15 @@
|
||||
<tr id="chore-{{ $curentChoreEntry->chore_id }}-row"
|
||||
class="@if($curentChoreEntry->due_type == 'overdue') table-danger @elseif($curentChoreEntry->due_type == 'duetoday') table-info @elseif($curentChoreEntry->due_type == 'duesoon') table-warning @endif">
|
||||
<td class="fit-content border-right">
|
||||
<a class="btn btn-success btn-sm track-chore-button permission-CHORE_TRACK_EXECUTION"
|
||||
<a class="btn btn-success btn-sm track-chore-button permission-CHORE_TRACK_EXECUTION @if(boolval($userSettings['chores_overview_swap_tracking_buttons'])) now @endif"
|
||||
href="#"
|
||||
data-toggle="tooltip"
|
||||
data-placement="left"
|
||||
@if(boolval($userSettings['chores_overview_swap_tracking_buttons']))
|
||||
title="{{ $__t('Track chore execution now') }}"
|
||||
@else
|
||||
title="{{ $__t('Track next chore schedule') }}"
|
||||
@endif
|
||||
data-chore-id="{{ $curentChoreEntry->chore_id }}"
|
||||
data-chore-name="{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}">
|
||||
<i class="fa-solid fa-play"></i>
|
||||
@ -161,11 +165,15 @@
|
||||
<i class="fa-solid fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="table-inline-menu dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item track-chore-button now permission-CHORE_TRACK_EXECUTION"
|
||||
<a class="dropdown-item track-chore-button permission-CHORE_TRACK_EXECUTION @if(!boolval($userSettings['chores_overview_swap_tracking_buttons'])) now @endif"
|
||||
data-chore-id="{{ $curentChoreEntry->chore_id }}"
|
||||
type="button"
|
||||
href="#">
|
||||
@if(boolval($userSettings['chores_overview_swap_tracking_buttons']))
|
||||
<span>{{ $__t('Track next chore schedule') }}</span>
|
||||
@else
|
||||
<span>{{ $__t('Track chore execution now') }}</span>
|
||||
@endif
|
||||
</a>
|
||||
<a class="dropdown-item reschedule-chore-button permission-CHORE_TRACK_EXECUTION"
|
||||
data-chore-id="{{ $curentChoreEntry->chore_id }}"
|
||||
|
@ -13,17 +13,31 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-12">
|
||||
<h4 ">{{ $__t('Chores overview') }}</h4>
|
||||
|
||||
@include('components.numberpicker', array(
|
||||
'id' => 'chores_due_soon_days',
|
||||
'additionalAttributes' => 'data-setting-key="chores_due_soon_days"',
|
||||
'label' => 'Due soon days',
|
||||
'min' => 0,
|
||||
'additionalCssClasses' => 'user-setting-control',
|
||||
'hint' => $__t('Set to 0 to hide due soon filters/highlighting')
|
||||
))
|
||||
'additionalAttributes' => 'data-setting-key=" chores_due_soon_days"', 'label'=> 'Due soon days',
|
||||
'min' => 0,
|
||||
'additionalCssClasses' => 'user-setting-control',
|
||||
'hint' => $__t('Set to 0 to hide due soon filters/highlighting')
|
||||
))
|
||||
|
||||
<a href="{{ $U('/choresoverview') }}"
|
||||
class="btn btn-success">{{ $__t('OK') }}</a>
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox"
|
||||
class="form-check-input custom-control-input user-setting-control"
|
||||
id="chores_overview_swap_tracking_buttons"
|
||||
data-setting-key="chores_overview_swap_tracking_buttons">
|
||||
<label class="form-check-label custom-control-label"
|
||||
for="chores_overview_swap_tracking_buttons">
|
||||
{{ $__t('Swap track next schedule / track now buttons') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{ $U('/choresoverview') }}"
|
||||
class="btn btn-success">{{ $__t('OK') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
Loading…
x
Reference in New Issue
Block a user