Skip to content

Commit e20dfd4

Browse files
committed
Media UI Improvements
1 parent 980f2c3 commit e20dfd4

File tree

6 files changed

+32
-1
lines changed

6 files changed

+32
-1
lines changed

src/Darryldecode/Backend/Base/Registrar/Registrar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Registrar {
1313
/**
1414
* the laravel backend version
1515
*/
16-
const VERSION = '1.0.12';
16+
const VERSION = '1.0.13';
1717
const VERSION_NAME = 'Alpha';
1818

1919
/**

src/Darryldecode/Backend/Components/MediaManager/Views/mediaManager.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
</div>
5959
<div data-ng-repeat="f in files.files" class="col-lg-2 col-md-2 col-sm-4">
6060
<div class="file-thumb">
61+
<label class="label label-info pull-left label-file-size">Size: @{{::getSizeName(f)}}</label>
6162
<file-preview file-source="@{{f}}"></file-preview>
6263
<div class="text-wrap meta-data-holder trim-info-xs">
6364
<a href="" data-toggle="tooltip" data-placement="bottom" title="@{{f}}" class="file-name">@{{::getLastSegment(f)}}</a>

src/Darryldecode/Backend/Public/backend/cb/app/contents/modals/controller.gallery.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ angular.module('cb.content').controller('GalleryModalController', ['$scope','$ti
7171
return path.split('/').pop();
7272
};
7373

74+
// get size name. Eg. ( name_large.jpg -> large )
75+
$scope.getSizeName = function(path) {
76+
var sizeName = 'Original';
77+
var fileName = $scope.getLastSegment(path);
78+
var f = fileName.split('_');
79+
if(f.length >= 2) {
80+
sizeName = f[1].split('.')[0];
81+
}
82+
return sizeName;
83+
};
84+
7485
// uploads the files
7586
function upload (files, path) {
7687
if (files && files.length) {

src/Darryldecode/Backend/Public/backend/cb/app/contents/modals/gallery.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ <h3>
4848
</div>
4949
<div data-ng-repeat="f in files.files" class="col-lg-3 col-md-3 col-sm-4">
5050
<div class="file-thumb">
51+
<label class="label label-info pull-left label-file-size">Size: {{::getSizeName(f)}}</label>
5152
<div class="gallery-select-control">
5253
<input data-ng-model="selectedFiles[f]" type="checkbox">
5354
</div>

src/Darryldecode/Backend/Public/backend/cb/app/media-manager/controller.manage.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,17 @@ angular.module('cb.mediaManager').controller('MediaManagerController', ['$scope'
153153
return path.split('/').pop();
154154
};
155155

156+
// get size name. Eg. ( name_large.jpg -> large )
157+
$scope.getSizeName = function(path) {
158+
var sizeName = 'Original';
159+
var fileName = $scope.getLastSegment(path);
160+
var f = fileName.split('_');
161+
if(f.length >= 2) {
162+
sizeName = f[1].split('.')[0];
163+
}
164+
return sizeName;
165+
};
166+
156167
// upload
157168
function upload (files, path) {
158169
if (files && files.length) {

src/Darryldecode/Backend/Public/backend/cb/css/backend.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,13 @@ ul.ul-clear li {
380380
font-size: 12px;
381381
margin: 0 5px;
382382
}
383+
.file-thumb .label-file-size {
384+
left: 15px;
385+
top: 0;
386+
position: absolute;
387+
font-weight: normal;
388+
font-size: 80%;
389+
}
383390

384391
/* CONTENTS */
385392
.editor-wrap {

0 commit comments

Comments
 (0)