Added an option to hide the calendar on the shopping list (closes #531)

This commit is contained in:
Bernd Bestel
2020-02-01 12:54:05 +01:00
parent 683ea0984c
commit 23efe0c87a
11 changed files with 67 additions and 25 deletions

View File

@@ -392,6 +392,9 @@
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item discrete-link" href="{{ $U('/stocksettings') }}"><i class="fas fa-box"></i>&nbsp;{{ $__t('Stock settings') }}</a>
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST)
<a class="dropdown-item discrete-link" href="{{ $U('/shoppinglistsettings') }}"><i class="fas fa-shopping-cart"></i>&nbsp;{{ $__t('Shopping list settings') }}</a>
@endif
@if(GROCY_FEATURE_FLAG_CHORES)
<a class="dropdown-item discrete-link" href="{{ $U('/choressettings') }}"><i class="fas fa-home"></i>&nbsp;{{ $__t('Chores settings') }}</a>
@endif

View File

@@ -94,7 +94,7 @@
</div>
<div id="shoppinglist-main" class="row d-print-none">
<div class="col-xs-12 col-md-8 pb-3">
<div class="@if(boolval($userSettings['shopping_list_show_calendar'])) col-xs-12 col-md-8 @else col-12 @endif pb-3">
<a id="shopping-list-normal-view-button" class="btn btn-outline-dark btn-block switch-view-mode-button d-none" href="#">
<i class="fas fa-expand-arrows-alt"></i> {{ $__t('Normal view') }}
</a>
@@ -157,11 +157,13 @@
</table>
</div>
@if(boolval($userSettings['shopping_list_show_calendar']))
<div class="col-xs-12 col-md-4 mt-md-2 d-print-none">
@include('components.calendarcard')
</div>
@endif
<div class="col-xs-12 col-md-8 d-print-none pt-2">
<div class="@if(boolval($userSettings['shopping_list_show_calendar'])) col-xs-12 col-md-8 @else col-12 @endif d-print-none pt-2">
<div class="form-group">
<label class="text-larger font-weight-bold" for="notes">{{ $__t('Notes') }}</label>
<a id="save-description-button" class="btn btn-success btn-sm ml-1 mb-2" href="#">{{ $__t('Save') }}</a>

View File

@@ -0,0 +1,33 @@
@extends('layout.default')
@section('title', $__t('Shopping list settings'))
@section('viewJsName', 'shoppinglistsettings')
@section('content')
<div class="row">
<div class="col-lg-6 col-xs-12">
<h1>@yield('title')</h1>
<h4 class="mt-2">{{ $__t('Shopping list') }}</h4>
<div class="form-group">
<div class="checkbox">
<label for="shopping-list-show-calendar">
<input type="checkbox" class="user-setting-control" id="shopping-list-show-calendar" name="shopping-list-show-calendar" data-setting-key="shopping_list_show_calendar"> {{ $__t('Show a month-view calendar') }}
</label>
</div>
</div>
<h4 class="mt-2">{{ $__t('Shopping list to stock workflow') }}</h4>
<div class="form-group">
<div class="checkbox">
<label for="shopping-list-to-stock-workflow-auto-submit-when-prefilled">
<input type="checkbox" class="user-setting-control" id="shopping-list-to-stock-workflow-auto-submit-when-prefilled" name="shopping-list-to-stock-workflow-auto-submit-when-prefilled" data-setting-key="shopping_list_to_stock_workflow_auto_submit_when_prefilled"> {{ $__t('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') }}
</label>
</div>
</div>
<a href="{{ $U('/shoppinglist') }}" class="btn btn-success">{{ $__t('OK') }}</a>
</div>
</div>
@stop

View File

@@ -75,18 +75,6 @@
'additionalCssClasses' => 'user-setting-control'
))
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST)
<h4 class="mt-2">{{ $__t('Shopping list to stock workflow') }}</h4>
<div class="form-group">
<div class="checkbox">
<label for="shopping-list-to-stock-workflow-auto-submit-when-prefilled">
<input type="checkbox" class="user-setting-control" id="shopping-list-to-stock-workflow-auto-submit-when-prefilled" name="shopping-list-to-stock-workflow-auto-submit-when-prefilled" data-setting-key="shopping_list_to_stock_workflow_auto_submit_when_prefilled"> {{ $__t('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') }}
</label>
</div>
</div>
@endif
<a href="{{ $U('/stockoverview') }}" class="btn btn-success">{{ $__t('OK') }}</a>
</div>
</div>