mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
General improvements
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
<form id="product-form">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="<?php if ($mode == 'edit') echo $product->name; ?>">
|
||||
<input type="text" class="form-control" required id="name" name="name" value="<?php if ($mode == 'edit') echo $product->name; ?>">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="barcode">Barcode</label>
|
||||
@@ -27,31 +28,35 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="location_id">Location</label>
|
||||
<select class="form-control" id="location_id" name="location_id">
|
||||
<select required class="form-control" id="location_id" name="location_id">
|
||||
<?php foreach ($locations as $location) : ?>
|
||||
<option <?php if ($mode == 'edit' && $location->id == $product->location_id) echo 'selected="selected"'; ?> value="<?php echo $location->id; ?>"><?php echo $location->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="qu_id_purchase">Quantity unit purchase</label>
|
||||
<select class="form-control" id="qu_id_purchase" name="qu_id_purchase">
|
||||
<select required class="form-control" id="qu_id_purchase" name="qu_id_purchase">
|
||||
<?php foreach ($quantityunits as $quantityunit) : ?>
|
||||
<option <?php if ($mode == 'edit' && $quantityunit->id == $product->qu_id_purchase) echo 'selected="selected"'; ?> value="<?php echo $quantityunit->id; ?>"><?php echo $quantityunit->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="qu_id_stock">Quantity unit stock</label>
|
||||
<select class="form-control" id="qu_id_stock" name="qu_id_stock">
|
||||
<?php foreach ($quantityunits as $quantityunit) : ?>
|
||||
<option <?php if ($mode == 'edit' && $quantityunit->id == $product->qu_id_stock) echo 'selected="selected"'; ?> value="<?php echo $quantityunit->id; ?>"><?php echo $quantityunit->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
<select required class="form-control" id="qu_id_stock" name="qu_id_stock">
|
||||
<?php foreach ($quantityunits as $quantityunit) : ?>
|
||||
<option <?php if ($mode == 'edit' && $quantityunit->id == $product->qu_id_stock) echo 'selected="selected"'; ?> value="<?php echo $quantityunit->id; ?>"><?php echo $quantityunit->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="qu_factor_purchase_to_stock">Factor purchase to stock quantity unit</label>
|
||||
<input type="text" class="form-control" id="qu_factor_purchase_to_stock" name="qu_factor_purchase_to_stock" value="<?php if ($mode == 'edit') echo $product->qu_factor_purchase_to_stock; else echo '1'; ?>">
|
||||
<input required min="1" type="number" class="form-control" id="qu_factor_purchase_to_stock" name="qu_factor_purchase_to_stock" value="<?php if ($mode == 'edit') echo $product->qu_factor_purchase_to_stock; else echo '1'; ?>">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<button id="save-product-button" type="submit" class="btn btn-default">Save</button>
|
||||
</form>
|
||||
|
Reference in New Issue
Block a user