diff --git a/app/Http/Controllers/AUKController.php b/app/Http/Controllers/AUKController.php index cc6926b..f8c09b7 100644 --- a/app/Http/Controllers/AUKController.php +++ b/app/Http/Controllers/AUKController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\AUK; use App\Models\Project; +use Illuminate\Support\Facades\Log; class AUKController extends Controller { @@ -161,7 +162,7 @@ class AUKController extends Controller } } } - array_push($auks,$tmp_array); + array_push($auks, $tmp_array); } } } @@ -176,22 +177,28 @@ class AUKController extends Controller */ public function load(Request $request) { + Log::alert("In load"); $project_id = $request->session()->get('project_id'); - $request->validate([ - 'name' => ['required', 'string', 'max:255'], - 'number' => ['required', 'integer'], - 'parent_id' => ['required', 'integer'], - ]); - // $user = - AUK::create([ - 'project_id' => $project_id, - 'name' => $request->name, - 'number' => $request->number, - 'parent_id' => $request->parent_id, - ]); + $i = 0; + while ($request->input('auk_name_' . $i) !== null) { + Log::alert("Loading " . $i); + $auk_name = $request->input('auk_name_' . $i); + $auk_path = $request->input('auk_path_' . $i); + $image_dir = $request->input('image_dir_' . $i); + Log::alert("auk_name \"" . $auk_name . "\""); + Log::alert("auk_path \"" . $auk_path . "\""); + Log::alert("image_dir \"" . $image_dir . "\""); + AUK::create([ + 'project_id' => $project_id, + 'auk_name' => $auk_name, + 'auk_path' => $auk_path, + 'image_dir' => $image_dir, + 'parent_id' => null, + ]); + $i++; + } return redirect(route('auks.index')); } - } diff --git a/app/Models/AUK.php b/app/Models/AUK.php index d23514c..340faff 100644 --- a/app/Models/AUK.php +++ b/app/Models/AUK.php @@ -13,8 +13,9 @@ class AUK extends Model protected $table = 'auks'; protected $fillable = [ 'project_id', - 'name', - 'number', + 'auk_name', + 'auk_path', + 'image_dir', 'parent_id', ]; diff --git a/public/css/app.css b/public/css/app.css index 20d3df4..1c96f25 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -734,15 +734,15 @@ select { .-mt-px { margin-top: -1px; } -.mt-1 { - margin-top: 0.25rem; -} .-mr-2 { margin-right: -0.5rem; } .mt-3 { margin-top: 0.75rem; } +.mt-1 { + margin-top: 0.25rem; +} .mt-6 { margin-top: 1.5rem; } @@ -800,24 +800,24 @@ select { .w-5 { width: 1.25rem; } +.w-96 { + width: 24rem; +} .w-8 { width: 2rem; } .w-auto { width: auto; } -.w-96 { - width: 24rem; -} -.w-full { - width: 100%; -} .w-4 { width: 1rem; } .w-6 { width: 1.5rem; } +.w-full { + width: 100%; +} .w-48 { width: 12rem; } @@ -1060,9 +1060,6 @@ select { .pt-8 { padding-top: 2rem; } -.pl-2 { - padding-left: 0.5rem; -} .pt-2 { padding-top: 0.5rem; } @@ -1072,6 +1069,12 @@ select { .pb-1 { padding-bottom: 0.25rem; } +.pl-2 { + padding-left: 0.5rem; +} +.pb-4 { + padding-bottom: 1rem; +} .pt-6 { padding-top: 1.5rem; } @@ -1084,9 +1087,6 @@ select { .pr-4 { padding-right: 1rem; } -.pb-4 { - padding-bottom: 1rem; -} .text-center { text-align: center; } @@ -9099,14 +9099,14 @@ readers do not read off random characters that represent icons */ --tw-bg-opacity: 1; background-color: rgb(29 78 216 / var(--tw-bg-opacity)); } -.hover\:bg-gray-700:hover { - --tw-bg-opacity: 1; - background-color: rgb(55 65 81 / var(--tw-bg-opacity)); -} .hover\:bg-gray-100:hover { --tw-bg-opacity: 1; background-color: rgb(243 244 246 / var(--tw-bg-opacity)); } +.hover\:bg-gray-700:hover { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} .hover\:bg-gray-50:hover { --tw-bg-opacity: 1; background-color: rgb(249 250 251 / var(--tw-bg-opacity)); @@ -9127,14 +9127,14 @@ readers do not read off random characters that represent icons */ --tw-text-opacity: 1; color: rgb(185 28 28 / 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-700:hover { --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)); diff --git a/resources/views/auks/scan.blade.php b/resources/views/auks/scan.blade.php index 91136a5..76137af 100644 --- a/resources/views/auks/scan.blade.php +++ b/resources/views/auks/scan.blade.php @@ -45,12 +45,12 @@ @if (count($auks)) -
+ @csrf @for($i = 0; $i < count($auks); $i++) - - - + + + @endfor