mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
242 lines
8.6 KiB
PHP
242 lines
8.6 KiB
PHP
@extends('layout.default')
|
|
|
|
@section('title', $__t('Shopping list'))
|
|
@section('activeNav', 'shoppinglist')
|
|
@section('viewJsName', 'shoppinglist')
|
|
|
|
@push('pageScripts')
|
|
<script src="{{ $U('/viewjs/purchase.js?v=', true) }}{{ $version }}"></script>
|
|
@endpush
|
|
|
|
@push('pageStyles')
|
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
|
|
rel="stylesheet">
|
|
@endpush
|
|
|
|
@section('content')
|
|
<div class="row d-print-none hide-on-fullscreen-card">
|
|
<div class="col">
|
|
<div class="title-related-links">
|
|
<h2 class="title mr-2 order-0">
|
|
@yield('title')
|
|
</h2>
|
|
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)
|
|
<div class="float-right">
|
|
<button class="btn btn-outline-dark d-md-none mt-2 order-1 order-md-3"
|
|
type="button"
|
|
data-toggle="collapse"
|
|
data-target="#table-filter-row">
|
|
<i class="fas fa-filter"></i>
|
|
</button>
|
|
<button class="btn btn-outline-dark d-md-none mt-2 order-1 order-md-3"
|
|
type="button"
|
|
data-toggle="collapse"
|
|
data-target="#related-links">
|
|
<i class="fas fa-ellipsis-v"></i>
|
|
</button>
|
|
</div>
|
|
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100"
|
|
id="related-links">
|
|
<div class="my-auto float-right">
|
|
<select class="custom-control custom-select custom-select-sm"
|
|
id="selected-shopping-list">
|
|
@foreach($shoppingLists as $shoppingList)
|
|
<option @if($shoppingList->id == $selectedShoppingListId) selected="selected" @endif value="{{ $shoppingList->id }}">{{ $shoppingList->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right show-as-dialog-link"
|
|
href="{{ $U('/shoppinglist/new?embedded') }}">
|
|
{{ $__t('New shopping list') }}
|
|
</a>
|
|
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right show-as-dialog-link @if($selectedShoppingListId == 1) disabled @endif"
|
|
href="{{ $U('/shoppinglist/' . $selectedShoppingListId . '?embedded') }}">
|
|
{{ $__t('Edit shopping list') }}
|
|
</a>
|
|
<a id="delete-selected-shopping-list"
|
|
class="btn btn-outline-danger responsive-button m-1 mt-md-0 mb-md-0 float-right @if($selectedShoppingListId == 1) disabled @endif"
|
|
href="#">
|
|
{{ $__t('Delete shopping list') }}
|
|
</a>
|
|
<a id="print-shopping-list-button"
|
|
class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right"
|
|
href="{{ $U('/shoppinglist?print&list=' . $selectedShoppingListId) }}">
|
|
{{ $__t('Print') }}
|
|
</a>
|
|
</div>
|
|
@else
|
|
<div class="float-right">
|
|
<button class="btn btn-outline-dark d-md-none mt-1 order-1 order-md-3"
|
|
type="button"
|
|
data-toggle="collapse"
|
|
data-target="#table-filter-row">
|
|
<i class="fas fa-filter"></i>
|
|
</button>
|
|
</div>
|
|
<input type="hidden"
|
|
name="selected-shopping-list"
|
|
id="selected-shopping-list"
|
|
value="1">
|
|
@endif
|
|
</div>
|
|
<div class="border-top border-bottom my-2 py-1">
|
|
<div id="table-filter-row"
|
|
data-status-filter="belowminstockamount"
|
|
class="collapse d-md-inline-block normal-message status-filter-message responsive-button @if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif"><span class="d-block d-md-none">{{count($missingProducts)}} <i class="fas fa-exclamation-circle"></i></span><span class="d-none d-md-block">{{ $__n(count($missingProducts), '%s product is below defined min. stock amount', '%s products are below defined min. stock amount') }}</span></div>
|
|
<div id="related-links"
|
|
class="float-right mt-1 collapse d-md-block">
|
|
<a class="btn btn-primary responsive-button btn-sm mb-1 show-as-dialog-link"
|
|
href="{{ $U('/shoppinglistitem/new?embedded&list=' . $selectedShoppingListId) }}">
|
|
{{ $__t('Add item') }}
|
|
</a>
|
|
<a id="clear-shopping-list"
|
|
class="btn btn-outline-danger btn-sm mb-1 responsive-button @if($listItems->count() == 0) disabled @endif"
|
|
href="#">
|
|
{{ $__t('Clear list') }}
|
|
</a>
|
|
<a id="add-all-items-to-stock-button"
|
|
class="btn btn-outline-primary btn-sm mb-1 responsive-button @if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif"
|
|
href="#">
|
|
{{ $__t('Add all list items to stock') }}
|
|
</a>
|
|
<a id="add-products-below-min-stock-amount"
|
|
class="btn btn-outline-primary btn-sm mb-1 responsive-button @if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif"
|
|
href="#">
|
|
{{ $__t('Add products that are below defined min. stock amount') }}
|
|
</a>
|
|
<a id="add-overdue-expired-products"
|
|
class="btn btn-outline-primary btn-sm mb-1 responsive-button @if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif"
|
|
href="#">
|
|
{{ $__t('Add overdue/expired products') }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row collapse d-md-flex d-print-none hide-on-fullscreen-card"
|
|
id="table-filter-row">
|
|
<div class="col-xs-12 col-md-5">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
|
</div>
|
|
<input type="text"
|
|
id="search"
|
|
class="form-control"
|
|
placeholder="{{ $__t('Search') }}">
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-12 col-md-4 col-lg-5">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Status') }}</span>
|
|
</div>
|
|
<select class="custom-control custom-select"
|
|
id="status-filter">
|
|
<option value="all">{{ $__t('All') }}</option>
|
|
<option class="@if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif"
|
|
value="belowminstockamount">{{ $__t('Below min. stock amount') }}</option>
|
|
<option value="xxUNDONExx">{{ $__t('Only undone items') }}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="float-right">
|
|
<a id="clear-filter-button"
|
|
class="btn btn-sm btn-outline-info"
|
|
href="#">
|
|
{{ $__t('Clear filter') }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="shoppinglist-main"
|
|
class="row d-print-none">
|
|
<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="#">
|
|
{{ $__t('Normal view') }}
|
|
</a>
|
|
@include('components.shoppinglisttable', array(
|
|
'listItems' => $listItems,
|
|
'products' => $products,
|
|
'quantityunits' => $quantityunits,
|
|
'missingProducts' => $missingProducts,
|
|
'productGroups' => $productGroups,
|
|
'selectedShoppingListId' => $selectedShoppingListId,
|
|
'quantityUnitConversionsResolved' => $quantityUnitConversionsResolved,
|
|
'productUserfields' => $productUserfields,
|
|
'productUserfieldValues' => $productUserfieldValues,
|
|
'userfields' => $userfields,
|
|
'userfieldValues' => $userfieldValues,
|
|
'isPrint' => false
|
|
))
|
|
</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="@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>
|
|
<a id="clear-description-button"
|
|
class="btn btn-danger btn-sm ml-1 mb-2"
|
|
href="#">{{ $__t('Clear') }}</a>
|
|
<textarea class="form-control wysiwyg-editor"
|
|
id="description"
|
|
name="description">{{ FindObjectInArrayByPropertyValue($shoppingLists, 'id', $selectedShoppingListId)->description }}</textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade"
|
|
id="shopping-list-stock-add-workflow-modal"
|
|
tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content text-center">
|
|
<div class="modal-body">
|
|
<iframe id="shopping-list-stock-add-workflow-purchase-form-frame"
|
|
class="embed-responsive"
|
|
src=""></iframe>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<span id="shopping-list-stock-add-workflow-purchase-item-count"
|
|
class="d-none mr-auto"></span>
|
|
<button id="shopping-list-stock-add-workflow-skip-button"
|
|
type="button"
|
|
class="btn btn-primary"><i class="fas fa-angle-double-right"></i> {{ $__t('Skip') }}</button>
|
|
<button type="button"
|
|
class="btn btn-secondary"
|
|
data-dismiss="modal">{{ $__t('Close') }}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade"
|
|
id="shoppinglist-productcard-modal"
|
|
tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content text-center">
|
|
<div class="modal-body">
|
|
@include('components.productcard')
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button"
|
|
class="btn btn-secondary"
|
|
data-dismiss="modal">{{ $__t('Close') }}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@stop |