mirror of
				https://github.com/grocy/grocy.git
				synced 2025-10-31 02:36:54 +00:00 
			
		
		
		
	
		
			
	
	
		
			63 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			63 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
|   | @extends('layout.default') | ||
|  | 
 | ||
|  | @if($mode == 'edit') | ||
|  | @section('title', $__t('Edit meal plan section')) | ||
|  | @else | ||
|  | @section('title', $__t('Create meal plan section')) | ||
|  | @endif | ||
|  | 
 | ||
|  | @section('viewJsName', 'mealplansectionform') | ||
|  | 
 | ||
|  | @section('content') | ||
|  | <div class="row"> | ||
|  | 	<div class="col"> | ||
|  | 		<h2 class="title">@yield('title')</h2> | ||
|  | 	</div> | ||
|  | </div> | ||
|  | 
 | ||
|  | <hr class="my-2"> | ||
|  | 
 | ||
|  | <div class="row"> | ||
|  | 	<div class="col-lg-6 col-12"> | ||
|  | 		<script> | ||
|  | 			Grocy.EditMode = '{{ $mode }}'; | ||
|  | 		</script> | ||
|  | 
 | ||
|  | 		@if($mode == 'edit') | ||
|  | 		<script> | ||
|  | 			Grocy.EditObjectId = {{ $mealplanSection->id }}; | ||
|  | 		</script> | ||
|  | 		@endif | ||
|  | 
 | ||
|  | 		<form id="mealplansection-form" | ||
|  | 			novalidate> | ||
|  | 
 | ||
|  | 			<div class="form-group"> | ||
|  | 				<label for="name">{{ $__t('Name') }}</label> | ||
|  | 				<input type="text" | ||
|  | 					class="form-control" | ||
|  | 					required | ||
|  | 					id="name" | ||
|  | 					name="name" | ||
|  | 					value="@if($mode == 'edit'){{ $mealplanSection->name }}@endif"> | ||
|  | 				<div class="invalid-feedback">{{ $__t('A name is required') }}</div> | ||
|  | 			</div> | ||
|  | 
 | ||
|  | 			@php if($mode == 'edit' && !empty($mealplanSection->sort_number)) { $value = $mealplanSection->sort_number; } else { $value = ''; } @endphp | ||
|  | 			@include('components.numberpicker', array( | ||
|  | 			'id' => 'sort_number', | ||
|  | 			'label' => 'Sort number', | ||
|  | 			'min' => 0, | ||
|  | 			'value' => $value, | ||
|  | 			'isRequired' => false, | ||
|  | 			'hint' => $__t('Sections will be ordered by that number on the meal plan') | ||
|  | 			)) | ||
|  | 
 | ||
|  | 			<button id="save-mealplansection-button" | ||
|  | 				class="btn btn-success">{{ $__t('Save') }}</button> | ||
|  | 
 | ||
|  | 		</form> | ||
|  | 	</div> | ||
|  | </div> | ||
|  | @stop |