mirror of
https://github.com/grocy/grocy.git
synced 2025-10-14 17:24:07 +00:00
Reorganize project part 3
This commit is contained in:
@@ -1,42 +1,50 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@if($mode == 'edit')
|
||||
@section('title', 'Edit habit')
|
||||
@else
|
||||
@section('title', 'Create habit')
|
||||
@endif
|
||||
|
||||
@section('viewJsName', 'habitform')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-4 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header"><?php echo $title; ?></h1>
|
||||
<h1 class="page-header">@yield('title')</h1>
|
||||
|
||||
<script>Grocy.EditMode = '<?php echo $mode; ?>';</script>
|
||||
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
||||
|
||||
<?php if ($mode == 'edit') : ?>
|
||||
<script>Grocy.EditObjectId = <?php echo $habit->id; ?>;</script>
|
||||
<?php endif; ?>
|
||||
@if($mode == 'edit')
|
||||
<script>Grocy.EditObjectId = {{ $habit->id }};</script>
|
||||
@endif
|
||||
|
||||
<form id="habit-form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" required id="name" name="name" value="<?php if ($mode == 'edit') echo $habit->name; ?>">
|
||||
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $habit->name }}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<textarea class="form-control" rows="2" id="description" name="description"><?php if ($mode == 'edit') echo $habit->description; ?></textarea>
|
||||
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $habit->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="period_type">Period type</label>
|
||||
<select required class="form-control input-group-habit-period-type" id="period_type" name="period_type">
|
||||
<?php foreach ($periodTypes as $periodType) : ?>
|
||||
<option <?php if ($mode == 'edit' && $periodType == $habit->period_type) echo 'selected="selected"'; ?> value="<?php echo $periodType; ?>"><?php echo $periodType; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($periodTypes as $periodType)
|
||||
<option @if($mode == 'edit' && $periodType == $habit->period_type) selected="selected" @endif value="{{ $periodType }}">{{ $periodType }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="period_days">Period days</label>
|
||||
<input type="number" class="form-control input-group-habit-period-type" id="period_days" name="period_days" value="<?php if ($mode == 'edit') echo $habit->period_days; ?>">
|
||||
<input type="number" class="form-control input-group-habit-period-type" id="period_days" name="period_days" value="@if($mode == 'edit'){{ $habit->period_days }}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user