2018-04-11 19:49:35 +02:00
@ extends ( 'layout.default' )
2018-04-12 21:13:38 +02:00
@ if ( $mode == 'edit' )
2020-08-31 20:32:50 +02:00
@ section ( 'title' , $__t ( 'Edit location' ))
2018-04-12 21:13:38 +02:00
@ else
2020-08-31 20:32:50 +02:00
@ section ( 'title' , $__t ( 'Create location' ))
2018-04-12 21:13:38 +02:00
@ endif
@ section ( 'viewJsName' , 'locationform' )
2018-04-11 19:49:35 +02:00
@ section ( 'content' )
2020-04-19 08:51:02 -04:00
< div class = "row" >
< div class = "col" >
< h2 class = "title" >@ yield ( 'title' ) </ h2 >
</ div >
</ div >
2020-10-31 18:37:10 +01:00
2020-11-08 15:09:10 +01:00
< hr class = "my-2" >
2020-10-31 18:37:10 +01:00
2018-07-10 20:37:13 +02:00
< div class = "row" >
< div class = "col-lg-6 col-xs-12" >
2020-08-31 20:32:50 +02:00
< script >
Grocy . EditMode = '{{ $mode }}' ;
</ script >
2017-04-15 23:16:20 +02:00
2018-07-10 20:37:13 +02:00
@ if ( $mode == 'edit' )
2020-08-31 20:32:50 +02:00
< script >
Grocy . EditObjectId = {{ $location -> id }};
</ script >
2018-07-10 20:37:13 +02:00
@ endif
2017-04-15 23:16:20 +02:00
2020-08-31 20:32:50 +02:00
< form id = "location-form"
novalidate >
2017-04-19 21:09:28 +02:00
2018-07-10 20:37:13 +02:00
< div class = "form-group" >
2019-05-01 20:19:18 +02:00
< label for = "name" > {{ $__t ( 'Name' ) }} </ label >
2020-08-31 20:32:50 +02:00
< input type = "text"
class = "form-control"
required
id = "name"
name = "name"
value = "@if( $mode == 'edit'){{ $location->name }}@endif" >
2019-05-01 20:19:18 +02:00
< div class = "invalid-feedback" > {{ $__t ( 'A name is required' ) }} </ div >
2018-07-10 20:37:13 +02:00
</ div >
2017-04-19 21:09:28 +02:00
2018-07-10 20:37:13 +02:00
< div class = "form-group" >
2019-05-01 20:19:18 +02:00
< label for = "description" > {{ $__t ( 'Description' ) }} </ label >
2020-08-31 20:32:50 +02:00
< textarea class = "form-control"
rows = "2"
id = "description"
name = "description" >@ if ( $mode == 'edit' ){{ $location -> description }} @ endif </ textarea >
2018-07-10 20:37:13 +02:00
</ div >
2017-04-19 21:09:28 +02:00
2020-01-26 20:01:30 +01:00
@ if ( GROCY_FEATURE_FLAG_STOCK_PRODUCT_FREEZING )
< div class = "form-group" >
2020-11-08 19:00:12 +01:00
< div class = "custom-control custom-checkbox" >
2020-08-31 20:32:50 +02:00
< input @ if ( $mode == 'edit'
&&
2020-11-08 19:00:12 +01:00
$location -> is_freezer == 1 ) checked @ endif class = "form-check-input custom-control-input" type = "checkbox" id = "is_freezer" name = "is_freezer" value = "1" >
< label class = "form-check-label custom-control-label"
2020-08-31 20:32:50 +02:00
for = "is_freezer" > {{ $__t ( 'Is freezer' ) }}
2020-11-15 15:23:47 +01:00
& nbsp ; < i class = "fas fa-question-circle text-muted"
2020-11-08 19:00:12 +01:00
data - toggle = "tooltip"
2020-11-15 19:53:44 +01:00
title = "{{ $__t ('When moving products from/to a freezer location, the products due date is automatically adjusted according to the product settings') }}" ></ i >
2020-01-26 20:01:30 +01:00
</ label >
</ div >
</ div >
@ else
2020-08-31 20:32:50 +02:00
< input type = "hidden"
name = "is_freezer"
value = "0" >
2020-01-26 20:01:30 +01:00
@ endif
2019-04-22 22:16:35 +02:00
@ include ( 'components.userfieldsform' , array (
2020-08-31 20:32:50 +02:00
'userfields' => $userfields ,
'entity' => 'locations'
2019-04-22 22:16:35 +02:00
))
2020-08-31 20:32:50 +02:00
< button id = "save-location-button"
class = "btn btn-success" > {{ $__t ( 'Save' ) }} </ button >
2017-04-19 21:09:28 +02:00
2018-07-10 20:37:13 +02:00
</ form >
</ div >
2017-04-15 23:16:20 +02:00
</ div >
2018-04-11 19:49:35 +02:00
@ stop