2018-04-11 19:49:35 +02:00
@ extends ( 'layout.default' )
2018-04-12 21:13:38 +02:00
@ if ( $mode == 'edit' )
2019-05-01 20:19:18 +02:00
@ section ( 'title' , $__t ( 'Edit location' ))
2018-04-12 21:13:38 +02:00
@ else
2019-05-01 20:19:18 +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 >
< hr >
</ div >
</ div >
2018-07-10 20:37:13 +02:00
< div class = " row " >
< div class = " col-lg-6 col-xs-12 " >
< script > Grocy . EditMode = '{{ $mode }}' ; </ script >
2017-04-15 23:16:20 +02:00
2018-07-10 20:37:13 +02:00
@ if ( $mode == 'edit' )
< script > Grocy . EditObjectId = {{ $location -> id }}; </ script >
@ endif
2017-04-15 23:16:20 +02:00
2018-07-11 19:43:05 +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 >
2018-07-10 20:37:13 +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 >
2018-07-10 20:37:13 +02:00
< textarea class = " form-control " rows = " 2 " id = " description " name = " description " >@ if ( $mode == 'edit' ){{ $location -> description }} @ endif </ textarea >
</ 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 " >
< div class = " form-check " >
< input type = " hidden " name = " is_freezer " value = " 0 " >
< input @ if ( $mode == 'edit' && $location -> is_freezer == 1 ) checked @ endif class = " form-check-input " type = " checkbox " id = " is_freezer " name = " is_freezer " value = " 1 " >
< label class = " form-check-label " for = " is_freezer " > {{ $__t ( 'Is freezer' ) }}
< span class = " text-muted small " > {{ $__t ( 'When moving products from/to a freezer location, the products best before date is automatically adjusted according to the product settings' ) }} </ span >
</ label >
</ div >
</ div >
@ else
< input type = " hidden " name = " is_freezer " value = " 0 " >
@ endif
2019-04-22 22:16:35 +02:00
@ include ( 'components.userfieldsform' , array (
'userfields' => $userfields ,
'entity' => 'locations'
))
2019-05-01 20:19:18 +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