diff --git a/config/file_library.php b/config/file_library.php index a9b025fca6..6724415eb3 100644 --- a/config/file_library.php +++ b/config/file_library.php @@ -27,4 +27,6 @@ 'filesize_limit' => env('FILE_LIBRARY_FILESIZE_LIMIT', 50), 'allowed_extensions' => [], 'prefix_uuid_with_local_path' => false, + 'show_uploaded_date' => false, + 'format_uploaded_date' => 'd/m/Y H:i', ]; diff --git a/frontend/js/components/media-library/MediaSidebar.vue b/frontend/js/components/media-library/MediaSidebar.vue index d584babf66..8c8aa5598f 100755 --- a/frontend/js/components/media-library/MediaSidebar.vue +++ b/frontend/js/components/media-library/MediaSidebar.vue @@ -16,6 +16,7 @@
  • {{ $trans('media-library.sidebar.dimensions', 'Dimensions') }}: {{ firstMedia.width }} × {{ firstMedia.height }}
  • +
  • {{ $trans('media-library.sidebar.uploaded-at', 'Uploaded at') }}: {{ firstMedia.uploadedDate }}
  • diff --git a/lang/en/lang.php b/lang/en/lang.php index 4adab5a77d..9507bddd4e 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -286,6 +286,7 @@ 'empty-text' => 'No file selected', 'files-selected' => 'files selected', 'tags' => 'Tags', + 'uploaded-at' => 'Uploaded at', ], 'title' => 'Media Library', 'update' => 'Update', diff --git a/lang/fr/lang.php b/lang/fr/lang.php index 92dbc166bd..8c91c99fec 100644 --- a/lang/fr/lang.php +++ b/lang/fr/lang.php @@ -274,6 +274,7 @@ 'empty-text' => 'Aucun fichier sélectionné', 'files-selected' => 'fichiers sélectionnés', 'tags' => 'Tags', + 'uploaded-at' => 'Uploaded at', ], 'title' => 'Galerie de médias', 'update' => 'Mettre à jour', diff --git a/src/Models/File.php b/src/Models/File.php index 65e352fd81..9ab8255fe0 100755 --- a/src/Models/File.php +++ b/src/Models/File.php @@ -35,6 +35,12 @@ public function scopeUnused($query) public function toCmsArray() { + $uploadedDate = []; + if (config('twill.file-library.show_uploaded_date')) { + $uploadedDate = [ + 'uploadedDate' => $this->created_at->format(config("twill.file-library.format_uploaded_date", "d/m/Y H:i")) + ]; + } return [ 'id' => $this->id, 'name' => $this->filename, @@ -42,7 +48,7 @@ public function toCmsArray() 'original' => FileService::getUrl($this->uuid), 'size' => $this->size, 'filesizeInMb' => number_format($this->attributes['size'] / 1048576, 2), - ]; + ] + $uploadedDate; } public function getTable()