show MMC alpha ready

This commit is contained in:
Александр Бабкин
2022-07-15 12:41:52 +03:00
parent cce02034f4
commit 518b072533
6 changed files with 246 additions and 161 deletions

View File

@@ -25,23 +25,8 @@
<td class="p-2 border border-gray-200 text-left align-top">
{{ $top_auk->auk_name }}</td>
<td class="p-2 border border-gray-200 text-center">
<table class="mx-auto">
<tr>
<th class="p-1 border border-gray-200 text-xs">
{{ __('File') }}
</th>
<th class="p-1 border border-gray-200 text-xs">
{{ __('Size') }}
</th>
<th class="p-1 border border-gray-200 text-xs">
{{ __('MTime') }}
</th>
<th class="p-1 border border-gray-200 text-xs">
{{ __('Image') }}
</th>
</tr>
@forelse ($top_auk->mmcs as $mmc)
<tr>
@if (count($top_auk->mmcs))
{{-- <tr>
<td class="p-1 border border-gray-200 text-xs">
{{ $mmc->filename }}</td>
<td class="p-1 border border-gray-200 text-xs">{{ $mmc['size'] }}
@@ -62,24 +47,21 @@
])
</svg>
@endif
{{-- <img height="50" src="{{ route('mmc.show', $mmc->id) }}"> --}}
</td>
</tr>
@empty
<tr>
<td colspan="3" class="p-1 border border-gray-200 text-xs">No MMC
<a href="{{ route('mmc.scan', $top_auk->id) }}"
class="pl-2">
<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>
@endforelse
</table>
</tr> --}}
<a href="{{ route('mmc.show', [$top_auk->id,0]) }}" class="pl-2">
<button
class="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded-full">
<i class="fa fa-eye pr-2"></i>{{ __('Show mmc') }}
</button>
</a>
@else
<a href="{{ route('mmc.scan', $top_auk->id) }}" class="pl-2">
<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>
@endif
</td>
</tr>
@if (count($top_auk->childs))

View File

@@ -3,10 +3,7 @@
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
<div class="flex flex-row">
<div class="basis-1/2">
{{ __('Selected project') }}: {{ $project->name }}
</div>
<div class="basis-1/2">
{{ __('MMC path') }}: {{ $project->mmc_path }}
{{ $project->name }}: {{ $auk->auk_name }}: {{ __('MMC Show') }}
</div>
</div>
</h2>
@@ -16,6 +13,54 @@
<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="flex flex-row">
<div class="basis-1/4">
<ul>
@forelse ($auk->mmcs as $mmc)
<li>
@if (strcasecmp(substr($mmc->filename, -3, 3), 'swf') == 0)
<a href="{{ route('mmc.show', [$auk->id, $mmc->id]) }}"
class="underline text-gray-500 hover:text-gray-700">{{ $mmc->filename }}</a>
@else
<a href="{{ route('mmc.show', [$auk->id, $mmc->id]) }}"
class="underline text-blue-500 hover:text-blue-700">{{ $mmc->filename }}</a>
@endif
</li>
@empty
<li>NO MMC!</li>
@endforelse
</ul>
</div>
<div class="basis-3/4">
<div class="flex flex-row">
<div class="basis-1/3">
<b>name:</b> {{ $current_mmc->filename }}
</div>
<div class="basis-1/3">
<b>size:</b> {{ $current_mmc->size }}
</div>
<div class="basis-1/3">
<b>mtime:</b> {{ date('d.m.Y H:i:s', $current_mmc->mtime) }}
</div>
</div>
<div class="pt-4">
@if (strcasecmp(substr($current_mmc->filename, -3, 3), 'svg') == 0)
{{-- <svg style="width:100%">
<use href="{{ route('mmc.getimage', [$auk->id, $current_mmc->id]) }}"></use>
</svg> --}}
<object width="800px" height="600px"
data="{{ route('mmc.getimage', [$auk->id, $current_mmc->id]) }}"
type="image/svg+xml" style="border-2">Error load svg</object>
{{-- <img width="800px" srcset="{{ route('mmc.getimage', [$auk->id, $current_mmc->id]) }}" type="image/svg+xml"> --}}
@elseif (strcasecmp(substr($current_mmc->filename, -3, 3), 'jpg') == 0)
<img width="800"
src="{{ route('mmc.getimage', [$auk->id, $current_mmc->id]) }}">
@elseif (strcasecmp(substr($current_mmc->filename, -3, 3), 'swf') == 0)
<b>Can't show FLASH!!!</b>
@endif
</div>
</div>
</div>
</div>
</div>