Skip to content

Commit b69fb36

Browse files
committed
put integration errors together, modify lfm.css
1 parent fca7b85 commit b69fb36

File tree

4 files changed

+33
-29
lines changed

4 files changed

+33
-29
lines changed

public/css/lfm.css

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
#wrapper {
2-
height: 100vh;
2+
min-height: 100vh;
33
margin-bottom: 0px;
44
}
55

6-
#tree {
7-
height: calc(100vh - 70px);
8-
}
9-
106
#main {
117
border-left: 1px solid silver;
12-
}
13-
14-
#content {
15-
height: calc(100vh - 140px);
16-
overflow: scroll;
8+
min-height: calc(100vh - 70px);
179
}
1810

1911
.img-row {
20-
margin-bottom: 10px;
12+
margin-bottom: 20px;
2113
}
2214

2315
.clickable {
@@ -39,6 +31,7 @@
3931
.thumbnail {
4032
max-width: 210px;
4133
max-height: 210px;
34+
margin-bottom: 10px;
4235
}
4336

4437
.square {

src/controllers/LfmController.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,20 @@ public function show()
2929
$default_folder_type = 'user';
3030
}
3131

32+
$type_key = $this->currentLfmType();
33+
$mine_config = 'lfm.valid_' . $type_key . '_mimetypes';
34+
$config_error = null;
35+
36+
if (!is_array(config($mine_config))) {
37+
$config_error = 'Config : ' . $mine_config . ' is not set correctly';
38+
}
39+
3240
return view('laravel-filemanager::index')->with([
3341
'working_dir' => $this->rootFolder($default_folder_type),
3442
'file_type' => $this->currentLfmType(true),
3543
'startup_view' => config('lfm.' . $this->currentLfmType() . '_startup_view'),
36-
'no_extension' => ! extension_loaded('gd') && ! extension_loaded('imagick')
44+
'no_extension' => ! extension_loaded('gd') && ! extension_loaded('imagick'),
45+
'config_error' => $config_error
3746
]);
3847
}
3948
}

src/controllers/UploadController.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ private function uploadValidator($file)
104104
$valid_mimetypes = config($mine_config, $this->{"default_{$type_key}_types"});
105105
$max_size = config('lfm.max_' . $type_key . '_size', $this->{"default_max_{$type_key}_size"});
106106

107-
if (!is_array($valid_mimetypes)) {
108-
return 'Config : ' . $mine_config . ' is not set correctly';
109-
}
110-
111107
if (false === in_array($mimetype, $valid_mimetypes)) {
112108
return $this->error('mime') . $mimetype;
113109
}

src/views/index.blade.php

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
</div>
2323

2424
<div class="col-xs-10" id="main">
25-
@if($no_extension)
26-
<div class="alert alert-warning"><i class="fa fa-exclamation-circle"></i> {{ Lang::get('laravel-filemanager::lfm.message-extension_not_found') }}</div>
27-
@endif
2825
<nav class="navbar navbar-default">
2926
<div class="navbar-header">
3027
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
@@ -67,16 +64,25 @@
6764
</div>
6865
</nav>
6966

70-
@if (isset($errors) && $errors->any())
71-
<div class="alert alert-danger" role="alert">
72-
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
73-
<ul>
74-
@foreach($errors->all() as $error)
75-
<li>{{ $error }}</li>
76-
@endforeach
77-
</ul>
78-
</div>
79-
@endif
67+
<div id="alerts">
68+
@if($no_extension)
69+
<div class="alert alert-warning"><i class="fa fa-exclamation-circle"></i> {{ Lang::get('laravel-filemanager::lfm.message-extension_not_found') }}</div>
70+
@endif
71+
@if(!is_null($config_error))
72+
<div class="alert alert-danger"><i class="fa fa-times-circle"></i> {{ $config_error }}</div>
73+
@endif
74+
75+
@if (isset($errors) && $errors->any())
76+
<div class="alert alert-danger" role="alert">
77+
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
78+
<ul>
79+
@foreach($errors->all() as $error)
80+
<li>{{ $error }}</li>
81+
@endforeach
82+
</ul>
83+
</div>
84+
@endif
85+
</div>
8086

8187
<div id="content"></div>
8288
</div>

0 commit comments

Comments
 (0)