Update AUK edit

This commit is contained in:
Александр Бабкин
2022-07-13 08:46:26 +03:00
parent fa2df0f944
commit 12e0611c4c
7 changed files with 127 additions and 176 deletions

View File

@@ -49,7 +49,8 @@
<x-select id="parent_id" class="block mt-1 w-full" name="parent_id" required>
<option value="0">---</option>
@foreach ($top_auks as $auks)
<option value="{{ $auks->id }}">{{ $auks->auk_name }} ({{ $auks->auk_path }})</option>
<option value="{{ $auks->id }}">{{ $auks->auk_name }}
({{ $auks->auk_path }})</option>
@if (count($auks->childs))
@include('auks.optionChild', [
'childs' => $auks->childs,

View File

@@ -19,22 +19,29 @@
</ul>
</div>
@endif
<form method="POST" action="{{ route('auks.update',$auk->id) }}">
<form method="POST" action="{{ route('auks.update', $auk->id) }}">
@csrf
@method('PUT')
<input type="hidden" id="id" name="id" value="{{ $auk->id }}">
<div>
<x-label for="name" value="{{ __('Title') }}" />
<x-label for="c" value="{{ __('Title') }}" />
<x-input id="name" class="block mt-1 w-full" type="text" name="name"
value="{{ $auk->name }}" required autofocus />
<x-input id="auk_name" class="block mt-1 w-full" type="text" name="auk_name"
value="{{ $auk->auk_name }}" required autofocus />
</div>
<div>
<x-label for="number" value="{{ __('Number') }}" />
<x-label for="auk_path" value="{{ __('Path') }}" />
<x-input id="number" class="block mt-1 w-full" type="text" name="number"
value="{{ $auk->number }}" required />
<x-input id="auk_path" class="block mt-1 w-full" type="text" name="auk_path"
value="{{ $auk->auk_path }}" required />
</div>
<div>
<x-label for="image_dir" value="{{ __('Image Dir') }}" />
<x-input id="image_dir" class="block mt-1 w-full" type="text" name="image_dir"
value="{{ $auk->image_dir }}" required />
</div>
<div>
@@ -44,12 +51,14 @@
<option value="0">---</option>
@foreach ($top_auks as $top_auk)
@if ($auk->parent_id == $top_auk->id)
<option value="{{ $top_auk->id }}" selected>{{ $top_auk->name }} ({{ $top_auk->number }})</option>
<option value="{{ $top_auk->id }}" selected>{{ $top_auk->auk_name }}
({{ $top_auk->auk_path }})</option>
@else
<option value="{{ $top_auk->id }}">{{ $top_auk->name }} ({{ $top_auk->number }})</option>
<option value="{{ $top_auk->id }}">{{ $top_auk->auk_name }}
({{ $top_auk->auk_path }})</option>
@endif
@if (count($top_auk->childs))
@include('documents.optionChildSelected', [
@include('auks.optionChildSelected', [
'childs' => $top_auk->childs,
'parent_id' => $top_auk->parent_id,
'level' => 1,

View File

@@ -1,7 +1,8 @@
@foreach ($childs as $child)
<option value="{{ $child->id }}">{{ str_pad('', $level, '-') . ' ' . $child->auk_name }} ({{ $child->auk_path }})</option>
<option value="{{ $child->id }}">{{ str_pad('', $level, '-') . ' ' . $child->auk_name }}
({{ $child->auk_path }})</option>
@if (count($child->childs))
@include('documents.optionChild', [
@include('auks.optionChild', [
'childs' => $child->childs,
'level' => $level + 1,
])

View File

@@ -1,8 +1,10 @@
@foreach ($childs as $child)
@if ($parent_id == $child->id)
<option value="{{ $child->id }}" selected>{{ str_pad('', $level, '-') . ' ' . $child->name }}</option>
<option value="{{ $child->id }}" selected>{{ str_pad('', $level, '-') }} {{ $child->auk_name }}
({{ $child->auk_path }})</option>
@else
<option value="{{ $child->id }}">{{ str_pad('', $level, '-') . ' ' . $child->name }}</option>
<option value="{{ $child->id }}">{{ str_pad('', $level, '-') }} {{ $child->auk_name }}
({{ $child->auk_path }})</option>
@endif
@if (count($child->childs))
@include('auks.optionChildSelected', [

View File

@@ -1,51 +0,0 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Show project') }}
</h2>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<div class="w-96 mx-auto">
<div>
<x-label for="name" :value="__('Title')" />
<x-input id="name" class="block mt-1 w-full" type="text" name="name" value="{{ $project->name }}" readonly />
</div>
<!-- Description -->
<div class="mt-4">
<x-label for="description" :value="__('Description')" />
<x-input id="description" class="block mt-1 w-full" type="text" name="description" value="{{ $project->description }}" readonly />
</div>
<!-- MMC Path -->
<div class="mt-4">
<x-label for="mmc_path" :value="__('MMC Path')" />
<x-input id="mmc_path" class="block mt-1 w-full" type="text" name="mmc_path" value="{{ $project->mmc_path }}" readonly />
</div>
<div class="flex items-center justify-end mt-4">
<div class="pl-2">
<a href="{{ route('projects.edit',$project->id) }}" class="btn bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full">
<i class="fa fa-edit pr-2"></i>{{__('Edit project')}}
</a>
</div>
<div class="pl-2">
<a href="{{ route('projects.index') }}" class="btn bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded-full">
<i class="fa fa-cancel pr-2"></i>{{__('Cancel')}}
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>