2018-04-11 19:49:35 +02:00
|
|
|
@extends('layout.default')
|
|
|
|
|
|
2018-04-12 21:13:38 +02:00
|
|
|
@if($mode == 'edit')
|
|
|
|
|
@section('title', 'Edit battery')
|
|
|
|
|
@else
|
|
|
|
|
@section('title', 'Create battery')
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
@section('viewJsName', 'batteryform')
|
|
|
|
|
|
2018-04-11 19:49:35 +02:00
|
|
|
@section('content')
|
2018-04-14 11:10:38 +02:00
|
|
|
<div class="col-sm-3 col-sm-offset-3 col-md-4 col-md-offset-2">
|
2017-11-05 12:41:00 +01:00
|
|
|
|
2018-04-12 21:13:38 +02:00
|
|
|
<h1 class="page-header">@yield('title')</h1>
|
2017-11-05 12:41:00 +01:00
|
|
|
|
2018-04-12 21:13:38 +02:00
|
|
|
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
2017-11-05 12:41:00 +01:00
|
|
|
|
2018-04-12 21:13:38 +02:00
|
|
|
@if($mode == 'edit')
|
|
|
|
|
<script>Grocy.EditObjectId = {{ $battery->id }}</script>
|
|
|
|
|
@endif
|
2017-11-05 12:41:00 +01:00
|
|
|
|
|
|
|
|
<form id="battery-form">
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="name">Name</label>
|
2018-04-12 21:13:38 +02:00
|
|
|
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $battery->name }}@endif">
|
2017-11-05 12:41:00 +01:00
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="description">Description</label>
|
2018-04-12 21:13:38 +02:00
|
|
|
<input type="text" class="form-control" id="description" name="description" value="@if($mode == 'edit'){{ $battery->description }}@endif">
|
2017-11-05 12:41:00 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="name">Used in</label>
|
2018-04-12 21:13:38 +02:00
|
|
|
<input type="text" class="form-control" id="used_in" name="used_in" value="@if($mode == 'edit'){{ $battery->used_in }}@endif">
|
2017-11-05 12:41:00 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button id="save-battery-button" type="submit" class="btn btn-default">Save</button>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
</div>
|
2018-04-11 19:49:35 +02:00
|
|
|
@stop
|