Skip to content

Commit

Permalink
Remove unnecessary route redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
ToukL committed Dec 30, 2024
1 parent a5ddd96 commit 0621c0e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 52 deletions.
90 changes: 44 additions & 46 deletions resources/views/volumes/videos/index/meta.blade.php
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
<div class="panel panel-default">
<div class="panel panel-default table-responsive">
<div class="panel-heading">
<h3 class="panel-title">Video information</h3>
</div>
<div class="panel-body table-responsive">
<table class="table">
@if ($video->width && $video->height)
<tr>
<th>Dimensions</th>
<td>{{ $video->width }} &times; {{ $video->height }} px </td>
</tr>
@endif
@if ($video->size)
<tr>
<th>Size</th>
<td>{{ round($video->size / 1E+6, 2) }} MBytes </td>
</tr>
@endif
@if ($video->mimetype)
<tr>
<th>MIME</th>
<td><code>{{ $video->mimetype }}</code></td>
</tr>
@endif
@if ($video->taken_at)
<tr>
<th>Created</th>
@if (is_array($video->taken_at))
@foreach ($video->taken_at as $value)
<td>{{ $value }}</td>
@endforeach
@else
<td>{{ $video->taken_at }}</td>
@endif
</tr>
@endif
@foreach ($metadata as $key => $field)
<tr>
<th>{{ $metadataMap[$key] }}</th>
@if (is_array($field))
@foreach ($field as $value)
<td>{{ $value }}</td>
@endforeach
@else
<table class="table">
@if ($video->width && $video->height)
<tr>
<th>Dimensions</th>
<td>{{ $video->width }} &times; {{ $video->height }} px </td>
</tr>
@endif
@if ($video->size)
<tr>
<th>Size</th>
<td>{{ round($video->size / 1E+6, 2) }} MBytes </td>
</tr>
@endif
@if ($video->mimetype)
<tr>
<th>MIME</th>
<td><code>{{ $video->mimetype }}</code></td>
</tr>
@endif
@if ($video->taken_at)
<tr>
<th>Created</th>
@if (is_array($video->taken_at))
@foreach ($video->taken_at as $value)
<td>{{ $value }}</td>
@endif
</tr>
@endforeach
</table>
</div>
@endforeach
@else
<td>{{ $video->taken_at }}</td>
@endif
</tr>
@endif
@foreach ($metadata as $key => $field)
<tr>
<th>{{ $metadataMap[$key] }}</th>
@if (is_array($field))
@foreach ($field as $value)
<td>{{ $value }}</td>
@endforeach
@else
<td>{{ $value }}</td>
@endif
</tr>
@endforeach
</table>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,4 @@ public function testShow()
$this->beGuest();
$this->get("videos/{$video->id}/annotations")->assertStatus(200);
}

public function testShowRedirect()
{
$this->beUser();
$this->get('video-annotate/999')->assertRedirect('/videos/999/annotations');
}
}

0 comments on commit 0621c0e

Please sign in to comment.