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')
|
2018-07-10 20:37:13 +02:00
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-lg-6 col-xs-12">
|
|
|
|
|
<h1>@yield('title')</h1>
|
2017-04-15 23:16:20 +02:00
|
|
|
|
2018-07-10 20:37:13 +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')
|
|
|
|
|
<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
|
|
|
|
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
|