Set customer vehicle name as optional, fix customer form to work with new gas and status values
This commit is contained in:
parent
66e70e4684
commit
5e910be1e7
2 changed files with 26 additions and 5 deletions
|
|
@ -23,8 +23,7 @@ class CustomerVehicle
|
||||||
|
|
||||||
// user-defined name for vehicle
|
// user-defined name for vehicle
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", length=80)
|
* @ORM\Column(type="string", length=80, nullable=true)
|
||||||
* @Assert\NotBlank()
|
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@
|
||||||
<div class="form-group m-form__group row">
|
<div class="form-group m-form__group row">
|
||||||
<div class="col-lg-3">
|
<div class="col-lg-3">
|
||||||
<label for="vehicle-name" data-field="name">Vehicle Name</label>
|
<label for="vehicle-name" data-field="name">Vehicle Name</label>
|
||||||
<input type="text" name="name" id="vehicle-name" class="form-control m-input" data-required="1">
|
<input type="text" name="name" id="vehicle-name" class="form-control m-input" data-required="0">
|
||||||
<div class="form-control-feedback hide" data-field="name"></div>
|
<div class="form-control-feedback hide" data-field="name"></div>
|
||||||
<span class="m-form__help">Display name for this vehicle</span>
|
<span class="m-form__help">Display name for this vehicle</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -957,14 +957,36 @@
|
||||||
field: 'status_condition',
|
field: 'status_condition',
|
||||||
title: 'Cond.',
|
title: 'Cond.',
|
||||||
template: function (row, index, datatable) {
|
template: function (row, index, datatable) {
|
||||||
return row.status_condition + '<div class="form-control-feedback hide" data-field="status_condition"></div>';
|
var label;
|
||||||
|
|
||||||
|
switch (row.status_condition) {
|
||||||
|
case 'new':
|
||||||
|
return 'Brand New';
|
||||||
|
break;
|
||||||
|
case 'second-hand':
|
||||||
|
return 'Second-Hand';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return label + '<div class="form-control-feedback hide" data-field="status_condition"></div>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'fuel_type',
|
field: 'fuel_type',
|
||||||
title: 'Fuel Type',
|
title: 'Fuel Type',
|
||||||
template: function (row, index, datatable) {
|
template: function (row, index, datatable) {
|
||||||
return row.fuel_type + '<div class="form-control-feedback hide" data-field="fuel_type"></div>';
|
var label;
|
||||||
|
|
||||||
|
switch (row.fuel_type) {
|
||||||
|
case 'gas':
|
||||||
|
return 'Gas';
|
||||||
|
break;
|
||||||
|
case 'diesel':
|
||||||
|
return 'Diesel';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return label + '<div class="form-control-feedback hide" data-field="fuel_type"></div>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue