mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
This commit is contained in:
19
views/components/recipepicker.blade.php
Normal file
19
views/components/recipepicker.blade.php
Normal file
@@ -0,0 +1,19 @@
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/recipepicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
|
||||
@php if(empty($prefillByName)) { $prefillByName = ''; } @endphp
|
||||
@php if(empty($prefillById)) { $prefillById = ''; } @endphp
|
||||
@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="recipe_id">{{ $L('Recipe') }} <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>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="invalid-feedback">{{ $L('You have to select a recipe') }}</div>
|
||||
</div>
|
@@ -42,6 +42,14 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@if (GROCY_FEATURE_FLAG_RECIPES)
|
||||
@include('components.recipepicker', array(
|
||||
'recipes' => $recipes,
|
||||
'isRequired' => false,
|
||||
'hint' => $L('This is for statistical purposes only')
|
||||
))
|
||||
@endif
|
||||
|
||||
<button id="save-consume-button" class="btn btn-success">{{ $L('OK') }}</button>
|
||||
<button id="save-mark-as-open-button" class="btn btn-secondary">{{ $L('Mark as opened') }}</button>
|
||||
|
||||
|
@@ -54,6 +54,7 @@
|
||||
Grocy.Culture = '{{ GROCY_CULTURE }}';
|
||||
Grocy.Currency = '{{ GROCY_CURRENCY }}';
|
||||
Grocy.UserSettings = {!! json_encode($userSettings) !!};
|
||||
Grocy.FeatureFlags = {!! json_encode($featureFlags) !!};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
Reference in New Issue
Block a user