MMC continue

This commit is contained in:
Александр Бабкин
2022-07-14 12:39:41 +03:00
parent 97bacd4423
commit 58c92adfbc
4 changed files with 18 additions and 8 deletions

View File

@@ -131,7 +131,7 @@ class MMCController extends Controller
// return redirect()->route('users.index'); // return redirect()->route('users.index');
} }
public function scan(Request $request) public function scan(Request $request, $auk_id)
{ {
$project_id = $request->session()->get('project_id'); $project_id = $request->session()->get('project_id');
$project = Project::find($project_id); $project = Project::find($project_id);

View File

@@ -62,20 +62,27 @@
</tr> </tr>
@forelse ($top_auks as $top_auk) @forelse ($top_auks as $top_auk)
<tr class="p-2 border border-gray-200 text-center"> <tr class="p-2 border border-gray-200 text-center">
<td>{{ $top_auk->auk_name }}</td> <td class="p-2 border border-gray-200 text-center">{{ $top_auk->auk_name }}</td>
<td> <td class="p-2 border border-gray-200 text-center">
<table> <table>
{{-- @forelse ($top_auk->mmcs as $mmc) @forelse ($top_auk->mmcs as $mmc)
<tr> <tr>
<td>{{ $mmc->filename }}</td> <td>{{ $mmc->filename }}</td>
</tr> </tr>
@empty @empty
<tr> <tr>
<td>No MMC</td> <td>No MMC
<a href="{{ route('mmc.scan') }}">
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full">
<i class="fa fa-search pr-2"></i>{{ __('Scan mmc') }}
</button>
</a>
</td>
</tr> </tr>
@endforelse --}} @endforelse
</table> </table>
</td> </td>
</tr> </tr>

View File

@@ -1,8 +1,11 @@
@foreach ($childs as $child) @foreach ($childs as $child)
<tr class="p-2 border border-gray-200 text-center"> <tr class="p-2 border border-gray-200 text-center">
<td> <td class="p-2 border border-gray-200 text-center">
{{ str_pad('', $level, '-') . ' ' . $child->auk_name }} {{ str_pad('', $level, '-') . ' ' . $child->auk_name }}
</td> </td>
<td>
</td>
</tr> </tr>
@if (count($child->childs)) @if (count($child->childs))
@include('mmc.tableAukChild', [ @include('mmc.tableAukChild', [

View File

@@ -38,7 +38,7 @@ Route::resource('/projects', ProjectController::class)->middleware(['auth']);
Route::post('/project/{project}/select',SelectProjectController::class)->middleware(['auth'])->name('project.select'); Route::post('/project/{project}/select',SelectProjectController::class)->middleware(['auth'])->name('project.select');
Route::resource('/mmc', MMCController::class)->middleware(['auth'])->only(['index','create']); Route::resource('/mmc', MMCController::class)->middleware(['auth'])->only(['index','create']);
Route::get('/mmc/scan', [MMCController::class, 'scan'])->middleware(['auth'])->name('mmc.scan'); Route::get('/mmc/scan/{auk}', [MMCController::class, 'scan'])->middleware(['auth'])->name('mmc.scan');
Route::resource('/documents', DocumentController::class)->except('show')->middleware(['auth']); Route::resource('/documents', DocumentController::class)->except('show')->middleware(['auth']);
Route::resource('/auks', AUKController::class)->except('show')->middleware(['auth']); Route::resource('/auks', AUKController::class)->except('show')->middleware(['auth']);
Route::get('/auks/scan', [AUKController::class, 'scan'])->middleware(['auth'])->name('auks.scan'); Route::get('/auks/scan', [AUKController::class, 'scan'])->middleware(['auth'])->name('auks.scan');