mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
Make presets for new products configurable (closes #92)
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
<div class="form-group">
|
||||
<label for="location_id">{{ $L('Location') }}</label>
|
||||
<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>
|
||||
@endforeach
|
||||
@@ -85,6 +86,7 @@
|
||||
<div class="form-group">
|
||||
<label for="qu_id_purchase">{{ $L('Quantity unit purchase') }}</label>
|
||||
<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>
|
||||
@endforeach
|
||||
@@ -95,6 +97,7 @@
|
||||
<div class="form-group">
|
||||
<label for="qu_id_stock">{{ $L('Quantity unit stock') }}</label>
|
||||
<select required class="form-control input-group-qu" id="qu_id_stock" name="qu_id_stock">
|
||||
<option></option>
|
||||
@foreach($quantityunits as $quantityunit)
|
||||
<option @if($mode == 'edit' && $quantityunit->id == $product->qu_id_stock) selected="selected" @endif value="{{ $quantityunit->id }}">{{ $quantityunit->name }}</option>
|
||||
@endforeach
|
||||
|
45
views/productpresets.blade.php
Normal file
45
views/productpresets.blade.php
Normal file
@@ -0,0 +1,45 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', $L('Presets for new products'))
|
||||
|
||||
@section('viewJsName', 'productpresets')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<h1>@yield('title')</h1>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="product_presets_location_id">{{ $L('Location') }}</label>
|
||||
<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>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="product_presets_product_group_id">{{ $L('Product group') }}</label>
|
||||
<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>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="product_presets_qu_id">{{ $L('Quantity unit purchase') }}</label>
|
||||
<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>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<a href="{{ $U('/products') }}" class="btn btn-success">{{ $L('OK') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
@@ -12,6 +12,9 @@
|
||||
<a class="btn btn-outline-dark" href="{{ $U('/product/new') }}">
|
||||
<i class="fas fa-plus"></i> {{ $L('Add') }}
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary" href="{{ $U('/productpresets') }}">
|
||||
<i class="fas fa-sliders-h"></i> {{ $L('Presets for new products') }}
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user