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

@@ -103,17 +103,19 @@ class AUKController extends Controller
{ {
$project_id = $request->session()->get('project_id'); $project_id = $request->session()->get('project_id');
$request->validate([ $request->validate([
'name' => ['required', 'string', 'max:255'], 'auk_name' => ['required', 'string', 'max:255'],
'number' => ['required', 'integer'], 'auk_path' => ['required', 'string', 'max:255'],
'image_dir' => ['required', 'string', 'max:255'],
'parent_id' => 'required|integer|different:id', 'parent_id' => 'required|integer|different:id',
]); ]);
$document = AUK::find($id); $auk = AUK::find($id);
$document->project_id = $project_id; $auk->project_id = $project_id;
$document->name = $request->name; $auk->auk_name = $request->auk_name;
$document->number = $request->number; $auk->auk_path = $request->auk_path;
$document->parent_id = $request->parent_id; $auk->image_dir = $request->image_dir;
$document->save(); $auk->parent_id = $request->parent_id;
$auk->save();
return redirect()->route('auks.index'); return redirect()->route('auks.index');
} }

View File

@@ -682,14 +682,14 @@ select {
.relative { .relative {
position: relative; position: relative;
} }
.top-0 { .left-0 {
top: 0px; left: 0px;
} }
.right-0 { .right-0 {
right: 0px; right: 0px;
} }
.left-0 { .top-0 {
left: 0px; top: 0px;
} }
.z-0 { .z-0 {
z-index: 0; z-index: 0;
@@ -710,18 +710,27 @@ select {
.ml-1 { .ml-1 {
margin-left: 0.25rem; margin-left: 0.25rem;
} }
.-mr-2 {
margin-right: -0.5rem;
}
.mt-3 {
margin-top: 0.75rem;
}
.mt-2 { .mt-2 {
margin-top: 0.5rem; margin-top: 0.5rem;
} }
.mt-1 {
margin-top: 0.25rem;
}
.mt-4 {
margin-top: 1rem;
}
.mr-2 { .mr-2 {
margin-right: 0.5rem; margin-right: 0.5rem;
} }
.ml-2 { .ml-2 {
margin-left: 0.5rem; margin-left: 0.5rem;
} }
.mt-4 {
margin-top: 1rem;
}
.ml-4 { .ml-4 {
margin-left: 1rem; margin-left: 1rem;
} }
@@ -734,21 +743,12 @@ select {
.-mt-px { .-mt-px {
margin-top: -1px; margin-top: -1px;
} }
.-mr-2 { .mb-4 {
margin-right: -0.5rem; margin-bottom: 1rem;
}
.mt-3 {
margin-top: 0.75rem;
}
.mt-1 {
margin-top: 0.25rem;
} }
.mt-6 { .mt-6 {
margin-top: 1.5rem; margin-top: 1.5rem;
} }
.mb-4 {
margin-bottom: 1rem;
}
.-mb-px { .-mb-px {
margin-bottom: -1px; margin-bottom: -1px;
} }
@@ -776,9 +776,6 @@ select {
.h-5 { .h-5 {
height: 1.25rem; height: 1.25rem;
} }
.h-8 {
height: 2rem;
}
.h-16 { .h-16 {
height: 4rem; height: 4rem;
} }
@@ -791,6 +788,9 @@ select {
.h-6 { .h-6 {
height: 1.5rem; height: 1.5rem;
} }
.h-8 {
height: 2rem;
}
.h-20 { .h-20 {
height: 5rem; height: 5rem;
} }
@@ -800,12 +800,6 @@ select {
.w-5 { .w-5 {
width: 1.25rem; width: 1.25rem;
} }
.w-96 {
width: 24rem;
}
.w-8 {
width: 2rem;
}
.w-auto { .w-auto {
width: auto; width: auto;
} }
@@ -815,11 +809,17 @@ select {
.w-6 { .w-6 {
width: 1.5rem; width: 1.5rem;
} }
.w-48 {
width: 12rem;
}
.w-96 {
width: 24rem;
}
.w-full { .w-full {
width: 100%; width: 100%;
} }
.w-48 { .w-8 {
width: 12rem; width: 2rem;
} }
.w-20 { .w-20 {
width: 5rem; width: 5rem;
@@ -830,9 +830,6 @@ select {
.max-w-6xl { .max-w-6xl {
max-width: 72rem; max-width: 72rem;
} }
.max-w-xl {
max-width: 36rem;
}
.flex-1 { .flex-1 {
flex: 1 1 0%; flex: 1 1 0%;
} }
@@ -949,9 +946,6 @@ select {
.border-l-4 { .border-l-4 {
border-left-width: 4px; border-left-width: 4px;
} }
.border-r {
border-right-width: 1px;
}
.border-gray-300 { .border-gray-300 {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity)); border-color: rgb(209 213 219 / var(--tw-border-opacity));
@@ -964,16 +958,12 @@ select {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(243 244 246 / var(--tw-border-opacity)); border-color: rgb(243 244 246 / var(--tw-border-opacity));
} }
.border-transparent {
border-color: transparent;
}
.border-indigo-400 { .border-indigo-400 {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(129 140 248 / var(--tw-border-opacity)); border-color: rgb(129 140 248 / var(--tw-border-opacity));
} }
.border-gray-400 { .border-transparent {
--tw-border-opacity: 1; border-color: transparent;
border-color: rgb(156 163 175 / var(--tw-border-opacity));
} }
.bg-white { .bg-white {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
@@ -991,14 +981,14 @@ select {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(107 114 128 / var(--tw-bg-opacity)); background-color: rgb(107 114 128 / var(--tw-bg-opacity));
} }
.bg-gray-800 {
--tw-bg-opacity: 1;
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
}
.bg-indigo-50 { .bg-indigo-50 {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(238 242 255 / var(--tw-bg-opacity)); background-color: rgb(238 242 255 / var(--tw-bg-opacity));
} }
.bg-gray-800 {
--tw-bg-opacity: 1;
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
}
.bg-gray-50 { .bg-gray-50 {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity)); background-color: rgb(249 250 251 / var(--tw-bg-opacity));
@@ -1035,14 +1025,6 @@ select {
padding-top: 3rem; padding-top: 3rem;
padding-bottom: 3rem; padding-bottom: 3rem;
} }
.py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
}
.px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.py-1 { .py-1 {
padding-top: 0.25rem; padding-top: 0.25rem;
padding-bottom: 0.25rem; padding-bottom: 0.25rem;
@@ -1051,15 +1033,20 @@ select {
padding-left: 0.25rem; padding-left: 0.25rem;
padding-right: 0.25rem; padding-right: 0.25rem;
} }
.py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
}
.px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.pr-2 { .pr-2 {
padding-right: 0.5rem; padding-right: 0.5rem;
} }
.pt-4 { .pt-4 {
padding-top: 1rem; padding-top: 1rem;
} }
.pt-8 {
padding-top: 2rem;
}
.pt-2 { .pt-2 {
padding-top: 0.5rem; padding-top: 0.5rem;
} }
@@ -1069,24 +1056,27 @@ select {
.pb-1 { .pb-1 {
padding-bottom: 0.25rem; padding-bottom: 0.25rem;
} }
.pl-2 {
padding-left: 0.5rem;
}
.pb-4 {
padding-bottom: 1rem;
}
.pt-6 {
padding-top: 1.5rem;
}
.pt-1 { .pt-1 {
padding-top: 0.25rem; padding-top: 0.25rem;
} }
.pl-2 {
padding-left: 0.5rem;
}
.pl-3 { .pl-3 {
padding-left: 0.75rem; padding-left: 0.75rem;
} }
.pr-4 { .pr-4 {
padding-right: 1rem; padding-right: 1rem;
} }
.pt-8 {
padding-top: 2rem;
}
.pb-4 {
padding-bottom: 1rem;
}
.pt-6 {
padding-top: 1.5rem;
}
.text-center { .text-center {
text-align: center; text-align: center;
} }
@@ -1140,9 +1130,6 @@ select {
.tracking-widest { .tracking-widest {
letter-spacing: 0.1em; letter-spacing: 0.1em;
} }
.tracking-wider {
letter-spacing: 0.05em;
}
.text-gray-500 { .text-gray-500 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity)); color: rgb(107 114 128 / var(--tw-text-opacity));
@@ -1167,6 +1154,26 @@ select {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity)); color: rgb(255 255 255 / var(--tw-text-opacity));
} }
.text-gray-600 {
--tw-text-opacity: 1;
color: rgb(75 85 99 / var(--tw-text-opacity));
}
.text-gray-400 {
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity));
}
.text-gray-900 {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
}
.text-indigo-700 {
--tw-text-opacity: 1;
color: rgb(67 56 202 / var(--tw-text-opacity));
}
.text-green-500 {
--tw-text-opacity: 1;
color: rgb(34 197 94 / var(--tw-text-opacity));
}
.text-gray-200 { .text-gray-200 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(229 231 235 / var(--tw-text-opacity)); color: rgb(229 231 235 / var(--tw-text-opacity));
@@ -1175,21 +1182,9 @@ select {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(209 213 219 / var(--tw-text-opacity)); color: rgb(209 213 219 / var(--tw-text-opacity));
} }
.text-gray-400 { .text-indigo-600 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity)); color: rgb(79 70 229 / var(--tw-text-opacity));
}
.text-gray-600 {
--tw-text-opacity: 1;
color: rgb(75 85 99 / var(--tw-text-opacity));
}
.text-gray-900 {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
}
.text-green-500 {
--tw-text-opacity: 1;
color: rgb(34 197 94 / var(--tw-text-opacity));
} }
.text-green-600 { .text-green-600 {
--tw-text-opacity: 1; --tw-text-opacity: 1;
@@ -1199,14 +1194,6 @@ select {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(220 38 38 / var(--tw-text-opacity)); color: rgb(220 38 38 / var(--tw-text-opacity));
} }
.text-indigo-700 {
--tw-text-opacity: 1;
color: rgb(67 56 202 / var(--tw-text-opacity));
}
.text-indigo-600 {
--tw-text-opacity: 1;
color: rgb(79 70 229 / var(--tw-text-opacity));
}
.underline { .underline {
-webkit-text-decoration-line: underline; -webkit-text-decoration-line: underline;
text-decoration-line: underline; text-decoration-line: underline;
@@ -9131,14 +9118,14 @@ readers do not read off random characters that represent icons */
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(55 65 81 / var(--tw-text-opacity)); color: rgb(55 65 81 / var(--tw-text-opacity));
} }
.hover\:text-green-700:hover {
--tw-text-opacity: 1;
color: rgb(21 128 61 / var(--tw-text-opacity));
}
.hover\:text-gray-800:hover { .hover\:text-gray-800:hover {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(31 41 55 / var(--tw-text-opacity)); color: rgb(31 41 55 / var(--tw-text-opacity));
} }
.hover\:text-green-700:hover {
--tw-text-opacity: 1;
color: rgb(21 128 61 / var(--tw-text-opacity));
}
.hover\:text-gray-900:hover { .hover\:text-gray-900:hover {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity)); color: rgb(17 24 39 / var(--tw-text-opacity));
@@ -9158,14 +9145,14 @@ readers do not read off random characters that represent icons */
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(165 180 252 / var(--tw-border-opacity)); border-color: rgb(165 180 252 / var(--tw-border-opacity));
} }
.focus\:border-gray-900:focus {
--tw-border-opacity: 1;
border-color: rgb(17 24 39 / var(--tw-border-opacity));
}
.focus\:border-indigo-700:focus { .focus\:border-indigo-700:focus {
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(67 56 202 / var(--tw-border-opacity)); border-color: rgb(67 56 202 / var(--tw-border-opacity));
} }
.focus\:border-gray-900:focus {
--tw-border-opacity: 1;
border-color: rgb(17 24 39 / var(--tw-border-opacity));
}
.focus\:bg-gray-100:focus { .focus\:bg-gray-100:focus {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity)); background-color: rgb(243 244 246 / var(--tw-bg-opacity));
@@ -9268,10 +9255,6 @@ readers do not read off random characters that represent icons */
margin-bottom: -1px; margin-bottom: -1px;
} }
.sm\:ml-0 {
margin-left: 0px;
}
.sm\:ml-10 { .sm\:ml-10 {
margin-left: 2.5rem; margin-left: 2.5rem;
} }
@@ -9280,6 +9263,10 @@ readers do not read off random characters that represent icons */
margin-left: 1.5rem; margin-left: 1.5rem;
} }
.sm\:ml-0 {
margin-left: 0px;
}
.sm\:block { .sm\:block {
display: block; display: block;
} }

View File

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

View File

@@ -24,17 +24,24 @@
@method('PUT') @method('PUT')
<input type="hidden" id="id" name="id" value="{{ $auk->id }}"> <input type="hidden" id="id" name="id" value="{{ $auk->id }}">
<div> <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" <x-input id="auk_name" class="block mt-1 w-full" type="text" name="auk_name"
value="{{ $auk->name }}" required autofocus /> value="{{ $auk->auk_name }}" required autofocus />
</div> </div>
<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" <x-input id="auk_path" class="block mt-1 w-full" type="text" name="auk_path"
value="{{ $auk->number }}" required /> 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>
<div> <div>
@@ -44,12 +51,14 @@
<option value="0">---</option> <option value="0">---</option>
@foreach ($top_auks as $top_auk) @foreach ($top_auks as $top_auk)
@if ($auk->parent_id == $top_auk->id) @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 @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 @endif
@if (count($top_auk->childs)) @if (count($top_auk->childs))
@include('documents.optionChildSelected', [ @include('auks.optionChildSelected', [
'childs' => $top_auk->childs, 'childs' => $top_auk->childs,
'parent_id' => $top_auk->parent_id, 'parent_id' => $top_auk->parent_id,
'level' => 1, 'level' => 1,

View File

@@ -1,7 +1,8 @@
@foreach ($childs as $child) @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)) @if (count($child->childs))
@include('documents.optionChild', [ @include('auks.optionChild', [
'childs' => $child->childs, 'childs' => $child->childs,
'level' => $level + 1, 'level' => $level + 1,
]) ])

View File

@@ -1,8 +1,10 @@
@foreach ($childs as $child) @foreach ($childs as $child)
@if ($parent_id == $child->id) @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 @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 @endif
@if (count($child->childs)) @if (count($child->childs))
@include('auks.optionChildSelected', [ @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>