Skip to content

Commit 77f65f2

Browse files
committed
refactor list-view.blade.php
1 parent b8a754f commit 77f65f2

File tree

1 file changed

+18
-38
lines changed

1 file changed

+18
-38
lines changed

src/views/list-view.blade.php

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,35 @@
88
<th>{{ Lang::get('laravel-filemanager::lfm.title-action') }}</th>
99
</thead>
1010
<tbody>
11-
@foreach($directories as $key => $directory)
12-
<tr>
13-
<td>
14-
<i class="fa fa-folder-o"></i>
15-
<a class="folder-item clickable" data-id="{{ $directory->path }}">
16-
{{ $directory->name }}
17-
</a>
18-
</td>
19-
<td></td>
20-
<td>{{ Lang::get('laravel-filemanager::lfm.type-folder') }}</td>
21-
<td></td>
22-
<td></td>
23-
</tr>
24-
@endforeach
25-
26-
@foreach($files as $file)
11+
@foreach($items as $item)
2712
<tr>
2813
<td>
29-
<i class="fa {{ $file->icon }}"></i>
30-
<?php $file_name = $file->name;?>
31-
<a href="javascript:useFile('{{ $file_name }}')" id="{{ $file_name }}" data-url="{{ $file->url }}">
32-
{{ str_limit($file_name, $limit = 20, $end = '...') }}
33-
</a>
34-
&nbsp;&nbsp;
35-
<a href="javascript:rename('{{ $file_name }}')">
36-
<i class="fa fa-edit"></i>
14+
<i class="fa {{ $item->icon }}"></i>
15+
@if(!$item->is_file)
16+
<a class="folder-item clickable" data-id="{{ $item->path }}">
17+
@else
18+
<a href="javascript:useFile('{{ $item->name }}')" id="{{ $item->name }}" data-url="{{ $item->url }}">
19+
@endif
20+
{{ str_limit($item->name, $limit = 20, $end = '...') }}
3721
</a>
3822
</td>
23+
<td>{{ $item->size ?? '' }}</td>
24+
<td>{{ $item->type }}</td>
25+
<td>{{ $item->time }}</td>
3926
<td>
40-
{{ $file->size }}
41-
</td>
42-
<td>
43-
{{ $file->type }}
44-
</td>
45-
<td>
46-
{{ date("Y-m-d h:m", $file->updated) }}
47-
</td>
48-
<td>
49-
<a href="javascript:trash('{{ $file_name }}')">
27+
@if($item->is_file)
28+
<a href="javascript:trash('{{ $item->name }}')">
5029
<i class="fa fa-trash fa-fw"></i>
5130
</a>
52-
@if($file->thumb)
53-
<a href="javascript:cropImage('{{ $file_name }}')">
31+
@if($item->thumb)
32+
<a href="javascript:cropImage('{{ $item->name }}')">
5433
<i class="fa fa-crop fa-fw"></i>
5534
</a>
56-
<a href="javascript:resizeImage('{{ $file_name }}')">
35+
<a href="javascript:resizeImage('{{ $item->name }}')">
5736
<i class="fa fa-arrows fa-fw"></i>
5837
</a>
5938
@endif
39+
@endif
6040
</td>
6141
</tr>
6242
@endforeach
@@ -94,7 +74,7 @@
9474
@else
9575
<a href="javascript:useFile('{{ $item->name }}')" id="{{ $item->name }}" data-url="{{ $item->url }}">
9676
@endif
97-
{{ str_limit($item->name, $limit = 10, $end = '...') }}
77+
{{ str_limit($item->name, $limit = 20, $end = '...') }}
9878
</a>
9979
&nbsp;&nbsp;
10080
{{-- <a href="javascript:rename('{{ $item->name }}')">

0 commit comments

Comments
 (0)