2018-04-11 19:49:35 +02:00
|
|
|
@extends('layout.default')
|
|
|
|
|
|
2018-04-12 21:13:38 +02:00
|
|
|
@if($mode == 'edit')
|
2018-09-22 13:26:58 +02:00
|
|
|
@section('title', $L('Edit chore'))
|
2018-04-12 21:13:38 +02:00
|
|
|
@else
|
2018-09-22 13:26:58 +02:00
|
|
|
@section('title', $L('Create chore'))
|
2018-04-12 21:13:38 +02:00
|
|
|
@endif
|
|
|
|
|
|
2018-09-22 13:26:58 +02:00
|
|
|
@section('viewJsName', 'choreform')
|
2018-04-12 21:13:38 +02:00
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
|
|
|
|
|
|
|
|
|
@if($mode == 'edit')
|
2018-09-22 13:26:58 +02:00
|
|
|
<script>Grocy.EditObjectId = {{ $chore->id }};</script>
|
2018-07-10 20:37:13 +02:00
|
|
|
@endif
|
|
|
|
|
|
2018-09-22 13:26:58 +02:00
|
|
|
<form id="chore-form" novalidate>
|
2018-07-10 20:37:13 +02:00
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="name">{{ $L('Name') }}</label>
|
2018-09-22 13:26:58 +02:00
|
|
|
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $chore->name }}@endif">
|
2018-07-11 19:43:05 +02:00
|
|
|
<div class="invalid-feedback">{{ $L('A name is required') }}</div>
|
2018-07-10 20:37:13 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="description">{{ $L('Description') }}</label>
|
2018-09-22 13:26:58 +02:00
|
|
|
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $chore->description }}@endif</textarea>
|
2018-07-10 20:37:13 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="period_type">{{ $L('Period type') }}</label>
|
2018-09-22 13:26:58 +02:00
|
|
|
<select required class="form-control input-group-chore-period-type" id="period_type" name="period_type">
|
2018-07-10 20:37:13 +02:00
|
|
|
@foreach($periodTypes as $periodType)
|
2018-09-22 13:26:58 +02:00
|
|
|
<option @if($mode == 'edit' && $periodType == $chore->period_type) selected="selected" @endif value="{{ $periodType }}">{{ $L($periodType) }}</option>
|
2018-07-10 20:37:13 +02:00
|
|
|
@endforeach
|
|
|
|
|
</select>
|
2018-07-11 19:43:05 +02:00
|
|
|
<div class="invalid-feedback">{{ $L('A period type is required') }}</div>
|
2018-07-10 20:37:13 +02:00
|
|
|
</div>
|
|
|
|
|
|
2018-09-22 13:26:58 +02:00
|
|
|
@php if($mode == 'edit') { $value = $chore->period_days; } else { $value = 0; } @endphp
|
2018-09-08 12:04:31 +02:00
|
|
|
@include('components.numberpicker', array(
|
|
|
|
|
'id' => 'period_days',
|
|
|
|
|
'label' => 'Period days',
|
|
|
|
|
'value' => $value,
|
|
|
|
|
'min' => '0',
|
2018-09-22 13:26:58 +02:00
|
|
|
'additionalCssClasses' => 'input-group-chore-period-type',
|
2018-09-08 14:06:19 +02:00
|
|
|
'invalidFeedback' => $L('This cannot be negative'),
|
2019-03-04 17:43:12 +01:00
|
|
|
'hintId' => 'chore-period-type-info'
|
2018-09-08 12:04:31 +02:00
|
|
|
))
|
2018-07-10 20:37:13 +02:00
|
|
|
|
2018-09-29 13:41:56 +02:00
|
|
|
<button id="save-chore-button" class="btn btn-success">{{ $L('Save') }}</button>
|
2018-07-10 20:37:13 +02:00
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2017-07-25 20:03:31 +02:00
|
|
|
</div>
|
2018-04-11 19:49:35 +02:00
|
|
|
@stop
|