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');
$request->validate([
'name' => ['required', 'string', 'max:255'],
'number' => ['required', 'integer'],
'auk_name' => ['required', 'string', 'max:255'],
'auk_path' => ['required', 'string', 'max:255'],
'image_dir' => ['required', 'string', 'max:255'],
'parent_id' => 'required|integer|different:id',
]);
$document = AUK::find($id);
$document->project_id = $project_id;
$document->name = $request->name;
$document->number = $request->number;
$document->parent_id = $request->parent_id;
$document->save();
$auk = AUK::find($id);
$auk->project_id = $project_id;
$auk->auk_name = $request->auk_name;
$auk->auk_path = $request->auk_path;
$auk->image_dir = $request->image_dir;
$auk->parent_id = $request->parent_id;
$auk->save();
return redirect()->route('auks.index');
}

View File

@@ -682,14 +682,14 @@ select {
.relative {
position: relative;
}
.top-0 {
top: 0px;
.left-0 {
left: 0px;
}
.right-0 {
right: 0px;
}
.left-0 {
left: 0px;
.top-0 {
top: 0px;
}
.z-0 {
z-index: 0;
@@ -710,18 +710,27 @@ select {
.ml-1 {
margin-left: 0.25rem;
}
.-mr-2 {
margin-right: -0.5rem;
}
.mt-3 {
margin-top: 0.75rem;
}
.mt-2 {
margin-top: 0.5rem;
}
.mt-1 {
margin-top: 0.25rem;
}
.mt-4 {
margin-top: 1rem;
}
.mr-2 {
margin-right: 0.5rem;
}
.ml-2 {
margin-left: 0.5rem;
}
.mt-4 {
margin-top: 1rem;
}
.ml-4 {
margin-left: 1rem;
}
@@ -734,21 +743,12 @@ select {
.-mt-px {
margin-top: -1px;
}
.-mr-2 {
margin-right: -0.5rem;
}
.mt-3 {
margin-top: 0.75rem;
}
.mt-1 {
margin-top: 0.25rem;
.mb-4 {
margin-bottom: 1rem;
}
.mt-6 {
margin-top: 1.5rem;
}
.mb-4 {
margin-bottom: 1rem;
}
.-mb-px {
margin-bottom: -1px;
}
@@ -776,9 +776,6 @@ select {
.h-5 {
height: 1.25rem;
}
.h-8 {
height: 2rem;
}
.h-16 {
height: 4rem;
}
@@ -791,6 +788,9 @@ select {
.h-6 {
height: 1.5rem;
}
.h-8 {
height: 2rem;
}
.h-20 {
height: 5rem;
}
@@ -800,12 +800,6 @@ select {
.w-5 {
width: 1.25rem;
}
.w-96 {
width: 24rem;
}
.w-8 {
width: 2rem;
}
.w-auto {
width: auto;
}
@@ -815,11 +809,17 @@ select {
.w-6 {
width: 1.5rem;
}
.w-48 {
width: 12rem;
}
.w-96 {
width: 24rem;
}
.w-full {
width: 100%;
}
.w-48 {
width: 12rem;
.w-8 {
width: 2rem;
}
.w-20 {
width: 5rem;
@@ -830,9 +830,6 @@ select {
.max-w-6xl {
max-width: 72rem;
}
.max-w-xl {
max-width: 36rem;
}
.flex-1 {
flex: 1 1 0%;
}
@@ -949,9 +946,6 @@ select {
.border-l-4 {
border-left-width: 4px;
}
.border-r {
border-right-width: 1px;
}
.border-gray-300 {
--tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity));
@@ -964,16 +958,12 @@ select {
--tw-border-opacity: 1;
border-color: rgb(243 244 246 / var(--tw-border-opacity));
}
.border-transparent {
border-color: transparent;
}
.border-indigo-400 {
--tw-border-opacity: 1;
border-color: rgb(129 140 248 / var(--tw-border-opacity));
}
.border-gray-400 {
--tw-border-opacity: 1;
border-color: rgb(156 163 175 / var(--tw-border-opacity));
.border-transparent {
border-color: transparent;
}
.bg-white {
--tw-bg-opacity: 1;
@@ -991,14 +981,14 @@ select {
--tw-bg-opacity: 1;
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 {
--tw-bg-opacity: 1;
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 {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
@@ -1035,14 +1025,6 @@ select {
padding-top: 3rem;
padding-bottom: 3rem;
}
.py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
}
.px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.py-1 {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
@@ -1051,15 +1033,20 @@ select {
padding-left: 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 {
padding-right: 0.5rem;
}
.pt-4 {
padding-top: 1rem;
}
.pt-8 {
padding-top: 2rem;
}
.pt-2 {
padding-top: 0.5rem;
}
@@ -1069,24 +1056,27 @@ select {
.pb-1 {
padding-bottom: 0.25rem;
}
.pl-2 {
padding-left: 0.5rem;
}
.pb-4 {
padding-bottom: 1rem;
}
.pt-6 {
padding-top: 1.5rem;
}
.pt-1 {
padding-top: 0.25rem;
}
.pl-2 {
padding-left: 0.5rem;
}
.pl-3 {
padding-left: 0.75rem;
}
.pr-4 {
padding-right: 1rem;
}
.pt-8 {
padding-top: 2rem;
}
.pb-4 {
padding-bottom: 1rem;
}
.pt-6 {
padding-top: 1.5rem;
}
.text-center {
text-align: center;
}
@@ -1140,9 +1130,6 @@ select {
.tracking-widest {
letter-spacing: 0.1em;
}
.tracking-wider {
letter-spacing: 0.05em;
}
.text-gray-500 {
--tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity));
@@ -1167,6 +1154,26 @@ select {
--tw-text-opacity: 1;
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 {
--tw-text-opacity: 1;
color: rgb(229 231 235 / var(--tw-text-opacity));
@@ -1175,21 +1182,9 @@ select {
--tw-text-opacity: 1;
color: rgb(209 213 219 / var(--tw-text-opacity));
}
.text-gray-400 {
.text-indigo-600 {
--tw-text-opacity: 1;
color: rgb(156 163 175 / 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));
color: rgb(79 70 229 / var(--tw-text-opacity));
}
.text-green-600 {
--tw-text-opacity: 1;
@@ -1199,14 +1194,6 @@ select {
--tw-text-opacity: 1;
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 {
-webkit-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;
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 {
--tw-text-opacity: 1;
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 {
--tw-text-opacity: 1;
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;
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 {
--tw-border-opacity: 1;
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 {
--tw-bg-opacity: 1;
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;
}
.sm\:ml-0 {
margin-left: 0px;
}
.sm\:ml-10 {
margin-left: 2.5rem;
}
@@ -9280,6 +9263,10 @@ readers do not read off random characters that represent icons */
margin-left: 1.5rem;
}
.sm\:ml-0 {
margin-left: 0px;
}
.sm\:block {
display: block;
}

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

@@ -24,17 +24,24 @@
@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>