Little changes for #551

This commit is contained in:
Bernd Bestel 2020-02-09 15:36:03 +01:00
parent a0ab5c5e94
commit 0359003e09
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
6 changed files with 19 additions and 3 deletions

View File

@ -4,6 +4,7 @@
### Shopping list improvements/fixes
- Added an option to hide the month-calendar (in the shopping list settings / top right corner settings menu) (defaults to disabled, so please enable this option if you still want to have the month-calendar on the shopping list)
- Optimized the new compact view (there was a little too much white space at the sides of the page)
- Added an option to not switch to the new compact view on mobile devices automatically (in the shopping list settings / top right corner settings menu) (defaults to `false`, so no changed behavior when not configured) (thanks @Forceu)
- Fixed that the "Shopping list to stock workflow" did not work when `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` was set to `false`
### Recipe improvements/fixes

View File

@ -97,7 +97,7 @@ DefaultUserSetting('scan_mode_purchase_enabled', false);
# Shopping list settings
DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled', false); // Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set
DefaultUserSetting('shopping_list_show_calendar', false);
DefaultUserSetting('shopping_list_disable_auto_compact_view', false);
DefaultUserSetting('shopping_list_disable_auto_compact_view_on_mobile', false);
# Chores settings
DefaultUserSetting('chores_due_soon_days', 5);

View File

@ -1717,3 +1717,6 @@ msgstr ""
msgid "Show a month-view calendar"
msgstr ""
msgid "Don't automatically switch to the compact view on mobile devices"
msgstr ""

View File

@ -383,8 +383,8 @@ if (window.location.hash === "#compact")
$("#shopping-list-compact-view-button").click();
}
// Auto switch to compact view on mobile
if ($(window).width() < 768 & window.location.hash !== "#compact" && !BoolVal(Grocy.UserSettings.shopping_list_disable_auto_compact_view))
// Auto switch to compact view on mobile when enabled
if ($(window).width() < 768 & window.location.hash !== "#compact" && !BoolVal(Grocy.UserSettings.shopping_list_disable_auto_compact_view_on_mobile))
{
$("#shopping-list-compact-view-button").click();
}

View File

@ -7,3 +7,8 @@ if (BoolVal(Grocy.UserSettings.shopping_list_show_calendar))
{
$("#shopping-list-show-calendar").prop("checked", true);
}
if (BoolVal(Grocy.UserSettings.shopping_list_disable_auto_compact_view_on_mobile))
{
$("#shopping-list-disable-auto-compact-view-on-mobile").prop("checked", true);
}

View File

@ -17,6 +17,13 @@
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label for="shopping-list-disable-auto-compact-view-on-mobile">
<input type="checkbox" class="user-setting-control" id="shopping-list-disable-auto-compact-view-on-mobile" name="shopping-list-disable-auto-compact-view-on-mobile" data-setting-key="shopping_list_disable_auto_compact_view_on_mobile"> {{ $__t('Don\'t automatically switch to the compact view on mobile devices') }}
</label>
</div>
</div>
<h4 class="mt-2">{{ $__t('Shopping list to stock workflow') }}</h4>
<div class="form-group">