Commit d9385661 authored by Nicolas Widart's avatar Nicolas Widart

Listing files

parent 1463c07c
......@@ -2,9 +2,20 @@
use Illuminate\Support\Facades\View;
use Modules\Core\Http\Controllers\Admin\AdminBaseController;
use Modules\Media\Repositories\FileRepository;
class MediaController extends AdminBaseController
{
/**
* @var FileRepository
*/
private $file;
public function __construct(FileRepository $file)
{
$this->file = $file;
}
/**
* Display a listing of the resource.
*
......@@ -12,7 +23,9 @@ class MediaController extends AdminBaseController
*/
public function index()
{
return View::make('media::admin.index');
$files = $this->file->all();
return View::make('media::admin.index', compact('files'));
}
/**
......
......@@ -44,13 +44,38 @@
</tr>
</thead>
<tbody>
<tr>
<td>23/09/1990</td>
<td>filename</td>
<td>500</td>
<td>500</td>
<td>action</td>
</tr>
<?php if ($files): ?>
<?php foreach($files as $file): ?>
<tr>
<td>
<a href="{{ URL::route('dashboard.media.edit', [$file->id]) }}">
{{ $file->created_at }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.media.edit', [$file->id]) }}">
{{ $file->filename }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.media.edit', [$file->id]) }}">
{{ $file->width }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.media.edit', [$file->id]) }}">
{{ $file->height }}
</a>
</td>
<td>
<div class="btn-group">
<a href="{{ URL::route('dashboard.media.edit', [$file->id]) }}" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-pencil"></i></a>
<button class="btn btn-danger btn-flat" data-toggle="modal" data-target="#confirmation-{{ $file->id }}"><i class="glyphicon glyphicon-trash"></i></button>
</div>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment