Skip to content

Commit

Permalink
v1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ctf0 committed Sep 17, 2017
1 parent 1a7a54b commit 0060f26
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php" : "~7.0",
"illuminate/support": "^5.4",
"tightenco/ziggy": "^0.3",
"tightenco/ziggy": "^0.4",
"ctf0/package-changelog": "^1.0"
},
"autoload": {
Expand Down
3 changes: 0 additions & 3 deletions logs/v1.2.2.txt

This file was deleted.

4 changes: 4 additions & 0 deletions logs/v1.2.3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- fixed sortBy:size
- fixed sortBy:last_modified
- add new option to config https://github.com/ctf0/Laravel-Media-Manager/blob/master/src/config/mediaManager.php#L51
- update view
24 changes: 13 additions & 11 deletions src/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,24 +308,26 @@ public function getFiles($dir)
foreach ($storageFolders as $folder) {
if (!preg_grep($pattern, [$folder])) {
$files[] = [
'name' => strpos($folder, '/') > 1 ? str_replace('/', '', strrchr($folder, '/')) : $folder,
'type' => 'folder',
'path' => $this->storageDisk->url($folder),
'size' => '',
'items' => count($this->storageDisk->allFiles($folder)) + count($this->storageDisk->allDirectories($folder)),
'last_modified' => Carbon::createFromTimestamp($this->storageDisk->lastModified($folder))->{$this->LMF}(),
'name' => strpos($folder, '/') > 1 ? str_replace('/', '', strrchr($folder, '/')) : $folder,
'type' => 'folder',
'path' => $this->storageDisk->url($folder),
'size' => '',
'items' => count($this->storageDisk->allFiles($folder)) + count($this->storageDisk->allDirectories($folder)),
'last_modified' => $this->storageDisk->lastModified($folder),
'last_modified_formated' => Carbon::createFromTimestamp($this->storageDisk->lastModified($folder))->{$this->LMF}(),
];
}
}

foreach ($storageFiles as $file) {
if (!preg_grep($pattern, [$file])) {
$files[] = [
'name' => strpos($file, '/') > 1 ? str_replace('/', '', strrchr($file, '/')) : $file,
'type' => $this->storageDisk->mimeType($file),
'path' => $this->storageDisk->url($file),
'size' => $this->storageDisk->size($file),
'last_modified' => Carbon::createFromTimestamp($this->storageDisk->lastModified($file))->{$this->LMF}(),
'name' => strpos($file, '/') > 1 ? str_replace('/', '', strrchr($file, '/')) : $file,
'type' => $this->storageDisk->mimeType($file),
'path' => $this->storageDisk->url($file),
'size' => $this->storageDisk->size($file),
'last_modified' => $this->storageDisk->lastModified($file),
'last_modified_formated' => Carbon::createFromTimestamp($this->storageDisk->lastModified($file))->{$this->LMF}(),
];
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/resources/assets/js/components/bulma/media.vue
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,6 @@ export default {
$('#file_loader').hide()
this.selectFirst()
$('#right').fadeIn()
this.allFiles.map((e) => {
if (typeof e.size !== 'undefined') {
e.size = this.bytesToSize(e.size)
}
})
})
// dirs list
Expand Down
14 changes: 7 additions & 7 deletions src/resources/views/bulma/media.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ class="button"
</template>

<span class="icon is-large" v-else>
<i v-if="fileTypeIs(file, 'folder')" class="fa fa-folder"></i>
<i v-if="fileTypeIs(file, 'video')" class="fa fa-video-camera"></i>
<i v-if="fileTypeIs(file, 'audio')" class="fa fa-music"></i>
<i v-if="fileTypeIs(file, 'text')" class="fa fa-file-text"></i>
<i v-if="fileTypeIs(file, 'folder')" class="fa fa-folder fa-3x"></i>
<i v-if="fileTypeIs(file, 'video')" class="fa fa-video-camera fa-3x"></i>
<i v-if="fileTypeIs(file, 'audio')" class="fa fa-music fa-3x"></i>
<i v-if="fileTypeIs(file, 'text')" class="fa fa-file-text fa-3x"></i>
</span>
</div>
<div class="details">
Expand All @@ -273,7 +273,7 @@ class="button"
@{{ file.items }} item(s)
</template>
<template v-else>
<span class="file_size">@{{ file.size }}</span>
<span class="file_size">@{{ bytesToSize(file.size) }}</span>
</template>
</small>
</div>
Expand Down Expand Up @@ -335,13 +335,13 @@ class="button"
<h4>Title: <span>@{{ selectedFile.name }}</span></h4>
<h4>Type: <span>@{{ selectedFile.type }}</span></h4>
<template v-if="!selectedFileIs('folder')">
<h4>Size: <span>@{{ selectedFile.size }}</span></h4>
<h4>Size: <span>@{{ bytesToSize(selectedFile.size) }}</span></h4>
<h4>Public URL: <a :href="selectedFile.path" target="_blank">Click Here</a></h4>
</template>
<template v-else>
<h4>items: <span>@{{ selectedFile.items }} Item(s)</span></h4>
</template>
<h4>Last Modified: <span>@{{ selectedFile.last_modified }}</span></h4>
<h4>Last Modified: <span>@{{ selectedFile.last_modified_formated }}</span></h4>
</div>
</div>
</template>
Expand Down

0 comments on commit 0060f26

Please sign in to comment.