Applied .blade.php formatting rules

This commit is contained in:
Bernd Bestel
2020-08-31 20:32:50 +02:00
parent ea9ba0b2be
commit 33325d5560
90 changed files with 4000 additions and 2091 deletions

View File

@@ -10,19 +10,27 @@
<hr>
<ul class="nav nav-tabs justify-content-center mt-3">
<li class="nav-item">
<a class="nav-link active" id="system-info-tab" data-toggle="tab" href="#system-info">{{ $__t('System info') }}</a>
<a class="nav-link active"
id="system-info-tab"
data-toggle="tab"
href="#system-info">{{ $__t('System info') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" id="changelog-tab" data-toggle="tab" href="#changelog">{{ $__t('Changelog') }}</a>
<a class="nav-link"
id="changelog-tab"
data-toggle="tab"
href="#changelog">{{ $__t('Changelog') }}</a>
</li>
</ul>
<div class="tab-content mt-3">
<div class="tab-pane show active" id="system-info">
<div class="tab-pane show active"
id="system-info">
<p>
Version <code>{{ $version }}</code><br>
{{ $__t('Released on') }} <code>{{ $releaseDate }}</code> <time class="timeago timeago-contextual" datetime="{{ $releaseDate }}"></time>
{{ $__t('Released on') }} <code>{{ $releaseDate }}</code> <time class="timeago timeago-contextual"
datetime="{{ $releaseDate }}"></time>
</p>
<p>
@@ -32,19 +40,25 @@
<p>
{{ $__t('Do you find grocy useful?') }}<br>
<a class="btn btn-sm btn-primary text-white mt-1" href="https://grocy.info/#say-thanks" target = "_blank">{{ $__t('Say thanks') }} <i class="fas fa-heart"></i></a>
<a class="btn btn-sm btn-primary text-white mt-1"
href="https://grocy.info/#say-thanks"
target="_blank">{{ $__t('Say thanks') }} <i class="fas fa-heart"></i></a>
</p>
</div>
<div class="tab-pane show" id="changelog">
<div class="tab-pane show"
id="changelog">
@php $Parsedown = new Parsedown(); @endphp
@foreach($changelog['changelog_items'] as $changelogItem)
<div class="card my-2">
<div class="card-header">
<a class="discrete-link" data-toggle="collapse-next" href="#">
<a class="discrete-link"
data-toggle="collapse-next"
href="#">
Version <span class="font-weight-bold">{{ $changelogItem['version'] }}</span><br>
{{ $__t('Released on') }} <span class="font-weight-bold">{{ $changelogItem['release_date'] }}</span>
<time class="timeago timeago-contextual" datetime="{{ $changelogItem['release_date'] }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $changelogItem['release_date'] }}"></time>
</a>
</div>
<div class="collapse @if($changelogItem['release_number'] >= $changelog['newest_release_number'] - 4) show @endif">
@@ -60,10 +74,14 @@
<p class="small text-muted">
grocy is a project by
<a href="https://berrnd.de" class="text-dark" target="_blank">Bernd Bestel</a><br>
<a href="https://berrnd.de"
class="text-dark"
target="_blank">Bernd Bestel</a><br>
Created with passion since 2017<br>
Life runs on code<br>
<a href="https://github.com/grocy/grocy" class="text-dark" target="_blank">
<a href="https://github.com/grocy/grocy"
class="text-dark"
target="_blank">
<i class="fab fa-github"></i>
</a>
</p>

View File

@@ -5,7 +5,8 @@
@section('viewJsName', 'barcodescannertesting')
@push('pageScripts')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -18,27 +19,45 @@
<div class="row">
<div class="col-lg-6 col-xs-12">
<form id="barcodescannertesting-form" novalidate>
<form id="barcodescannertesting-form"
novalidate>
<div class="form-group">
<label for="expected_barcode">{{ $__t('Expected barcode') }}</label>
<input type="text" class="form-control" required id="expected_barcode" name="expected_barcode" value="">
<input type="text"
class="form-control"
required
id="expected_barcode"
name="expected_barcode"
value="">
</div>
<div class="form-group">
<label for="scanned_barcode">{{ $__t('Scan field') }}</label>
<div class="input-group">
<input type="text" class="form-control barcodescanner-input" id="scanned_barcode" name="scanned_barcode" value="" disabled data-target="#scanned_barcode">
<input type="text"
class="form-control barcodescanner-input"
id="scanned_barcode"
name="scanned_barcode"
value=""
disabled
data-target="#scanned_barcode">
</div>
</div>
<div class="form-group">
<label for="scanned_codes">{{ $__t('Scanned barcodes') }}</label>
<div class="float-right font-weight-bold">
<span class="text-success">{{ $__t('Hit') }}: <span id="hit-count" class="locale-number locale-number-generic">0</span></span> //
<span class="text-danger">{{ $__t('Miss') }}: <span id="miss-count" class="locale-number locale-number-generic">0</span></span>
<span class="text-success">{{ $__t('Hit') }}: <span id="hit-count"
class="locale-number locale-number-generic">0</span></span> //
<span class="text-danger">{{ $__t('Miss') }}: <span id="miss-count"
class="locale-number locale-number-generic">0</span></span>
</div>
<select class="form-control" id="scanned_codes" name="scanned_codes" multiple size="30"></select>
<select class="form-control"
id="scanned_codes"
name="scanned_codes"
multiple
size="30"></select>
</div>
</form>

View File

@@ -10,7 +10,8 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary" href="{{ $U('/userfields?entity=batteries') }}">
<a class="btn btn-outline-secondary"
href="{{ $U('/userfields?entity=batteries') }}">
{{ $__t('Configure userfields') }}
</a>
</div>
@@ -20,7 +21,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3 permission-MASTER_DATA_EDIT" href="{{ $U('/battery/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3 permission-MASTER_DATA_EDIT"
href="{{ $U('/battery/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -31,14 +33,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="batteries-table" class="table table-sm table-striped dt-responsive">
<table id="batteries-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -57,10 +63,14 @@
@foreach($batteries as $battery)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm permission-MASTER_DATA_EDIT" href="{{ $U('/battery/') }}{{ $battery->id }}">
<a class="btn btn-info btn-sm permission-MASTER_DATA_EDIT"
href="{{ $U('/battery/') }}{{ $battery->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm battery-delete-button permission-MASTER_DATA_EDIT" href="#" data-battery-id="{{ $battery->id }}" data-battery-name="{{ $battery->name }}">
<a class="btn btn-danger btn-sm battery-delete-button permission-MASTER_DATA_EDIT"
href="#"
data-battery-id="{{ $battery->id }}"
data-battery-name="{{ $battery->name }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -18,7 +18,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
@@ -26,7 +29,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="battery-filter">
<select class="form-control"
id="battery-filter">
<option value="all">{{ $__t('All') }}</option>
@foreach($batteries as $battery)
<option value="{{ $battery->id }}">{{ $battery->name }}</option>
@@ -38,7 +42,8 @@
<div class="row">
<div class="col">
<table id="batteries-journal-table" class="table table-sm table-striped dt-responsive">
<table id="batteries-journal-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -48,9 +53,15 @@
</thead>
<tbody class="d-none">
@foreach($chargeCycles as $chargeCycleEntry)
<tr id="charge-cycle-{{ $chargeCycleEntry->id }}-row" class="@if($chargeCycleEntry->undone == 1) text-muted @endif">
<tr id="charge-cycle-{{ $chargeCycleEntry->id }}-row"
class="@if($chargeCycleEntry->undone == 1) text-muted @endif">
<td class="fit-content border-right">
<a class="btn btn-secondary btn-sm undo-battery-execution-button @if($chargeCycleEntry->undone == 1) disabled @endif permission-BATTERIES_UNDO_CHARGE_CYCLE" href="#" data-charge-cycle-id="{{ $chargeCycleEntry->id }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Undo charge cycle') }}">
<a class="btn btn-secondary btn-sm undo-battery-execution-button @if($chargeCycleEntry->undone == 1) disabled @endif permission-BATTERIES_UNDO_CHARGE_CYCLE"
href="#"
data-charge-cycle-id="{{ $chargeCycleEntry->id }}"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Undo charge cycle') }}">
<i class="fas fa-undo"></i>
</a>
</td>
@@ -59,12 +70,14 @@
@if($chargeCycleEntry->undone == 1)
<br>
{{ $__t('Undone on') . ' ' . $chargeCycleEntry->undone_timestamp }}
<time class="timeago timeago-contextual" datetime="{{ $chargeCycleEntry->undone_timestamp }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $chargeCycleEntry->undone_timestamp }}"></time>
@endif
</td>
<td>
{{ $chargeCycleEntry->tracked_time }}
<time class="timeago timeago-contextual" datetime="{{ $chargeCycleEntry->tracked_time }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $chargeCycleEntry->tracked_time }}"></time>
</td>
</tr>
@endforeach

View File

@@ -5,7 +5,8 @@
@section('viewJsName', 'batteriesoverview')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -14,14 +15,20 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-dark responsive-button" href="{{ $U('/batteriesjournal') }}">
<a class="btn btn-outline-dark responsive-button"
href="{{ $U('/batteriesjournal') }}">
{{ $__t('Journal') }}
</a>
</div>
</div>
<hr>
<p id="info-due-batteries" data-status-filter="duesoon" data-next-x-days="{{ $nextXDays }}" class="warning-message status-filter-message responsive-button mr-2"></p>
<p id="info-overdue-batteries" data-status-filter="overdue" class="error-message status-filter-message responsive-button"></p>
<p id="info-due-batteries"
data-status-filter="duesoon"
data-next-x-days="{{ $nextXDays }}"
class="warning-message status-filter-message responsive-button mr-2"></p>
<p id="info-overdue-batteries"
data-status-filter="overdue"
class="error-message status-filter-message responsive-button"></p>
</div>
</div>
@@ -31,7 +38,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
@@ -39,7 +49,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="status-filter">
<select class="form-control"
id="status-filter">
<option value="all">{{ $__t('All') }}</option>
<option value="duesoon">{{ $__t('Due soon') }}</option>
<option value="overdue">{{ $__t('Overdue') }}</option>
@@ -50,7 +61,8 @@
<div class="row">
<div class="col">
<table id="batteries-overview-table" class="table table-sm table-striped dt-responsive">
<table id="batteries-overview-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -67,51 +79,83 @@
</thead>
<tbody class="d-none">
@foreach($current as $currentBatteryEntry)
<tr id="battery-{{ $currentBatteryEntry->battery_id }}-row" class="@if(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s')) table-danger @elseif(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) table-warning @endif">
<tr id="battery-{{ $currentBatteryEntry->battery_id }}-row"
class="@if(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s')) table-danger @elseif(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s', strtotime("
+$nextXDays
days")))
table-warning
@endif">
<td class="fit-content border-right">
<a class="btn btn-success btn-sm track-charge-cycle-button permission-BATTERIES_TRACK_CHARGE_CYCLE" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Track charge cycle of battery %s', FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name) }}"
<a class="btn btn-success btn-sm track-charge-cycle-button permission-BATTERIES_TRACK_CHARGE_CYCLE"
href="#"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Track charge cycle of battery %s', FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name) }}"
data-battery-id="{{ $currentBatteryEntry->battery_id }}"
data-battery-name="{{ FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name }}">
<i class="fas fa-fire"></i>
</a>
<div class="dropdown d-inline-block">
<button class="btn btn-sm btn-light text-secondary" type="button" data-toggle="dropdown">
<button class="btn btn-sm btn-light text-secondary"
type="button"
data-toggle="dropdown">
<i class="fas fa-ellipsis-v"></i>
</button>
<div class="table-inline-menu dropdown-menu dropdown-menu-right">
<a class="dropdown-item battery-name-cell" data-battery-id="{{ $currentBatteryEntry->battery_id }}" type="button" href="#">
<a class="dropdown-item battery-name-cell"
data-battery-id="{{ $currentBatteryEntry->battery_id }}"
type="button"
href="#">
<span class="dropdown-item-icon"><i class="fas fa-info"></i></span> <span class="dropdown-item-text">{{ $__t('Show battery details') }}</span>
</a>
<a class="dropdown-item" type="button" href="{{ $U('/batteriesjournal?battery=') }}{{ $currentBatteryEntry->battery_id }}">
<a class="dropdown-item"
type="button"
href="{{ $U('/batteriesjournal?battery=') }}{{ $currentBatteryEntry->battery_id }}">
<span class="dropdown-item-icon"><i class="fas fa-file-alt"></i></span> <span class="dropdown-item-text">{{ $__t('Journal for this battery') }}</span>
</a>
<a class="dropdown-item permission-MASTER_DATA_EDIT" type="button" href="{{ $U('/battery/') }}{{ $currentBatteryEntry->battery_id }}">
<a class="dropdown-item permission-MASTER_DATA_EDIT"
type="button"
href="{{ $U('/battery/') }}{{ $currentBatteryEntry->battery_id }}">
<span class="dropdown-item-icon"><i class="fas fa-edit"></i></span> <span class="dropdown-item-text">{{ $__t('Edit battery') }}</span>
</a>
</div>
</div>
</td>
<td class="battery-name-cell cursor-link" data-battery-id="{{ $currentBatteryEntry->battery_id }}">
<td class="battery-name-cell cursor-link"
data-battery-id="{{ $currentBatteryEntry->battery_id }}">
{{ FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name }}
</td>
<td>
<span id="battery-{{ $currentBatteryEntry->battery_id }}-last-tracked-time">{{ $currentBatteryEntry->last_tracked_time }}</span>
<time id="battery-{{ $currentBatteryEntry->battery_id }}-last-tracked-time-timeago" class="timeago timeago-contextual" datetime="{{ $currentBatteryEntry->last_tracked_time }}"></time>
<time id="battery-{{ $currentBatteryEntry->battery_id }}-last-tracked-time-timeago"
class="timeago timeago-contextual"
datetime="{{ $currentBatteryEntry->last_tracked_time }}"></time>
</td>
<td>
@if(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0)
<span id="battery-{{ $currentBatteryEntry->battery_id }}-next-charge-time">{{ $currentBatteryEntry->next_estimated_charge_time }}</span>
<time id="battery-{{ $currentBatteryEntry->battery_id }}-next-charge-time-timeago" class="timeago timeago-contextual" datetime="{{ $currentBatteryEntry->next_estimated_charge_time }}"></time>
<time id="battery-{{ $currentBatteryEntry->battery_id }}-next-charge-time-timeago"
class="timeago timeago-contextual"
datetime="{{ $currentBatteryEntry->next_estimated_charge_time }}"></time>
@else
...
@endif
</td>
<td class="d-none">
"@if(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s')) overdue @elseif(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) duesoon @endif
"@if(FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d
H:i:s'))
overdue
@elseif(FindObjectInArrayByPropertyValue($batteries, 'id'
,
$currentBatteryEntry->battery_id)->charge_interval_days > 0 && $currentBatteryEntry->next_estimated_charge_time < date('Y-m-d
H:i:s',
strtotime("+$nextXDays
days")))
duesoon
@endif
</td>
@include('components.userfields_tbody', array(
'userfields' => $userfields,
@include('components.userfields_tbody',
array( 'userfields'=> $userfields,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $currentBatteryEntry->battery_id)
))
@@ -122,14 +166,18 @@
</div>
</div>
<div class="modal fade" id="batteriesoverview-batterycard-modal" tabindex="-1">
<div class="modal fade"
id="batteriesoverview-batterycard-modal"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content text-center">
<div class="modal-body">
@include('components.batterycard')
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $__t('Close') }}</button>
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Close') }}</button>
</div>
</div>
</div>

View File

@@ -23,7 +23,8 @@
'additionalCssClasses' => 'user-setting-control'
))
<a href="{{ $U('/batteriesoverview') }}" class="btn btn-success">{{ $__t('OK') }}</a>
<a href="{{ $U('/batteriesoverview') }}"
class="btn btn-success">{{ $__t('OK') }}</a>
</div>
</div>
@stop

View File

@@ -18,28 +18,46 @@
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $battery->id }}</script>
<script>
Grocy.EditObjectId = {{ $battery->id }}
</script>
@endif
<form id="battery-form" novalidate>
<form id="battery-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $battery->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $battery->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<input type="text" class="form-control" id="description" name="description" value="@if($mode == 'edit'){{ $battery->description }}@endif">
<input type="text"
class="form-control"
id="description"
name="description"
value="@if($mode == 'edit'){{ $battery->description }}@endif">
</div>
<div class="form-group">
<label for="name">{{ $__t('Used in') }}</label>
<input type="text" class="form-control" id="used_in" name="used_in" value="@if($mode == 'edit'){{ $battery->used_in }}@endif">
<input type="text"
class="form-control"
id="used_in"
name="used_in"
value="@if($mode == 'edit'){{ $battery->used_in }}@endif">
</div>
@php if($mode == 'edit') { $value = $battery->charge_interval_days; } else { $value = 0; } @endphp
@@ -57,7 +75,8 @@
'entity' => 'batteries'
))
<button id="save-battery-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-battery-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -9,11 +9,15 @@
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
<h2 class="title">@yield('title')</h2>
<hr>
<form id="batterytracking-form" novalidate>
<form id="batterytracking-form"
novalidate>
<div class="form-group">
<label for="battery_id">{{ $__t('Battery') }}</label>
<select class="form-control combobox" id="battery_id" name="battery_id" required>
<select class="form-control combobox"
id="battery_id"
name="battery_id"
required>
<option value=""></option>
@foreach($batteries as $battery)
<option value="{{ $battery->id }}">{{ $battery->name }}</option>
@@ -32,7 +36,8 @@
'invalidFeedback' => $__t('This can only be before now')
))
<button id="save-batterytracking-button" class="btn btn-success">{{ $__t('OK') }}</button>
<button id="save-batterytracking-button"
class="btn btn-success">{{ $__t('OK') }}</button>
</form>
</div>

View File

@@ -10,7 +10,8 @@
@endpush
@push('pageStyles')
<link href="{{ $U('/node_modules/fullcalendar/dist/fullcalendar.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/fullcalendar/dist/fullcalendar.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -19,7 +20,9 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a id="ical-button" class="btn btn-outline-dark" href="#">
<a id="ical-button"
class="btn btn-outline-dark"
href="#">
{{ $__t('Share/Integrate calendar (iCal)') }}
</a>
</div>

View File

@@ -17,30 +17,49 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $chore->id }};</script>
<script>
Grocy.EditObjectId = {{ $chore->id }};
</script>
@endif
<form id="chore-form" novalidate>
<form id="chore-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $chore->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $chore->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $chore->description }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="description"
name="description">@if($mode == 'edit'){{ $chore->description }}@endif</textarea>
</div>
<div class="form-group">
<label for="period_type">{{ $__t('Period type') }} <span id="chore-period-type-info" class="small text-muted"></span></label>
<select required class="form-control input-group-chore-period-type" id="period_type" name="period_type">
<label for="period_type">{{ $__t('Period type') }} <span id="chore-period-type-info"
class="small text-muted"></span></label>
<select required
class="form-control input-group-chore-period-type"
id="period_type"
name="period_type">
@foreach($periodTypes as $periodType)
<option @if($mode == 'edit' && $periodType == $chore->period_type) selected="selected" @endif value="{{ $periodType }}">{{ $__t($periodType) }}</option>
<option @if($mode=='edit'
&&
$periodType==$chore->period_type) selected="selected" @endif value="{{ $periodType }}">{{ $__t($periodType) }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A period type is required') }}</div>
@@ -59,36 +78,67 @@
<div class="form-group period-type-input period-type-weekly">
<div class="form-check form-check-inline">
<input class="form-check-input input-group-chore-period-type" type="checkbox" id="monday" value="monday">
<label class="form-check-label" for="monday">{{ $__t('Monday') }}</label>
<input class="form-check-input input-group-chore-period-type"
type="checkbox"
id="monday"
value="monday">
<label class="form-check-label"
for="monday">{{ $__t('Monday') }}</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input input-group-chore-period-type" type="checkbox" id="tuesday" value="tuesday">
<label class="form-check-label" for="tuesday">{{ $__t('Tuesday') }}</label>
<input class="form-check-input input-group-chore-period-type"
type="checkbox"
id="tuesday"
value="tuesday">
<label class="form-check-label"
for="tuesday">{{ $__t('Tuesday') }}</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input input-group-chore-period-type" type="checkbox" id="wednesday" value="wednesday">
<label class="form-check-label" for="wednesday">{{ $__t('Wednesday') }}</label>
<input class="form-check-input input-group-chore-period-type"
type="checkbox"
id="wednesday"
value="wednesday">
<label class="form-check-label"
for="wednesday">{{ $__t('Wednesday') }}</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input input-group-chore-period-type" type="checkbox" id="thursday" value="thursday">
<label class="form-check-label" for="thursday">{{ $__t('Thursday') }}</label>
<input class="form-check-input input-group-chore-period-type"
type="checkbox"
id="thursday"
value="thursday">
<label class="form-check-label"
for="thursday">{{ $__t('Thursday') }}</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input input-group-chore-period-type" type="checkbox" id="friday" value="friday">
<label class="form-check-label" for="friday">{{ $__t('Friday') }}</label>
<input class="form-check-input input-group-chore-period-type"
type="checkbox"
id="friday"
value="friday">
<label class="form-check-label"
for="friday">{{ $__t('Friday') }}</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input input-group-chore-period-type" type="checkbox" id="saturday" value="saturday">
<label class="form-check-label" for="saturday">{{ $__t('Saturday') }}</label>
<input class="form-check-input input-group-chore-period-type"
type="checkbox"
id="saturday"
value="saturday">
<label class="form-check-label"
for="saturday">{{ $__t('Saturday') }}</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input input-group-chore-period-type" type="checkbox" id="sunday" value="sunday">
<label class="form-check-label" for="sunday">{{ $__t('Sunday') }}</label>
<input class="form-check-input input-group-chore-period-type"
type="checkbox"
id="sunday"
value="sunday">
<label class="form-check-label"
for="sunday">{{ $__t('Sunday') }}</label>
</div>
</div>
<input type="hidden" id="period_config" name="period_config" value="@if($mode == 'edit'){{ $chore->period_config }}@endif">
<input type="hidden"
id="period_config"
name="period_config"
value="@if($mode == 'edit'){{ $chore->period_config }}@endif">
@php if($mode == 'edit') { $value = $chore->period_interval; } else { $value = 1; } @endphp
@include('components.numberpicker', array(
@@ -104,10 +154,16 @@
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<div class="form-group">
<label for="assignment_type">{{ $__t('Assignment type') }} <span id="chore-assignment-type-info" class="small text-muted"></span></label>
<select required class="form-control input-group-chore-assignment-type" id="assignment_type" name="assignment_type">
<label for="assignment_type">{{ $__t('Assignment type') }} <span id="chore-assignment-type-info"
class="small text-muted"></span></label>
<select required
class="form-control input-group-chore-assignment-type"
id="assignment_type"
name="assignment_type">
@foreach($assignmentTypes as $assignmentType)
<option @if($mode == 'edit' && $assignmentType == $chore->assignment_type) selected="selected" @endif value="{{ $assignmentType }}">{{ $__t($assignmentType) }}</option>
<option @if($mode=='edit'
&&
$assignmentType==$chore->assignment_type) selected="selected" @endif value="{{ $assignmentType }}">{{ $__t($assignmentType) }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('An assignment type is required') }}</div>
@@ -115,23 +171,42 @@
<div class="form-group">
<label for="assignment_config">{{ $__t('Assign to') }}</label>
<select required multiple class="form-control input-group-chore-assignment-type selectpicker" id="assignment_config" name="assignment_config" data-actions-Box="true" data-live-search="true">
<select required
multiple
class="form-control input-group-chore-assignment-type selectpicker"
id="assignment_config"
name="assignment_config"
data-actions-Box="true"
data-live-search="true">
@foreach($users as $user)
<option @if($mode == 'edit' && in_array($user->id, explode(',', $chore->assignment_config))) selected="selected" @endif value="{{ $user->id }}">{{ $user->display_name }}</option>
<option @if($mode=='edit'
&&
in_array($user->id, explode(',', $chore->assignment_config))) selected="selected" @endif value="{{ $user->id }}">{{ $user->display_name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('This assignment type requires that at least one is assigned') }}</div>
</div>
@else
<input type="hidden" id="assignment_type" name="assignment_type" value="{{ \Grocy\Services\ChoresService::CHORE_ASSIGNMENT_TYPE_NO_ASSIGNMENT }}">
<input type="hidden" id="assignment_config" name="assignment_config" value="">
<input type="hidden"
id="assignment_type"
name="assignment_type"
value="{{ \Grocy\Services\ChoresService::CHORE_ASSIGNMENT_TYPE_NO_ASSIGNMENT }}">
<input type="hidden"
id="assignment_config"
name="assignment_config"
value="">
@endif
<div class="form-group">
<div class="form-check">
<input type="hidden" name="track_date_only" value="0">
<input @if($mode == 'edit' && $chore->track_date_only == 1) checked @endif class="form-check-input" type="checkbox" id="track_date_only" name="track_date_only" value="1">
<label class="form-check-label" for="track_date_only">{{ $__t('Track date only') }}
<input type="hidden"
name="track_date_only"
value="0">
<input @if($mode=='edit'
&&
$chore->track_date_only == 1) checked @endif class="form-check-input" type="checkbox" id="track_date_only" name="track_date_only" value="1">
<label class="form-check-label"
for="track_date_only">{{ $__t('Track date only') }}
<span class="text-muted small">{{ $__t('When enabled only the day of an execution is tracked, not the time') }}</span>
</label>
</div>
@@ -139,9 +214,14 @@
<div class="form-group">
<div class="form-check">
<input type="hidden" name="rollover" value="0">
<input @if($mode == 'edit' && $chore->rollover == 1) checked @endif class="form-check-input" type="checkbox" id="rollover" name="rollover" value="1">
<label class="form-check-label" for="rollover">{{ $__t('Due date rollover') }}
<input type="hidden"
name="rollover"
value="0">
<input @if($mode=='edit'
&&
$chore->rollover == 1) checked @endif class="form-check-input" type="checkbox" id="rollover" name="rollover" value="1">
<label class="form-check-label"
for="rollover">{{ $__t('Due date rollover') }}
<span class="text-muted small">{{ $__t('When enabled the chore can never be overdue, the due date will shift forward each day when due') }}</span>
</label>
</div>
@@ -150,9 +230,14 @@
@if(GROCY_FEATURE_FLAG_STOCK)
<div class="form-group mt-4 mb-1">
<div class="form-check">
<input type="hidden" name="consume_product_on_execution" value="0">
<input @if($mode == 'edit' && $chore->consume_product_on_execution == 1) checked @endif class="form-check-input" type="checkbox" id="consume_product_on_execution" name="consume_product_on_execution" value="1">
<label class="form-check-label" for="consume_product_on_execution">{{ $__t('Consume product on chore execution') }}</label>
<input type="hidden"
name="consume_product_on_execution"
value="0">
<input @if($mode=='edit'
&&
$chore->consume_product_on_execution == 1) checked @endif class="form-check-input" type="checkbox" id="consume_product_on_execution" name="consume_product_on_execution" value="1">
<label class="form-check-label"
for="consume_product_on_execution">{{ $__t('Consume product on chore execution') }}</label>
</div>
</div>
@@ -183,7 +268,8 @@
'entity' => 'chores'
))
<button id="save-chore-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-chore-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -10,7 +10,8 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary" href="{{ $U('/userfields?entity=chores') }}">
<a class="btn btn-outline-secondary"
href="{{ $U('/userfields?entity=chores') }}">
{{ $__t('Configure userfields') }}
</a>
</div>
@@ -20,7 +21,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/chore/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/chore/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -31,14 +33,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="chores-table" class="table table-sm table-striped dt-responsive">
<table id="chores-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -56,10 +62,14 @@
@foreach($chores as $chore)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/chore/') }}{{ $chore->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/chore/') }}{{ $chore->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm chore-delete-button" href="#" data-chore-id="{{ $chore->id }}" data-chore-name="{{ $chore->name }}">
<a class="btn btn-danger btn-sm chore-delete-button"
href="#"
data-chore-id="{{ $chore->id }}"
data-chore-name="{{ $chore->name }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -18,7 +18,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
@@ -26,7 +29,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="chore-filter">
<select class="form-control"
id="chore-filter">
<option value="all">{{ $__t('All') }}</option>
@foreach($chores as $chore)
<option value="{{ $chore->id }}">{{ $chore->name }}</option>
@@ -38,7 +42,8 @@
<div class="row">
<div class="col">
<table id="chores-journal-table" class="table table-sm table-striped dt-responsive">
<table id="chores-journal-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -51,9 +56,15 @@
</thead>
<tbody class="d-none">
@foreach($choresLog as $choreLogEntry)
<tr id="chore-execution-{{ $choreLogEntry->id }}-row" class="@if($choreLogEntry->undone == 1) text-muted @endif">
<tr id="chore-execution-{{ $choreLogEntry->id }}-row"
class="@if($choreLogEntry->undone == 1) text-muted @endif">
<td class="fit-content border-right">
<a class="btn btn-secondary btn-sm undo-chore-execution-button permission-CHORE_UNDO_EXECUTION @if($choreLogEntry->undone == 1) disabled @endif" href="#" data-execution-id="{{ $choreLogEntry->id }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Undo chore execution') }}">
<a class="btn btn-secondary btn-sm undo-chore-execution-button permission-CHORE_UNDO_EXECUTION @if($choreLogEntry->undone == 1) disabled @endif"
href="#"
data-execution-id="{{ $choreLogEntry->id }}"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Undo chore execution') }}">
<i class="fas fa-undo"></i>
</a>
</td>
@@ -62,12 +73,14 @@
@if($choreLogEntry->undone == 1)
<br>
{{ $__t('Undone on') . ' ' . $choreLogEntry->undone_timestamp }}
<time class="timeago timeago-contextual" datetime="{{ $choreLogEntry->undone_timestamp }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $choreLogEntry->undone_timestamp }}"></time>
@endif
</td>
<td>
<span>{{ $choreLogEntry->tracked_time }}</span>
<time class="timeago timeago-contextual @if(FindObjectInArrayByPropertyValue($chores, 'id', $choreLogEntry->chore_id)->track_date_only == 1) timeago-date-only @endif" datetime="{{ $choreLogEntry->tracked_time }}"></time>
<time class="timeago timeago-contextual @if(FindObjectInArrayByPropertyValue($chores, 'id', $choreLogEntry->chore_id)->track_date_only == 1) timeago-date-only @endif"
datetime="{{ $choreLogEntry->tracked_time }}"></time>
</td>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<td>

View File

@@ -5,7 +5,8 @@
@section('viewJsName', 'choresoverview')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -14,16 +15,24 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-dark responsive-button" href="{{ $U('/choresjournal') }}">
<a class="btn btn-outline-dark responsive-button"
href="{{ $U('/choresjournal') }}">
{{ $__t('Journal') }}
</a>
</div>
</div>
<hr>
<p id="info-due-chores" data-status-filter="duesoon" data-next-x-days="{{ $nextXDays }}" class="warning-message status-filter-message responsive-message mr-2"></p>
<p id="info-overdue-chores" data-status-filter="overdue" class="error-message status-filter-message responsive-button mr-2"></p>
<p id="info-due-chores"
data-status-filter="duesoon"
data-next-x-days="{{ $nextXDays }}"
class="warning-message status-filter-message responsive-message mr-2"></p>
<p id="info-overdue-chores"
data-status-filter="overdue"
class="error-message status-filter-message responsive-button mr-2"></p>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<p id="info-assigned-to-me-chores" data-user-filter="xx{{ GROCY_USER_ID }}xx" class="normal-message user-filter-message responsive-button"></p>
<p id="info-assigned-to-me-chores"
data-user-filter="xx{{ GROCY_USER_ID }}xx"
class="normal-message user-filter-message responsive-button"></p>
@endif
</div>
</div>
@@ -34,7 +43,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
@@ -43,7 +55,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="status-filter">
<select class="form-control"
id="status-filter">
<option value="all">{{ $__t('All') }}</option>
<option value="duesoon">{{ $__t('Due soon') }}</option>
<option value="overdue">{{ $__t('Overdue') }}</option>
@@ -57,10 +70,12 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="user-filter">
<select class="form-control"
id="user-filter">
<option></option>
@foreach($users as $user)
<option data-user-id="{{ $user->id }}" value="xx{{ $user->id }}xx">{{ $user->display_name }}</option>
<option data-user-id="{{ $user->id }}"
value="xx{{ $user->id }}xx">{{ $user->display_name }}</option>
@endforeach
</select>
</div>
@@ -70,7 +85,8 @@
<div class="row">
<div class="col">
<table id="chores-overview-table" class="table table-sm table-striped dt-responsive">
<table id="chores-overview-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -93,44 +109,67 @@
</thead>
<tbody class="d-none">
@foreach($currentChores as $curentChoreEntry)
<tr id="chore-{{ $curentChoreEntry->chore_id }}-row" class="@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s')) table-danger @elseif(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) table-warning @endif">
<tr id="chore-{{ $curentChoreEntry->chore_id }}-row"
class="@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s')) table-danger @elseif(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s', strtotime("
+$nextXDays
days")))
table-warning
@endif">
<td class="fit-content border-right">
<a class="btn btn-success btn-sm track-chore-button permission-CHORE_TRACK_EXECUTION" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Track execution of chore %s', FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name) }}"
<a class="btn btn-success btn-sm track-chore-button permission-CHORE_TRACK_EXECUTION"
href="#"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Track execution of chore %s', FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name) }}"
data-chore-id="{{ $curentChoreEntry->chore_id }}"
data-chore-name="{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}">
<i class="fas fa-play"></i>
</a>
<div class="dropdown d-inline-block">
<button class="btn btn-sm btn-light text-secondary" type="button" data-toggle="dropdown">
<button class="btn btn-sm btn-light text-secondary"
type="button"
data-toggle="dropdown">
<i class="fas fa-ellipsis-v"></i>
</button>
<div class="table-inline-menu dropdown-menu dropdown-menu-right">
<a class="dropdown-item chore-name-cell" data-chore-id="{{ $curentChoreEntry->chore_id }}" type="button" href="#">
<a class="dropdown-item chore-name-cell"
data-chore-id="{{ $curentChoreEntry->chore_id }}"
type="button"
href="#">
<span class="dropdown-item-icon"><i class="fas fa-info"></i></span> <span class="dropdown-item-text">{{ $__t('Show chore details') }}</span>
</a>
<a class="dropdown-item" type="button" href="{{ $U('/choresjournal?chore=') }}{{ $curentChoreEntry->chore_id }}">
<a class="dropdown-item"
type="button"
href="{{ $U('/choresjournal?chore=') }}{{ $curentChoreEntry->chore_id }}">
<span class="dropdown-item-icon"><i class="fas fa-file-alt"></i></span> <span class="dropdown-item-text">{{ $__t('Journal for this chore') }}</span>
</a>
<a class="dropdown-item permission-MASTER_DATA_EDIT" type="button" href="{{ $U('/chore/') }}{{ $curentChoreEntry->chore_id }}">
<a class="dropdown-item permission-MASTER_DATA_EDIT"
type="button"
href="{{ $U('/chore/') }}{{ $curentChoreEntry->chore_id }}">
<span class="dropdown-item-icon"><i class="fas fa-edit"></i></span> <span class="dropdown-item-text">{{ $__t('Edit chore') }}</span>
</a>
</div>
</div>
</td>
<td class="chore-name-cell cursor-link" data-chore-id="{{ $curentChoreEntry->chore_id }}">
<td class="chore-name-cell cursor-link"
data-chore-id="{{ $curentChoreEntry->chore_id }}">
{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}
</td>
<td>
@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY)
<span id="chore-{{ $curentChoreEntry->chore_id }}-next-execution-time">{{ $curentChoreEntry->next_estimated_execution_time }}</span>
<time id="chore-{{ $curentChoreEntry->chore_id }}-next-execution-time-timeago" class="timeago timeago-contextual @if($curentChoreEntry->track_date_only == 1) timeago-date-only @endif" datetime="{{ $curentChoreEntry->next_estimated_execution_time }}"></time>
<time id="chore-{{ $curentChoreEntry->chore_id }}-next-execution-time-timeago"
class="timeago timeago-contextual @if($curentChoreEntry->track_date_only == 1) timeago-date-only @endif"
datetime="{{ $curentChoreEntry->next_estimated_execution_time }}"></time>
@else
<span>-</span>
@endif
</td>
<td>
<span id="chore-{{ $curentChoreEntry->chore_id }}-last-tracked-time">{{ $curentChoreEntry->last_tracked_time }}</span>
<time id="chore-{{ $curentChoreEntry->chore_id }}-last-tracked-time-timeago" class="timeago timeago-contextual @if($curentChoreEntry->track_date_only == 1) timeago-date-only @endif" datetime="{{ $curentChoreEntry->last_tracked_time }}"></time>
<time id="chore-{{ $curentChoreEntry->chore_id }}-last-tracked-time-timeago"
class="timeago timeago-contextual @if($curentChoreEntry->track_date_only == 1) timeago-date-only @endif"
datetime="{{ $curentChoreEntry->last_tracked_time }}"></time>
</td>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<td>
@@ -143,11 +182,23 @@
</span>
</td>
@endif
<td id="chore-{{ $curentChoreEntry->chore_id }}-due-filter-column" class="d-none">
@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s')) overdue @elseif(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) duesoon @endif
<td id="chore-{{ $curentChoreEntry->chore_id }}-due-filter-column"
class="d-none">
@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d
H:i:s'))
overdue
@elseif(FindObjectInArrayByPropertyValue($chores, 'id'
,
$curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d
H:i:s',
strtotime("+$nextXDays
days")))
duesoon
@endif
</td>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<td class="d-none">
<td
class="d-none">
@if(!empty($curentChoreEntry->next_execution_assigned_to_user_id))
xx{{ $curentChoreEntry->next_execution_assigned_to_user_id }}xx
@endif
@@ -166,14 +217,18 @@
</div>
</div>
<div class="modal fade" id="choresoverview-chorecard-modal" tabindex="-1">
<div class="modal fade"
id="choresoverview-chorecard-modal"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content text-center">
<div class="modal-body">
@include('components.chorecard')
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $__t('Close') }}</button>
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Close') }}</button>
</div>
</div>
</div>

View File

@@ -23,7 +23,8 @@
'additionalCssClasses' => 'user-setting-control'
))
<a href="{{ $U('/choresoverview') }}" class="btn btn-success">{{ $__t('OK') }}</a>
<a href="{{ $U('/choresoverview') }}"
class="btn btn-success">{{ $__t('OK') }}</a>
</div>
</div>
@stop

View File

@@ -9,11 +9,15 @@
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
<h2 class="title">@yield('title')</h2>
<hr>
<form id="choretracking-form" novalidate>
<form id="choretracking-form"
novalidate>
<div class="form-group">
<label for="chore_id">{{ $__t('Chore') }}</label>
<select class="form-control combobox" id="chore_id" name="chore_id" required>
<select class="form-control combobox"
id="chore_id"
name="chore_id"
required>
<option value=""></option>
@foreach($chores as $chore)
<option value="{{ $chore->id }}">{{ $chore->name }}</option>
@@ -40,10 +44,14 @@
'prefillByUserId' => GROCY_USER_ID
))
@else
<input type="hidden" id="user_id" name="user_id" value="{{ GROCY_USER_ID }}">
<input type="hidden"
id="user_id"
name="user_id"
value="{{ GROCY_USER_ID }}">
@endif
<button id="save-choretracking-button" class="btn btn-success">{{ $__t('OK') }}</button>
<button id="save-choretracking-button"
class="btn btn-success">{{ $__t('OK') }}</button>
</form>
</div>

View File

@@ -21,6 +21,7 @@
.combobox-container #barcodescanner-start-button {
margin-right: 36px !important;
}
</style>
@endpush

View File

@@ -5,17 +5,27 @@
<div class="card batterycard">
<div class="card-header">
<i class="fas fa-battery-three-quarters"></i> {{ $__t('Battery overview') }}
<a id="batterycard-battery-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit battery') }}">
<a id="batterycard-battery-edit-button"
class="btn btn-sm btn-outline-info py-0 float-right disabled"
href="#"
data-toggle="tooltip"
title="{{ $__t('Edit battery') }}">
<i class="fas fa-edit"></i>
</a>
<a id="batterycard-battery-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link" href="#" data-toggle="tooltip" title="{{ $__t('Journal for this battery') }}">
<a id="batterycard-battery-journal-button"
class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link"
href="#"
data-toggle="tooltip"
title="{{ $__t('Journal for this battery') }}">
<i class="fas fa-file-alt"></i>
</a>
</div>
<div class="card-body">
<h3><span id="batterycard-battery-name"></span></h3>
<strong>{{ $__t('Used in') }}:</strong> <span id="batterycard-battery-used_in"></span><br>
<strong>{{ $__t('Charge cycles count') }}:</strong> <span id="batterycard-battery-charge-cycles-count" class="locale-number locale-number-generic"></span><br>
<strong>{{ $__t('Last charged') }}:</strong> <span id="batterycard-battery-last-charged"></span> <time id="batterycard-battery-last-charged-timeago" class="timeago timeago-contextual"></time><br>
<strong>{{ $__t('Charge cycles count') }}:</strong> <span id="batterycard-battery-charge-cycles-count"
class="locale-number locale-number-generic"></span><br>
<strong>{{ $__t('Last charged') }}:</strong> <span id="batterycard-battery-last-charged"></span> <time id="batterycard-battery-last-charged-timeago"
class="timeago timeago-contextual"></time><br>
</div>
</div>

View File

@@ -7,6 +7,7 @@
<i class="fas fa-calendar"></i> {{ $__t('Calendar') }}
</div>
<div class="card-body">
<div id="calendar" data-target-input="nearest"></div>
<div id="calendar"
data-target-input="nearest"></div>
</div>
</div>

View File

@@ -5,17 +5,27 @@
<div class="card chorecard">
<div class="card-header">
<i class="fas fa-home"></i> {{ $__t('Chore overview') }}
<a id="chorecard-chore-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit chore') }}">
<a id="chorecard-chore-edit-button"
class="btn btn-sm btn-outline-info py-0 float-right disabled"
href="#"
data-toggle="tooltip"
title="{{ $__t('Edit chore') }}">
<i class="fas fa-edit"></i>
</a>
<a id="chorecard-chore-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link" href="#" data-toggle="tooltip" title="{{ $__t('Journal for this chore') }}">
<a id="chorecard-chore-journal-button"
class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link"
href="#"
data-toggle="tooltip"
title="{{ $__t('Journal for this chore') }}">
<i class="fas fa-file-alt"></i>
</a>
</div>
<div class="card-body">
<h3><span id="chorecard-chore-name"></span></h3>
<strong>{{ $__t('Tracked count') }}:</strong> <span id="chorecard-chore-tracked-count" class="locale-number locale-number-generic"></span><br>
<strong>{{ $__t('Last tracked') }}:</strong> <span id="chorecard-chore-last-tracked"></span> <time id="chorecard-chore-last-tracked-timeago" class="timeago timeago-contextual"></time><br>
<strong>{{ $__t('Tracked count') }}:</strong> <span id="chorecard-chore-tracked-count"
class="locale-number locale-number-generic"></span><br>
<strong>{{ $__t('Last tracked') }}:</strong> <span id="chorecard-chore-last-tracked"></span> <time id="chorecard-chore-last-tracked-timeago"
class="timeago timeago-contextual"></time><br>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<strong>{{ $__t('Last done by') }}:</strong> <span id="chorecard-chore-last-done-by"></span>
@endif

View File

@@ -16,33 +16,60 @@
@php if(empty($additionalGroupCssClasses)) { $additionalGroupCssClasses = ''; } @endphp
@php if(empty($activateNumberPad)) { $activateNumberPad = false; } @endphp
<div id="datetimepicker-wrapper" class="form-group {{ $additionalGroupCssClasses }}">
<div id="datetimepicker-wrapper"
class="form-group {{ $additionalGroupCssClasses }}">
<label for="{{ $id }}">{{ $__t($label) }}
<span class="small text-muted">
@if(!empty($hint)){{ $__t($hint) }}@endif
<time id="datetimepicker-timeago" class="timeago timeago-contextual"></time>
<time id="datetimepicker-timeago"
class="timeago timeago-contextual"></time>
</span>
</label>
<div class="input-group">
<div class="input-group date datetimepicker @if(!empty($additionalGroupCssClasses)){{ $additionalGroupCssClasses }}@endif" id="{{ $id }}" @if(!$noNameAttribute) name="{{ $id }}" @endif data-target-input="nearest">
<input {!! $additionalAttributes !!} type="text" @if($activateNumberPad) inputmode="numeric" @endif @if($isRequired) @if($isRequired) required @endif @endif class="form-control datetimepicker-input @if(!empty($additionalCssClasses)){{ $additionalCssClasses }}@endif"
data-target="#{{ $id }}" data-format="{{ $format }}"
<div class="input-group date datetimepicker @if(!empty($additionalGroupCssClasses)){{ $additionalGroupCssClasses }}@endif"
id="{{ $id }}"
@if(!$noNameAttribute)
name="{{ $id }}"
@endif
data-target-input="nearest">
<input {!!
$additionalAttributes
!!}
type="text"
@if($activateNumberPad)
inputmode="numeric"
@endif
@if($isRequired)
@if($isRequired)
required
@endif
@endif
class="form-control datetimepicker-input @if(!empty($additionalCssClasses)){{ $additionalCssClasses }}@endif"
data-target="#{{ $id }}"
data-format="{{ $format }}"
data-init-with-now="{{ BoolToString($initWithNow) }}"
data-init-value="{{ $initialValue }}"
data-limit-end-to-now="{{ BoolToString($limitEndToNow) }}"
data-limit-start-to-now="{{ BoolToString($limitStartToNow) }}"
data-next-input-selector="{{ $nextInputSelector }}"
data-earlier-than-limit="{{ $earlierThanInfoLimit }}" />
<div class="input-group-append" data-target="#{{ $id }}" data-toggle="datetimepicker">
<div class="input-group-append"
data-target="#{{ $id }}"
data-toggle="datetimepicker">
<div class="input-group-text"><i class="fas fa-calendar"></i></div>
</div>
<div class="invalid-feedback">{{ $invalidFeedback }}</div>
</div>
<div id="datetimepicker-earlier-than-info" class="form-text text-info font-italic d-none">{{ $earlierThanInfoText }}</div>
<div id="datetimepicker-earlier-than-info"
class="form-text text-info font-italic d-none">{{ $earlierThanInfoText }}</div>
@if(isset($shortcutValue) && isset($shortcutLabel))
<div class="form-check w-100">
<input class="form-check-input" type="checkbox" id="datetimepicker-shortcut" data-datetimepicker-shortcut-value="{{ $shortcutValue }}">
<label class="form-check-label" for="datetimepicker-shortcut">{{ $__t($shortcutLabel) }}</label>
<input class="form-check-input"
type="checkbox"
id="datetimepicker-shortcut"
data-datetimepicker-shortcut-value="{{ $shortcutValue }}">
<label class="form-check-label"
for="datetimepicker-shortcut">{{ $__t($shortcutLabel) }}</label>
</div>
@endif
</div>

View File

@@ -15,33 +15,57 @@
@php if(empty($additionalAttributes)) { $additionalAttributes = ''; } @endphp
@php if(empty($additionalGroupCssClasses)) { $additionalGroupCssClasses = ''; } @endphp
<div id="datetimepicker2-wrapper" class="form-group {{ $additionalGroupCssClasses }}">
<div id="datetimepicker2-wrapper"
class="form-group {{ $additionalGroupCssClasses }}">
<label for="{{ $id }}">{{ $__t($label) }}
<span class="small text-muted">
@if(!empty($hint)){{ $__t($hint) }}@endif
<time id="datetimepicker2-timeago" class="timeago timeago-contextual"></time>
<time id="datetimepicker2-timeago"
class="timeago timeago-contextual"></time>
</span>
</label>
<div class="input-group">
<div class="input-group date datetimepicker2 @if(!empty($additionalGroupCssClasses)){{ $additionalGroupCssClasses }}@endif" id="{{ $id }}" @if(!$noNameAttribute) name="{{ $id }}" @endif data-target-input="nearest">
<input {!! $additionalAttributes !!} type="text" @if($isRequired) @if($isRequired) required @endif @endif class="form-control datetimepicker2-input @if(!empty($additionalCssClasses)){{ $additionalCssClasses }}@endif"
data-target="#{{ $id }}" data-format="{{ $format }}"
<div class="input-group date datetimepicker2 @if(!empty($additionalGroupCssClasses)){{ $additionalGroupCssClasses }}@endif"
id="{{ $id }}"
@if(!$noNameAttribute)
name="{{ $id }}"
@endif
data-target-input="nearest">
<input {!!
$additionalAttributes
!!}
type="text"
@if($isRequired)
@if($isRequired)
required
@endif
@endif
class="form-control datetimepicker2-input @if(!empty($additionalCssClasses)){{ $additionalCssClasses }}@endif"
data-target="#{{ $id }}"
data-format="{{ $format }}"
data-init-with-now="{{ BoolToString($initWithNow) }}"
data-init-value="{{ $initialValue }}"
data-limit-end-to-now="{{ BoolToString($limitEndToNow) }}"
data-limit-start-to-now="{{ BoolToString($limitStartToNow) }}"
data-next-input-selector="{{ $nextInputSelector }}"
data-earlier-than-limit="{{ $earlierThanInfoLimit }}" />
<div class="input-group-append" data-target="#{{ $id }}" data-toggle="datetimepicker">
<div class="input-group-append"
data-target="#{{ $id }}"
data-toggle="datetimepicker">
<div class="input-group-text"><i class="fas fa-calendar"></i></div>
</div>
<div class="invalid-feedback">{{ $invalidFeedback }}</div>
</div>
<div id="datetimepicker2-earlier-than-info" class="form-text text-info font-italic d-none">{{ $earlierThanInfoText }}</div>
<div id="datetimepicker2-earlier-than-info"
class="form-text text-info font-italic d-none">{{ $earlierThanInfoText }}</div>
@if(isset($shortcutValue) && isset($shortcutLabel))
<div class="form-check w-100">
<input class="form-check-input" type="checkbox" id="datetimepicker2-shortcut" data-datetimepicker2-shortcut-value="{{ $shortcutValue }}">
<label class="form-check-label" for="datetimepicker2-shortcut">{{ $__t($shortcutLabel) }}</label>
<input class="form-check-input"
type="checkbox"
id="datetimepicker2-shortcut"
data-datetimepicker2-shortcut-value="{{ $shortcutValue }}">
<label class="form-check-label"
for="datetimepicker2-shortcut">{{ $__t($shortcutLabel) }}</label>
</div>
@endif
</div>

View File

@@ -7,9 +7,18 @@
@php if(!isset($isRequired)) { $isRequired = true; } @endphp
@php if(empty($hint)) { $hint = ''; } @endphp
<div class="form-group" data-next-input-selector="{{ $nextInputSelector }}" data-prefill-by-name="{{ $prefillByName }}" data-prefill-by-id="{{ $prefillById }}">
<label for="location_id">{{ $__t('Location') }}&nbsp;&nbsp;<span id="{{ $hintId }}" class="small text-muted">{{ $hint }}</span></label>
<select class="form-control location-combobox" id="location_id" name="location_id" @if($isRequired) required @endif>
<div class="form-group"
data-next-input-selector="{{ $nextInputSelector }}"
data-prefill-by-name="{{ $prefillByName }}"
data-prefill-by-id="{{ $prefillById }}">
<label for="location_id">{{ $__t('Location') }}&nbsp;&nbsp;<span id="{{ $hintId }}"
class="small text-muted">{{ $hint }}</span></label>
<select class="form-control location-combobox"
id="location_id"
name="location_id"
@if($isRequired)
required
@endif>
<option value=""></option>
@foreach($locations as $location)
<option value="{{ $location->id }}">{{ $location->name }}</option>

View File

@@ -16,12 +16,30 @@
@php if(!isset($isRequired)) { $isRequired = true; } @endphp
@php if(!isset($noNameAttribute)) { $noNameAttribute = false; } @endphp
<div id="group-{{ $id }}" class="form-group {{ $additionalGroupCssClasses }}">
<div id="group-{{ $id }}"
class="form-group {{ $additionalGroupCssClasses }}">
<label for="{{ $id }}">
{{ $__t($label) }}&nbsp;
<span id="{{ $hintId }}" data-toggle="tooltip" title="{{ $hint }}"></span>{!! $additionalHtmlContextHelp !!}</label>
<span id="{{ $hintId }}"
data-toggle="tooltip"
title="{{ $hint }}"></span>{!! $additionalHtmlContextHelp !!}</label>
<div class="input-group">
<input {!! $additionalAttributes !!} type="number" class="form-control numberpicker {{ $additionalCssClasses }}" id="{{ $id }}" @if(!$noNameAttribute) name="{{ $id }}" @endif value="{{ $value }}" min="{{ $min }}" max="{{ $max }}" step="{{ $step }}" @if($isRequired) required @endif>
<input {!!
$additionalAttributes
!!}
type="number"
class="form-control numberpicker {{ $additionalCssClasses }}"
id="{{ $id }}"
@if(!$noNameAttribute)
name="{{ $id }}"
@endif
value="{{ $value }}"
min="{{ $min }}"
max="{{ $max }}"
step="{{ $step }}"
@if($isRequired)
required
@endif>
<div class="input-group-append">
<div class="input-group-text numberpicker-up-button"><i class="fas fa-arrow-up"></i></div>
</div>

View File

@@ -20,14 +20,22 @@
<div class="form-group col-8 mb-1">
<label for="qu_id">{{ $__t('Quantity unit') }}</label>
<select required class="form-control input-group-productamountpicker" id="qu_id" name="qu_id" data-initial-qu-id="{{ $initialQuId }}">
<select required
class="form-control input-group-productamountpicker"
id="qu_id"
name="qu_id"
data-initial-qu-id="{{ $initialQuId }}">
<option></option>
</select>
<div class="invalid-feedback">{{ $__t('A quantity unit is required') }}</div>
</div>
<div id="qu-conversion-info" class="col form-text text-info d-none"></div>
<input type="hidden" id="amount" name="amount" value="">
<div id="qu-conversion-info"
class="col form-text text-info d-none"></div>
<input type="hidden"
id="amount"
name="amount"
value="">
</div>
</div>

View File

@@ -6,40 +6,65 @@
<div class="card productcard">
<div class="card-header">
<i class="fab fa-product-hunt"></i> {{ $__t('Product overview') }}
<a id="productcard-product-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit product') }}">
<a id="productcard-product-edit-button"
class="btn btn-sm btn-outline-info py-0 float-right disabled"
href="#"
data-toggle="tooltip"
title="{{ $__t('Edit product') }}">
<i class="fas fa-edit"></i>
</a>
<a id="productcard-product-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link" href="#" data-toggle="tooltip" title="{{ $__t('Stock journal for this product') }}">
<a id="productcard-product-journal-button"
class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link"
href="#"
data-toggle="tooltip"
title="{{ $__t('Stock journal for this product') }}">
<i class="fas fa-file-alt"></i>
</a>
</div>
<div class="card-body">
<h3><span id="productcard-product-name"></span></h3>
<div id="productcard-product-description-wrapper" class="expandable-text mb-2 d-none">
<p id="productcard-product-description" class="text-muted collapse mb-0"></p>
<a class="collapsed" data-toggle="collapse" href="#productcard-product-description">{{ $__t('Show more') }}</a>
<div id="productcard-product-description-wrapper"
class="expandable-text mb-2 d-none">
<p id="productcard-product-description"
class="text-muted collapse mb-0"></p>
<a class="collapsed"
data-toggle="collapse"
href="#productcard-product-description">{{ $__t('Show more') }}</a>
</div>
<strong>{{ $__t('Stock amount') }}:</strong> <span id="productcard-product-stock-amount" class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name"></span>
<span id="productcard-product-stock-factor-purchase-amount" class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-factor-purchase-qu-name"></span>
<span id="productcard-product-stock-opened-amount" class="small font-italic locale-number locale-number-quantity-amount"></span><br>
<strong>{{ $__t('Stock value') }}:</strong> <span id="productcard-product-stock-value" class="locale-number locale-number-currency"></span>
<span id="productcard-aggregated-amounts" class="pl-2 text-secondary d-none"><i class="fas fa-custom-sigma-sign"></i> <span id="productcard-product-stock-amount-aggregated" class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name-aggregated"></span> <span id="productcard-product-stock-opened-amount-aggregated locale-number locale-number-quantity-amount" class="small font-italic"></span></span><br>
<strong>{{ $__t('Stock amount') }}:</strong> <span id="productcard-product-stock-amount"
class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name"></span>
<span id="productcard-product-stock-factor-purchase-amount"
class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-factor-purchase-qu-name"></span>
<span id="productcard-product-stock-opened-amount"
class="small font-italic locale-number locale-number-quantity-amount"></span><br>
<strong>{{ $__t('Stock value') }}:</strong> <span id="productcard-product-stock-value"
class="locale-number locale-number-currency"></span>
<span id="productcard-aggregated-amounts"
class="pl-2 text-secondary d-none"><i class="fas fa-custom-sigma-sign"></i> <span id="productcard-product-stock-amount-aggregated"
class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name-aggregated"></span> <span id="productcard-product-stock-opened-amount-aggregated locale-number locale-number-quantity-amount"
class="small font-italic"></span></span><br>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)<strong>{{ $__t('Default location') }}:</strong> <span id="productcard-product-location"></span><br>@endif
<strong>{{ $__t('Last purchased') }}:</strong> <span id="productcard-product-last-purchased"></span> <time id="productcard-product-last-purchased-timeago" class="timeago timeago-contextual"></time><br>
<strong>{{ $__t('Last used') }}:</strong> <span id="productcard-product-last-used"></span> <time id="productcard-product-last-used-timeago" class="timeago timeago-contextual"></time><br>
<strong>{{ $__t('Last purchased') }}:</strong> <span id="productcard-product-last-purchased"></span> <time id="productcard-product-last-purchased-timeago"
class="timeago timeago-contextual"></time><br>
<strong>{{ $__t('Last used') }}:</strong> <span id="productcard-product-last-used"></span> <time id="productcard-product-last-used-timeago"
class="timeago timeago-contextual"></time><br>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)<strong>{{ $__t('Last price') }}:</strong> <span id="productcard-product-last-price"></span><br>@endif
@if (GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)<strong>{{ $__t('Average price') }}:</strong> <span id="productcard-product-average-price"></span><br>@endif
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)<strong>{{ $__t('Average shelf life') }}:</strong> <span id="productcard-product-average-shelf-life"></span><br>@endif
<strong>{{ $__t('Spoil rate') }}:</strong> <span id="productcard-product-spoil-rate"></span>
<p class="w-75 mt-3 mx-auto"><img id="productcard-product-picture" data-src="" class="img-fluid img-thumbnail d-none lazy"></p>
<p class="w-75 mt-3 mx-auto"><img id="productcard-product-picture"
data-src=""
class="img-fluid img-thumbnail d-none lazy"></p>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<h5 class="mt-3">{{ $__t('Price history') }}</h5>
<canvas id="productcard-product-price-history-chart" class="w-100 d-none"></canvas>
<span id="productcard-no-price-data-hint" class="font-italic d-none">{{ $__t('No price history available') }}</span>
<canvas id="productcard-product-price-history-chart"
class="w-100 d-none"></canvas>
<span id="productcard-no-price-data-hint"
class="font-italic d-none">{{ $__t('No price history available') }}</span>
@endif
</div>
</div>

View File

@@ -12,23 +12,41 @@
@php if(empty($hint)) { $hint = ''; } @endphp
@php if(empty($nextInputSelector)) { $nextInputSelector = ''; } @endphp
<div class="form-group" data-next-input-selector="{{ $nextInputSelector }}" data-disallow-add-product-workflows="{{ BoolToString($disallowAddProductWorkflows) }}" data-disallow-all-product-workflows="{{ BoolToString($disallowAllProductWorkflows) }}" data-prefill-by-name="{{ $prefillByName }}" data-prefill-by-id="{{ $prefillById }}">
<div class="form-group"
data-next-input-selector="{{ $nextInputSelector }}"
data-disallow-add-product-workflows="{{ BoolToString($disallowAddProductWorkflows) }}"
data-disallow-all-product-workflows="{{ BoolToString($disallowAllProductWorkflows) }}"
data-prefill-by-name="{{ $prefillByName }}"
data-prefill-by-id="{{ $prefillById }}">
<label for="product_id">
{{ $__t($label) }}&nbsp;<i class="fas fa-barcode"></i>&nbsp;
<span id="barcode-lookup-disabled-hint" class="small text-muted d-none"> {{ $__t('Barcode lookup is disabled') }}</span>&nbsp;
<span id="barcode-lookup-disabled-hint"
class="small text-muted d-none"> {{ $__t('Barcode lookup is disabled') }}</span>&nbsp;
</label>
<select class="form-control product-combobox barcodescanner-input" id="product_id" name="product_id" @if($isRequired) required @endif @if($disabled) disabled @endif data-target="@productpicker">
<select class="form-control product-combobox barcodescanner-input"
id="product_id"
name="product_id"
@if($isRequired)
required
@endif
@if($disabled)
disabled
@endif
data-target="@productpicker">
<option value=""></option>
@foreach($products as $product)
<option data-additional-searchdata="{{ FindObjectInArrayByPropertyValue($barcodes, 'product_id', $product->id)->barcodes }}," value="{{ $product->id }}">{{ $product->name }}</option>
<option data-additional-searchdata="{{ FindObjectInArrayByPropertyValue($barcodes, 'product_id', $product->id)->barcodes }},"
value="{{ $product->id }}">{{ $product->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('You have to select a product') }}</div>
<div id="custom-productpicker-error" class="form-text text-danger d-none"></div>
<div id="custom-productpicker-error"
class="form-text text-danger d-none"></div>
@if(!$disallowAllProductWorkflows)
<div class="form-text text-info small">{{ $__t('Type a new product name or barcode and hit TAB to start a workflow') }}</div>
@endif
<div id="flow-info-addbarcodetoselection" class="form-text text-muted small d-none"><strong><span id="addbarcodetoselection"></span></strong> {{ $__t('will be added to the list of barcodes for the selected product on submit') }}</div>
<div id="flow-info-addbarcodetoselection"
class="form-text text-muted small d-none"><strong><span id="addbarcodetoselection"></span></strong> {{ $__t('will be added to the list of barcodes for the selected product on submit') }}</div>
</div>
@include('components.barcodescanner')

View File

@@ -9,9 +9,18 @@
@php if(empty($hintId)) { $hintId = ''; } @endphp
@php if(empty($nextInputSelector)) { $nextInputSelector = ''; } @endphp
<div class="form-group" data-next-input-selector="{{ $nextInputSelector }}" data-prefill-by-name="{{ $prefillByName }}" data-prefill-by-id="{{ $prefillById }}">
<label for="recipe_id">{{ $__t('Recipe') }}&nbsp;&nbsp;<span id="{{ $hintId }}" class="small text-muted">{{ $hint }}</span></label>
<select class="form-control recipe-combobox" id="recipe_id" name="recipe_id" @if($isRequired) required @endif>
<div class="form-group"
data-next-input-selector="{{ $nextInputSelector }}"
data-prefill-by-name="{{ $prefillByName }}"
data-prefill-by-id="{{ $prefillById }}">
<label for="recipe_id">{{ $__t('Recipe') }}&nbsp;&nbsp;<span id="{{ $hintId }}"
class="small text-muted">{{ $hint }}</span></label>
<select class="form-control recipe-combobox"
id="recipe_id"
name="recipe_id"
@if($isRequired)
required
@endif>
<option value=""></option>
@foreach($recipes as $recipe)
<option value="{{ $recipe->id }}">{{ $recipe->name }}</option>

View File

@@ -8,9 +8,18 @@
@php if(empty($hint)) { $hint = ''; } @endphp
@php if(empty($nextInputSelector)) { $nextInputSelector = ''; } @endphp
<div class="form-group" data-next-input-selector="{{ $nextInputSelector }}" data-prefill-by-name="{{ $prefillByName }}" data-prefill-by-id="{{ $prefillById }}">
<label for="shopping_location_id">{{ $__t($label) }}&nbsp;&nbsp;<span id="{{ $hintId }}" class="small text-muted">{{ $hint }}</span></label>
<select class="form-control shopping-location-combobox" id="shopping_location_id" name="shopping_location_id" @if($isRequired) required @endif>
<div class="form-group"
data-next-input-selector="{{ $nextInputSelector }}"
data-prefill-by-name="{{ $prefillByName }}"
data-prefill-by-id="{{ $prefillById }}">
<label for="shopping_location_id">{{ $__t($label) }}&nbsp;&nbsp;<span id="{{ $hintId }}"
class="small text-muted">{{ $hint }}</span></label>
<select class="form-control shopping-location-combobox"
id="shopping_location_id"
name="shopping_location_id"
@if($isRequired)
required
@endif>
<option value=""></option>
@foreach($shoppinglocations as $shoppinglocation)
<option value="{{ $shoppinglocation->id }}">{{ $shoppinglocation->name }}</option>

View File

@@ -11,13 +11,19 @@
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_CHECKLIST)
{!! str_replace(',', '<br>', $userfieldObject->value) !!}
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_LINK)
<a href="{{ $userfieldObject->value }}" target="_blank">{{ $userfieldObject->value }}</a>
<a href="{{ $userfieldObject->value }}"
target="_blank">{{ $userfieldObject->value }}</a>
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_FILE)
<a class="show-as-dialog-link" href="{{ $U('/files/userfiles/'. $userfieldObject->value) }}" target="_blank">{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}</a>
<a class="show-as-dialog-link"
href="{{ $U('/files/userfiles/'. $userfieldObject->value) }}"
target="_blank">{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}</a>
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_IMAGE)
<a class="show-as-dialog-link" href="{{ $U('/files/userfiles/'. $userfieldObject->value . '?force_serve_as=picture') }}">
<a class="show-as-dialog-link"
href="{{ $U('/files/userfiles/'. $userfieldObject->value . '?force_serve_as=picture') }}">
<img src="{{ $U('/files/userfiles/'. $userfieldObject->value . '?force_serve_as=picture&best_fit_width=32&best_fit_height=32') }}"
class="lazy" title="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}" alt="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}">
class="lazy"
title="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}"
alt="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}">
</a>
@else
{{ $userfieldObject->value }}

View File

@@ -4,7 +4,10 @@
@if(count($userfields) > 0)
<div id="userfields-form" data-entity="{{ $entity }}" class="border border-info p-2 mb-2" novalidate>
<div id="userfields-form"
data-entity="{{ $entity }}"
class="border border-info p-2 mb-2"
novalidate>
<h2 class="small">{{ $__t('Userfields') }}</h2>
@foreach($userfields as $userfield)
@@ -12,12 +15,16 @@
@if($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_SINGLE_LINE_TEXT)
<div class="form-group">
<label for="name">{{ $userfield->caption }}</label>
<input type="text" class="form-control userfield-input" data-userfield-name="{{ $userfield->name }}">
<input type="text"
class="form-control userfield-input"
data-userfield-name="{{ $userfield->name }}">
</div>
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_SINGLE_MULTILINE_TEXT)
<div class="form-group">
<label for="description">{{ $userfield->caption }}</label>
<textarea class="form-control userfield-input" rows="4" data-userfield-name="{{ $userfield->name }}"></textarea>
<textarea class="form-control userfield-input"
rows="4"
data-userfield-name="{{ $userfield->name }}"></textarea>
</div>
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_INTEGRAL_NUMBER)
@include('components.numberpicker', array(
@@ -70,14 +77,19 @@
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_CHECKBOX)
<div class="form-group">
<div class="form-check">
<input class="form-check-input userfield-input" type="checkbox" data-userfield-name="{{ $userfield->name }}" value="1">
<label class="form-check-label" for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
<input class="form-check-input userfield-input"
type="checkbox"
data-userfield-name="{{ $userfield->name }}"
value="1">
<label class="form-check-label"
for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
</div>
</div>
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_LIST)
<div class="form-group">
<label for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
<select class="form-control userfield-input" data-userfield-name="{{ $userfield->name }}">
<select class="form-control userfield-input"
data-userfield-name="{{ $userfield->name }}">
<option></option>
@foreach(preg_split('/\r\n|\r|\n/', $userfield->config) as $option)
<option value="{{ $option }}">{{ $option }}</option>
@@ -87,7 +99,11 @@
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_CHECKLIST)
<div class="form-group">
<label for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
<select multiple class="form-control userfield-input selectpicker" data-userfield-name="{{ $userfield->name }}" data-actions-Box="true" data-live-search="true">
<select multiple
class="form-control userfield-input selectpicker"
data-userfield-name="{{ $userfield->name }}"
data-actions-Box="true"
data-live-search="true">
@foreach(preg_split('/\r\n|\r|\n/', $userfield->config) as $option)
<option value="{{ $option }}">{{ $option }}</option>
@endforeach
@@ -96,15 +112,23 @@
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_LINK)
<div class="form-group">
<label for="name">{{ $userfield->caption }}</label>
<input type="link" class="form-control userfield-input" data-userfield-name="{{ $userfield->name }}">
<input type="link"
class="form-control userfield-input"
data-userfield-name="{{ $userfield->name }}">
</div>
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_FILE)
<div class="form-group">
<label for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
<input type="file" class="form-control userfield-input" data-userfield-name="{{ $userfield->name }}">
<input type="file"
class="form-control userfield-input"
data-userfield-name="{{ $userfield->name }}">
<div class="d-none userfield-file">
<a href="" class="userfield-current-file" data-uf-name="{{ $userfield->name }}"></a>
<button type="button" class="userfield-current-file btn btn-danger userfield-file-delete" data-uf-name="{{ $userfield->name }}">
<a href=""
class="userfield-current-file"
data-uf-name="{{ $userfield->name }}"></a>
<button type="button"
class="userfield-current-file btn btn-danger userfield-file-delete"
data-uf-name="{{ $userfield->name }}">
<i class="fas fa-trash"></i>
</button>
</div>
@@ -112,10 +136,17 @@
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_IMAGE)
<div class="form-group">
<label for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
<input type="file" class="form-control userfield-input" data-userfield-name="{{ $userfield->name }}">
<input type="file"
class="form-control userfield-input"
data-userfield-name="{{ $userfield->name }}">
<div class="d-none userfield-file">
<img src="" alt="{{ $userfield->name }}" class="userfield-current-file" data-uf-name="{{ $userfield->name }}"/>
<button type="button" class="userfield-current-file btn btn-danger userfield-file-delete" data-uf-name="{{ $userfield->name }}">
<img src=""
alt="{{ $userfield->name }}"
class="userfield-current-file"
data-uf-name="{{ $userfield->name }}" />
<button type="button"
class="userfield-current-file btn btn-danger userfield-file-delete"
data-uf-name="{{ $userfield->name }}">
<i class="fas fa-trash"></i>
</button>
</div>

View File

@@ -1,5 +1,9 @@
<label>
<input type="checkbox" name="{{ $perm->permission_name }}" class="permission-cb" data-perm-id="{{ $perm->permission_id }}" @if($perm->has_permission) checked @endif autocomplete="off">
<input type="checkbox"
name="{{ $perm->permission_name }}"
class="permission-cb"
data-perm-id="{{ $perm->permission_id }}"
@if($perm->has_permission) checked @endif autocomplete="off">
{{ $__t($perm->permission_name) }}
</label>
<div id="permission-sub-{{ $perm->permission_name }}">

View File

@@ -6,12 +6,18 @@
@php if(empty($prefillByUserId)) { $prefillByUserId = ''; } @endphp
@php if(!isset($nextInputSelector)) { $nextInputSelector = ''; } @endphp
<div class="form-group" data-next-input-selector="{{ $nextInputSelector }}" data-prefill-by-username="{{ $prefillByUsername }}" data-prefill-by-user-id="{{ $prefillByUserId }}">
<div class="form-group"
data-next-input-selector="{{ $nextInputSelector }}"
data-prefill-by-username="{{ $prefillByUsername }}"
data-prefill-by-user-id="{{ $prefillByUserId }}">
<label for="user_id">{{ $__t($label) }}</label>
<select class="form-control user-combobox" id="user_id" name="user_id">
<select class="form-control user-combobox"
id="user_id"
name="user_id">
<option value=""></option>
@foreach($users as $user)
<option data-additional-searchdata="{{ $user->username }}" value="{{ $user->id }}">{{ GetUserDisplayName($user) }}</option>
<option data-additional-searchdata="{{ $user->username }}"
value="{{ $user->id }}">{{ GetUserDisplayName($user) }}</option>
@endforeach
</select>
</div>

View File

@@ -15,8 +15,16 @@
<h2 class="title">@yield('title')</h2>
<div class="related-links">
@if(!$embedded)
<button id="scan-mode-button" class="btn @if(boolval($userSettings['scan_mode_consume_enabled'])) btn-success @else btn-danger @endif" type="checkbox">{{ $__t('Scan mode') }} <span id="scan-mode-status">@if(boolval($userSettings['scan_mode_consume_enabled'])) {{ $__t('on') }} @else {{ $__t('off') }} @endif</span></button>
<input id="scan-mode" type="checkbox" class="d-none user-setting-control" data-setting-key="scan_mode_consume_enabled" @if(boolval($userSettings['scan_mode_consume_enabled'])) checked @endif>
<button id="scan-mode-button"
class="btn @if(boolval($userSettings['scan_mode_consume_enabled'])) btn-success @else btn-danger @endif"
type="checkbox">{{ $__t('Scan mode') }} <span id="scan-mode-status">@if(boolval($userSettings['scan_mode_consume_enabled'])) {{ $__t('on') }} @else {{ $__t('off') }} @endif</span></button>
<input id="scan-mode"
type="checkbox"
class="d-none user-setting-control"
data-setting-key="scan_mode_consume_enabled"
@if(boolval($userSettings['scan_mode_consume_enabled']))
checked
@endif>
@else
<script>
Grocy.UserSettings.scan_mode_consume_enabled = false;
@@ -26,7 +34,8 @@
</div>
<hr>
<form id="consume-form" novalidate>
<form id="consume-form"
novalidate>
@include('components.productpicker', array(
'products' => $products,
@@ -42,7 +51,8 @@
'min' => 1,
'value' => 0,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
@@ -55,7 +65,10 @@
<div class="form-group">
<label for="location_id">{{ $__t('Location') }}</label>
<select required class="form-control location-combobox" id="location_id" name="location_id">
<select required
class="form-control location-combobox"
id="location_id"
name="location_id">
<option></option>
@foreach($locations as $location)
<option value="{{ $location->id }}">{{ $location->name }}</option>
@@ -67,17 +80,24 @@
<div class="form-group">
<label for="use_specific_stock_entry">
<input type="checkbox" id="use_specific_stock_entry" name="use_specific_stock_entry"> {{ $__t('Use a specific stock item') }}
<input type="checkbox"
id="use_specific_stock_entry"
name="use_specific_stock_entry"> {{ $__t('Use a specific stock item') }}
<span class="small text-muted">{{ $__t('The first item in this list would be picked by the default rule which is "First expiring first, then first in first out"') }}</span>
</label>
<select disabled class="form-control" id="specific_stock_entry" name="specific_stock_entry">
<select disabled
class="form-control"
id="specific_stock_entry"
name="specific_stock_entry">
<option></option>
</select>
</div>
<div class="checkbox">
<label for="spoiled">
<input type="checkbox" id="spoiled" name="spoiled"> {{ $__t('Spoiled') }}
<input type="checkbox"
id="spoiled"
name="spoiled"> {{ $__t('Spoiled') }}
</label>
</div>
@@ -89,10 +109,12 @@
))
@endif
<button id="save-consume-button" class="btn btn-success">{{ $__t('OK') }}</button>
<button id="save-consume-button"
class="btn btn-success">{{ $__t('OK') }}</button>
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING)
<button id="save-mark-as-open-button" class="btn btn-secondary permission-STOCK_OPEN">{{ $__t('Mark as opened') }}</button>
<button id="save-mark-as-open-button"
class="btn btn-secondary permission-STOCK_OPEN">{{ $__t('Mark as opened') }}</button>
@endif
</form>

View File

@@ -13,7 +13,8 @@
<div class="row">
<div class="col-xs-12 col-md-4 col-xl-3">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/equipment/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/equipment/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -22,10 +23,14 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
<table id="equipment-table" class="table table-striped dt-responsive">
<table id="equipment-table"
class="table table-striped dt-responsive">
<thead>
<tr>
<th>{{ $__t('Name') }}</th>
@@ -57,49 +62,78 @@
<div class="col-xs-12 col-md-8">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#instruction-manual-tab">{{ $__t('Instruction manual') }}</a>
<a class="nav-link active"
data-toggle="tab"
href="#instruction-manual-tab">{{ $__t('Instruction manual') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#description-tab">{{ $__t('Notes') }}</a>
<a class="nav-link"
data-toggle="tab"
href="#description-tab">{{ $__t('Notes') }}</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="instruction-manual-tab">
<div id="selectedEquipmentInstructionManualCard" class="card">
<div class="tab-pane fade show active"
id="instruction-manual-tab">
<div id="selectedEquipmentInstructionManualCard"
class="card">
<div class="card-header card-header-fullscreen">
<i class="fas fa-toolbox"></i> <span class="selected-equipment-name"></span>&nbsp;&nbsp;
<a class="btn btn-sm btn-outline-info py-0 equipment-edit-button hide-on-fullscreen-card" href="#">
<a class="btn btn-sm btn-outline-info py-0 equipment-edit-button hide-on-fullscreen-card"
href="#">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-outline-danger py-0 equipment-delete-button hide-on-fullscreen-card" href="#" data-equipment-id="{{ $equipmentItem->id }}" data-equipment-name="{{ $equipmentItem->name }}">
<a class="btn btn-sm btn-outline-danger py-0 equipment-delete-button hide-on-fullscreen-card"
href="#"
data-equipment-id="{{ $equipmentItem->id }}"
data-equipment-name="{{ $equipmentItem->name }}">
<i class="fas fa-trash"></i>
</a>
<a id="selectedEquipmentInstructionManualToggleFullscreenButton" class="btn btn-sm btn-outline-secondary py-0 float-right" href="#" data-toggle="tooltip" title="{{ $__t('Expand to fullscreen') }}">
<a id="selectedEquipmentInstructionManualToggleFullscreenButton"
class="btn btn-sm btn-outline-secondary py-0 float-right"
href="#"
data-toggle="tooltip"
title="{{ $__t('Expand to fullscreen') }}">
<i class="fas fa-expand-arrows-alt"></i>
</a>
</div>
<div class="card-body py-0 px-0">
<p id="selected-equipment-has-no-instruction-manual-hint" class="text-muted font-italic d-none pt-3 pl-3">{{ $__t('The selected equipment has no instruction manual') }}</p>
<embed id="selected-equipment-instruction-manual" class="embed-responsive embed-responsive-4by3" src="" type="application/pdf">
<p id="selected-equipment-has-no-instruction-manual-hint"
class="text-muted font-italic d-none pt-3 pl-3">{{ $__t('The selected equipment has no instruction manual') }}</p>
<embed id="selected-equipment-instruction-manual"
class="embed-responsive embed-responsive-4by3"
src=""
type="application/pdf">
</div>
</div>
</div>
<div class="tab-pane fade" id="description-tab">
<div id="selectedEquipmentDescriptionCard" class="card">
<div class="tab-pane fade"
id="description-tab">
<div id="selectedEquipmentDescriptionCard"
class="card">
<div class="card-header card-header-fullscreen">
<i class="fas fa-toolbox"></i> <span class="selected-equipment-name"></span>&nbsp;&nbsp;
<a class="btn btn-sm btn-outline-info py-0 equipment-edit-button hide-on-fullscreen-card" href="#">
<a class="btn btn-sm btn-outline-info py-0 equipment-edit-button hide-on-fullscreen-card"
href="#">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-outline-danger py-0 equipment-delete-button hide-on-fullscreen-card" href="#" data-equipment-id="{{ $equipmentItem->id }}" data-equipment-name="{{ $equipmentItem->name }}">
<a class="btn btn-sm btn-outline-danger py-0 equipment-delete-button hide-on-fullscreen-card"
href="#"
data-equipment-id="{{ $equipmentItem->id }}"
data-equipment-name="{{ $equipmentItem->name }}">
<i class="fas fa-trash"></i>
</a>
<a id="selectedEquipmentDescriptionToggleFullscreenButton" class="btn btn-sm btn-outline-secondary py-0 float-right" href="#" data-toggle="tooltip" title="{{ $__t('Expand to fullscreen') }}">
<a id="selectedEquipmentDescriptionToggleFullscreenButton"
class="btn btn-sm btn-outline-secondary py-0 float-right"
href="#"
data-toggle="tooltip"
title="{{ $__t('Expand to fullscreen') }}">
<i class="fas fa-expand-arrows-alt"></i>
</a>
</div>
<div class="card-body">
<div id="description-tab-content" class="mb-0"></div>
<div id="description-tab-content"
class="mb-0"></div>
</div>
</div>
</div>

View File

@@ -18,21 +18,33 @@
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $equipment->id }};</script>
<script>
Grocy.EditObjectId = {{ $equipment->id }};
</script>
@if(!empty($equipment->instruction_manual_file_name))
<script>Grocy.InstructionManualFileNameName = '{{ $equipment->instruction_manual_file_name }}';</script>
<script>
Grocy.InstructionManualFileNameName = '{{ $equipment->instruction_manual_file_name }}';
</script>
@endif
@endif
<form id="equipment-form" novalidate>
<form id="equipment-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $equipment->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $equipment->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
@@ -41,14 +53,20 @@
<span class="text-muted small">{{ $__t('If you don\'t select a file, the current instruction manual will not be altered') }}</span>
</label>
<div class="custom-file">
<input type="file" class="custom-file-input" id="instruction-manual" accept="application/pdf">
<label class="custom-file-label" for="instruction-manual">{{ $__t('No file selected') }}</label>
<input type="file"
class="custom-file-input"
id="instruction-manual"
accept="application/pdf">
<label class="custom-file-label"
for="instruction-manual">{{ $__t('No file selected') }}</label>
</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Notes') }}</label>
<textarea class="form-control wysiwyg-editor" id="description" name="description">@if($mode == 'edit'){{ $equipment->description }}@endif</textarea>
<textarea class="form-control wysiwyg-editor"
id="description"
name="description">@if($mode == 'edit'){{ $equipment->description }}@endif</textarea>
</div>
@include('components.userfieldsform', array(
@@ -56,19 +74,26 @@
'entity' => 'equipment'
))
<button id="save-equipment-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-equipment-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>
<div class="col-lg-6 col-xs-12">
<label class="mt-2">{{ $__t('Instruction manual') }}</label>
<button id="delete-current-instruction-manual-button" class="btn btn-sm btn-danger mb-1 @if(empty($equipment->instruction_manual_file_name)) disabled @endif"><i class="fas fa-trash"></i> {{ $__t('Delete') }}</button>
<button id="delete-current-instruction-manual-button"
class="btn btn-sm btn-danger mb-1 @if(empty($equipment->instruction_manual_file_name)) disabled @endif"><i class="fas fa-trash"></i> {{ $__t('Delete') }}</button>
@if(!empty($equipment->instruction_manual_file_name))
<embed id="current-equipment-instruction-manual" class="embed-responsive embed-responsive-4by3" src="{{ $U('/api/files/equipmentmanuals/' . base64_encode($equipment->instruction_manual_file_name)) }}" type="application/pdf">
<p id="delete-current-instruction-manual-on-save-hint" class="form-text text-muted font-italic d-none">{{ $__t('The current instruction manual will be deleted when you save the equipment') }}</p>
<embed id="current-equipment-instruction-manual"
class="embed-responsive embed-responsive-4by3"
src="{{ $U('/api/files/equipmentmanuals/' . base64_encode($equipment->instruction_manual_file_name)) }}"
type="application/pdf">
<p id="delete-current-instruction-manual-on-save-hint"
class="form-text text-muted font-italic d-none">{{ $__t('The current instruction manual will be deleted when you save the equipment') }}</p>
@else
<p id="no-current-instruction-manual-hint" class="form-text text-muted font-italic">{{ $__t('No instruction manual available') }}</p>
<p id="no-current-instruction-manual-hint"
class="form-text text-muted font-italic">{{ $__t('No instruction manual available') }}</p>
@endif
</div>
</div>

View File

@@ -3,7 +3,8 @@
@section('title', $__t('Page not found'))
@section('content')
<meta http-equiv="refresh" content="5;url={{$U('/')}}">
<meta http-equiv="refresh"
content="5;url={{$U('/')}}">
<div class="row">
<div class="col">
<h1 class="alert alert-danger">{{ $__t('This page does not exist') }}</h1>

View File

@@ -8,7 +8,8 @@
<h1 class="alert alert-danger">{{ $__t('A server error occured while processing your request') }}</h1>
<div class="alert alert-info">
{{ $__t('If you think this is a bug, please report it') }}<br>
&rarr; <a target="_blank" href="https://github.com/grocy/grocy/issues">https://github.com/grocy/grocy/issues</a>
&rarr; <a target="_blank"
href="https://github.com/grocy/grocy/issues">https://github.com/grocy/grocy/issues</a>
</div>
</div>
</div>

View File

@@ -9,7 +9,8 @@
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
<h2 class="title">@yield('title')</h2>
<hr>
<form id="inventory-form" novalidate>
<form id="inventory-form"
novalidate>
@include('components.productpicker', array(
'products' => $products,
@@ -25,8 +26,10 @@
'value' => 1,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'additionalAttributes' => 'data-not-equal="-1"',
'additionalHtmlElements' => '<div id="inventory-change-info" class="form-text text-muted small d-none"></div>',
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-small text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
'additionalHtmlElements' => '<div id="inventory-change-info"
class="form-text text-muted small d-none"></div>',
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
class="text-small text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
@php
@@ -74,7 +77,10 @@
'shoppinglocations' => $shoppinglocations
))
@else
<input type="hidden" name="price" id="price" value="0">
<input type="hidden"
name="price"
id="price"
value="0">
@endif
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
@@ -84,7 +90,8 @@
))
@endif
<button id="save-inventory-button" class="btn btn-success">{{ $__t('OK') }}</button>
<button id="save-inventory-button"
class="btn btn-success">{{ $__t('OK') }}</button>
</form>
</div>

View File

@@ -1,44 +1,82 @@
<!DOCTYPE html>
<html lang="{{ GROCY_LOCALE }}">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible"
content="ie=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="noindex,nofollow">
<meta name="format-detection" content="telephone=no">
<meta name="robots"
content="noindex,nofollow">
<meta name="format-detection"
content="telephone=no">
<meta name="author" content="Bernd Bestel (bernd@berrnd.de)">
<meta name="author"
content="Bernd Bestel (bernd@berrnd.de)">
<link rel="apple-touch-icon" sizes="180x180" href="{{ $U('/img/appicons/apple-touch-icon.png?v=', true) }}{{ $version }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ $U('/img/appicons/favicon-32x32.png?v=', true) }}{{ $version }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ $U('/img/appicons/favicon-16x16.png?v=', true) }}{{ $version }}">
<link rel="manifest" href="{{ $U('/img/appicons/site.webmanifest?v=', true) }}{{ $version }}">
<link rel="mask-icon" href="{{ $U('/img/appicons/safari-pinned-tab.svg?v=', true) }}{{ $version }}" color="#0b024c">
<link rel="shortcut icon" href="{{ $U('/img/appicons/favicon.ico?v=', true) }}{{ $version }}">
<meta name="apple-mobile-web-app-title" content="grocy">
<meta name="application-name" content="grocy">
<meta name="msapplication-TileColor" content="#e5e5e5">
<meta name="msapplication-config" content="{{ $U('/img/appicons/browserconfig.xml?v=', true) }}{{ $version }}">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon"
sizes="180x180"
href="{{ $U('/img/appicons/apple-touch-icon.png?v=', true) }}{{ $version }}">
<link rel="icon"
type="image/png"
sizes="32x32"
href="{{ $U('/img/appicons/favicon-32x32.png?v=', true) }}{{ $version }}">
<link rel="icon"
type="image/png"
sizes="16x16"
href="{{ $U('/img/appicons/favicon-16x16.png?v=', true) }}{{ $version }}">
<link rel="manifest"
href="{{ $U('/img/appicons/site.webmanifest?v=', true) }}{{ $version }}">
<link rel="mask-icon"
href="{{ $U('/img/appicons/safari-pinned-tab.svg?v=', true) }}{{ $version }}"
color="#0b024c">
<link rel="shortcut icon"
href="{{ $U('/img/appicons/favicon.ico?v=', true) }}{{ $version }}">
<meta name="apple-mobile-web-app-title"
content="grocy">
<meta name="application-name"
content="grocy">
<meta name="msapplication-TileColor"
content="#e5e5e5">
<meta name="msapplication-config"
content="{{ $U('/img/appicons/browserconfig.xml?v=', true) }}{{ $version }}">
<meta name="theme-color"
content="#ffffff">
<title>@yield('title') | grocy</title>
<link href="{{ $U('/node_modules/bootstrap/dist/css/bootstrap.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/startbootstrap-sb-admin/css/sb-admin.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/@fortawesome/fontawesome-free/css/all.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/@danielfarrell/bootstrap-combobox/css/bootstrap-combobox.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/toastr/build/toastr.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/summernote/dist/summernote-bs4.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/bootstrap-select/dist/css/bootstrap-select.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/components_unmanaged/noto-sans-v9-latin/noto-sans-v9-latin.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/css/grocy.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/css/grocy_night_mode.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/bootstrap/dist/css/bootstrap.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/startbootstrap-sb-admin/css/sb-admin.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/@fortawesome/fontawesome-free/css/all.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/@danielfarrell/bootstrap-combobox/css/bootstrap-combobox.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/toastr/build/toastr.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/summernote/dist/summernote-bs4.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/bootstrap-select/dist/css/bootstrap-select.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/components_unmanaged/noto-sans-v9-latin/noto-sans-v9-latin.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/css/grocy.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/css/grocy_night_mode.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@stack('pageStyles')
@if(file_exists(GROCY_DATAPATH . '/custom_css.html'))
@@ -72,33 +110,53 @@
<body class="fixed-nav @if(boolval($userSettings['night_mode_enabled']) || (boolval($userSettings['auto_night_mode_enabled']) && boolval($userSettings['currently_inside_night_mode_range']))) night-mode @endif @if($embedded) embedded @endif">
@if(!($embedded))
<nav id="mainNav" class="navbar navbar-expand-lg navbar-light fixed-top">
<a class="navbar-brand py-0" href="{{ $U('/') }}"><img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}" height="30"></a>
<span id="clock-container" class="text-muted font-italic d-none">
<nav id="mainNav"
class="navbar navbar-expand-lg navbar-light fixed-top">
<a class="navbar-brand py-0"
href="{{ $U('/') }}"><img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}"
height="30"></a>
<span id="clock-container"
class="text-muted font-italic d-none">
<i class="far fa-clock"></i>
<span id="clock-small" class="d-inline d-sm-none"></span>
<span id="clock-big" class="d-none d-sm-inline"></span>
<span id="clock-small"
class="d-inline d-sm-none"></span>
<span id="clock-big"
class="d-none d-sm-inline"></span>
</span>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#sidebarResponsive">
<button class="navbar-toggler navbar-toggler-right"
type="button"
data-toggle="collapse"
data-target="#sidebarResponsive">
<span class="navbar-toggler-icon"></span>
</button>
@if(GROCY_AUTHENTICATED)
<div id="sidebarResponsive" class="collapse navbar-collapse">
<div id="sidebarResponsive"
class="collapse navbar-collapse">
<ul class="navbar-nav navbar-sidenav">
@if(GROCY_FEATURE_FLAG_STOCK)
<li class="nav-item nav-item-sidebar" data-toggle="tooltip" data-placement="right" title="{{ $__t('Stock overview') }}" data-nav-for-page="stockoverview">
<a class="nav-link discrete-link" href="{{ $U('/stockoverview') }}">
<li class="nav-item nav-item-sidebar"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Stock overview') }}"
data-nav-for-page="stockoverview">
<a class="nav-link discrete-link"
href="{{ $U('/stockoverview') }}">
<i class="fas fa-box"></i>
<span class="nav-link-text">{{ $__t('Stock overview') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST)
<li class="nav-item nav-item-sidebar" data-toggle="tooltip" data-placement="right" title="{{ $__t('Shopping list') }}" data-nav-for-page="shoppinglist">
<a class="nav-link discrete-link" href="{{ $U('/shoppinglist') }}">
<li class="nav-item nav-item-sidebar"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Shopping list') }}"
data-nav-for-page="shoppinglist">
<a class="nav-link discrete-link"
href="{{ $U('/shoppinglist') }}">
<i class="fas fa-shopping-cart"></i>
<span class="nav-link-text">{{ $__t('Shopping list') }}</span>
</a>
@@ -106,14 +164,24 @@
@endif
@if(GROCY_FEATURE_FLAG_RECIPES)
<div class="nav-item-divider"></div>
<li class="nav-item nav-item-sidebar permission-RECIPES" data-toggle="tooltip" data-placement="right" title="{{ $__t('Recipes') }}" data-nav-for-page="recipes">
<a class="nav-link discrete-link" href="{{ $U('/recipes') }}">
<li class="nav-item nav-item-sidebar permission-RECIPES"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Recipes') }}"
data-nav-for-page="recipes">
<a class="nav-link discrete-link"
href="{{ $U('/recipes') }}">
<i class="fas fa-cocktail"></i>
<span class="nav-link-text">{{ $__t('Recipes') }}</span>
</a>
</li>
<li class="nav-item nav-item-sidebar permission-RECIPES_MEALPLAN" data-toggle="tooltip" data-placement="right" title="{{ $__t('Meal plan') }}" data-nav-for-page="mealplan">
<a class="nav-link discrete-link" href="{{ $U('/mealplan') }}">
<li class="nav-item nav-item-sidebar permission-RECIPES_MEALPLAN"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Meal plan') }}"
data-nav-for-page="mealplan">
<a class="nav-link discrete-link"
href="{{ $U('/mealplan') }}">
<i class="fas fa-paper-plane"></i>
<span class="nav-link-text">{{ $__t('Meal plan') }}</span>
</a>
@@ -121,32 +189,52 @@
@endif
@if(GROCY_FEATURE_FLAG_CHORES)
<div class="nav-item-divider"></div>
<li class="nav-item nav-item-sidebar" data-toggle="tooltip" data-placement="right" title="{{ $__t('Chores overview') }}" data-nav-for-page="choresoverview">
<a class="nav-link discrete-link" href="{{ $U('/choresoverview') }}">
<li class="nav-item nav-item-sidebar"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Chores overview') }}"
data-nav-for-page="choresoverview">
<a class="nav-link discrete-link"
href="{{ $U('/choresoverview') }}">
<i class="fas fa-home"></i>
<span class="nav-link-text">{{ $__t('Chores overview') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_TASKS)
<li class="nav-item nav-item-sidebar" data-toggle="tooltip" data-placement="right" title="{{ $__t('Tasks') }}" data-nav-for-page="tasks">
<a class="nav-link discrete-link" href="{{ $U('/tasks') }}">
<li class="nav-item nav-item-sidebar"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Tasks') }}"
data-nav-for-page="tasks">
<a class="nav-link discrete-link"
href="{{ $U('/tasks') }}">
<i class="fas fa-tasks"></i>
<span class="nav-link-text">{{ $__t('Tasks') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_BATTERIES)
<li class="nav-item nav-item-sidebar" data-toggle="tooltip" data-placement="right" title="{{ $__t('Batteries overview') }}" data-nav-for-page="batteriesoverview">
<a class="nav-link discrete-link" href="{{ $U('/batteriesoverview') }}">
<li class="nav-item nav-item-sidebar"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Batteries overview') }}"
data-nav-for-page="batteriesoverview">
<a class="nav-link discrete-link"
href="{{ $U('/batteriesoverview') }}">
<i class="fas fa-battery-half"></i>
<span class="nav-link-text">{{ $__t('Batteries overview') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_EQUIPMENT)
<li class="nav-item nav-item-sidebar permission-EQUIPMENT" data-toggle="tooltip" data-placement="right" title="{{ $__t('Equipment') }}" data-nav-for-page="equipment">
<a class="nav-link discrete-link" href="{{ $U('/equipment') }}">
<li class="nav-item nav-item-sidebar permission-EQUIPMENT"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Equipment') }}"
data-nav-for-page="equipment">
<a class="nav-link discrete-link"
href="{{ $U('/equipment') }}">
<i class="fas fa-toolbox"></i>
<span class="nav-link-text">{{ $__t('Equipment') }}</span>
</a>
@@ -154,8 +242,13 @@
@endif
@if(GROCY_FEATURE_FLAG_CALENDAR)
<div class="nav-item-divider"></div>
<li class="nav-item nav-item-sidebar permission-CALENDAR" data-toggle="tooltip" data-placement="right" title="{{ $__t('Calendar') }}" data-nav-for-page="calendar">
<a class="nav-link discrete-link" href="{{ $U('/calendar') }}">
<li class="nav-item nav-item-sidebar permission-CALENDAR"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Calendar') }}"
data-nav-for-page="calendar">
<a class="nav-link discrete-link"
href="{{ $U('/calendar') }}">
<i class="fas fa-calendar-alt"></i>
<span class="nav-link-text">{{ $__t('Calendar') }}</span>
</a>
@@ -164,44 +257,74 @@
@if(GROCY_FEATURE_FLAG_STOCK)
<div class="nav-item-divider"></div>
<li class="nav-item nav-item-sidebar permission-STOCK_PURCHASE" data-toggle="tooltip" data-placement="right" title="{{ $__t('Purchase') }}" data-nav-for-page="purchase">
<a class="nav-link discrete-link" href="{{ $U('/purchase') }}">
<li class="nav-item nav-item-sidebar permission-STOCK_PURCHASE"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Purchase') }}"
data-nav-for-page="purchase">
<a class="nav-link discrete-link"
href="{{ $U('/purchase') }}">
<i class="fas fa-shopping-cart"></i>
<span class="nav-link-text">{{ $__t('Purchase') }}</span>
</a>
</li>
<li class="nav-item nav-item-sidebar permission-STOCK_CONSUME" data-toggle="tooltip" data-placement="right" title="{{ $__t('Consume') }}" data-nav-for-page="consume">
<a class="nav-link discrete-link" href="{{ $U('/consume') }}">
<li class="nav-item nav-item-sidebar permission-STOCK_CONSUME"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Consume') }}"
data-nav-for-page="consume">
<a class="nav-link discrete-link"
href="{{ $U('/consume') }}">
<i class="fas fa-utensils"></i>
<span class="nav-link-text">{{ $__t('Consume') }}</span>
</a>
</li>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<li class="nav-item nav-item-sidebar permission-STOCK_TRANSFER" data-toggle="tooltip" data-placement="right" title="{{ $__t('Transfer') }}" data-nav-for-page="transfer">
<a class="nav-link discrete-link" href="{{ $U('/transfer') }}">
<li class="nav-item nav-item-sidebar permission-STOCK_TRANSFER"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Transfer') }}"
data-nav-for-page="transfer">
<a class="nav-link discrete-link"
href="{{ $U('/transfer') }}">
<i class="fas fa-exchange-alt"></i>
<span class="nav-link-text">{{ $__t('Transfer') }}</span>
</a>
</li>
@endif
<li class="nav-item nav-item-sidebar permission-STOCK_INVENTORY" data-toggle="tooltip" data-placement="right" title="{{ $__t('Inventory') }}" data-nav-for-page="inventory">
<a class="nav-link discrete-link" href="{{ $U('/inventory') }}">
<li class="nav-item nav-item-sidebar permission-STOCK_INVENTORY"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Inventory') }}"
data-nav-for-page="inventory">
<a class="nav-link discrete-link"
href="{{ $U('/inventory') }}">
<i class="fas fa-list"></i>
<span class="nav-link-text">{{ $__t('Inventory') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_CHORES)
<li class="nav-item nav-item-sidebar permission-CHORE_TRACK_EXECUTION" data-toggle="tooltip" data-placement="right" title="{{ $__t('Chore tracking') }}" data-nav-for-page="choretracking">
<a class="nav-link discrete-link" href="{{ $U('/choretracking') }}">
<li class="nav-item nav-item-sidebar permission-CHORE_TRACK_EXECUTION"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Chore tracking') }}"
data-nav-for-page="choretracking">
<a class="nav-link discrete-link"
href="{{ $U('/choretracking') }}">
<i class="fas fa-play"></i>
<span class="nav-link-text">{{ $__t('Chore tracking') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_BATTERIES)
<li class="nav-item nav-item-sidebar permission-BATTERIES_TRACK_CHARGE_CYCLE" data-toggle="tooltip" data-placement="right" title="{{ $__t('Battery tracking') }}" data-nav-for-page="batterytracking">
<a class="nav-link discrete-link" href="{{ $U('/batterytracking') }}">
<li class="nav-item nav-item-sidebar permission-BATTERIES_TRACK_CHARGE_CYCLE"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Battery tracking') }}"
data-nav-for-page="batterytracking">
<a class="nav-link discrete-link"
href="{{ $U('/batterytracking') }}">
<i class="fas fa-fire"></i>
<span class="nav-link-text">{{ $__t('Battery tracking') }}</span>
</a>
@@ -213,8 +336,13 @@
@if($firstUserentity)
<div class="nav-item-divider"></div>
@endif
<li class="nav-item nav-item-sidebar" data-toggle="tooltip" data-placement="right" title="{{ $userentity->caption }}" data-nav-for-page="userentity-{{ $userentity->name }}">
<a class="nav-link discrete-link" href="{{ $U('/userobjects/' . $userentity->name) }}">
<li class="nav-item nav-item-sidebar"
data-toggle="tooltip"
data-placement="right"
title="{{ $userentity->caption }}"
data-nav-for-page="userentity-{{ $userentity->name }}">
<a class="nav-link discrete-link"
href="{{ $U('/userobjects/' . $userentity->name) }}">
<i class="{{ $userentity->icon_css_class }}"></i>
<span class="nav-link-text">{{ $userentity->caption }}</span>
</a>
@@ -223,80 +351,106 @@
@endforeach
<div class="nav-item-divider"></div>
<li class="nav-item nav-item-sidebar" data-toggle="tooltip" data-placement="right" title="{{ $__t('Manage master data') }}">
<a class="nav-link nav-link-collapse collapsed discrete-link" data-toggle="collapse" href="#top-nav-manager-master-data">
<li class="nav-item nav-item-sidebar"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Manage master data') }}">
<a class="nav-link nav-link-collapse collapsed discrete-link"
data-toggle="collapse"
href="#top-nav-manager-master-data">
<i class="fas fa-table"></i>
<span class="nav-link-text">{{ $__t('Manage master data') }}</span>
</a>
<ul id="top-nav-manager-master-data" class="sidenav-second-level collapse">
<ul id="top-nav-manager-master-data"
class="sidenav-second-level collapse">
@if(GROCY_FEATURE_FLAG_STOCK)
<li data-nav-for-page="products" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/products') }}">
<li data-nav-for-page="products"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/products') }}">
<i class="fab fa-product-hunt"></i>
<span class="nav-link-text">{{ $__t('Products') }}</span>
</a>
</li>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<li data-nav-for-page="locations" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/locations') }}">
<li data-nav-for-page="locations"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/locations') }}">
<i class="fas fa-map-marker-alt"></i>
<span class="nav-link-text">{{ $__t('Locations') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<li data-nav-for-page="shoppinglocations" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/shoppinglocations') }}">
<li data-nav-for-page="shoppinglocations"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/shoppinglocations') }}">
<i class="fas fa-shopping-cart"></i>
<span class="nav-link-text">{{ $__t('Stores') }}</span>
</a>
</li>
@endif
<li data-nav-for-page="quantityunits" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/quantityunits') }}">
<li data-nav-for-page="quantityunits"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/quantityunits') }}">
<i class="fas fa-balance-scale"></i>
<span class="nav-link-text">{{ $__t('Quantity units') }}</span>
</a>
</li>
<li data-nav-for-page="productgroups" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/productgroups') }}">
<li data-nav-for-page="productgroups"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/productgroups') }}">
<i class="fas fa-object-group"></i>
<span class="nav-link-text">{{ $__t('Product groups') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_CHORES)
<li data-nav-for-page="chores" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/chores') }}">
<li data-nav-for-page="chores"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/chores') }}">
<i class="fas fa-home"></i>
<span class="nav-link-text">{{ $__t('Chores') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_BATTERIES)
<li data-nav-for-page="batteries" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/batteries') }}">
<li data-nav-for-page="batteries"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/batteries') }}">
<i class="fas fa-battery-half"></i>
<span class="nav-link-text">{{ $__t('Batteries') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_TASKS)
<li data-nav-for-page="taskcategories" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/taskcategories') }}">
<li data-nav-for-page="taskcategories"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/taskcategories') }}">
<i class="fas fa-project-diagram "></i>
<span class="nav-link-text">{{ $__t('Task categories') }}</span>
</a>
</li>
@endif
<li data-nav-for-page="userfields" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/userfields') }}">
<li data-nav-for-page="userfields"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/userfields') }}">
<i class="fas fa-bookmark "></i>
<span class="nav-link-text">{{ $__t('Userfields') }}</span>
</a>
</li>
<li data-nav-for-page="userentities" data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link" href="{{ $U('/userentities') }}">
<li data-nav-for-page="userentities"
data-sub-menu-of="#top-nav-manager-master-data">
<a class="nav-link discrete-link"
href="{{ $U('/userentities') }}">
<i class="fas fa-bookmark "></i>
<span class="nav-link-text">{{ $__t('Userentities') }}</span>
</a>
@@ -307,7 +461,8 @@
<ul class="navbar-nav sidenav-toggler">
<li class="nav-item">
<a id="sidenavToggler" class="nav-link text-center">
<a id="sidenavToggler"
class="nav-link text-center">
<i class="fas fa-angle-left"></i>
</a>
</li>
@@ -316,33 +471,47 @@
<ul class="navbar-nav ml-auto">
@if(GROCY_AUTHENTICATED === true && !GROCY_IS_EMBEDDED_INSTALL && GROCY_SHOW_AUTH_VIEWS)
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle discrete-link" href="#" data-toggle="dropdown"><i class="fas fa-user"></i> {{ GROCY_USER_USERNAME }}</a>
<a class="nav-link dropdown-toggle discrete-link"
href="#"
data-toggle="dropdown"><i class="fas fa-user"></i> {{ GROCY_USER_USERNAME }}</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item logout-button discrete-link" href="{{ $U('/logout') }}"><i class="fas fa-sign-out-alt"></i>&nbsp;{{ $__t('Logout') }}</a>
<a class="dropdown-item logout-button discrete-link"
href="{{ $U('/logout') }}"><i class="fas fa-sign-out-alt"></i>&nbsp;{{ $__t('Logout') }}</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item logout-button discrete-link" href="{{ $U('/user/' . GROCY_USER_ID . '?changepw=true') }}"><i class="fas fa-key"></i>&nbsp;{{ $__t('Change password') }}</a>
<a class="dropdown-item logout-button discrete-link"
href="{{ $U('/user/' . GROCY_USER_ID . '?changepw=true') }}"><i class="fas fa-key"></i>&nbsp;{{ $__t('Change password') }}</a>
</div>
</li>
@endif
@if(GROCY_AUTHENTICATED === true)
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle discrete-link" href="#" data-toggle="dropdown"><i class="fas fa-sliders-h"></i> <span class="d-inline d-lg-none">{{ $__t('View settings') }}</span></a>
<a class="nav-link dropdown-toggle discrete-link"
href="#"
data-toggle="dropdown"><i class="fas fa-sliders-h"></i> <span class="d-inline d-lg-none">{{ $__t('View settings') }}</span></a>
<div class="dropdown-menu dropdown-menu-right">
<div class="dropdown-item">
<div class="form-check">
<input class="form-check-input user-setting-control" type="checkbox" id="auto-reload-enabled" data-setting-key="auto_reload_on_db_change">
<label class="form-check-label" for="auto-reload-enabled">
<input class="form-check-input user-setting-control"
type="checkbox"
id="auto-reload-enabled"
data-setting-key="auto_reload_on_db_change">
<label class="form-check-label"
for="auto-reload-enabled">
{{ $__t('Auto reload on external changes') }}
</label>
</div>
</div>
<div class="dropdown-item">
<div class="form-check">
<input class="form-check-input user-setting-control" type="checkbox" id="show-clock-in-header" data-setting-key="show_clock_in_header">
<label class="form-check-label" for="show-clock-in-header">
<input class="form-check-input user-setting-control"
type="checkbox"
id="show-clock-in-header"
data-setting-key="show_clock_in_header">
<label class="form-check-label"
for="show-clock-in-header">
{{ $__t('Show clock in header') }}
</label>
</div>
@@ -350,44 +519,77 @@
<div class="dropdown-divider"></div>
<div class="dropdown-item">
<div class="form-check">
<input class="form-check-input user-setting-control" type="checkbox" id="night-mode-enabled" data-setting-key="night_mode_enabled">
<label class="form-check-label" for="night-mode-enabled">
<input class="form-check-input user-setting-control"
type="checkbox"
id="night-mode-enabled"
data-setting-key="night_mode_enabled">
<label class="form-check-label"
for="night-mode-enabled">
{{ $__t('Enable night mode') }}
</label>
</div>
</div>
<div class="dropdown-item">
<div class="form-check">
<input class="form-check-input user-setting-control" type="checkbox" id="auto-night-mode-enabled" data-setting-key="auto_night_mode_enabled">
<label class="form-check-label" for="auto-night-mode-enabled">
<input class="form-check-input user-setting-control"
type="checkbox"
id="auto-night-mode-enabled"
data-setting-key="auto_night_mode_enabled">
<label class="form-check-label"
for="auto-night-mode-enabled">
{{ $__t('Auto enable in time range') }}
</label>
</div>
<div class="form-inline">
<input type="text" class="form-control my-1 user-setting-control" readonly id="auto-night-mode-time-range-from" placeholder="{{ $__t('From') }} ({{ $__t('in format') }} HH:mm)" data-setting-key="auto_night_mode_time_range_from">
<input type="text" class="form-control user-setting-control" readonly id="auto-night-mode-time-range-to" placeholder="{{ $__t('To') }} ({{ $__t('in format') }} HH:mm)" data-setting-key="auto_night_mode_time_range_to">
<input type="text"
class="form-control my-1 user-setting-control"
readonly
id="auto-night-mode-time-range-from"
placeholder="{{ $__t('From') }} ({{ $__t('in format') }} HH:mm)"
data-setting-key="auto_night_mode_time_range_from">
<input type="text"
class="form-control user-setting-control"
readonly
id="auto-night-mode-time-range-to"
placeholder="{{ $__t('To') }} ({{ $__t('in format') }} HH:mm)"
data-setting-key="auto_night_mode_time_range_to">
</div>
<div class="form-check mt-1">
<input class="form-check-input user-setting-control" type="checkbox" id="auto-night-mode-time-range-goes-over-midgnight" data-setting-key="auto_night_mode_time_range_goes_over_midnight">
<label class="form-check-label" for="auto-night-mode-time-range-goes-over-midgnight">
<input class="form-check-input user-setting-control"
type="checkbox"
id="auto-night-mode-time-range-goes-over-midgnight"
data-setting-key="auto_night_mode_time_range_goes_over_midnight">
<label class="form-check-label"
for="auto-night-mode-time-range-goes-over-midgnight">
{{ $__t('Time range goes over midnight') }}
</label>
</div>
<input class="form-check-input d-none user-setting-control" type="checkbox" id="currently-inside-night-mode-range" data-setting-key="currently_inside_night_mode_range">
<input class="form-check-input d-none user-setting-control"
type="checkbox"
id="currently-inside-night-mode-range"
data-setting-key="currently_inside_night_mode_range">
</div>
<div class="dropdown-divider"></div>
<div class="dropdown-item">
<div class="form-check">
<input class="form-check-input user-setting-control" type="checkbox" id="keep_screen_on" data-setting-key="keep_screen_on">
<label class="form-check-label" for="keep_screen_on">
<input class="form-check-input user-setting-control"
type="checkbox"
id="keep_screen_on"
data-setting-key="keep_screen_on">
<label class="form-check-label"
for="keep_screen_on">
{{ $__t('Keep screen on') }}
</label>
</div>
</div>
<div class="dropdown-item">
<div class="form-check">
<input class="form-check-input user-setting-control" type="checkbox" id="keep_screen_on_when_fullscreen_card" data-setting-key="keep_screen_on_when_fullscreen_card">
<label class="form-check-label" for="keep_screen_on_when_fullscreen_card">
<input class="form-check-input user-setting-control"
type="checkbox"
id="keep_screen_on_when_fullscreen_card"
data-setting-key="keep_screen_on_when_fullscreen_card">
<label class="form-check-label"
for="keep_screen_on_when_fullscreen_card">
{{ $__t('Keep screen on while displaying a "fullscreen-card"') }}
</label>
</div>
@@ -397,38 +599,54 @@
@endif
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle discrete-link" href="#" data-toggle="dropdown"><i class="fas fa-wrench"></i> <span class="d-inline d-lg-none">{{ $__t('Settings') }}</span></a>
<a class="nav-link dropdown-toggle discrete-link"
href="#"
data-toggle="dropdown"><i class="fas fa-wrench"></i> <span class="d-inline d-lg-none">{{ $__t('Settings') }}</span></a>
<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>
<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 permission-SHOPPINGLIST" href="{{ $U('/shoppinglistsettings') }}"><i class="fas fa-shopping-cart"></i>&nbsp;{{ $__t('Shopping list settings') }}</a>
<a class="dropdown-item discrete-link permission-SHOPPINGLIST"
href="{{ $U('/shoppinglistsettings') }}"><i class="fas fa-shopping-cart"></i>&nbsp;{{ $__t('Shopping list settings') }}</a>
@endif
@if(GROCY_FEATURE_FLAG_RECIPES)
<a class="dropdown-item discrete-link permission-RECIPES" href="{{ $U('/recipessettings') }}"><i class="fas fa-cocktail"></i>&nbsp;{{ $__t('Recipes settings') }}</a>
<a class="dropdown-item discrete-link permission-RECIPES"
href="{{ $U('/recipessettings') }}"><i class="fas fa-cocktail"></i>&nbsp;{{ $__t('Recipes settings') }}</a>
@endif
@if(GROCY_FEATURE_FLAG_CHORES)
<a class="dropdown-item discrete-link permission-CHORES" href="{{ $U('/choressettings') }}"><i class="fas fa-home"></i>&nbsp;{{ $__t('Chores settings') }}</a>
<a class="dropdown-item discrete-link permission-CHORES"
href="{{ $U('/choressettings') }}"><i class="fas fa-home"></i>&nbsp;{{ $__t('Chores settings') }}</a>
@endif
@if(GROCY_FEATURE_FLAG_BATTERIES)
<a class="dropdown-item discrete-link permission-BATTERIES" href="{{ $U('/batteriessettings') }}"><i class="fas fa-battery-half"></i>&nbsp;{{ $__t('Batteries settings') }}</a>
<a class="dropdown-item discrete-link permission-BATTERIES"
href="{{ $U('/batteriessettings') }}"><i class="fas fa-battery-half"></i>&nbsp;{{ $__t('Batteries settings') }}</a>
@endif
@if(GROCY_FEATURE_FLAG_TASKS)
<a class="dropdown-item discrete-link permission-TASKS" href="{{ $U('/taskssettings') }}"><i class="fas fa-tasks"></i>&nbsp;{{ $__t('Tasks settings') }}</a>
<a class="dropdown-item discrete-link permission-TASKS"
href="{{ $U('/taskssettings') }}"><i class="fas fa-tasks"></i>&nbsp;{{ $__t('Tasks settings') }}</a>
@endif
<a data-href="{{ $U('/usersettings') }}" class="dropdown-item discrete-link link-return">
<a data-href="{{ $U('/usersettings') }}"
class="dropdown-item discrete-link link-return">
<i class="fas fa-user-cog"></i> {{ $__t('User settings') }}
</a>
<div class="dropdown-divider"></div>
@if(GROCY_SHOW_AUTH_VIEWS)
<a class="dropdown-item discrete-link permission-USERS_READ" href="{{ $U('/users') }}"><i class="fas fa-users"></i>&nbsp;{{ $__t('Manage users') }}</a>
<a class="dropdown-item discrete-link permission-USERS_READ"
href="{{ $U('/users') }}"><i class="fas fa-users"></i>&nbsp;{{ $__t('Manage users') }}</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item discrete-link" href="{{ $U('/manageapikeys') }}"><i class="fas fa-handshake"></i>&nbsp;{{ $__t('Manage API keys') }}</a>
<a class="dropdown-item discrete-link"
href="{{ $U('/manageapikeys') }}"><i class="fas fa-handshake"></i>&nbsp;{{ $__t('Manage API keys') }}</a>
@endif
<a class="dropdown-item discrete-link" target="_blank" href="{{ $U('/api') }}"><i class="fas fa-book"></i>&nbsp;{{ $__t('REST API & data model documentation') }}</a>
<a class="dropdown-item discrete-link" href="{{ $U('/barcodescannertesting') }}"><i class="fas fa-barcode"></i>&nbsp;{{ $__t('Barcode scanner testing') }}</a>
<a class="dropdown-item discrete-link"
target="_blank"
href="{{ $U('/api') }}"><i class="fas fa-book"></i>&nbsp;{{ $__t('REST API & data model documentation') }}</a>
<a class="dropdown-item discrete-link"
href="{{ $U('/barcodescannertesting') }}"><i class="fas fa-barcode"></i>&nbsp;{{ $__t('Barcode scanner testing') }}</a>
<div class="dropdown-divider"></div>
<a id="about-dialog-link" class="dropdown-item discrete-link" href="#"><i class="fas fa-info fa-fw"></i>&nbsp;{{ $__t('About grocy') }} (Version {{ $version }})</a>
<a id="about-dialog-link"
class="dropdown-item discrete-link"
href="#"><i class="fas fa-info fa-fw"></i>&nbsp;{{ $__t('About grocy') }} (Version {{ $version }})</a>
</div>
</li>
</ul>
@@ -439,7 +657,8 @@
<div class="content-wrapper pt-0">
<div class="container-fluid pr-1 pl-md-3 pl-1">
<div class="row mb-3">
<div id="page-content" class="col content-text">
<div id="page-content"
class="col content-text">
@yield('content')
</div>
</div>

View File

@@ -5,8 +5,7 @@
@push('pageStyles')
<style>
@media print
{
@media print {
.page:not(:last-child) {
page-break-after: always !important;
}
@@ -24,13 +23,15 @@
display: inline !important;
}
}
</style>
@endpush
@section('content')
<h1 class="d-print-none">
@yield('title')
<a class="btn btn-outline-dark responsive-button print-all-locations-button" href="#">
<a class="btn btn-outline-dark responsive-button print-all-locations-button"
href="#">
<i class="fas fa-print"></i> {{ $__t('Print') . ' (' . $__t('all locations') . ')' }}
</a>
</h1>
@@ -41,9 +42,12 @@
@foreach($locations as $location)
<div class="page">
<h1 class="text-center">
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}" height="30" class="d-none d-print-flex mx-auto">
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}"
height="30"
class="d-none d-print-flex mx-auto">
{{ $location->name }}
<a class="btn btn-outline-dark responsive-button print-single-location-button d-print-none" href="#">
<a class="btn btn-outline-dark responsive-button print-single-location-button d-print-none"
href="#">
<i class="fas fa-print"></i> {{ $__t('Print') . ' (' . $__t('this location') . ')' }}
</a>
</h1>

View File

@@ -17,37 +17,57 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $location->id }};</script>
<script>
Grocy.EditObjectId = {{ $location->id }};
</script>
@endif
<form id="location-form" novalidate>
<form id="location-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $location->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $location->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $location->description }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="description"
name="description">@if($mode == 'edit'){{ $location->description }}@endif</textarea>
</div>
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_FREEZING)
<div class="form-group">
<div class="form-check">
<input type="hidden" name="is_freezer" value="0">
<input @if($mode == 'edit' && $location->is_freezer == 1) checked @endif class="form-check-input" type="checkbox" id="is_freezer" name="is_freezer" value="1">
<label class="form-check-label" for="is_freezer">{{ $__t('Is freezer') }}
<input type="hidden"
name="is_freezer"
value="0">
<input @if($mode=='edit'
&&
$location->is_freezer == 1) checked @endif class="form-check-input" type="checkbox" id="is_freezer" name="is_freezer" value="1">
<label class="form-check-label"
for="is_freezer">{{ $__t('Is freezer') }}
<span class="text-muted small">{{ $__t('When moving products from/to a freezer location, the products best before date is automatically adjusted according to the product settings') }}</span>
</label>
</div>
</div>
@else
<input type="hidden" name="is_freezer" value="0">
<input type="hidden"
name="is_freezer"
value="0">
@endif
@include('components.userfieldsform', array(
@@ -55,7 +75,8 @@
'entity' => 'locations'
))
<button id="save-location-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-location-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -10,7 +10,8 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary" href="{{ $U('/userfields?entity=locations') }}">
<a class="btn btn-outline-secondary"
href="{{ $U('/userfields?entity=locations') }}">
{{ $__t('Configure userfields') }}
</a>
</div>
@@ -20,7 +21,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/location/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/location/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -31,14 +33,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="locations-table" class="table table-sm table-striped dt-responsive">
<table id="locations-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -55,10 +61,14 @@
@foreach($locations as $location)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/location/') }}{{ $location->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/location/') }}{{ $location->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm location-delete-button" href="#" data-location-id="{{ $location->id }}" data-location-name="{{ $location->name }}">
<a class="btn btn-danger btn-sm location-delete-button"
href="#"
data-location-id="{{ $location->id }}"
data-location-name="{{ $location->name }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -8,27 +8,42 @@
<div class="col-lg-6 offset-lg-3 col-xs-12">
<h2 class="text-center">@yield('title')</h2>
<hr>
<form method="post" action="{{ $U('/login') }}" id="login-form" novalidate>
<form method="post"
action="{{ $U('/login') }}"
id="login-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Username') }}</label>
<input type="text" class="form-control" required id="username" name="username">
<input type="text"
class="form-control"
required
id="username"
name="username">
</div>
<div class="form-group">
<label for="name">{{ $__t('Password') }}</label>
<input type="password" class="form-control" required id="password" name="password">
<div id="login-error" class="form-text text-danger d-none"></div>
<input type="password"
class="form-control"
required
id="password"
name="password">
<div id="login-error"
class="form-text text-danger d-none"></div>
</div>
<div class="checkbox">
<label for="stay_logged_in">
<input type="checkbox" id="stay_logged_in" name="stay_logged_in"> {{ $__t('Stay logged in permanently') }}
<input type="checkbox"
id="stay_logged_in"
name="stay_logged_in"> {{ $__t('Stay logged in permanently') }}
<p class="form-text text-muted small my-0">{{ $__t('When not set, you will get logged out at latest after 30 days') }}</p>
</label>
</div>
<button id="login-button" class="btn btn-success">{{ $__t('OK') }}</button>
<button id="login-button"
class="btn btn-success">{{ $__t('OK') }}</button>
</form>
</div>

View File

@@ -5,7 +5,8 @@
@section('viewJsName', 'manageapikeys')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -17,7 +18,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/manageapikeys/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/manageapikeys/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -28,14 +30,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="apikeys-table" class="table table-sm table-striped dt-responsive">
<table id="apikeys-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -51,7 +57,10 @@
@foreach($apiKeys as $apiKey)
<tr id="apiKeyRow_{{ $apiKey->id }}">
<td class="fit-content border-right">
<a class="btn btn-danger btn-sm apikey-delete-button" href="#" data-apikey-id="{{ $apiKey->id }}" data-apikey-apikey="{{ $apiKey->api_key }}">
<a class="btn btn-danger btn-sm apikey-delete-button"
href="#"
data-apikey-id="{{ $apiKey->id }}"
data-apikey-apikey="{{ $apiKey->api_key }}">
<i class="fas fa-trash"></i>
</a>
</td>
@@ -63,15 +72,18 @@
</td>
<td>
{{ $apiKey->expires }}
<time class="timeago timeago-contextual" datetime="{{ $apiKey->expires }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $apiKey->expires }}"></time>
</td>
<td>
@if(empty($apiKey->last_used)){{ $__t('never') }}@else{{ $apiKey->last_used }}@endif
<time class="timeago timeago-contextual" datetime="{{ $apiKey->last_used }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $apiKey->last_used }}"></time>
</td>
<td>
{{ $apiKey->row_created_timestamp }}
<time class="timeago timeago-contextual" datetime="{{ $apiKey->row_created_timestamp }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $apiKey->row_created_timestamp }}"></time>
</td>
<td>
{{ $apiKey->key_type }}

View File

@@ -10,7 +10,8 @@
@endpush
@push('pageStyles')
<link href="{{ $U('/node_modules/fullcalendar/dist/fullcalendar.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/fullcalendar/dist/fullcalendar.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -38,14 +39,18 @@
</div>
</div>
<div class="modal fade" id="add-recipe-modal" tabindex="-1">
<div class="modal fade"
id="add-recipe-modal"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 id="add-recipe-modal-title" class="modal-title w-100"></h4>
<h4 id="add-recipe-modal-title"
class="modal-title w-100"></h4>
</div>
<div class="modal-body">
<form id="add-recipe-form" novalidate>
<form id="add-recipe-form"
novalidate>
@include('components.recipepicker', array(
'recipes' => $recipes,
@@ -61,53 +66,79 @@
'invalidFeedback' => $__t('This cannot be lower than %s', '1')
))
<input type="hidden" id="day" name="day" value="">
<input type="hidden" name="type" value="recipe">
<input type="hidden"
id="day"
name="day"
value="">
<input type="hidden"
name="type"
value="recipe">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="save-add-recipe-button" data-dismiss="modal" class="btn btn-success">{{ $__t('Save') }}</button>
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="save-add-recipe-button"
data-dismiss="modal"
class="btn btn-success">{{ $__t('Save') }}</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="add-note-modal" tabindex="-1">
<div class="modal fade"
id="add-note-modal"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 id="add-note-modal-title" class="modal-title w-100"></h4>
<h4 id="add-note-modal-title"
class="modal-title w-100"></h4>
</div>
<div class="modal-body">
<form id="add-note-form" novalidate>
<form id="add-note-form"
novalidate>
<div class="form-group">
<label for="note">{{ $__t('Note') }}</label>
<textarea class="form-control" rows="2" id="note" name="note"></textarea>
<textarea class="form-control"
rows="2"
id="note"
name="note"></textarea>
</div>
<input type="hidden" name="type" value="note">
<input type="hidden"
name="type"
value="note">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="save-add-note-button" data-dismiss="modal" class="btn btn-success">{{ $__t('Save') }}</button>
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="save-add-note-button"
data-dismiss="modal"
class="btn btn-success">{{ $__t('Save') }}</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="add-product-modal" tabindex="-1">
<div class="modal fade"
id="add-product-modal"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 id="add-product-modal-title" class="modal-title w-100"></h4>
<h4 id="add-product-modal-title"
class="modal-title w-100"></h4>
</div>
<div class="modal-body">
<form id="add-product-form" novalidate>
<form id="add-product-form"
novalidate>
@include('components.productpicker', array(
'products' => $products,
@@ -119,13 +150,19 @@
'additionalGroupCssClasses' => 'mb-0'
))
<input type="hidden" name="type" value="product">
<input type="hidden"
name="type"
value="product">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="save-add-product-button" data-dismiss="modal" class="btn btn-success">{{ $__t('Save') }}</button>
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="save-add-product-button"
data-dismiss="modal"
class="btn btn-success">{{ $__t('Save') }}</button>
</div>
</div>
</div>

View File

@@ -1,19 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible"
content="ie=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="noindex,nofollow">
<meta name="format-detection" content="telephone=no">
<meta name="robots"
content="noindex,nofollow">
<meta name="format-detection"
content="telephone=no">
<meta name="author" content="Bernd Bestel (bernd@berrnd.de)">
<link rel="icon" href="{{ $U('/img/grocy_icon.svg?v=', true) }}{{ $version }}">
<meta name="author"
content="Bernd Bestel (bernd@berrnd.de)">
<link rel="icon"
href="{{ $U('/img/grocy_icon.svg?v=', true) }}{{ $version }}">
<title>{{ $__t('REST API & data model documentation') }} | grocy</title>
<link href="{{ $U('/node_modules/swagger-ui-dist/swagger-ui.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/swagger-ui-dist/swagger-ui.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@if(file_exists(GROCY_DATAPATH . '/custom_css.html'))
@php include GROCY_DATAPATH . '/custom_css.html' @endphp
@@ -45,6 +53,7 @@
-webkit-box-shadow: none !important;
border-bottom: 1px solid rgba(59, 65, 81, 0.3) !important;
}
</style>
</head>
@@ -60,4 +69,5 @@
@php include GROCY_DATAPATH . '/custom_js.html' @endphp
@endif
</body>
</html>

View File

@@ -20,20 +20,33 @@
<h3 class="text-muted">{{ $__t('Barcode for product') }} <strong>{{ $product->name }}</strong></h3>
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $barcode->id }};</script>
<script>
Grocy.EditObjectId = {{ $barcode->id }};
</script>
@endif
<form id="barcode-form" novalidate>
<form id="barcode-form"
novalidate>
<input type="hidden" name="product_id" value="{{ $product->id }}">
<input type="hidden"
name="product_id"
value="{{ $product->id }}">
<div class="form-group">
<label for="name">{{ $__t('Barcode') }}<i class="fas fa-barcode"></i></label>
<div class="input-group">
<input type="text" class="form-control barcodescanner-input" required id="barcode" name="barcode" value="@if($mode == 'edit'){{ $barcode->barcode }}@endif" data-target="#scanned_barcode">
<input type="text"
class="form-control barcodescanner-input"
required
id="barcode"
name="barcode"
value="@if($mode == 'edit'){{ $barcode->barcode }}@endif"
data-target="#scanned_barcode">
@include('components.barcodescanner')
</div>
</div>
@@ -52,18 +65,26 @@
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<div class="form-group">
<label for="shopping_location_id_id">{{ $__t('Default store') }}</label>
<select class="form-control" id="shopping_location_id" name="shopping_location_id">
<select class="form-control"
id="shopping_location_id"
name="shopping_location_id">
<option></option>
@foreach($shoppinglocations as $store)
<option @if($mode == 'edit' && $store->id == $product->shopping_location_id) selected="selected" @endif value="{{ $store->id }}">{{ $store->name }}</option>
<option @if($mode=='edit'
&&
$store->id == $product->shopping_location_id) selected="selected" @endif value="{{ $store->id }}">{{ $store->name }}</option>
@endforeach
</select>
</div>
@else
<input type="hidden" name="shopping_location_id" id="shopping_location_id" value="1">
<input type="hidden"
name="shopping_location_id"
id="shopping_location_id"
value="1">
@endif
<button id="save-barcode-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-barcode-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -15,8 +15,10 @@
@endpush
@push('pageStyles')
<link href="{{ $U('/node_modules/TagManager/tagmanager.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/TagManager/tagmanager.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -28,29 +30,49 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $product->id }};</script>
<script>
Grocy.EditObjectId = {{ $product->id }};
</script>
@if(!empty($product->picture_file_name))
<script>Grocy.ProductPictureFileName = '{{ $product->picture_file_name }}';</script>
<script>
Grocy.ProductPictureFileName = '{{ $product->picture_file_name }}';
</script>
@endif
@endif
<form id="product-form" novalidate>
<form id="product-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $product->name}}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $product->name}}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<div class="form-check">
<input type="hidden" name="active" value="1">
<input @if($mode == 'create') checked @elseif($mode == 'edit' && $product->active == 1) checked @endif class="form-check-input" type="checkbox" id="active" name="active" value="1">
<label class="form-check-label" for="active">{{ $__t('Active') }}</label>
<input type="hidden"
name="active"
value="1">
<input @if($mode=='create'
)
checked
@elseif($mode=='edit'
&&
$product->active == 1) checked @endif class="form-check-input" type="checkbox" id="active" name="active" value="1">
<label class="form-check-label"
for="active">{{ $__t('Active') }}</label>
</div>
</div>
@@ -74,22 +96,32 @@
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control wysiwyg-editor" id="description" name="description">@if($mode == 'edit'){{ $product->description }}@endif</textarea>
<textarea class="form-control wysiwyg-editor"
id="description"
name="description">@if($mode == 'edit'){{ $product->description }}@endif</textarea>
</div>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<div class="form-group">
<label for="location_id">{{ $__t('Default location') }}</label>
<select required class="form-control" id="location_id" name="location_id">
<select required
class="form-control"
id="location_id"
name="location_id">
<option></option>
@foreach($locations as $location)
<option @if($mode == 'edit' && $location->id == $product->location_id) selected="selected" @endif value="{{ $location->id }}">{{ $location->name }}</option>
<option @if($mode=='edit'
&&
$location->id == $product->location_id) selected="selected" @endif value="{{ $location->id }}">{{ $location->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A location is required') }}</div>
</div>
@else
<input type="hidden" name="location_id" id="location_id" value="1">
<input type="hidden"
name="location_id"
id="location_id"
value="1">
@endif
@php $prefillById = ''; if($mode=='edit') { $prefillById = $product->shopping_location_id; } @endphp
@@ -100,7 +132,10 @@
'shoppinglocations' => $shoppinglocations
))
@else
<input type="hidden" name="shopping_location_id" id="shopping_location_id" value="1">
<input type="hidden"
name="shopping_location_id"
id="shopping_location_id"
value="1">
@endif
@php if($mode == 'edit') { $value = $product->min_stock_amount; } else { $value = 0; } @endphp
@@ -115,9 +150,14 @@
<div class="form-group">
<div class="form-check">
<input type="hidden" name="cumulate_min_stock_amount_of_sub_products" value="0">
<input @if($mode == 'edit' && $product->cumulate_min_stock_amount_of_sub_products == 1) checked @endif class="form-check-input" type="checkbox" id="cumulate_min_stock_amount_of_sub_products" name="cumulate_min_stock_amount_of_sub_products" value="1">
<label class="form-check-label" for="cumulate_min_stock_amount_of_sub_products">{{ $__t('Accumulate sub products min. stock amount') }}
<input type="hidden"
name="cumulate_min_stock_amount_of_sub_products"
value="0">
<input @if($mode=='edit'
&&
$product->cumulate_min_stock_amount_of_sub_products == 1) checked @endif class="form-check-input" type="checkbox" id="cumulate_min_stock_amount_of_sub_products" name="cumulate_min_stock_amount_of_sub_products" value="1">
<label class="form-check-label"
for="cumulate_min_stock_amount_of_sub_products">{{ $__t('Accumulate sub products min. stock amount') }}
<span class="text-muted small">{{ $__t('If enabled, the min. stock amount of sub products will be accumulated into this product, means the sub product will never be "missing", only this product') }}</span>
</label>
</div>
@@ -149,20 +189,29 @@
<div class="form-group">
<label for="product_group_id">{{ $__t('Product group') }}</label>
<select class="form-control" id="product_group_id" name="product_group_id">
<select class="form-control"
id="product_group_id"
name="product_group_id">
<option></option>
@foreach($productgroups as $productgroup)
<option @if($mode == 'edit' && $productgroup->id == $product->product_group_id) selected="selected" @endif value="{{ $productgroup->id }}">{{ $productgroup->name }}</option>
<option @if($mode=='edit'
&&
$productgroup->id == $product->product_group_id) selected="selected" @endif value="{{ $productgroup->id }}">{{ $productgroup->name }}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="qu_id_purchase">{{ $__t('Quantity unit purchase') }}</label>
<select required class="form-control input-group-qu" id="qu_id_purchase" name="qu_id_purchase">
<select required
class="form-control input-group-qu"
id="qu_id_purchase"
name="qu_id_purchase">
<option></option>
@foreach($quantityunits as $quantityunit)
<option @if($mode == 'edit' && $quantityunit->id == $product->qu_id_purchase) selected="selected" @endif value="{{ $quantityunit->id }}">{{ $quantityunit->name }}</option>
<option @if($mode=='edit'
&&
$quantityunit->id == $product->qu_id_purchase) selected="selected" @endif value="{{ $quantityunit->id }}">{{ $quantityunit->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A quantity unit is required') }}</div>
@@ -170,11 +219,22 @@
<div class="form-group">
<label for="qu_id_stock">{{ $__t('Quantity unit stock') }}</label>
<i class="fas fa-question-circle" data-toggle="tooltip" title="{{ $__t('Quantity unit stock cannot be changed after first purchase') }}"></i>
<select required class="form-control input-group-qu" id="qu_id_stock" name="qu_id_stock" @if($mode == 'edit') disabled @endif>
<i class="fas fa-question-circle"
data-toggle="tooltip"
title="{{ $__t('Quantity unit stock cannot be changed after first purchase') }}"></i>
<select required
class="form-control input-group-qu"
id="qu_id_stock"
name="qu_id_stock"
@if($mode=='edit'
)
disabled
@endif>
<option></option>
@foreach($quantityunits as $quantityunit)
<option @if($mode == 'edit' && $quantityunit->id == $product->qu_id_stock) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
<option @if($mode=='edit'
&&
$quantityunit->id == $product->qu_id_stock) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A quantity unit is required') }}</div>
@@ -188,22 +248,33 @@
'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalCssClasses' => 'input-group-qu',
'additionalHtmlElements' => '<p id="qu-conversion-info" class="form-text text-muted small d-none"></p>'
'additionalHtmlElements' => '<p id="qu-conversion-info"
class="form-text text-muted small d-none"></p>'
))
<div class="form-group">
<div class="form-check">
<input type="hidden" name="allow_partial_units_in_stock" value="0">
<input @if($mode == 'edit' && $product->allow_partial_units_in_stock == 1) checked @endif class="form-check-input" type="checkbox" id="allow_partial_units_in_stock" name="allow_partial_units_in_stock" value="1">
<label class="form-check-label" for="allow_partial_units_in_stock">{{ $__t('Allow partial units in stock') }}</label>
<input type="hidden"
name="allow_partial_units_in_stock"
value="0">
<input @if($mode=='edit'
&&
$product->allow_partial_units_in_stock == 1) checked @endif class="form-check-input" type="checkbox" id="allow_partial_units_in_stock" name="allow_partial_units_in_stock" value="1">
<label class="form-check-label"
for="allow_partial_units_in_stock">{{ $__t('Allow partial units in stock') }}</label>
</div>
</div>
<div class="form-group mb-1">
<div class="form-check">
<input type="hidden" name="enable_tare_weight_handling" value="0">
<input @if($mode == 'edit' && $product->enable_tare_weight_handling == 1) checked @endif class="form-check-input" type="checkbox" id="enable_tare_weight_handling" name="enable_tare_weight_handling" value="1">
<label class="form-check-label" for="enable_tare_weight_handling">{{ $__t('Enable tare weight handling') }}
<input type="hidden"
name="enable_tare_weight_handling"
value="0">
<input @if($mode=='edit'
&&
$product->enable_tare_weight_handling == 1) checked @endif class="form-check-input" type="checkbox" id="enable_tare_weight_handling" name="enable_tare_weight_handling" value="1">
<label class="form-check-label"
for="enable_tare_weight_handling">{{ $__t('Enable tare weight handling') }}
<span class="text-muted small">{{ $__t('This is useful e.g. for flour in jars - on purchase/consume/inventory you always weigh the whole jar, the amount to be posted is then automatically calculated based on what is in stock and the tare weight defined below') }}</span>
</label>
</div>
@@ -226,9 +297,14 @@
@if(GROCY_FEATURE_FLAG_RECIPES)
<div class="form-group">
<div class="form-check">
<input type="hidden" name="not_check_stock_fulfillment_for_recipes" value="0">
<input @if($mode == 'edit' && $product->not_check_stock_fulfillment_for_recipes == 1) checked @endif class="form-check-input" type="checkbox" id="not_check_stock_fulfillment_for_recipes" name="not_check_stock_fulfillment_for_recipes" value="1">
<label class="form-check-label" for="not_check_stock_fulfillment_for_recipes">{{ $__t('Disable stock fulfillment checking for this ingredient') }}
<input type="hidden"
name="not_check_stock_fulfillment_for_recipes"
value="0">
<input @if($mode=='edit'
&&
$product->not_check_stock_fulfillment_for_recipes == 1) checked @endif class="form-check-input" type="checkbox" id="not_check_stock_fulfillment_for_recipes" name="not_check_stock_fulfillment_for_recipes" value="1">
<label class="form-check-label"
for="not_check_stock_fulfillment_for_recipes">{{ $__t('Disable stock fulfillment checking for this ingredient') }}
<span class="text-muted small">{{ $__t('This will be used as the default setting when adding this product as a recipe ingredient') }}</span>
</label>
</div>
@@ -268,8 +344,12 @@
'hint' => $__t('On moving this product from a freezer location (so when thawing it), the best before date will be replaced by today + this amount of days')
))
@else
<input type="hidden" name="default_best_before_days_after_freezing" value="0">
<input type="hidden" name="default_best_before_days_after_thawing" value="0">
<input type="hidden"
name="default_best_before_days_after_freezing"
value="0">
<input type="hidden"
name="default_best_before_days_after_thawing"
value="0">
@endif
<div class="form-group">
@@ -277,8 +357,12 @@
<span class="text-muted small">{{ $__t('If you don\'t select a file, the current picture will not be altered') }}</span>
</label>
<div class="custom-file">
<input type="file" class="custom-file-input" id="product-picture" accept="image/*">
<label class="custom-file-label" for="product-picture">{{ $__t('No file selected') }}</label>
<input type="file"
class="custom-file-input"
id="product-picture"
accept="image/*">
<label class="custom-file-label"
for="product-picture">{{ $__t('No file selected') }}</label>
</div>
</div>
@@ -287,7 +371,8 @@
'entity' => 'products'
))
<button id="save-product-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-product-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>
@@ -295,12 +380,16 @@
<div class="col-lg-6 col-xs-12">
<h2>
{{ $__t('QU conversions') }}
<a class="btn btn-outline-dark show-as-dialog-link" type="button" href="{{ $U('/quantityunitconversion/new?embedded&product=' . $product->id ) }}">
<a class="btn btn-outline-dark show-as-dialog-link"
type="button"
href="{{ $U('/quantityunitconversion/new?embedded&product=' . $product->id ) }}">
<i class="fas fa-plus"></i> {{ $__t('Add') }}
</a>
</h2>
<h5 id="qu-conversion-headline-info" class="text-muted font-italic"></h5>
<table id="qu-conversions-table" class="table table-sm table-striped dt-responsive">
<h5 id="qu-conversion-headline-info"
class="text-muted font-italic"></h5>
<table id="qu-conversions-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -316,10 +405,13 @@
@if($quConversion->product_id == $product->id || $quConversion->product_id == null)
<tr>
<td class="fit-content border-right">
<a class="btn btn-sm btn-info show-as-dialog-link @if($quConversion->product_id == null) disabled @endif" href="{{ $U('/quantityunitconversion/' . $quConversion->id . '?embedded&product=' . $product->id ) }}">
<a class="btn btn-sm btn-info show-as-dialog-link @if($quConversion->product_id == null) disabled @endif"
href="{{ $U('/quantityunitconversion/' . $quConversion->id . '?embedded&product=' . $product->id ) }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger qu-conversion-delete-button @if($quConversion->product_id == null) disabled @endif" href="#" data-qu-conversion-id="{{ $quConversion->id }}">
<a class="btn btn-sm btn-danger qu-conversion-delete-button @if($quConversion->product_id == null) disabled @endif"
href="#"
data-qu-conversion-id="{{ $quConversion->id }}">
<i class="fas fa-trash"></i>
</a>
</td>
@@ -348,12 +440,16 @@
<h2>
{{ $__t('Barcodes') }}
<a class="btn btn-outline-dark show-as-dialog-link" type="button" href="{{ $U('/productbarcodes/new?embedded&product=' . $product->id ) }}">
<a class="btn btn-outline-dark show-as-dialog-link"
type="button"
href="{{ $U('/productbarcodes/new?embedded&product=' . $product->id ) }}">
<i class="fas fa-plus"></i> {{ $__t('Add') }}
</a>
</h2>
<h5 id="barcode-headline-info" class="text-muted font-italic"></h5>
<table id="barcode-table" class="table table-sm table-striped dt-responsive">
<h5 id="barcode-headline-info"
class="text-muted font-italic"></h5>
<table id="barcode-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -368,10 +464,16 @@
@if($barcode->product_id == $product->id || $barcode->product_id == null)
<tr>
<td class="fit-content border-right">
<a class="btn btn-sm btn-info show-as-dialog-link @if($barcode->product_id == null) disabled @endif" href="{{ $U('/productbarcodes/' . $barcode->id . '?embedded&product=' . $product->id ) }}">
<a class="btn btn-sm btn-info show-as-dialog-link @if($barcode->product_id == null) disabled @endif"
href="{{ $U('/productbarcodes/' . $barcode->id . '?embedded&product=' . $product->id ) }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger barcode-delete-button @if($barcode->product_id == null) disabled @endif" href="#" data-barcode-id="{{ $barcode->id }}" data-barcode="{{ $barcode->barcode }}" data-product-barcode="{{ $product->barcode }}" data-product-id="{{ $product->id }}">
<a class="btn btn-sm btn-danger barcode-delete-button @if($barcode->product_id == null) disabled @endif"
href="#"
data-barcode-id="{{ $barcode->id }}"
data-barcode="{{ $barcode->barcode }}"
data-product-barcode="{{ $product->barcode }}"
data-product-id="{{ $product->id }}">
<i class="fas fa-trash"></i>
</a>
</td>
@@ -397,12 +499,17 @@
<div class="pt-5">
<label class="mt-2">{{ $__t('Picture') }}</label>
<button id="delete-current-product-picture-button" class="btn btn-sm btn-danger @if(empty($product->picture_file_name)) disabled @endif"><i class="fas fa-trash"></i> {{ $__t('Delete') }}</button>
<button id="delete-current-product-picture-button"
class="btn btn-sm btn-danger @if(empty($product->picture_file_name)) disabled @endif"><i class="fas fa-trash"></i> {{ $__t('Delete') }}</button>
@if(!empty($product->picture_file_name))
<p><img id="current-product-picture" data-src="{{ $U('/api/files/productpictures/' . base64_encode($product->picture_file_name) . '?force_serve_as=picture&best_fit_width=400') }}" class="img-fluid img-thumbnail mt-2 lazy"></p>
<p id="delete-current-product-picture-on-save-hint" class="form-text text-muted font-italic d-none">{{ $__t('The current picture will be deleted when you save the product') }}</p>
<p><img id="current-product-picture"
data-src="{{ $U('/api/files/productpictures/' . base64_encode($product->picture_file_name) . '?force_serve_as=picture&best_fit_width=400') }}"
class="img-fluid img-thumbnail mt-2 lazy"></p>
<p id="delete-current-product-picture-on-save-hint"
class="form-text text-muted font-italic d-none">{{ $__t('The current picture will be deleted when you save the product') }}</p>
@else
<p id="no-current-product-picture-hint" class="form-text text-muted font-italic">{{ $__t('No picture available') }}</p>
<p id="no-current-product-picture-hint"
class="form-text text-muted font-italic">{{ $__t('No picture available') }}</p>
@endif
</div>
</div>

View File

@@ -17,23 +17,36 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $group->id }};</script>
<script>
Grocy.EditObjectId = {{ $group->id }};
</script>
@endif
<form id="product-group-form" novalidate>
<form id="product-group-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $group->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $group->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $group->description }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="description"
name="description">@if($mode == 'edit'){{ $group->description }}@endif</textarea>
</div>
@include('components.userfieldsform', array(
@@ -41,7 +54,8 @@
'entity' => 'product_groups'
))
<button id="save-product-group-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-product-group-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -10,7 +10,8 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary" href="{{ $U('/userfields?entity=product_groups') }}">
<a class="btn btn-outline-secondary"
href="{{ $U('/userfields?entity=product_groups') }}">
{{ $__t('Configure userfields') }}
</a>
</div>
@@ -20,7 +21,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3 show-as-dialog-link" href="{{ $U('/productgroup/new?embedded') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3 show-as-dialog-link"
href="{{ $U('/productgroup/new?embedded') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -31,14 +33,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="productgroups-table" class="table table-sm table-striped dt-responsive">
<table id="productgroups-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -55,10 +61,14 @@
@foreach($productGroups as $productGroup)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm show-as-dialog-link" href="{{ $U('/productgroup/') }}{{ $productGroup->id }}?embedded">
<a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/productgroup/') }}{{ $productGroup->id }}?embedded">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm product-group-delete-button" href="#" data-group-id="{{ $productGroup->id }}" data-group-name="{{ $productGroup->name }}">
<a class="btn btn-danger btn-sm product-group-delete-button"
href="#"
data-group-id="{{ $productGroup->id }}"
data-group-name="{{ $productGroup->name }}">
<i class="fas fa-trash"></i>
</a>
</td>
@@ -70,7 +80,8 @@
</td>
<td>
{{ count(FindAllObjectsInArrayByPropertyValue($products, 'product_group_id', $productGroup->id)) }}
<a class="btn btn-link btn-sm text-body" href="{{ $U('/products?product-group=') . $productGroup->id }}">
<a class="btn btn-link btn-sm text-body"
href="{{ $U('/products?product-group=') . $productGroup->id }}">
<i class="fas fa-external-link-alt"></i>
</a>
</td>

View File

@@ -10,10 +10,12 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary mb-1" href="{{ $U('/userfields?entity=products') }}">
<a class="btn btn-outline-secondary mb-1"
href="{{ $U('/userfields?entity=products') }}">
{{ $__t('Configure userfields') }}
</a>
<a class="btn btn-outline-secondary mb-1" href="{{ $U('/stocksettings#productpresets') }}">
<a class="btn btn-outline-secondary mb-1"
href="{{ $U('/stocksettings#productpresets') }}">
{{ $__t('Presets for new products') }}
</a>
</div>
@@ -24,7 +26,8 @@
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/product/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/product/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -35,7 +38,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
@@ -43,7 +49,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="location-filter">
<select class="form-control"
id="location-filter">
<option value="all">{{ $__t('All') }}</option>
@foreach($productGroups as $productGroup)
<option value="{{ $productGroup->id }}">{{ $productGroup->name }}</option>
@@ -55,7 +62,8 @@
<div class="row">
<div class="col">
<table id="products-table" class="table table-sm table-striped dt-responsive">
<table id="products-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -78,10 +86,14 @@
@foreach($products as $product)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/product/') }}{{ $product->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/product/') }}{{ $product->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm product-delete-button @if($product->active == 0) disabled @endif" href="#" data-product-id="{{ $product->id }}" data-product-name="{{ $product->name }}">
<a class="btn btn-danger btn-sm product-delete-button @if($product->active == 0) disabled @endif"
href="#"
data-product-id="{{ $product->id }}"
data-product-name="{{ $product->name }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -15,8 +15,16 @@
<h2 class="title">@yield('title')</h2>
<div class="related-links">
@if(!$embedded)
<button id="scan-mode-button" class="btn @if(boolval($userSettings['scan_mode_purchase_enabled'])) btn-success @else btn-danger @endif" type="checkbox">{{ $__t('Scan mode') }} <span id="scan-mode-status">@if(boolval($userSettings['scan_mode_purchase_enabled'])) {{ $__t('on') }} @else {{ $__t('off') }} @endif</span></button>
<input id="scan-mode" type="checkbox" class="d-none user-setting-control" data-setting-key="scan_mode_purchase_enabled" @if(boolval($userSettings['scan_mode_purchase_enabled'])) checked @endif>
<button id="scan-mode-button"
class="btn @if(boolval($userSettings['scan_mode_purchase_enabled'])) btn-success @else btn-danger @endif"
type="checkbox">{{ $__t('Scan mode') }} <span id="scan-mode-status">@if(boolval($userSettings['scan_mode_purchase_enabled'])) {{ $__t('on') }} @else {{ $__t('off') }} @endif</span></button>
<input id="scan-mode"
type="checkbox"
class="d-none user-setting-control"
data-setting-key="scan_mode_purchase_enabled"
@if(boolval($userSettings['scan_mode_purchase_enabled']))
checked
@endif>
@else
<script>
Grocy.UserSettings.scan_mode_purchase_enabled = false;
@@ -26,7 +34,8 @@
</div>
<hr>
<form id="purchase-form" novalidate>
<form id="purchase-form"
novalidate>
@include('components.productpicker', array(
'products' => $products,
@@ -40,7 +49,8 @@
'hintId' => 'amount_qu_unit',
'min' => 1,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
@php
@@ -82,19 +92,33 @@
'additionalGroupCssClasses' => 'mb-1'
))
<div class="form-check form-check-inline mb-3">
<input class="form-check-input" type="radio" name="price-type" id="price-type-unit-price" value="unit-price" checked>
<label class="form-check-label" for="price-type-unit-price">{{ $__t('Price') }}</label>
<input class="form-check-input"
type="radio"
name="price-type"
id="price-type-unit-price"
value="unit-price"
checked>
<label class="form-check-label"
for="price-type-unit-price">{{ $__t('Price') }}</label>
</div>
<div class="form-check form-check-inline mb-3">
<input class="form-check-input" type="radio" name="price-type" id="price-type-total-price" value="total-price">
<label class="form-check-label" for="price-type-total-price">{{ $__t('Total price') }}</label>
<input class="form-check-input"
type="radio"
name="price-type"
id="price-type-total-price"
value="total-price">
<label class="form-check-label"
for="price-type-total-price">{{ $__t('Total price') }}</label>
</div>
@include('components.shoppinglocationpicker', array(
'label' => 'Store',
'shoppinglocations' => $shoppinglocations
))
@else
<input type="hidden" name="price" id="price" value="0">
<input type="hidden"
name="price"
id="price"
value="0">
@endif
@include('components.numberpicker', array(
@@ -104,7 +128,8 @@
'additionalGroupCssClasses' => 'd-none',
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalCssClasses' => 'input-group-qu',
'additionalHtmlElements' => '<p id="qu-conversion-info" class="form-text text-muted small d-none"></p>'
'additionalHtmlElements' => '<p id="qu-conversion-info"
class="form-text text-muted small d-none"></p>'
))
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
@@ -114,7 +139,8 @@
))
@endif
<button id="save-purchase-button" class="btn btn-success d-block">{{ $__t('OK') }}</button>
<button id="save-purchase-button"
class="btn btn-success d-block">{{ $__t('OK') }}</button>
</form>
</div>

View File

@@ -24,24 +24,38 @@
<h3 class="text-muted">{{ $__t('Default for QU') }} <strong>{{ $defaultQuUnit->name }}</strong></h3>
@endif
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $quConversion->id }};</script>
<script>
Grocy.EditObjectId = {{ $quConversion->id }};
</script>
@endif
<form id="quconversion-form" novalidate>
<form id="quconversion-form"
novalidate>
@if($product != null)
<input type="hidden" name="product_id" value="{{ $product->id }}">
<input type="hidden"
name="product_id"
value="{{ $product->id }}">
@endif
<div class="form-group">
<label for="from_qu_id">{{ $__t('Quantity unit from') }}</label>
<select required disabled class="form-control input-group-qu" id="from_qu_id" name="from_qu_id">
<select required
disabled
class="form-control input-group-qu"
id="from_qu_id"
name="from_qu_id">
<option></option>
@foreach($quantityunits as $quantityunit)
<option @if(($product != null && $quantityunit->id == $product->qu_id_stock) || ($defaultQuUnit != null && $quantityunit->id == $defaultQuUnit->id))) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
<option @if(($product
!=null
&&
$quantityunit->id == $product->qu_id_stock) || ($defaultQuUnit != null && $quantityunit->id == $defaultQuUnit->id))) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A quantity unit is required') }}</div>
@@ -49,10 +63,15 @@
<div class="form-group">
<label for="to_qu_id">{{ $__t('Quantity unit to') }}</label>
<select required class="form-control input-group-qu" id="to_qu_id" name="to_qu_id">
<select required
class="form-control input-group-qu"
id="to_qu_id"
name="to_qu_id">
<option></option>
@foreach($quantityunits as $quantityunit)
<option @if($mode == 'edit' && $quantityunit->id == $quConversion->to_qu_id) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
<option @if($mode=='edit'
&&
$quantityunit->id == $quConversion->to_qu_id) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A quantity unit is required') }}</div>
@@ -66,14 +85,19 @@
'step' => 0.001,
'value' => $value,
'invalidFeedback' => $__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', '0', '3'),
'additionalHtmlElements' => '<p id="qu-conversion-info" class="form-text text-info d-none"></p>',
'additionalHtmlElements' => '<p id="qu-conversion-info"
class="form-text text-info d-none"></p>',
'additionalCssClasses' => 'input-group-qu'
))
<div class="checkbox @if($mode == 'edit') d-none @endif">
<label for="create_inverse">
<input type="checkbox" id="create_inverse" name="create_inverse:skip" checked> {{ $__t('Create inverse QU conversion') }}
<span id="qu-conversion-inverse-info" class="form-text text-info d-none"></span>
<input type="checkbox"
id="create_inverse"
name="create_inverse:skip"
checked> {{ $__t('Create inverse QU conversion') }}
<span id="qu-conversion-inverse-info"
class="form-text text-info d-none"></span>
</label>
</div>
@@ -82,7 +106,8 @@
'entity' => 'quantity_unit_conversions'
))
<button id="save-quconversion-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-quconversion-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -17,23 +17,37 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $quantityUnit->id }};</script>
<script>
Grocy.EditObjectId = {{ $quantityUnit->id }};
</script>
@endif
<form id="quantityunit-form" novalidate>
<form id="quantityunit-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }} <span class="small text-muted">{{ $__t('in singular form') }}</span></label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $quantityUnit->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $quantityUnit->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<label for="name_plural">{{ $__t('Name') }} <span class="small text-muted">{{ $__t('in plural form') }}</span></label>
<input type="text" class="form-control" id="name_plural" name="name_plural" value="@if($mode == 'edit'){{ $quantityUnit->name_plural }}@endif">
<input type="text"
class="form-control"
id="name_plural"
name="name_plural"
value="@if($mode == 'edit'){{ $quantityUnit->name_plural }}@endif">
</div>
@if($pluralCount > 2)
@@ -46,13 +60,19 @@
{{ $__t('Plural rule') }}: {{ $pluralRule }}
</span>
</label>
<textarea class="form-control" rows="3" id="plural_forms" name="plural_forms">@if($mode == 'edit'){{ $quantityUnit->plural_forms }}@endif</textarea>
<textarea class="form-control"
rows="3"
id="plural_forms"
name="plural_forms">@if($mode == 'edit'){{ $quantityUnit->plural_forms }}@endif</textarea>
</div>
@endif
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $quantityUnit->description }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="description"
name="description">@if($mode == 'edit'){{ $quantityUnit->description }}@endif</textarea>
</div>
@include('components.userfieldsform', array(
@@ -60,10 +80,12 @@
'entity' => 'quantity_units'
))
<button id="save-quantityunit-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-quantityunit-button"
class="btn btn-success">{{ $__t('Save') }}</button>
@if(intval($pluralCount) > 2)
<button id="test-quantityunit-plural-forms-button" class="btn btn-secondary">{{ $__t('Test plural forms') }}</button>
<button id="test-quantityunit-plural-forms-button"
class="btn btn-secondary">{{ $__t('Test plural forms') }}</button>
@endif
</form>
@@ -72,12 +94,16 @@
<div class="col-lg-6 col-xs-12">
<h2>
{{ $__t('Default conversions') }}
<a id="qu-conversion-add-button" class="btn btn-outline-dark" href="#">
<a id="qu-conversion-add-button"
class="btn btn-outline-dark"
href="#">
<i class="fas fa-plus"></i> {{ $__t('Add') }}
</a>
</h2>
<h5 id="qu-conversion-headline-info" class="text-muted font-italic"></h5>
<table id="qu-conversions-table" class="table table-sm table-striped dt-responsive">
<h5 id="qu-conversion-headline-info"
class="text-muted font-italic"></h5>
<table id="qu-conversions-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -90,10 +116,14 @@
@foreach($defaultQuConversions as $defaultQuConversion)
<tr>
<td class="fit-content border-right">
<a class="btn btn-sm btn-info qu-conversion-edit-button" href="#" data-qu-conversion-id="{{ $defaultQuConversion->id }}">
<a class="btn btn-sm btn-info qu-conversion-edit-button"
href="#"
data-qu-conversion-id="{{ $defaultQuConversion->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger qu-conversion-delete-button" href="#" data-qu-conversion-id="{{ $defaultQuConversion->id }}">
<a class="btn btn-sm btn-danger qu-conversion-delete-button"
href="#"
data-qu-conversion-id="{{ $defaultQuConversion->id }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -5,7 +5,8 @@
@section('viewJsName', 'quantityunitpluraltesting')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -17,14 +18,19 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<form id="quantityunitpluraltesting-form" novalidate>
<form id="quantityunitpluraltesting-form"
novalidate>
<div class="form-group">
<label for="qu_id">{{ $__t('Quantity unit') }}</label>
<select class="form-control" id="qu_id" name="qu_id">
<select class="form-control"
id="qu_id"
name="qu_id">
<option></option>
@foreach($quantityUnits as $quantityUnit)
<option value="{{ $quantityUnit->id }}" data-singular-form="{{ $quantityUnit->name }}" data-plural-form="{{ $quantityUnit->name_plural }}">{{ $quantityUnit->name }}</option>
<option value="{{ $quantityUnit->id }}"
data-singular-form="{{ $quantityUnit->name }}"
data-plural-form="{{ $quantityUnit->name_plural }}">{{ $quantityUnit->name }}</option>
@endforeach
</select>
</div>

View File

@@ -10,7 +10,8 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary" href="{{ $U('/userfields?entity=quantity_units') }}">
<a class="btn btn-outline-secondary"
href="{{ $U('/userfields?entity=quantity_units') }}">
{{ $__t('Configure userfields') }}
</a>
</div>
@@ -20,7 +21,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/quantityunit/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/quantityunit/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -31,14 +33,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="quantityunits-table" class="table table-sm table-striped dt-responsive">
<table id="quantityunits-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -54,10 +60,14 @@
@foreach($quantityunits as $quantityunit)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/quantityunit/') }}{{ $quantityunit->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/quantityunit/') }}{{ $quantityunit->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm quantityunit-delete-button" href="#" data-quantityunit-id="{{ $quantityunit->id }}" data-quantityunit-name="{{ $quantityunit->name }}">
<a class="btn btn-danger btn-sm quantityunit-delete-button"
href="#"
data-quantityunit-id="{{ $quantityunit->id }}"
data-quantityunit-name="{{ $quantityunit->name }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -14,7 +14,8 @@
@endpush
@push('pageStyles')
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -29,10 +30,14 @@
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $recipe->id }};</script>
<script>
Grocy.EditObjectId = {{ $recipe->id }};
</script>
@if(!empty($recipe->picture_file_name))
<script>Grocy.RecipePictureFileName = '{{ $recipe->picture_file_name }}';</script>
<script>
Grocy.RecipePictureFileName = '{{ $recipe->picture_file_name }}';
</script>
@endif
@endif
</div>
@@ -40,11 +45,17 @@
<div class="row">
<div class="col-xs-12 col-md-7 pb-3">
<form id="recipe-form" novalidate>
<form id="recipe-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $recipe->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $recipe->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
@@ -54,16 +65,24 @@
</label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="recipe-picture" accept="image/*">
<label id="recipe-picture-label" class="custom-file-label @if(empty($recipe->picture_file_name)) d-none @endif" for="recipe-picture">
<input type="file"
class="custom-file-input"
id="recipe-picture"
accept="image/*">
<label id="recipe-picture-label"
class="custom-file-label @if(empty($recipe->picture_file_name)) d-none @endif"
for="recipe-picture">
{{ $recipe->picture_file_name }}
</label>
<label id="recipe-picture-label-none" class="custom-file-label @if(!empty($recipe->picture_file_name)) d-none @endif" for="recipe-picture">
<label id="recipe-picture-label-none"
class="custom-file-label @if(!empty($recipe->picture_file_name)) d-none @endif"
for="recipe-picture">
{{ $__t('No file selected') }}
</label>
</div>
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-trash" id="delete-current-recipe-picture-button"></i></span>
<span class="input-group-text"><i class="fas fa-trash"
id="delete-current-recipe-picture-button"></i></span>
</div>
</div>
</div>
@@ -80,14 +99,18 @@
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="hidden" name="not_check_shoppinglist" value="0">
<input @if($mode == 'edit' && $recipe->not_check_shoppinglist == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="not_check_shoppinglist" name="not_check_shoppinglist" value="1">
<label class="form-check-label custom-control-label" for="not_check_shoppinglist">
<input type="hidden"
name="not_check_shoppinglist"
value="0">
<input @if($mode=='edit'
&&
$recipe->not_check_shoppinglist == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="not_check_shoppinglist" name="not_check_shoppinglist" value="1">
<label class="form-check-label custom-control-label"
for="not_check_shoppinglist">
{{ $__t('Do not check against the shopping list when adding missing items to it') }}&nbsp;
<i class="fas fa-question-circle"
data-toggle="tooltip"
title="{{ $__t('By default the amount to be added to the shopping list is `needed amount - stock amount - shopping list amount` - when this is enabled, it is only checked against the stock amount, not against what is already on the shopping list') }}"
></i>
title="{{ $__t('By default the amount to be added to the shopping list is `needed amount - stock amount - shopping list amount` - when this is enabled, it is only checked against the stock amount, not against what is already on the shopping list') }}"></i>
</label>
</div>
</div>
@@ -107,13 +130,17 @@
<div class="form-group">
<label for="description">{{ $__t('Preparation') }}</label>
<textarea id="description" class="form-control wysiwyg-editor" name="description">@if($mode == 'edit'){{ $recipe->description }}@endif</textarea>
<textarea id="description"
class="form-control wysiwyg-editor"
name="description">@if($mode == 'edit'){{ $recipe->description }}@endif</textarea>
</div>
<small class="my-2 form-text text-muted @if($mode == 'edit') d-none @endif">{{ $__t('Save & continue to add ingredients and included recipes') }}</small>
<button class="save-recipe btn btn-success mb-2" data-location="continue">{{ $__t('Save & continue') }}</button>
<button class="save-recipe btn btn-info mb-2" data-location="return">{{ $__t('Save & return to recipes') }}</button>
<button class="save-recipe btn btn-success mb-2"
data-location="continue">{{ $__t('Save & continue') }}</button>
<button class="save-recipe btn btn-info mb-2"
data-location="return">{{ $__t('Save & return to recipes') }}</button>
</form>
</div>
@@ -122,10 +149,14 @@
<div class="row">
<div class="col">
@if(!empty($recipe->picture_file_name))
<img id="current-recipe-picture" data-src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name) . '?force_serve_as=picture&best_fit_width=400') }}" class="img-fluid img-thumbnail mt-2 lazy mb-5">
<p id="delete-current-recipe-picture-on-save-hint" class="form-text text-muted font-italic d-none mb-5">{{ $__t('The current picture will be deleted when you save the recipe') }}</p>
<img id="current-recipe-picture"
data-src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name) . '?force_serve_as=picture&best_fit_width=400') }}"
class="img-fluid img-thumbnail mt-2 lazy mb-5">
<p id="delete-current-recipe-picture-on-save-hint"
class="form-text text-muted font-italic d-none mb-5">{{ $__t('The current picture will be deleted when you save the recipe') }}</p>
@else
<p id="no-current-recipe-picture-hint" class="form-text text-muted font-italic mb-5">{{ $__t('No picture available') }}</p>
<p id="no-current-recipe-picture-hint"
class="form-text text-muted font-italic mb-5">{{ $__t('No picture available') }}</p>
@endif
</div>
</div>
@@ -137,13 +168,17 @@
{{ $__t('Ingredients list') }}
</h4>
<div class="related-links">
<a id="recipe-pos-add-button" class="btn btn-outline-primary btn-sm recipe-pos-add-button" type="button" href="#">
<a id="recipe-pos-add-button"
class="btn btn-outline-primary btn-sm recipe-pos-add-button"
type="button"
href="#">
{{ $__t('Add') }}
</a>
</div>
</div>
<table id="recipes-pos-table" class="table table-sm table-striped dt-responsive">
<table id="recipes-pos-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -158,10 +193,17 @@
@foreach($recipePositions as $recipePosition)
<tr>
<td class="fit-content border-right">
<a class="btn btn-sm btn-info recipe-pos-edit-button" type="button" href="#" data-recipe-pos-id="{{ $recipePosition->id }}" data-product-id="{{ $recipePosition->product_id }}">
<a class="btn btn-sm btn-info recipe-pos-edit-button"
type="button"
href="#"
data-recipe-pos-id="{{ $recipePosition->id }}"
data-product-id="{{ $recipePosition->product_id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger recipe-pos-delete-button" href="#" data-recipe-pos-id="{{ $recipePosition->id }}" data-recipe-pos-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $recipePosition->product_id)->name }}">
<a class="btn btn-sm btn-danger recipe-pos-delete-button"
href="#"
data-recipe-pos-id="{{ $recipePosition->id }}"
data-recipe-pos-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $recipePosition->product_id)->name }}">
<i class="fas fa-trash"></i>
</a>
</td>
@@ -191,7 +233,12 @@
@endif
</td>
<td class="fit-content">
<a class="btn btn-sm btn-info recipe-pos-show-note-button @if(empty($recipePosition->note)) disabled @endif" href="#" data-toggle="tooltip" data-placement="top" title="{{ $__t('Show notes') }}" data-recipe-pos-note="{{ $recipePosition->note }}">
<a class="btn btn-sm btn-info recipe-pos-show-note-button @if(empty($recipePosition->note)) disabled @endif"
href="#"
data-toggle="tooltip"
data-placement="top"
title="{{ $__t('Show notes') }}"
data-recipe-pos-note="{{ $recipePosition->note }}">
<i class="fas fa-eye"></i>
</a>
</td>
@@ -213,12 +260,15 @@
{{ $__t('Included recipes') }}
</h4>
<div class="related-links">
<a id="recipe-include-add-button" class="btn btn-outline-primary btn-sm" href="#">
<a id="recipe-include-add-button"
class="btn btn-outline-primary btn-sm"
href="#">
{{ $__t('Add') }}
</a>
</div>
</div>
<table id="recipes-includes-table" class="table table-sm table-striped dt-responsive">
<table id="recipes-includes-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -231,10 +281,17 @@
@foreach($recipeNestings as $recipeNesting)
<tr>
<td class="fit-content border-right">
<a class="btn btn-sm btn-info recipe-include-edit-button" href="#" data-recipe-include-id="{{ $recipeNesting->id }}" data-recipe-included-recipe-id="{{ $recipeNesting->includes_recipe_id }}" data-recipe-included-recipe-servings="{{ $recipeNesting->servings }}">
<a class="btn btn-sm btn-info recipe-include-edit-button"
href="#"
data-recipe-include-id="{{ $recipeNesting->id }}"
data-recipe-included-recipe-id="{{ $recipeNesting->includes_recipe_id }}"
data-recipe-included-recipe-servings="{{ $recipeNesting->servings }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger recipe-include-delete-button" href="#" data-recipe-include-id="{{ $recipeNesting->id }}" data-recipe-include-name="{{ FindObjectInArrayByPropertyValue($recipes, 'id', $recipeNesting->includes_recipe_id)->name }}">
<a class="btn btn-sm btn-danger recipe-include-delete-button"
href="#"
data-recipe-include-id="{{ $recipeNesting->id }}"
data-recipe-include-name="{{ FindObjectInArrayByPropertyValue($recipes, 'id', $recipeNesting->includes_recipe_id)->name }}">
<i class="fas fa-trash"></i>
</a>
</td>
@@ -255,14 +312,18 @@
</div>
<div class="modal fade" id="recipe-include-editform-modal" tabindex="-1">
<div class="modal fade"
id="recipe-include-editform-modal"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content text-center">
<div class="modal-header">
<h4 id="recipe-include-editform-title" class="modal-title w-100"></h4>
<h4 id="recipe-include-editform-title"
class="modal-title w-100"></h4>
</div>
<div class="modal-body">
<form id="recipe-include-form" novalidate>
<form id="recipe-include-form"
novalidate>
@include('components.recipepicker', array(
'recipes' => $recipes,
@@ -280,8 +341,12 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="save-recipe-include-button" data-dismiss="modal" class="btn btn-success">{{ $__t('Save') }}</button>
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="save-recipe-include-button"
data-dismiss="modal"
class="btn btn-success">{{ $__t('Save') }}</button>
</div>
</div>
</div>

View File

@@ -28,10 +28,13 @@
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $recipePos->id }};</script>
<script>
Grocy.EditObjectId = {{ $recipePos->id }};
</script>
@endif
<form id="recipe-pos-form" novalidate>
<form id="recipe-pos-form"
novalidate>
@include('components.productpicker', array(
'products' => $products,
@@ -41,9 +44,14 @@
<div class="row">
<div class="col">
<div class="form-check form-group mb-1">
<input type="hidden" name="only_check_single_unit_in_stock" value="0">
<input @if($mode == 'edit' && $recipePos->only_check_single_unit_in_stock == 1) checked @endif class="form-check-input" type="checkbox" id="only_check_single_unit_in_stock" name="only_check_single_unit_in_stock" value="1">
<label class="form-check-label" for="only_check_single_unit_in_stock">{{ $__t('Only check if a single unit is in stock (a different quantity can then be used above)') }}</label>
<input type="hidden"
name="only_check_single_unit_in_stock"
value="0">
<input @if($mode=='edit'
&&
$recipePos->only_check_single_unit_in_stock == 1) checked @endif class="form-check-input" type="checkbox" id="only_check_single_unit_in_stock" name="only_check_single_unit_in_stock" value="1">
<label class="form-check-label"
for="only_check_single_unit_in_stock">{{ $__t('Only check if a single unit is in stock (a different quantity can then be used above)') }}</label>
</div>
</div>
</div>
@@ -58,23 +66,39 @@
<div class="form-group">
<label for="variable_amount">{{ $__t('Variable amount') }}&nbsp;&nbsp;<span class="small text-muted">{{ $__t('When this is not empty, it will be shown instead of the amount entered above while the amount there will still be used for stock fulfillment checking') }}</span></label>
<input type="text" class="form-control" id="variable_amount" name="variable_amount" value="@if($mode == 'edit'){{ $recipePos->variable_amount }}@endif">
<input type="text"
class="form-control"
id="variable_amount"
name="variable_amount"
value="@if($mode == 'edit'){{ $recipePos->variable_amount }}@endif">
</div>
<div class="form-check mb-3">
<input type="hidden" name="not_check_stock_fulfillment" value="0">
<input @if($mode == 'edit' && ($recipePos->not_check_stock_fulfillment == 1 || FindObjectInArrayByPropertyValue($products, 'id', $recipePos->product_id)->not_check_stock_fulfillment_for_recipes == 1)) checked @endif class="form-check-input" type="checkbox" id="not_check_stock_fulfillment" name="not_check_stock_fulfillment" value="1">
<label class="form-check-label" for="not_check_stock_fulfillment">{{ $__t('Disable stock fulfillment checking for this ingredient') }}</label>
<input type="hidden"
name="not_check_stock_fulfillment"
value="0">
<input @if($mode=='edit'
&&
($recipePos->not_check_stock_fulfillment == 1 || FindObjectInArrayByPropertyValue($products, 'id', $recipePos->product_id)->not_check_stock_fulfillment_for_recipes == 1)) checked @endif class="form-check-input" type="checkbox" id="not_check_stock_fulfillment" name="not_check_stock_fulfillment" value="1">
<label class="form-check-label"
for="not_check_stock_fulfillment">{{ $__t('Disable stock fulfillment checking for this ingredient') }}</label>
</div>
<div class="form-group">
<label for="ingredient_group">{{ $__t('Group') }}&nbsp;&nbsp;<span class="small text-muted">{{ $__t('This will be used as a headline to group ingredients together') }}</span></label>
<input type="text" class="form-control" id="ingredient_group" name="ingredient_group" value="@if($mode == 'edit'){{ $recipePos->ingredient_group }}@endif">
<input type="text"
class="form-control"
id="ingredient_group"
name="ingredient_group"
value="@if($mode == 'edit'){{ $recipePos->ingredient_group }}@endif">
</div>
<div class="form-group">
<label for="note">{{ $__t('Note') }}</label>
<textarea class="form-control" rows="2" id="note" name="note">@if($mode == 'edit'){{ $recipePos->note }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="note"
name="note">@if($mode == 'edit'){{ $recipePos->note }}@endif</textarea>
</div>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
@@ -91,10 +115,14 @@
'value' => $value
))
@else
<input type="hidden" name="price_factor" id="price" value="1">
<input type="hidden"
name="price_factor"
id="price"
value="1">
@endif
<button id="save-recipe-pos-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-recipe-pos-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -20,7 +20,8 @@
<div class="row">
<div class="col-xs-12 col-md-4 col-xl-2">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/recipe/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/recipe/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -31,7 +32,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
@@ -40,7 +44,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="status-filter">
<select class="form-control"
id="status-filter">
<option value="all">{{ $__t('All') }}</option>
<option value="enoughtinstock">{{ $__t('Enough in stock') }}</option>
<option value="enoughinstockwithshoppinglist">{{ $__t('Not enough in stock, but already on the shopping list') }}</option>
@@ -52,16 +57,24 @@
<ul class="nav nav-tabs mt-3 mb-1 grocy-tabs">
<li class="nav-item">
<a class="nav-link active" id="list-tab" data-toggle="tab" href="#list">{{ $__t('List') }}</a>
<a class="nav-link active"
id="list-tab"
data-toggle="tab"
href="#list">{{ $__t('List') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" id="gallery-tab" data-toggle="tab" href="#gallery">{{ $__t('Gallery') }}</a>
<a class="nav-link"
id="gallery-tab"
data-toggle="tab"
href="#gallery">{{ $__t('Gallery') }}</a>
</li>
</ul>
<div class="tab-content grocy-tabs">
<div class="tab-pane show active" id="list">
<table id="recipes-table" class="table table-sm table-striped dt-responsive">
<div class="tab-pane show active"
id="list">
<table id="recipes-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -80,12 +93,17 @@
</thead>
<tbody class="d-none">
@foreach($recipes as $recipe)
<tr id="recipe-row-{{ $recipe->id }}" data-recipe-id="{{ $recipe->id }}">
<tr id="recipe-row-{{ $recipe->id }}"
data-recipe-id="{{ $recipe->id }}">
<td class="fit-content border-right">
<a class="btn btn-info btn-sm hide-when-embedded hide-on-fullscreen-card" href="{{ $U('/recipe/') }}{{ $recipe->id }}">
<a class="btn btn-info btn-sm hide-when-embedded hide-on-fullscreen-card"
href="{{ $U('/recipe/') }}{{ $recipe->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger hide-when-embedded hide-on-fullscreen-card recipe-delete" href="#" data-recipe-id="{{ $recipe->id }}" data-recipe-name="{{ $recipe->name }}">
<a class="btn btn-sm btn-danger hide-when-embedded hide-on-fullscreen-card recipe-delete"
href="#"
data-recipe-id="{{ $recipe->id }}"
data-recipe-name="{{ $recipe->name }}">
<i class="fas fa-trash"></i>
</a>
</td>
@@ -122,13 +140,18 @@
</table>
</div>
<div class="tab-pane show" id="gallery">
<div class="tab-pane show"
id="gallery">
<div class="card-columns no-gutters">
@foreach($recipes as $recipe)
<a class="discrete-link recipe-gallery-item" data-recipe-id="{{ $recipe->id }}" href="#">
<div id="RecipeGalleryCard-{{ $recipe->id }}" class="card recipe-card">
<a class="discrete-link recipe-gallery-item"
data-recipe-id="{{ $recipe->id }}"
href="#">
<div id="RecipeGalleryCard-{{ $recipe->id }}"
class="card recipe-card">
@if(!empty($recipe->picture_file_name))
<img data-src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name) . '?force_serve_as=picture&best_fit_width=400') }}" class="card-img-top lazy">
<img data-src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name) . '?force_serve_as=picture&best_fit_width=400') }}"
class="card-img-top lazy">
@endif
<div class="card-body text-center">
<h5 class="card-title mb-1">{{ $recipe->name }}</h5>
@@ -151,13 +174,16 @@
array_unshift($allRecipes, $selectedRecipe);
@endphp
<div class="col-xs-12 col-md-6 print-view">
<div id="selectedRecipeCard" class="card grocy-card">
<div id="selectedRecipeCard"
class="card grocy-card">
@if(count($allRecipes) > 1)
<div class="card-header card-header-fullscreen d-print-none">
<ul class="nav nav-tabs grocy-tabs card-header-tabs">
@foreach($allRecipes as $index=>$recipe)
<li class="nav-item">
<a class="nav-link @if($index == 0) active @endif" data-toggle="tab" href="#recipe-{{ $index + 1 }}">{{ $recipe->name }}</a>
<a class="nav-link @if($index == 0) active @endif"
data-toggle="tab"
href="#recipe-{{ $index + 1 }}">{{ $recipe->name }}</a>
</li>
@endforeach
</ul>
@@ -166,9 +192,12 @@
<div class="tab-content grocy-tabs print break">
@foreach($allRecipes as $index=>$recipe)
<div class="tab-pane @if($index == 0) active @endif" id="recipe-{{ $index + 1 }}" role="tabpanel">
<div class="tab-pane @if($index == 0) active @endif"
id="recipe-{{ $index + 1 }}"
role="tabpanel">
@if(!empty($recipe->picture_file_name))
<img class="card-img-top lazy" src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name) . '?force_serve_as=picture') }}">
<img class="card-img-top lazy"
src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name) . '?force_serve_as=picture') }}">
@endif
<div class="card-body">
<div class="shadow p-4 mb-5 bg-white rounded mt-n5 d-print-none @if(empty($recipe->picture_file_name)) d-none @endif">
@@ -197,7 +226,10 @@
title="{{ $__t('Expand to fullscreen') }}">
<i class="fas fa-expand-arrows-alt"></i>
</a>
<a class="recipe-print hide-when-embedded" href="#" data-toggle="tooltip" title="{{ $__t('Print') }}">
<a class="recipe-print hide-when-embedded"
href="#"
data-toggle="tooltip"
title="{{ $__t('Print') }}">
<i class="fas fa-print"></i>
</a>
</div>
@@ -229,7 +261,10 @@
title="{{ $__t('Expand to fullscreen') }}">
<i class="fas fa-expand-arrows-alt"></i>
</a>
<a class="recipe-print hide-when-embedded PrintRecipe" href="#" data-toggle="tooltip" title="{{ $__t('Print') }}">
<a class="recipe-print hide-when-embedded PrintRecipe"
href="#"
data-toggle="tooltip"
title="{{ $__t('Print') }}">
<i class="fas fa-print"></i>
</a>
</div>
@@ -250,7 +285,9 @@
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<div class="col-5">
<label>{{ $__t('Costs') }}&nbsp;</label>
<i class="fas fa-question-circle" data-toggle="tooltip" title="{{ $__t('Based on the prices of the default consume rule which is "First expiring first, then first in first out"') }}"></i>
<i class="fas fa-question-circle"
data-toggle="tooltip"
title="{{ $__t('Based on the prices of the default consume rule which is "First expiring first, then first in first out"') }}"></i>
<h3 class="locale-number locale-number-currency pt-0">{{ $costs }}</h3>
</div>
@endif
@@ -274,22 +311,31 @@
$recipePositionsFiltered = FindAllObjectsInArrayByPropertyValue($allRecipePositions[$recipe->id], 'recipe_id', $recipe->id);
@endphp
<ul class="nav nav-tabs grocy-tabs mb-3 d-print-none" role="tablist">
<ul class="nav nav-tabs grocy-tabs mb-3 d-print-none"
role="tablist">
@if(count($recipePositionsFiltered) > 0)
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#ingredients-{{ $index }}" role="tab">{{ $__t('Ingredients') }}</a>
<a class="nav-link active"
data-toggle="tab"
href="#ingredients-{{ $index }}"
role="tab">{{ $__t('Ingredients') }}</a>
</li>
@endif
@if(!empty($recipe->description))
<li class="nav-item">
<a class="nav-link @if(count($recipePositionsFiltered) == 0) active @endif" data-toggle="tab" href="#prep-{{ $index }}" role="tab">{{ $__t('Preparation') }}</a>
<a class="nav-link @if(count($recipePositionsFiltered) == 0) active @endif"
data-toggle="tab"
href="#prep-{{ $index }}"
role="tab">{{ $__t('Preparation') }}</a>
</li>
@endif
</ul>
<div class="tab-content grocy-tabs p-2 print">
@if(count($recipePositionsFiltered) > 0)
<div class="tab-pane active" id="ingredients-{{ $index }}" role="tabpanel">
<div class="tab-pane active"
id="ingredients-{{ $index }}"
role="tabpanel">
<div class="mb-2 mt-3 d-none d-print-block">
<h3 class="mb-0">{{ $__t('Ingredients') }}</h3>
</div>
@@ -346,7 +392,9 @@
</ul>
</div>
@endif
<div class="tab-pane @if(count($recipePositionsFiltered) == 0) active @endif" id="prep-{{ $index }}" role="tabpanel">
<div class="tab-pane @if(count($recipePositionsFiltered) == 0) active @endif"
id="prep-{{ $index }}"
role="tabpanel">
<div class="mb-2 d-none d-print-block">
<h3 class="mb-0">{{ $__t('Preparation') }}</h3>
</div>
@@ -358,12 +406,17 @@
</div>
</div>
<div id="missing-recipe-pos-list" class="list-group d-none mt-3">
<div id="missing-recipe-pos-list"
class="list-group d-none mt-3">
@foreach($recipePositionsResolved as $recipePos)
@if(in_array($recipePos->recipe_id, $includedRecipeIdsAbsolute) && $recipePos->missing_amount > 0)
<a href="#" class="list-group-item list-group-item-action list-group-item-primary missing-recipe-pos-select-button">
<a href="#"
class="list-group-item list-group-item-action list-group-item-primary missing-recipe-pos-select-button">
<div class="form-check form-check-inline">
<input class="form-check-input missing-recipe-pos-product-checkbox" type="checkbox" data-product-id="{{ $recipePos->product_id }}" checked>
<input class="form-check-input missing-recipe-pos-product-checkbox"
type="checkbox"
data-product-id="{{ $recipePos->product_id }}"
checked>
</div>
{{ FindObjectInArrayByPropertyValue($products, 'id', $recipePos->product_id)->name }}
</a>

View File

@@ -17,12 +17,16 @@
<div class="form-group">
<div class="checkbox">
<label for="recipe_ingredients_group_by_product_group">
<input type="checkbox" class="user-setting-control" id="recipe_ingredients_group_by_product_group" data-setting-key="recipe_ingredients_group_by_product_group"> {{ $__t('Group ingredients by their product group') }}
<input type="checkbox"
class="user-setting-control"
id="recipe_ingredients_group_by_product_group"
data-setting-key="recipe_ingredients_group_by_product_group"> {{ $__t('Group ingredients by their product group') }}
</label>
</div>
</div>
<a href="{{ $U('/recipes') }}" class="btn btn-success">{{ $__t('OK') }}</a>
<a href="{{ $U('/recipes') }}"
class="btn btn-success">{{ $__t('OK') }}</a>
</div>
</div>
@stop

View File

@@ -11,13 +11,16 @@
@endpush
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<style>
tr.dtrg-group {
cursor: pointer;
}
</style>
@endpush
@@ -29,20 +32,26 @@
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)
<div class="col-sm-12 col-md-6 d-flex align-items-end flex-wrap">
<div class="d-inline-block flex-grow-1 pr-1 mb-1">
<select class="form-control form-control-sm" id="selected-shopping-list">
<select class="form-control form-control-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>
<div class="d-inline-block mb-1">
<a class="btn btn-outline-dark btn-sm responsive-button" href="{{ $U('/shoppinglist/new') }}">
<a class="btn btn-outline-dark btn-sm responsive-button"
href="{{ $U('/shoppinglist/new') }}">
{{ $__t('New shopping list') }}
</a>
<a id="delete-selected-shopping-list" class="btn btn-outline-danger btn-sm responsive-button @if($selectedShoppingListId == 1) disabled @endif" href="#">
<a id="delete-selected-shopping-list"
class="btn btn-outline-danger btn-sm responsive-button @if($selectedShoppingListId == 1) disabled @endif"
href="#">
{{ $__t('Delete shopping list') }}
</a>
<a id="print-shopping-list-button" class="btn btn-outline-dark btn-sm responsive-button" href="#">
<a id="print-shopping-list-button"
class="btn btn-outline-dark btn-sm responsive-button"
href="#">
{{ $__t('Print') }}
</a>
<!--<div class="dropdown d-inline-block">
@@ -54,26 +63,37 @@
</div>
</div>
@else
<input type="hidden" name="selected-shopping-list" id="selected-shopping-list" value="1">
<input type="hidden"
name="selected-shopping-list"
id="selected-shopping-list"
value="1">
@endif
</div>
<hr>
<p data-status-filter="belowminstockamount" class="normal-message status-filter-message responsive-button">{{ $__n(count($missingProducts), '%s product is below defined min. stock amount', '%s products are below defined min. stock amount') }}</p>
<p data-status-filter="belowminstockamount"
class="normal-message status-filter-message responsive-button">{{ $__n(count($missingProducts), '%s product is below defined min. stock amount', '%s products are below defined min. stock amount') }}</p>
</div>
</div>
<div class="row mt-3 d-print-none hide-on-fullscreen-card">
<div class="col-md-12 mb-2">
<a class="btn btn-primary responsive-button btn-sm mb-1" href="{{ $U('/shoppinglistitem/new?list=' . $selectedShoppingListId) }}">
<a class="btn btn-primary responsive-button btn-sm mb-1"
href="{{ $U('/shoppinglistitem/new?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="#">
<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" href="#">
<a id="add-all-items-to-stock-button"
class="btn btn-outline-primary btn-sm mb-1 responsive-button"
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" href="#">
<a id="add-products-below-min-stock-amount"
class="btn btn-outline-primary btn-sm mb-1 responsive-button"
href="#">
{{ $__t('Add products that are below defined min. stock amount') }}
</a>
</div>
@@ -82,7 +102,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-4 col-lg-5">
@@ -90,7 +113,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="status-filter">
<select class="form-control"
id="status-filter">
<option value="all">{{ $__t('All') }}</option>
<option value="belowminstockamount">{{ $__t('Below min. stock amount') }}</option>
<option value="xxUNDONExx">{{ $__t('Only undone items') }}</option>
@@ -98,18 +122,24 @@
</div>
</div>
<div class="col-xs-12 col-md-3 col-lg-2 mb-3">
<a id="shopping-list-compact-view-button" class="btn btn-outline-dark responsive-button switch-view-mode-button w-100" href="#">
<a id="shopping-list-compact-view-button"
class="btn btn-outline-dark responsive-button switch-view-mode-button w-100"
href="#">
{{ $__t('Compact view') }}
</a>
</div>
</div>
<div id="shoppinglist-main" class="row d-print-none">
<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="#">
<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>
<table id="shoppinglist-table" class="table table-sm table-striped dt-responsive">
<table id="shoppinglist-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -126,23 +156,36 @@
</thead>
<tbody class="d-none">
@foreach($listItems as $listItem)
<tr id="shoppinglistitem-{{ $listItem->id }}-row" class="@if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) table-info @endif @if($listItem->done == 1) text-muted text-strike-through @endif">
<tr id="shoppinglistitem-{{ $listItem->id }}-row"
class="@if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) table-info @endif @if($listItem->done == 1) text-muted text-strike-through @endif">
<td class="fit-content border-right">
<a class="btn btn-success btn-sm order-listitem-button" href="#"
<a class="btn btn-success btn-sm order-listitem-button"
href="#"
data-item-id="{{ $listItem->id }}"
data-item-done="{{ $listItem->done }}"
data-toggle="tooltip" data-placement="right" title="{{ $__t('Mark this item as done') }}">
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Mark this item as done') }}">
<i class="fas fa-check"></i>
</a>
<a class="btn btn-sm btn-info" href="{{ $U('/shoppinglistitem/') . $listItem->id . '?list=' . $selectedShoppingListId }}"
data-toggle="tooltip" data-placement="right" title="{{ $__t('Edit this item') }}">
<a class="btn btn-sm btn-info"
href="{{ $U('/shoppinglistitem/') . $listItem->id . '?list=' . $selectedShoppingListId }}"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger shoppinglist-delete-button" href="#" data-shoppinglist-id="{{ $listItem->id }}"
data-toggle="tooltip" data-placement="right" title="{{ $__t('Delete this item') }}">
<a class="btn btn-sm btn-danger shoppinglist-delete-button"
href="#"
data-shoppinglist-id="{{ $listItem->id }}"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i>
</a>
<a class="btn btn-sm btn-primary @if(empty($listItem->product_id)) disabled @else shopping-list-stock-add-workflow-list-item-button @endif" href="{{ $U('/purchase?embedded&flow=shoppinglistitemtostock&product=') }}{{ $listItem->product_id }}&amount={{ $listItem->amount }}&listitemid={{ $listItem->id }}" @if(!empty($listItem->product_id)) data-toggle="tooltip" title="{{ $__t('Add %1$s of %2$s to stock', $listItem->amount . ' ' . $__n($listItem->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name_plural), FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name, $listItem->amount) }}" @endif>
<a class="btn btn-sm btn-primary @if(empty($listItem->product_id)) disabled @else shopping-list-stock-add-workflow-list-item-button @endif"
href="{{ $U('/purchase?embedded&flow=shoppinglistitemtostock&product=') }}{{ $listItem->product_id }}&amount={{ $listItem->amount }}&listitemid={{ $listItem->id }}"
@if(!empty($listItem->product_id)) data-toggle="tooltip" title="{{ $__t('Add %1$s of %2$s to stock', $listItem->amount . ' ' . $__n($listItem->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name_plural), FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name, $listItem->amount) }}" @endif>
<i class="fas fa-box"></i>
</a>
</td>
@@ -155,7 +198,8 @@
<td class="d-none">
@if(!empty(FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->product_group_id)) {{ FindObjectInArrayByPropertyValue($productGroups, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->product_group_id)->name }} @else <span class="font-italic font-weight-light">{{ $__t('Ungrouped') }}</span> @endif
</td>
<td id="shoppinglistitem-{{ $listItem->id }}-status-info" class="d-none">
<td id="shoppinglistitem-{{ $listItem->id }}-status-info"
class="d-none">
@if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) belowminstockamount @endif
@if($listItem->done != 1) xxUNDONExx @endif
</td>
@@ -179,24 +223,40 @@
<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>
<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 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>
<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>
<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>
@@ -204,7 +264,9 @@
<div class="d-none d-print-block">
<h1 class="text-center">
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}" height="30" class="d-print-flex mx-auto">
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}"
height="30"
class="d-print-flex mx-auto">
{{ $__t("Shopping list") }}
</h1>
@if (FindObjectInArrayByPropertyValue($shoppingLists, 'id', $selectedShoppingListId)->name != $__t("Shopping list"))

View File

@@ -17,21 +17,32 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $shoppingList->id }};</script>
<script>
Grocy.EditObjectId = {{ $shoppingList->id }};
</script>
@endif
<form id="shopping-list-form" novalidate>
<form id="shopping-list-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $shoppingList->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $shoppingList->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<button id="save-shopping-list-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-shopping-list-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -17,25 +17,37 @@
</div>
<div class="row">
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $listItem->id }};</script>
<script>
Grocy.EditObjectId = {{ $listItem->id }};
</script>
@endif
<form id="shoppinglist-form" novalidate>
<form id="shoppinglist-form"
novalidate>
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)
<div class="form-group">
<label for="shopping_list_id">{{ $__t('Shopping list') }}</label>
<select class="form-control" id="shopping_list_id" name="shopping_list_id">
<select class="form-control"
id="shopping_list_id"
name="shopping_list_id">
@foreach($shoppingLists as $shoppingList)
<option @if($mode == 'edit' && $shoppingList->id == $listItem->shopping_list_id) selected="selected" @endif value="{{ $shoppingList->id }}">{{ $shoppingList->name }}</option>
<option @if($mode=='edit'
&&
$shoppingList->id == $listItem->shopping_list_id) selected="selected" @endif value="{{ $shoppingList->id }}">{{ $shoppingList->name }}</option>
@endforeach
</select>
</div>
@else
<input type="hidden" id="shopping_list_id" name="shopping_list_id" value="1">
<input type="hidden"
id="shopping_list_id"
name="shopping_list_id"
value="1">
@endif
@php if($mode == 'edit') { $productId = $listItem->product_id; } else { $productId = ''; } @endphp
@@ -59,10 +71,14 @@
<div class="form-group">
<label for="note">{{ $__t('Note') }}</label>
<textarea class="form-control" rows="2" id="note" name="note">@if($mode == 'edit'){{ $listItem->note }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="note"
name="note">@if($mode == 'edit'){{ $listItem->note }}@endif</textarea>
</div>
<button id="save-shoppinglist-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-shoppinglist-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -17,14 +17,22 @@
<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') }}
<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>
<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') }}
<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>
@@ -33,12 +41,17 @@
<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') }}
<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>
<a href="{{ $U('/shoppinglist') }}"
class="btn btn-success">{{ $__t('OK') }}</a>
</div>
</div>
@stop

View File

@@ -17,23 +17,36 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $shoppinglocation->id }};</script>
<script>
Grocy.EditObjectId = {{ $shoppinglocation->id }};
</script>
@endif
<form id="shoppinglocation-form" novalidate>
<form id="shoppinglocation-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $shoppinglocation->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $shoppinglocation->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $shoppinglocation->description }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="description"
name="description">@if($mode == 'edit'){{ $shoppinglocation->description }}@endif</textarea>
</div>
@include('components.userfieldsform', array(
@@ -41,7 +54,8 @@
'entity' => 'shopping_locations'
))
<button id="save-shopping-location-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-shopping-location-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -10,7 +10,8 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary" href="{{ $U('/userfields?entity=shoppinglocations') }}">
<a class="btn btn-outline-secondary"
href="{{ $U('/userfields?entity=shoppinglocations') }}">
{{ $__t('Configure userfields') }}
</a>
</div>
@@ -21,7 +22,8 @@
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/shoppinglocation/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/shoppinglocation/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -32,14 +34,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="shoppinglocations-table" class="table table-sm table-striped dt-responsive">
<table id="shoppinglocations-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -56,10 +62,14 @@
@foreach($shoppinglocations as $shoppinglocation)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/shoppinglocation/') }}{{ $shoppinglocation->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/shoppinglocation/') }}{{ $shoppinglocation->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm shoppinglocation-delete-button" href="#" data-shoppinglocation-id="{{ $shoppinglocation->id }}" data-shoppinglocation-name="{{ $shoppinglocation->name }}">
<a class="btn btn-danger btn-sm shoppinglocation-delete-button"
href="#"
data-shoppinglocation-id="{{ $shoppinglocation->id }}"
data-shoppinglocation-name="{{ $shoppinglocation->name }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -4,7 +4,8 @@
@section('viewJsName', 'stockentries')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@push('pageScripts')
@@ -26,7 +27,8 @@
<hr>
<div class="row">
<div class="col">
<table id="stockentries-table" class="table table-sm table-striped dt-responsive">
<table id="stockentries-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -51,9 +53,18 @@
</thead>
<tbody class="d-none">
@foreach($stockEntries as $stockEntry)
<tr id="stock-{{ $stockEntry->id }}-row" class="@if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $stockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $stockEntry->amount > 0) table-danger @elseif(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $stockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("+$nextXDays days")) && $stockEntry->amount > 0) table-warning @endif">
<tr id="stock-{{ $stockEntry->id }}-row"
class="@if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $stockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $stockEntry->amount > 0) table-danger @elseif(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $stockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("
+$nextXDays
days"))
&&
$stockEntry->amount > 0) table-warning @endif">
<td class="fit-content border-right">
<a class="btn btn-danger btn-sm stock-consume-button" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Consume this stock entry') }}"
<a class="btn btn-danger btn-sm stock-consume-button"
href="#"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Consume this stock entry') }}"
data-product-id="{{ $stockEntry->product_id }}"
data-stock-id="{{ $stockEntry->stock_id }}"
data-stockrow-id="{{ $stockEntry->id }}"
@@ -64,7 +75,11 @@
<i class="fas fa-utensils"></i>
</a>
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING)
<a class="btn btn-success btn-sm product-open-button @if($stockEntry->open == 1) disabled @endif" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Mark this stock entry as open') }}"
<a class="btn btn-success btn-sm product-open-button @if($stockEntry->open == 1) disabled @endif"
href="#"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Mark this stock entry as open') }}"
data-product-id="{{ $stockEntry->product_id }}"
data-product-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name }}"
data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name }}"
@@ -73,44 +88,69 @@
<i class="fas fa-box-open"></i>
</a>
@endif
<a class="btn btn-info btn-sm show-as-dialog-link" href="{{ $U('/stockentry/' . $stockEntry->id . '?embedded') }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Edit stock entry') }}">
<a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/stockentry/' . $stockEntry->id . '?embedded') }}"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Edit stock entry') }}">
<i class="fas fa-edit"></i>
</a>
<div class="dropdown d-inline-block">
<button class="btn btn-sm btn-light text-secondary" type="button" data-toggle="dropdown">
<button class="btn btn-sm btn-light text-secondary"
type="button"
data-toggle="dropdown">
<i class="fas fa-ellipsis-v"></i>
</button>
<div class="dropdown-menu">
<a class="dropdown-item show-as-dialog-link" type="button" href="{{ $U('/shoppinglistitem/new?embedded&updateexistingproduct&product=' . $stockEntry->product_id ) }}">
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/shoppinglistitem/new?embedded&updateexistingproduct&product=' . $stockEntry->product_id ) }}">
<i class="fas fa-shopping-cart"></i> {{ $__t('Add to shopping list') }}
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item show-as-dialog-link" type="button" href="{{ $U('/purchase?embedded&product=' . $stockEntry->product_id ) }}">
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/purchase?embedded&product=' . $stockEntry->product_id ) }}">
<i class="fas fa-shopping-cart"></i> {{ $__t('Purchase') }}
</a>
<a class="dropdown-item show-as-dialog-link" type="button" href="{{ $U('/consume?embedded&product=' . $stockEntry->product_id . '&locationId=' . $stockEntry->location_id . '&stockId=' . $stockEntry->stock_id) }}">
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/consume?embedded&product=' . $stockEntry->product_id . '&locationId=' . $stockEntry->location_id . '&stockId=' . $stockEntry->stock_id) }}">
<i class="fas fa-utensils"></i> {{ $__t('Consume') }}
</a>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<a class="dropdown-item show-as-dialog-link" type="button" href="{{ $U('/transfer?embedded&product=' . $stockEntry->product_id . '&locationId=' . $stockEntry->location_id . '&stockId=' . $stockEntry->stock_id) }}">
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/transfer?embedded&product=' . $stockEntry->product_id . '&locationId=' . $stockEntry->location_id . '&stockId=' . $stockEntry->stock_id) }}">
<i class="fas fa-exchange-alt"></i> {{ $__t('Transfer') }}
</a>
@endif
<a class="dropdown-item show-as-dialog-link" type="button" href="{{ $U('/inventory?embedded&product=' . $stockEntry->product_id ) }}">
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/inventory?embedded&product=' . $stockEntry->product_id ) }}">
<i class="fas fa-list"></i> {{ $__t('Inventory') }}
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item product-name-cell" data-product-id="{{ $stockEntry->product_id }}" type="button" href="#">
<a class="dropdown-item product-name-cell"
data-product-id="{{ $stockEntry->product_id }}"
type="button"
href="#">
<i class="fas fa-info"></i> {{ $__t('Show product details') }}
</a>
<a class="dropdown-item" type="button" href="{{ $U('/stockjournal?product=') }}{{ $stockEntry->product_id }}">
<a class="dropdown-item"
type="button"
href="{{ $U('/stockjournal?product=') }}{{ $stockEntry->product_id }}">
<i class="fas fa-file-alt"></i> {{ $__t('Stock journal for this product') }}
</a>
<a class="dropdown-item" type="button" href="{{ $U('/product/') }}{{ $stockEntry->product_id . '?returnto=/stockentries' }}">
<a class="dropdown-item"
type="button"
href="{{ $U('/product/') }}{{ $stockEntry->product_id . '?returnto=/stockentries' }}">
<i class="fas fa-edit"></i> {{ $__t('Edit product') }}
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item stock-consume-button stock-consume-button-spoiled @if($stockEntry->amount < 1) disabled @endif" type="button" href="#"
<a class="dropdown-item stock-consume-button stock-consume-button-spoiled @if($stockEntry->amount < 1) disabled @endif"
type="button"
href="#"
data-product-id="{{ $stockEntry->product_id }}"
data-product-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name }}"
data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name }}"
@@ -121,41 +161,53 @@
<i class="fas fa-utensils"></i> {{ $__t('Consume %1$s of %2$s as spoiled', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name) }}
</a>
@if(GROCY_FEATURE_FLAG_RECIPES)
<a class="dropdown-item" type="button" href="{{ $U('/recipes?search=') }}{{ FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name }}">
<a class="dropdown-item"
type="button"
href="{{ $U('/recipes?search=') }}{{ FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name }}">
<i class="fas fa-cocktail"></i> {{ $__t('Search for recipes containing this product') }}
</a>
@endif
</div>
</div>
</td>
<td class="d-none" data-product-id="{{ $stockEntry->product_id }}">
<td class="d-none"
data-product-id="{{ $stockEntry->product_id }}">
{{ $stockEntry->product_id }}
</td>
<td class="product-name-cell cursor-link" data-product-id="{{ $stockEntry->product_id }}">
<td class="product-name-cell cursor-link"
data-product-id="{{ $stockEntry->product_id }}">
{{ FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name }}
</td>
<td>
<span id="stock-{{ $stockEntry->id }}-amount" class="locale-number locale-number-quantity-amount">{{ $stockEntry->amount }}</span> <span id="product-{{ $stockEntry->product_id }}-qu-name">{{ $__n($stockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name_plural) }}</span>
<span id="stock-{{ $stockEntry->id }}-opened-amount" class="small font-italic">@if($stockEntry->open == 1){{ $__t('Opened') }}@endif</span>
<span id="stock-{{ $stockEntry->id }}-amount"
class="locale-number locale-number-quantity-amount">{{ $stockEntry->amount }}</span> <span id="product-{{ $stockEntry->product_id }}-qu-name">{{ $__n($stockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name_plural) }}</span>
<span id="stock-{{ $stockEntry->id }}-opened-amount"
class="small font-italic">@if($stockEntry->open == 1){{ $__t('Opened') }}@endif</span>
</td>
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
<td>
<span id="stock-{{ $stockEntry->id }}-best-before-date">{{ $stockEntry->best_before_date }}</span>
<time id="stock-{{ $stockEntry->id }}-best-before-date-timeago" class="timeago timeago-contextual" datetime="{{ $stockEntry->best_before_date }} 23:59:59"></time>
<time id="stock-{{ $stockEntry->id }}-best-before-date-timeago"
class="timeago timeago-contextual"
datetime="{{ $stockEntry->best_before_date }} 23:59:59"></time>
</td>
@endif
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<td id="stock-{{ $stockEntry->id }}-location" data-location-id="{{ $stockEntry->location_id }}">
<td id="stock-{{ $stockEntry->id }}-location"
data-location-id="{{ $stockEntry->location_id }}">
{{ FindObjectInArrayByPropertyValue($locations, 'id', $stockEntry->location_id)->name }}
</td>
@endif
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<td id="stock-{{ $stockEntry->id }}-shopping-location" data-shopping-location-id="{{ $stockEntry->shopping_location_id }}">
<td id="stock-{{ $stockEntry->id }}-shopping-location"
data-shopping-location-id="{{ $stockEntry->shopping_location_id }}">
@if (FindObjectInArrayByPropertyValue($shoppinglocations, 'id', $stockEntry->shopping_location_id) !== null)
{{ FindObjectInArrayByPropertyValue($shoppinglocations, 'id', $stockEntry->shopping_location_id)->name }}
@endif
</td>
<td id="stock-{{ $stockEntry->id }}-price" class="locale-number locale-number-currency" data-price-id="{{ $stockEntry->price }}">
<td id="stock-{{ $stockEntry->id }}-price"
class="locale-number locale-number-currency"
data-price-id="{{ $stockEntry->price }}">
{{ $stockEntry->price }}
</td>
@endif
@@ -164,7 +216,9 @@
</td>
<td>
<span id="stock-{{ $stockEntry->id }}-purchased-date">{{ $stockEntry->purchased_date }}</span>
<time id="stock-{{ $stockEntry->id }}-purchased-date-timeago" class="timeago timeago-contextual" datetime="{{ $stockEntry->purchased_date }} 23:59:59"></time>
<time id="stock-{{ $stockEntry->id }}-purchased-date-timeago"
class="timeago timeago-contextual"
datetime="{{ $stockEntry->purchased_date }} 23:59:59"></time>
</td>
@include('components.userfields_tbody', array(
@@ -179,14 +233,18 @@
</div>
</div>
<div class="modal fade" id="productcard-modal" tabindex="-1">
<div class="modal fade"
id="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>
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Close') }}</button>
</div>
</div>
</div>

View File

@@ -18,7 +18,8 @@
<div class="row">
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
<form id="stockentry-form" novalidate>
<form id="stockentry-form"
novalidate>
@php
$product = FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id);
@endphp
@@ -57,7 +58,8 @@
'hintId' => 'amount_qu_unit',
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'additionalAttributes' => 'data-not-equal="-1"',
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-small text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
class="text-small text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
@include('components.numberpicker', array(
@@ -67,7 +69,8 @@
'min' => 1,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalCssClasses' => 'input-group-qu',
'additionalHtmlElements' => '<p id="qu-conversion-info" class="form-text text-muted small d-none"></p>'
'additionalHtmlElements' => '<p id="qu-conversion-info"
class="form-text text-muted small d-none"></p>'
))
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
@@ -97,7 +100,10 @@
'prefillById' => $stockEntry->shopping_location_id
))
@else
<input type="hidden" name="price" id="price" value="0">
<input type="hidden"
name="price"
id="price"
value="0">
@endif
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
@@ -106,7 +112,10 @@
'prefillById' => $stockEntry->location_id
))
@else
<input type="hidden" name="location_id" id="location_id" value="1">
<input type="hidden"
name="location_id"
id="location_id"
value="1">
@endif
@include('components.datetimepicker2', array(
@@ -128,7 +137,8 @@
</label>
</div>
<button id="save-stockentry-button" class="btn btn-success">{{ $__t('OK') }}</button>
<button id="save-stockentry-button"
class="btn btn-success">{{ $__t('OK') }}</button>
</form>
</div>

View File

@@ -18,7 +18,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
@@ -26,7 +29,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="product-filter">
<select class="form-control"
id="product-filter">
<option value="all">{{ $__t('All') }}</option>
@foreach($products as $product)
<option value="{{ $product->id }}">{{ $product->name }}</option>
@@ -38,7 +42,8 @@
<div class="row">
<div class="col">
<table id="stock-journal-table" class="table table-sm table-striped dt-responsive">
<table id="stock-journal-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -51,9 +56,16 @@
</thead>
<tbody class="d-none">
@foreach($stockLog as $stockLogEntry)
<tr id="stock-booking-{{ $stockLogEntry->id }}-row" class="@if($stockLogEntry->undone == 1) text-muted @endif stock-booking-correlation-{{ $stockLogEntry->correlation_id }}" data-correlation-id="{{ $stockLogEntry->correlation_id }}">
<tr id="stock-booking-{{ $stockLogEntry->id }}-row"
class="@if($stockLogEntry->undone == 1) text-muted @endif stock-booking-correlation-{{ $stockLogEntry->correlation_id }}"
data-correlation-id="{{ $stockLogEntry->correlation_id }}">
<td class="fit-content border-right">
<a class="btn btn-secondary btn-sm undo-stock-booking-button @if($stockLogEntry->undone == 1) disabled @endif" href="#" data-booking-id="{{ $stockLogEntry->id }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Undo booking') }}">
<a class="btn btn-secondary btn-sm undo-stock-booking-button @if($stockLogEntry->undone == 1) disabled @endif"
href="#"
data-booking-id="{{ $stockLogEntry->id }}"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Undo booking') }}">
<i class="fas fa-undo"></i>
</a>
</td>
@@ -62,7 +74,8 @@
@if($stockLogEntry->undone == 1)
<br>
{{ $__t('Undone on') . ' ' . $stockLogEntry->undone_timestamp }}
<time class="timeago timeago-contextual" datetime="{{ $stockLogEntry->undone_timestamp }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $stockLogEntry->undone_timestamp }}"></time>
@endif
</td>
<td>
@@ -70,7 +83,8 @@
</td>
<td>
{{ $stockLogEntry->row_created_timestamp }}
<time class="timeago timeago-contextual" datetime="{{ $stockLogEntry->row_created_timestamp }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $stockLogEntry->row_created_timestamp }}"></time>
</td>
<td>
{{ $__t($stockLogEntry->transaction_type) }}

View File

@@ -5,7 +5,8 @@
@section('viewJsName', 'stockoverview')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@push('pageScripts')
@@ -18,27 +19,40 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-dark responsive-button" href="{{ $U('/stockjournal') }}">
<a class="btn btn-outline-dark responsive-button"
href="{{ $U('/stockjournal') }}">
{{ $__t('Journal') }}
</a>
<a class="btn btn-outline-dark responsive-button" href="{{ $U('/stockentries') }}">
<a class="btn btn-outline-dark responsive-button"
href="{{ $U('/stockentries') }}">
{{ $__t('Stock entries') }}
</a>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<a class="btn btn-outline-dark responsive-button" href="{{ $U('/locationcontentsheet') }}">
<a class="btn btn-outline-dark responsive-button"
href="{{ $U('/locationcontentsheet') }}">
{{ $__t('Location Content Sheet') }}
</a>
@endif
</div>
</div>
<div id="info-current-stock" class="text-muted"></div>
<div id="info-current-stock"
class="text-muted"></div>
<hr>
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
<p id="info-expiring-products" data-next-x-days="{{ $nextXDays }}" data-status-filter="expiring" class="warning-message status-filter-message responsive-button mr-2"></p>
<p id="info-expired-products" data-status-filter="expired" class="error-message status-filter-message responsive-button mr-2"></p>
<p id="info-expiring-products"
data-next-x-days="{{ $nextXDays }}"
data-status-filter="expiring"
class="warning-message status-filter-message responsive-button mr-2"></p>
<p id="info-expired-products"
data-status-filter="expired"
class="error-message status-filter-message responsive-button mr-2"></p>
@endif
<p id="info-missing-products" data-status-filter="belowminstockamount" class="normal-message status-filter-message responsive-button"></p>
<a id="clear-filter-button" class="btn btn-sm btn-outline-info float-right" href="#">
<p id="info-missing-products"
data-status-filter="belowminstockamount"
class="normal-message status-filter-message responsive-button"></p>
<a id="clear-filter-button"
class="btn btn-sm btn-outline-info float-right"
href="#">
{{ $__t('Clear filter') }}
</a>
</div>
@@ -49,7 +63,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
@@ -58,7 +75,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Location') }}</span>
</div>
<select class="form-control" id="location-filter">
<select class="form-control"
id="location-filter">
<option value="all">{{ $__t('All') }}</option>
@foreach($locations as $location)
<option value="{{ $location->name }}">{{ $location->name }}</option>
@@ -72,7 +90,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Product group') }}</span>
</div>
<select class="form-control" id="product-group-filter">
<select class="form-control"
id="product-group-filter">
<option value="all">{{ $__t('All') }}</option>
@foreach($productGroups as $productGroup)
<option value="{{ $productGroup->name }}">{{ $productGroup->name }}</option>
@@ -85,8 +104,10 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span>
</div>
<select class="form-control" id="status-filter">
<option class="bg-white" value="all">{{ $__t('All') }}</option>
<select class="form-control"
id="status-filter">
<option class="bg-white"
value="all">{{ $__t('All') }}</option>
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
<option value="expiring">{{ $__t('Expiring soon') }}</option>
<option value="expired">{{ $__t('Already expired') }}</option>
@@ -99,7 +120,8 @@
<div class="row">
<div class="col">
<table id="stock-overview-table" class="table table-sm table-striped dt-responsive">
<table id="stock-overview-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -119,16 +141,30 @@
</thead>
<tbody class="d-none">
@foreach($currentStock as $currentStockEntry)
<tr id="product-{{ $currentStockEntry->product_id }}-row" class="@if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) table-danger @elseif(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("+$nextXDays days")) && $currentStockEntry->amount > 0) table-warning @elseif ($currentStockEntry->product_missing) table-info @endif">
<tr id="product-{{ $currentStockEntry->product_id }}-row"
class="@if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) table-danger @elseif(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("
+$nextXDays
days"))
&&
$currentStockEntry->amount > 0) table-warning @elseif ($currentStockEntry->product_missing) table-info @endif">
<td class="fit-content border-right">
<a class="permission-STOCK_CONSUME btn btn-success btn-sm product-consume-button @if($currentStockEntry->amount < 1 || $currentStockEntry->enable_tare_weight_handling == 1) disabled @endif" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Consume %1$s of %2$s', '1 ' . $currentStockEntry->qu_unit_name, $currentStockEntry->product_name) }}"
<a class="permission-STOCK_CONSUME btn btn-success btn-sm product-consume-button @if($currentStockEntry->amount < 1 || $currentStockEntry->enable_tare_weight_handling == 1) disabled @endif"
href="#"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Consume %1$s of %2$s', '1 ' . $currentStockEntry->qu_unit_name, $currentStockEntry->product_name) }}"
data-product-id="{{ $currentStockEntry->product_id }}"
data-product-name="{{ $currentStockEntry->product_name }}"
data-product-qu-name="{{ $currentStockEntry->qu_unit_name }}"
data-consume-amount="1">
<i class="fas fa-utensils"></i> 1
</a>
<a id="product-{{ $currentStockEntry->product_id }}-consume-all-button" class="permission-STOCK_CONSUME d-none d-sm-inline-block btn btn-danger btn-sm product-consume-button @if($currentStockEntry->amount == 0) disabled @endif" href="#" data-toggle="tooltip" data-placement="right" title="{{ $__t('Consume all %s which are currently in stock', $currentStockEntry->product_name) }}"
<a id="product-{{ $currentStockEntry->product_id }}-consume-all-button"
class="permission-STOCK_CONSUME d-none d-sm-inline-block btn btn-danger btn-sm product-consume-button @if($currentStockEntry->amount == 0) disabled @endif"
href="#"
data-toggle="tooltip"
data-placement="right"
title="{{ $__t('Consume all %s which are currently in stock', $currentStockEntry->product_name) }}"
data-product-id="{{ $currentStockEntry->product_id }}"
data-product-name="{{ $currentStockEntry->product_name }}"
data-product-qu-name="{{ $currentStockEntry->qu_unit_name }}"
@@ -137,7 +173,11 @@
<i class="fas fa-utensils"></i> {{ $__t('All') }}
</a>
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING)
<a class="btn btn-success btn-sm product-open-button @if($currentStockEntry->amount < 1 || $currentStockEntry->amount == $currentStockEntry->amount_opened || $currentStockEntry->enable_tare_weight_handling == 1) disabled @endif" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Mark %1$s of %2$s as open', '1 ' . $currentStockEntry->qu_unit_name, $currentStockEntry->product_name) }}"
<a class="btn btn-success btn-sm product-open-button @if($currentStockEntry->amount < 1 || $currentStockEntry->amount == $currentStockEntry->amount_opened || $currentStockEntry->enable_tare_weight_handling == 1) disabled @endif"
href="#"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Mark %1$s of %2$s as open', '1 ' . $currentStockEntry->qu_unit_name, $currentStockEntry->product_name) }}"
data-product-id="{{ $currentStockEntry->product_id }}"
data-product-name="{{ $currentStockEntry->product_name }}"
data-product-qu-name="{{ $currentStockEntry->qu_unit_name }}">
@@ -145,51 +185,78 @@
</a>
@endif
<div class="dropdown d-inline-block">
<button class="btn btn-sm btn-light text-secondary" type="button" data-toggle="dropdown">
<button class="btn btn-sm btn-light text-secondary"
type="button"
data-toggle="dropdown">
<i class="fas fa-ellipsis-v"></i>
</button>
<div class="table-inline-menu dropdown-menu dropdown-menu-right">
<a id="product-{{ $currentStockEntry->product_id }}-consume-all-button" class="d-inline-block d-sm-none dropdown-item show-as-dialog-link text-danger product-consume-button @if($currentStockEntry->amount == 0) disabled @endif" href="#" data-toggle="tooltip" data-placement="right"
<a id="product-{{ $currentStockEntry->product_id }}-consume-all-button"
class="d-inline-block d-sm-none dropdown-item show-as-dialog-link text-danger product-consume-button @if($currentStockEntry->amount == 0) disabled @endif"
href="#"
data-toggle="tooltip"
data-placement="right"
data-product-id="{{ $currentStockEntry->product_id }}"
data-product-name="{{ $currentStockEntry->product_name }}"
data-product-qu-name="{{ $currentStockEntry->qu_unit_name }}"
data-consume-amount="{{ $currentStockEntry->amount }}">
<span class="dropdown-item-icon"><i class="fas fa-utensils"></i></span> <span class="dropdown-item-text">{{ $__t('Consume all %s which are currently in stock', $currentStockEntry->product_name) }}</span>
</a>
<a class="dropdown-item show-as-dialog-link permission-SHOPPINGLIST_ITEMS_ADD" type="button" href="{{ $U('/shoppinglistitem/new?embedded&updateexistingproduct&product=' . $currentStockEntry->product_id ) }}">
<a class="dropdown-item show-as-dialog-link permission-SHOPPINGLIST_ITEMS_ADD"
type="button"
href="{{ $U('/shoppinglistitem/new?embedded&updateexistingproduct&product=' . $currentStockEntry->product_id ) }}">
<span class="dropdown-item-icon"><i class="fas fa-shopping-cart"></i></span> <span class="dropdown-item-text">{{ $__t('Add to shopping list') }}</span>
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item show-as-dialog-link permission-STOCK_PURCHASE" type="button" href="{{ $U('/purchase?embedded&product=' . $currentStockEntry->product_id ) }}">
<a class="dropdown-item show-as-dialog-link permission-STOCK_PURCHASE"
type="button"
href="{{ $U('/purchase?embedded&product=' . $currentStockEntry->product_id ) }}">
<span class="dropdown-item-icon"><i class="fas fa-shopping-cart"></i></span> <span class="dropdown-item-text">{{ $__t('Purchase') }}</span>
</a>
<a class="dropdown-item show-as-dialog-link permission-STOCK_CONSUME" type="button" href="{{ $U('/consume?embedded&product=' . $currentStockEntry->product_id ) }}">
<a class="dropdown-item show-as-dialog-link permission-STOCK_CONSUME"
type="button"
href="{{ $U('/consume?embedded&product=' . $currentStockEntry->product_id ) }}">
<span class="dropdown-item-icon"><i class="fas fa-utensils"></i></span> <span class="dropdown-item-text">{{ $__t('Consume') }}</span>
</a>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<a class="dropdown-item show-as-dialog-link permission-STOCK_TRANSFER @if($currentStockEntry->amount < 1) disabled @endif" type="button" href="{{ $U('/transfer?embedded&product=' . $currentStockEntry->product_id) }}">
<a class="dropdown-item show-as-dialog-link permission-STOCK_TRANSFER @if($currentStockEntry->amount < 1) disabled @endif"
type="button"
href="{{ $U('/transfer?embedded&product=' . $currentStockEntry->product_id) }}">
<span class="dropdown-item-icon"><i class="fas fa-exchange-alt"></i></span> <span class="dropdown-item-text">{{ $__t('Transfer') }}</span>
</a>
@endif
<a class="dropdown-item show-as-dialog-link permission-STOCK_INVENTORY" type="button" href="{{ $U('/inventory?embedded&product=' . $currentStockEntry->product_id ) }}">
<a class="dropdown-item show-as-dialog-link permission-STOCK_INVENTORY"
type="button"
href="{{ $U('/inventory?embedded&product=' . $currentStockEntry->product_id ) }}">
<span class="dropdown-item-icon"><i class="fas fa-list"></i></span> <span class="dropdown-item-text">{{ $__t('Inventory') }}</span>
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item product-name-cell" data-product-id="{{ $currentStockEntry->product_id }}" type="button" href="#">
<a class="dropdown-item product-name-cell"
data-product-id="{{ $currentStockEntry->product_id }}"
type="button"
href="#">
<span class="dropdown-item-icon"><i class="fas fa-info"></i></span> <span class="dropdown-item-text">{{ $__t('Show product details') }}</span>
</a>
<a class="dropdown-item" type="button" href="{{ $U('/stockentries?product=') }}{{ $currentStockEntry->product_id }}"
<a class="dropdown-item"
type="button"
href="{{ $U('/stockentries?product=') }}{{ $currentStockEntry->product_id }}"
data-product-id="{{ $currentStockEntry->product_id }}">
<span class="dropdown-item-icon"><i class="fas fa-boxes"></i></span> <span class="dropdown-item-text">{{ $__t('Show stock entries') }}</span>
</a>
<a class="dropdown-item" type="button" href="{{ $U('/stockjournal?product=') }}{{ $currentStockEntry->product_id }}">
<a class="dropdown-item"
type="button"
href="{{ $U('/stockjournal?product=') }}{{ $currentStockEntry->product_id }}">
<span class="dropdown-item-icon"><i class="fas fa-file-alt"></i></span> <span class="dropdown-item-text">{{ $__t('Stock journal for this product') }}</span>
</a>
<a class="dropdown-item permission-MASTER_DATA_EDIT" type="button" href="{{ $U('/product/') }}{{ $currentStockEntry->product_id . '?returnto=%2Fstockoverview' }}">
<a class="dropdown-item permission-MASTER_DATA_EDIT"
type="button"
href="{{ $U('/product/') }}{{ $currentStockEntry->product_id . '?returnto=%2Fstockoverview' }}">
<span class="dropdown-item-icon"><i class="fas fa-edit"></i></span> <span class="dropdown-item-text">{{ $__t('Edit product') }}</span>
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item product-consume-button product-consume-button-spoiled permission-STOCK_CONSUME @if($currentStockEntry->amount < 1) disabled @endif" type="button" href="#"
<a class="dropdown-item product-consume-button product-consume-button-spoiled permission-STOCK_CONSUME @if($currentStockEntry->amount < 1) disabled @endif"
type="button"
href="#"
data-product-id="{{ $currentStockEntry->product_id }}"
data-product-name="{{ $currentStockEntry->product_name }}"
data-product-qu-name="{{ $currentStockEntry->qu_unit_name }}"
@@ -197,29 +264,37 @@
<span class="dropdown-item-icon"><i class="fas fa-utensils"></i></span> <span class="dropdown-item-text">{{ $__t('Consume %1$s of %2$s as spoiled', '1 ' . $currentStockEntry->qu_unit_name, $currentStockEntry->product_name) }}</span>
</a>
@if(GROCY_FEATURE_FLAG_RECIPES)
<a class="dropdown-item" type="button" href="{{ $U('/recipes?search=') }}{{ $currentStockEntry->product_name }}">
<a class="dropdown-item"
type="button"
href="{{ $U('/recipes?search=') }}{{ $currentStockEntry->product_name }}">
<span class="dropdown-item-icon"><i class="fas fa-cocktail"></i></span> <span class="dropdown-item-text">{{ $__t('Search for recipes containing this product') }}</span>
</a>
@endif
</div>
</div>
</td>
<td class="product-name-cell cursor-link" data-product-id="{{ $currentStockEntry->product_id }}">
<td class="product-name-cell cursor-link"
data-product-id="{{ $currentStockEntry->product_id }}">
{{ $currentStockEntry->product_name }}
</td>
<td>
@if($currentStockEntry->product_group_name !== null){{ $currentStockEntry->product_group_name }}@endif
</td>
<td>
<span id="product-{{ $currentStockEntry->product_id }}-amount" class="locale-number locale-number-quantity-amount">{{ $currentStockEntry->amount }}</span> <span id="product-{{ $currentStockEntry->product_id }}-qu-name">{{ $__n($currentStockEntry->amount, $currentStockEntry->qu_unit_name, $currentStockEntry->qu_unit_name_plural) }}</span>
<span id="product-{{ $currentStockEntry->product_id }}-opened-amount" class="small font-italic">@if($currentStockEntry->amount_opened > 0){{ $__t('%s opened', $currentStockEntry->amount_opened) }}@endif</span>
<span id="product-{{ $currentStockEntry->product_id }}-amount"
class="locale-number locale-number-quantity-amount">{{ $currentStockEntry->amount }}</span> <span id="product-{{ $currentStockEntry->product_id }}-qu-name">{{ $__n($currentStockEntry->amount, $currentStockEntry->qu_unit_name, $currentStockEntry->qu_unit_name_plural) }}</span>
<span id="product-{{ $currentStockEntry->product_id }}-opened-amount"
class="small font-italic">@if($currentStockEntry->amount_opened > 0){{ $__t('%s opened', $currentStockEntry->amount_opened) }}@endif</span>
@if($currentStockEntry->amount != $currentStockEntry->factor_purchase_amount)
<span id="product-{{ $currentStockEntry->product_id }}-factor-purchase-amount" class="locale-number locale-number-quantity-amount">({{ $currentStockEntry->factor_purchase_amount }}</span> <span id="product-{{ $currentStockEntry->product_id }}-qu-purchase-name">{{ $__n($currentStockEntry->factor_purchase_amount, $currentStockEntry->qu_purchase_unit_name,$currentStockEntry->qu_purchase_unit_name_plural) }})</span>
<span id="product-{{ $currentStockEntry->product_id }}-factor-purchase-amount"
class="locale-number locale-number-quantity-amount">({{ $currentStockEntry->factor_purchase_amount }}</span> <span id="product-{{ $currentStockEntry->product_id }}-qu-purchase-name">{{ $__n($currentStockEntry->factor_purchase_amount, $currentStockEntry->qu_purchase_unit_name,$currentStockEntry->qu_purchase_unit_name_plural) }})</span>
@endif
@if($currentStockEntry->is_aggregated_amount == 1)
<span class="pl-1 text-secondary">
<i class="fas fa-custom-sigma-sign"></i> <span id="product-{{ $currentStockEntry->product_id }}-amount-aggregated" class="locale-number locale-number-quantity-amount">{{ $currentStockEntry->amount_aggregated }}</span> {{ $__n($currentStockEntry->amount_aggregated, $currentStockEntry->qu_unit_name, $currentStockEntry->qu_unit_name_plural) }}
@if($currentStockEntry->amount_opened_aggregated > 0)<span id="product-{{ $currentStockEntry->product_id }}-opened-amount-aggregated" class="small font-italic">{{ $__t('%s opened', $currentStockEntry->amount_opened_aggregated) }}</span>@endif
<i class="fas fa-custom-sigma-sign"></i> <span id="product-{{ $currentStockEntry->product_id }}-amount-aggregated"
class="locale-number locale-number-quantity-amount">{{ $currentStockEntry->amount_aggregated }}</span> {{ $__n($currentStockEntry->amount_aggregated, $currentStockEntry->qu_unit_name, $currentStockEntry->qu_unit_name_plural) }}
@if($currentStockEntry->amount_opened_aggregated > 0)<span id="product-{{ $currentStockEntry->product_id }}-opened-amount-aggregated"
class="small font-italic">{{ $__t('%s opened', $currentStockEntry->amount_opened_aggregated) }}</span>@endif
</span>
@endif
@if(boolval($userSettings['show_icon_on_stock_overview_page_when_product_is_on_shopping_list']))
@@ -232,7 +307,9 @@
</td>
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) d-none @endif">
<span id="product-{{ $currentStockEntry->product_id }}-next-best-before-date">{{ $currentStockEntry->best_before_date }}</span>
<time id="product-{{ $currentStockEntry->product_id }}-next-best-before-date-timeago" class="timeago timeago-contextual" datetime="{{ $currentStockEntry->best_before_date }} 23:59:59"></time>
<time id="product-{{ $currentStockEntry->product_id }}-next-best-before-date-timeago"
class="timeago timeago-contextual"
datetime="{{ $currentStockEntry->best_before_date }} 23:59:59"></time>
</td>
<td class="d-none">
@foreach(FindAllObjectsInArrayByPropertyValue($currentStockLocations, 'product_id', $currentStockEntry->product_id) as $locationsForProduct)
@@ -240,7 +317,17 @@
@endforeach
</td>
<td class="d-none">
@if($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) expired @elseif($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("+$nextXDays days")) && $currentStockEntry->amount > 0) expiring @endif @if($currentStockEntry->product_missing) belowminstockamount @endif
@if($currentStockEntry->best_before_date < date('Y-m-d
23:59:59',
strtotime('-1
days'))
&&
$currentStockEntry->amount > 0) expired @elseif($currentStockEntry->best_before_date < date('Y-m-d
23:59:59',
strtotime("+$nextXDays
days"))
&&
$currentStockEntry->amount > 0) expiring @endif @if($currentStockEntry->product_missing) belowminstockamount @endif
</td>
<td class="d-none">
xx{{ $currentStockEntry->product_group_name }}xx
@@ -258,14 +345,18 @@
</div>
</div>
<div class="modal fade" id="stockoverview-productcard-modal" tabindex="-1">
<div class="modal fade"
id="stockoverview-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>
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Close') }}</button>
</div>
</div>
</div>

View File

@@ -19,7 +19,9 @@
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<div class="form-group">
<label for="product_presets_location_id">{{ $__t('Location') }}</label>
<select class="form-control user-setting-control" id="product_presets_location_id" data-setting-key="product_presets_location_id">
<select class="form-control user-setting-control"
id="product_presets_location_id"
data-setting-key="product_presets_location_id">
<option value="-1"></option>
@foreach($locations as $location)
<option value="{{ $location->id }}">{{ $location->name }}</option>
@@ -30,7 +32,9 @@
<div class="form-group">
<label for="product_presets_product_group_id">{{ $__t('Product group') }}</label>
<select class="form-control user-setting-control" id="product_presets_product_group_id" data-setting-key="product_presets_product_group_id">
<select class="form-control user-setting-control"
id="product_presets_product_group_id"
data-setting-key="product_presets_product_group_id">
<option value="-1"></option>
@foreach($productGroups as $productGroup)
<option value="{{ $productGroup->id }}">{{ $productGroup->name }}</option>
@@ -40,7 +44,9 @@
<div class="form-group">
<label for="product_presets_qu_id">{{ $__t('Quantity unit') }}</label>
<select class="form-control user-setting-control" id="product_presets_qu_id" data-setting-key="product_presets_qu_id">
<select class="form-control user-setting-control"
id="product_presets_qu_id"
data-setting-key="product_presets_qu_id">
<option value="-1"></option>
@foreach($quantityunits as $quantityunit)
<option value="{{ $quantityunit->id }}">{{ $quantityunit->name }}</option>
@@ -82,12 +88,16 @@
<div class="form-group">
<div class="checkbox">
<label for="show_icon_on_stock_overview_page_when_product_is_on_shopping_list">
<input type="checkbox" class="user-setting-control" id="show_icon_on_stock_overview_page_when_product_is_on_shopping_list" data-setting-key="show_icon_on_stock_overview_page_when_product_is_on_shopping_list"> {{ $__t('Show an icon if the product is already on the shopping list') }}
<input type="checkbox"
class="user-setting-control"
id="show_icon_on_stock_overview_page_when_product_is_on_shopping_list"
data-setting-key="show_icon_on_stock_overview_page_when_product_is_on_shopping_list"> {{ $__t('Show an icon if the product is already on the shopping list') }}
</label>
</div>
</div>
<a href="{{ $U('/stockoverview') }}" class="btn btn-success">{{ $__t('OK') }}</a>
<a href="{{ $U('/stockoverview') }}"
class="btn btn-success">{{ $__t('OK') }}</a>
</div>
</div>
@stop

View File

@@ -10,7 +10,8 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary" href="{{ $U('/userfields?entity=task_categories') }}">
<a class="btn btn-outline-secondary"
href="{{ $U('/userfields?entity=task_categories') }}">
{{ $__t('Configure userfields') }}
</a>
</div>
@@ -20,7 +21,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/taskcategory/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/taskcategory/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -31,14 +33,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="taskcategories-table" class="table table-sm table-striped dt-responsive">
<table id="taskcategories-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -55,10 +61,14 @@
@foreach($taskCategories as $taskCategory)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/taskcategory/') }}{{ $taskCategory->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/taskcategory/') }}{{ $taskCategory->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm task-category-delete-button" href="#" data-category-id="{{ $taskCategory->id }}" data-category-name="{{ $taskCategory->name }}">
<a class="btn btn-danger btn-sm task-category-delete-button"
href="#"
data-category-id="{{ $taskCategory->id }}"
data-category-name="{{ $taskCategory->name }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -17,23 +17,36 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $category->id }};</script>
<script>
Grocy.EditObjectId = {{ $category->id }};
</script>
@endif
<form id="task-category-form" novalidate>
<form id="task-category-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $category->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $category->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $category->description }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="description"
name="description">@if($mode == 'edit'){{ $category->description }}@endif</textarea>
</div>
@include('components.userfieldsform', array(
@@ -41,7 +54,8 @@
'entity' => 'task_categories'
))
<button id="save-task-category-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-task-category-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -17,23 +17,36 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $task->id }};</script>
<script>
Grocy.EditObjectId = {{ $task->id }};
</script>
@endif
<form id="task-form" novalidate>
<form id="task-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $task->name }}@endif">
<input type="text"
class="form-control"
required
id="name"
name="name"
value="@if($mode == 'edit'){{ $task->name }}@endif">
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $task->description }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="description"
name="description">@if($mode == 'edit'){{ $task->description }}@endif</textarea>
</div>
@php
@@ -59,10 +72,14 @@
<div class="form-group">
<label for="category_id">{{ $__t('Category') }}</label>
<select class="form-control" id="category_id" name="category_id">
<select class="form-control"
id="category_id"
name="category_id">
<option></option>
@foreach($taskCategories as $taskCategory)
<option @if($mode == 'edit' && $taskCategory->id == $task->category_id) selected="selected" @endif value="{{ $taskCategory->id }}">{{ $taskCategory->name }}</option>
<option @if($mode=='edit'
&&
$taskCategory->id == $task->category_id) selected="selected" @endif value="{{ $taskCategory->id }}">{{ $taskCategory->name }}</option>
@endforeach
</select>
</div>
@@ -85,7 +102,8 @@
'entity' => 'tasks'
))
<button id="save-task-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-task-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -10,8 +10,10 @@
@endpush
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}"
rel="stylesheet">
@endpush
@section('content')
@@ -19,14 +21,20 @@
<div class="col">
<h2 class="title">@yield('title')</h2>
<hr>
<p id="info-due-tasks" data-status-filter="duesoon" data-next-x-days="{{ $nextXDays }}" class="warning-message status-filter-message responsive-button mr-2"></p>
<p id="info-overdue-tasks" data-status-filter="overdue" class="error-message status-filter-message responsive-button"></p>
<p id="info-due-tasks"
data-status-filter="duesoon"
data-next-x-days="{{ $nextXDays }}"
class="warning-message status-filter-message responsive-button mr-2"></p>
<p id="info-overdue-tasks"
data-status-filter="overdue"
class="error-message status-filter-message responsive-button"></p>
</div>
</div>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/task/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/task/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -37,7 +45,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
@@ -45,7 +56,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="status-filter">
<select class="form-control"
id="status-filter">
<option value="all">{{ $__t('All') }}</option>
<option value="duesoon">{{ $__t('Due soon') }}</option>
<option value="overdue">{{ $__t('Overdue') }}</option>
@@ -54,8 +66,11 @@
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
<div class="form-check custom-control form-control-lg custom-checkbox pt-0">
<input class="form-check-input custom-control-input" type="checkbox" id="show-done-tasks">
<label class="form-check-label custom-control-label" for="show-done-tasks">
<input class="form-check-input custom-control-input"
type="checkbox"
id="show-done-tasks">
<label class="form-check-label custom-control-label"
for="show-done-tasks">
{{ $__t('Show done tasks') }}
</label>
</div>
@@ -64,7 +79,8 @@
<div class="row">
<div class="col">
<table id="tasks-table" class="table table-sm table-striped dt-responsive">
<table id="tasks-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -82,36 +98,53 @@
</thead>
<tbody class="d-none">
@foreach($tasks as $task)
<tr id="task-{{ $task->id }}-row" class="@if($task->done == 1) text-muted @endif @if(!empty($task->due_date) && $task->due_date < date('Y-m-d')) table-danger @elseif(!empty($task->due_date) && $task->due_date < date('Y-m-d', strtotime("+$nextXDays days"))) table-warning @endif">
<tr id="task-{{ $task->id }}-row"
class="@if($task->done == 1) text-muted @endif @if(!empty($task->due_date) && $task->due_date < date('Y-m-d')) table-danger @elseif(!empty($task->due_date) && $task->due_date < date('Y-m-d', strtotime("
+$nextXDays
days")))
table-warning
@endif">
<td class="fit-content border-right">
@if($task->done == 0)
<a class="btn btn-success btn-sm do-task-button" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Mark task "%s" as completed', $task->name) }}"
<a class="btn btn-success btn-sm do-task-button"
href="#"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Mark task "%s" as completed', $task->name) }}"
data-task-id="{{ $task->id }}"
data-task-name="{{ $task->name }}">
<i class="fas fa-check"></i>
</a>
@else
<a class="btn btn-secondary btn-sm undo-task-button" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Undo task "%s"', $task->name) }}"
<a class="btn btn-secondary btn-sm undo-task-button"
href="#"
data-toggle="tooltip"
data-placement="left"
title="{{ $__t('Undo task "%s"', $task->name) }}"
data-task-id="{{ $task->id }}"
data-task-name="{{ $task->name }}">
<i class="fas fa-undo"></i>
</a>
@endif
<a class="btn btn-sm btn-danger delete-task-button" href="#"
<a class="btn btn-sm btn-danger delete-task-button"
href="#"
data-task-id="{{ $task->id }}"
data-task-name="{{ $task->name }}">
<i class="fas fa-trash"></i>
</a>
<a class="btn btn-info btn-sm" href="{{ $U('/task/') }}{{ $task->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/task/') }}{{ $task->id }}">
<i class="fas fa-edit"></i>
</a>
</td>
<td id="task-{{ $task->id }}-name" class="@if($task->done == 1) text-strike-through @endif">
<td id="task-{{ $task->id }}-name"
class="@if($task->done == 1) text-strike-through @endif">
{{ $task->name }}
</td>
<td>
<span>{{ $task->due_date }}</span>
<time class="timeago timeago-contextual" datetime="{{ $task->due_date }}"></time>
<time class="timeago timeago-contextual"
datetime="{{ $task->due_date }}"></time>
</td>
<td class="d-none">
@if($task->category_id != null) <span>{{ FindObjectInArrayByPropertyValue($taskCategories, 'id', $task->category_id)->name }}</span> @else <span class="font-italic font-weight-light">{{ $__t('Uncategorized') }}</span>@endif
@@ -120,11 +153,16 @@
@if($task->assigned_to_user_id != null) <span>{{ GetUserDisplayName(FindObjectInArrayByPropertyValue($users, 'id', $task->assigned_to_user_id)) }}</span> @endif
</td>
<td class="d-none">
@if($task->done == 1) text-muted @endif @if(!empty($task->due_date) && $task->due_date < date('Y-m-d')) overdue @elseif(!empty($task->due_date) && $task->due_date < date('Y-m-d', strtotime("+$nextXDays days"))) duesoon @endif
@if($task->done == 1) text-muted @endif @if(!empty($task->due_date) && $task->due_date < date('Y-m-d'))
overdue
@elseif(!empty($task->due_date) && $task->due_date < date('Y-m-d',
strtotime("+$nextXDays
days")))
duesoon
@endif
</td>
@include('components.userfields_tbody', array(
'userfields' => $userfields,
@include('components.userfields_tbody',
array( 'userfields'=> $userfields,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $task->id)
))

View File

@@ -23,7 +23,8 @@
'additionalCssClasses' => 'user-setting-control'
))
<a href="{{ $U('/tasks') }}" class="btn btn-success">{{ $__t('OK') }}</a>
<a href="{{ $U('/tasks') }}"
class="btn btn-success">{{ $__t('OK') }}</a>
</div>
</div>
@stop

View File

@@ -10,7 +10,8 @@
<h2 class="title">@yield('title')</h2>
<hr>
<form id="transfer-form" novalidate>
<form id="transfer-form"
novalidate>
@include('components.productpicker', array(
'products' => $products,
@@ -28,10 +29,14 @@
<div class="form-group">
<label for="location_id_from">{{ $__t('From location') }}</label>
<select required class="form-control location-combobox" id="location_id_from" name="location_id_from">
<select required
class="form-control location-combobox"
id="location_id_from"
name="location_id_from">
<option></option>
@foreach($locations as $location)
<option value="{{ $location->id }}" data-is-freezer="{{ $location->is_freezer }}">{{ $location->name }}</option>
<option value="{{ $location->id }}"
data-is-freezer="{{ $location->is_freezer }}">{{ $location->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A location is required') }}</div>
@@ -44,15 +49,21 @@
'min' => 1,
'value' => 1,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
<div class="form-group">
<label for="use_specific_stock_entry">
<input type="checkbox" id="use_specific_stock_entry" name="use_specific_stock_entry"> {{ $__t('Use a specific stock item') }}
<input type="checkbox"
id="use_specific_stock_entry"
name="use_specific_stock_entry"> {{ $__t('Use a specific stock item') }}
<span class="small text-muted">{{ $__t('The first item in this list would be picked by the default rule which is "First expiring first, then first in first out"') }}</span>
</label>
<select disabled class="form-control" id="specific_stock_entry" name="specific_stock_entry">
<select disabled
class="form-control"
id="specific_stock_entry"
name="specific_stock_entry">
<option></option>
</select>
</div>
@@ -65,16 +76,21 @@
<div class="form-group">
<label for="location_id_to">{{ $__t('To location') }}</label>
<select required class="form-control location-combobox" id="location_id_to" name="location_id_to">
<select required
class="form-control location-combobox"
id="location_id_to"
name="location_id_to">
<option></option>
@foreach($locations as $location)
<option value="{{ $location->id }}" data-is-freezer="{{ $location->is_freezer }}">{{ $location->name }}</option>
<option value="{{ $location->id }}"
data-is-freezer="{{ $location->is_freezer }}">{{ $location->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A location is required') }}</div>
</div>
<button id="save-transfer-button" class="btn btn-success">{{ $__t('OK') }}</button>
<button id="save-transfer-button"
class="btn btn-success">{{ $__t('OK') }}</button>
</form>
</div>

View File

@@ -13,7 +13,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/userentity/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/userentity/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -24,14 +25,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="userentities-table" class="table table-sm table-striped dt-responsive">
<table id="userentities-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -43,13 +48,18 @@
@foreach($userentities as $userentity)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/userentity/') }}{{ $userentity->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/userentity/') }}{{ $userentity->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm userentity-delete-button" href="#" data-userentity-id="{{ $userentity->id }}" data-userentity-name="{{ $userentity->name }}">
<a class="btn btn-danger btn-sm userentity-delete-button"
href="#"
data-userentity-id="{{ $userentity->id }}"
data-userentity-name="{{ $userentity->name }}">
<i class="fas fa-trash"></i>
</a>
<a class="btn btn-secondary btn-sm" href="{{ $U('/userfields?entity=userentity-') }}{{ $userentity->name }}">
<a class="btn btn-secondary btn-sm"
href="{{ $U('/userfields?entity=userentity-') }}{{ $userentity->name }}">
<i class="fas fa-th-list"></i> {{ $__t('Configure fields') }}
</a>
</td>

View File

@@ -17,45 +17,79 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $userentity->id }};</script>
<script>
Grocy.EditObjectId = {{ $userentity->id }};
</script>
@endif
<form id="userentity-form" novalidate>
<form id="userentity-form"
novalidate>
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input @if($mode == 'edit') disabled @endif type="text" class="form-control" required pattern="^[a-zA-Z0-9]*$" id="name" name="name" value="@if($mode == 'edit'){{ $userentity->name }}@endif">
<input @if($mode=='edit'
)
disabled
@endif
type="text"
class="form-control"
required
pattern="^[a-zA-Z0-9]*$"
id="name"
name="name"
value="@if($mode == 'edit'){{ $userentity->name }}@endif">
<div class="invalid-feedback">{{ $__t('This is required and can only contain letters and numbers') }}</div>
</div>
<div class="form-group">
<label for="name">{{ $__t('Caption') }}</label>
<input type="text" class="form-control" required id="caption" name="caption" value="@if($mode == 'edit'){{ $userentity->caption }}@endif">
<input type="text"
class="form-control"
required
id="caption"
name="caption"
value="@if($mode == 'edit'){{ $userentity->caption }}@endif">
<div class="invalid-feedback">{{ $__t('A caption is required') }}</div>
</div>
<div class="form-group">
<label for="description">{{ $__t('Description') }}</label>
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $userentity->description }}@endif</textarea>
<textarea class="form-control"
rows="2"
id="description"
name="description">@if($mode == 'edit'){{ $userentity->description }}@endif</textarea>
</div>
<div class="form-group">
<div class="form-check">
<input type="hidden" name="show_in_sidebar_menu" value="0">
<input @if($mode == 'edit' && $userentity->show_in_sidebar_menu == 1) checked @endif class="form-check-input" type="checkbox" id="show_in_sidebar_menu" name="show_in_sidebar_menu" value="1">
<label class="form-check-label" for="show_in_sidebar_menu">{{ $__t('Show in sidebar menu') }}</label>
<input type="hidden"
name="show_in_sidebar_menu"
value="0">
<input @if($mode=='edit'
&&
$userentity->show_in_sidebar_menu == 1) checked @endif class="form-check-input" type="checkbox" id="show_in_sidebar_menu" name="show_in_sidebar_menu" value="1">
<label class="form-check-label"
for="show_in_sidebar_menu">{{ $__t('Show in sidebar menu') }}</label>
</div>
</div>
<div class="form-group">
<label for="name">{{ $__t('Icon CSS class') }}</label>
<input type="text" class="form-control" id="icon_css_class" name="icon_css_class" value="@if($mode == 'edit'){{ $userentity->icon_css_class }}@endif" placeholder='{{ $__t('For example') }} "fas fa-smile"'>
<input type="text"
class="form-control"
id="icon_css_class"
name="icon_css_class"
value="@if($mode == 'edit'){{ $userentity->icon_css_class }}@endif"
placeholder='{{ $__t('For example') }} "fas fa-smile"'>
</div>
<button id="save-userentity-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-userentity-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -17,20 +17,30 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $userfield->id }};</script>
<script>
Grocy.EditObjectId = {{ $userfield->id }};
</script>
@endif
<form id="userfield-form" novalidate>
<form id="userfield-form"
novalidate>
<div class="form-group">
<label for="entity">{{ $__t('Entity') }}</label>
<select required class="form-control" id="entity" name="entity">
<select required
class="form-control"
id="entity"
name="entity">
<option></option>
@foreach($entities as $entity)
<option @if($mode == 'edit' && $userfield->entity == $entity) selected="selected" @endif value="{{ $entity }}">{{ $entity }}</option>
<option @if($mode=='edit'
&&
$userfield->entity == $entity) selected="selected" @endif value="{{ $entity }}">{{ $entity }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A entity is required') }}</div>
@@ -38,41 +48,67 @@
<div class="form-group">
<label for="name">{{ $__t('Name') }}</label>
<input type="text" class="form-control" required pattern="^[a-zA-Z0-9]*$" id="name" name="name" value="@if($mode == 'edit'){{ $userfield->name }}@endif">
<input type="text"
class="form-control"
required
pattern="^[a-zA-Z0-9]*$"
id="name"
name="name"
value="@if($mode == 'edit'){{ $userfield->name }}@endif">
<div class="invalid-feedback">{{ $__t('This is required and can only contain letters and numbers') }}</div>
</div>
<div class="form-group">
<label for="name">{{ $__t('Caption') }}</label>
<input type="text" class="form-control" required id="caption" name="caption" value="@if($mode == 'edit'){{ $userfield->caption }}@endif">
<input type="text"
class="form-control"
required
id="caption"
name="caption"
value="@if($mode == 'edit'){{ $userfield->caption }}@endif">
<div class="invalid-feedback">{{ $__t('A caption is required') }}</div>
</div>
<div class="form-group">
<label for="type">{{ $__t('Type') }}</label>
<select required class="form-control" id="type" name="type">
<select required
class="form-control"
id="type"
name="type">
<option></option>
@foreach($userfieldTypes as $userfieldType)
<option @if($mode == 'edit' && $userfield->type == $userfieldType) selected="selected" @endif value="{{ $userfieldType }}">{{ $__t($userfieldType) }}</option>
<option @if($mode=='edit'
&&
$userfield->type == $userfieldType) selected="selected" @endif value="{{ $userfieldType }}">{{ $__t($userfieldType) }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('A type is required') }}</div>
</div>
<div class="form-group d-none">
<label for="config">{{ $__t('Configuration') }} <span id="config-hint" class="small text-muted"></span></label>
<textarea class="form-control" rows="10" id="config" name="config">@if($mode == 'edit'){{ $userfield->config }}@endif</textarea>
<label for="config">{{ $__t('Configuration') }} <span id="config-hint"
class="small text-muted"></span></label>
<textarea class="form-control"
rows="10"
id="config"
name="config">@if($mode == 'edit'){{ $userfield->config }}@endif</textarea>
</div>
<div class="form-group">
<div class="form-check">
<input type="hidden" name="show_as_column_in_tables" value="0">
<input @if($mode == 'edit' && $userfield->show_as_column_in_tables == 1) checked @endif class="form-check-input" type="checkbox" id="show_as_column_in_tables" name="show_as_column_in_tables" value="1">
<label class="form-check-label" for="show_as_column_in_tables">{{ $__t('Show as column in tables') }}</label>
<input type="hidden"
name="show_as_column_in_tables"
value="0">
<input @if($mode=='edit'
&&
$userfield->show_as_column_in_tables == 1) checked @endif class="form-check-input" type="checkbox" id="show_as_column_in_tables" name="show_as_column_in_tables" value="1">
<label class="form-check-label"
for="show_as_column_in_tables">{{ $__t('Show as column in tables') }}</label>
</div>
</div>
<button id="save-userfield-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-userfield-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -14,7 +14,8 @@
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/userfield/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/userfield/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -25,7 +26,10 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
<div class="col-xs-12 col-md-6 col-xl-3">
@@ -33,7 +37,8 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i></span>
</div>
<select class="form-control" id="entity-filter">
<select class="form-control"
id="entity-filter">
<option value="all">{{ $__t('All') }}</option>
@foreach($entities as $entity)
<option value="{{ $entity }}">{{ $entity }}</option>
@@ -45,7 +50,8 @@
<div class="row">
<div class="col">
<table id="userfields-table" class="table table-sm table-striped dt-responsive">
<table id="userfields-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -59,10 +65,14 @@
@foreach($userfields as $userfield)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/userfield/') }}{{ $userfield->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/userfield/') }}{{ $userfield->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm userfield-delete-button" href="#" data-userfield-id="{{ $userfield->id }}" data-userfield-name="{{ $userfield->name }}">
<a class="btn btn-danger btn-sm userfield-delete-button"
href="#"
data-userfield-id="{{ $userfield->id }}"
data-userfield-name="{{ $userfield->name }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -17,42 +17,69 @@
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<script>Grocy.EditMode = '{{ $mode }}';</script>
<script>
Grocy.EditMode = '{{ $mode }}';
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $user->id }};</script>
<script>
Grocy.EditObjectId = {{ $user->id }};
</script>
@endif
<form id="user-form" novalidate>
<form id="user-form"
novalidate>
<div class="form-group">
<label for="username">{{ $__t('Username') }}</label>
<input type="text" class="form-control" required id="username" name="username" value="@if($mode == 'edit'){{ $user->username }}@endif">
<input type="text"
class="form-control"
required
id="username"
name="username"
value="@if($mode == 'edit'){{ $user->username }}@endif">
<div class="invalid-feedback">{{ $__t('A username is required') }}</div>
</div>
<div class="form-group">
<label for="first_name">{{ $__t('First name') }}</label>
<input type="text" class="form-control" id="first_name" name="first_name" value="@if($mode == 'edit'){{ $user->first_name }}@endif">
<input type="text"
class="form-control"
id="first_name"
name="first_name"
value="@if($mode == 'edit'){{ $user->first_name }}@endif">
</div>
<div class="form-group">
<label for="last_name">{{ $__t('Last name') }}</label>
<input type="text" class="form-control" id="last_name" name="last_name" value="@if($mode == 'edit'){{ $user->last_name }}@endif">
<input type="text"
class="form-control"
id="last_name"
name="last_name"
value="@if($mode == 'edit'){{ $user->last_name }}@endif">
</div>
<div class="form-group">
<label for="password">{{ $__t('Password') }}</label>
<input type="password" class="form-control" required id="password" name="password">
<input type="password"
class="form-control"
required
id="password"
name="password">
</div>
<div class="form-group">
<label for="password_confirm">{{ $__t('Confirm password') }}</label>
<input type="password" class="form-control" required id="password_confirm" name="password_confirm">
<input type="password"
class="form-control"
required
id="password_confirm"
name="password_confirm">
<div class="invalid-feedback">{{ $__t('Passwords do not match') }}</div>
</div>
<button id="save-user-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-user-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -24,17 +24,21 @@
</script>
@if($mode == 'edit')
<script>Grocy.EditObjectId = {{ $userobject->id }};</script>
<script>
Grocy.EditObjectId = {{ $userobject->id }};
</script>
@endif
<form id="userobject-form" novalidate>
<form id="userobject-form"
novalidate>
@include('components.userfieldsform', array(
'userfields' => $userfields,
'entity' => 'userentity-' . $userentity->name
))
<button id="save-userobject-button" class="btn btn-success">{{ $__t('Save') }}</button>
<button id="save-userobject-button"
class="btn btn-success">{{ $__t('Save') }}</button>
</form>
</div>

View File

@@ -10,7 +10,8 @@
<div class="title-related-links">
<h2 class="title">@yield('title')</h2>
<div class="related-links">
<a class="btn btn-outline-secondary d-print-none" href="{{ $U('/userfields?entity=' . 'userentity-' . $userentity->name) }}">
<a class="btn btn-outline-secondary d-print-none"
href="{{ $U('/userfields?entity=' . 'userentity-' . $userentity->name) }}">
{{ $__t('Configure fields') }}
</a>
</div>
@@ -21,7 +22,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/userobject/' . $userentity->name . '/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/userobject/' . $userentity->name . '/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -32,14 +34,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="userobjects-table" class="table table-sm table-striped dt-responsive">
<table id="userobjects-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right d-print-none"></th>
@@ -54,10 +60,13 @@
@foreach($userobjects as $userobject)
<tr>
<td class="fit-content border-right d-print-none">
<a class="btn btn-info btn-sm" href="{{ $U('/userobject/' . $userentity->name . '/') }}{{ $userobject->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/userobject/' . $userentity->name . '/') }}{{ $userobject->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-danger btn-sm userobject-delete-button" href="#" data-userobject-id="{{ $userobject->id }}">
<a class="btn btn-danger btn-sm userobject-delete-button"
href="#"
data-userobject-id="{{ $userobject->id }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -28,7 +28,9 @@
</li>
@endforeach
</ul>
<button id="permission-save" class="btn btn-success" type="submit">{{ $__t('Save') }}</button>
<button id="permission-save"
class="btn btn-success"
type="submit">{{ $__t('Save') }}</button>
</div>
</div>
@endsection

View File

@@ -13,7 +13,8 @@
<hr>
<div class="row mt-3">
<div class="col-xs-12 col-md-2 col-xl-1">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/user/new') }}">
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3"
href="{{ $U('/user/new') }}">
{{ $__t('Add') }}
</a>
</div>
@@ -24,14 +25,18 @@
<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') }}">
<input type="text"
id="search"
class="form-control"
placeholder="{{ $__t('Search') }}">
</div>
</div>
</div>
<div class="row">
<div class="col">
<table id="users-table" class="table table-sm table-striped dt-responsive">
<table id="users-table"
class="table table-sm table-striped dt-responsive">
<thead>
<tr>
<th class="border-right"></th>
@@ -44,13 +49,18 @@
@foreach($users as $user)
<tr>
<td class="fit-content border-right">
<a class="btn btn-info btn-sm" href="{{ $U('/user/') }}{{ $user->id }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/user/') }}{{ $user->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-info btn-sm" href="{{ $U('/user/' . $user->id . '/permissions') }}">
<a class="btn btn-info btn-sm"
href="{{ $U('/user/' . $user->id . '/permissions') }}">
<i class="fas fa-lock"></i>
</a>
<a class="btn btn-danger btn-sm user-delete-button @if($user->id == GROCY_USER_ID) disabled @endif" href="#" data-user-id="{{ $user->id }}" data-user-username="{{ $user->username }}">
<a class="btn btn-danger btn-sm user-delete-button @if($user->id == GROCY_USER_ID) disabled @endif"
href="#"
data-user-id="{{ $user->id }}"
data-user-username="{{ $user->username }}">
<i class="fas fa-trash"></i>
</a>
</td>

View File

@@ -16,15 +16,21 @@
<div class="form-group">
<label for="locale">{{ $__t('Language') }}</label>
<select class="form-control user-setting-control" id="locale" data-setting-key="locale">
<select class="form-control user-setting-control"
id="locale"
data-setting-key="locale">
<option value="">{{ $__t('Default') }}</option>
@foreach($languages as $lang)
<option value="{{ $lang }}" @if(GROCY_LOCALE == $lang) checked @endif>{{ $__t($lang) }}</option>
<option value="{{ $lang }}"
@if(GROCY_LOCALE==$lang)
checked
@endif>{{ $__t($lang) }}</option>
@endforeach
</select>
</div>
<a href="{{ $U('/') }}" class="btn btn-success link-return">{{ $__t('OK') }}</a>
<a href="{{ $U('/') }}"
class="btn btn-success link-return">{{ $__t('OK') }}</a>
</div>
</div>
@stop