closes #6247
parent
0a5d16d1cd
commit
c7506d77b0
@ -0,0 +1,7 @@
|
||||
{
|
||||
"upload-file": "Upload File",
|
||||
"filename": "Filename",
|
||||
"size/filecount": "Size / Filecount",
|
||||
"confirm-delete": "Do you really want to delete this file?",
|
||||
"filecount": "%1 files"
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
define('admin/manage/uploads', ['uploader'], function (uploader) {
|
||||
var Uploads = {};
|
||||
|
||||
Uploads.init = function () {
|
||||
$('#upload').on('click', function () {
|
||||
uploader.show({
|
||||
title: '[[admin/manage/uploads:upload-file]]',
|
||||
route: config.relative_path + '/api/admin/upload/file',
|
||||
params: { folder: ajaxify.data.currentFolder },
|
||||
}, function () {
|
||||
ajaxify.refresh();
|
||||
});
|
||||
});
|
||||
|
||||
$('.delete').on('click', function () {
|
||||
var file = $(this).parents('[data-path]');
|
||||
bootbox.confirm('[[admin/manage/uploads:confirm-delete]]', function (ok) {
|
||||
if (!ok) {
|
||||
return;
|
||||
}
|
||||
socket.emit('admin.uploads.delete', file.attr('data-path'), function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
file.remove();
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return Uploads;
|
||||
});
|
@ -0,0 +1,39 @@
|
||||
<!-- IMPORT partials/breadcrumbs.tpl -->
|
||||
<div class="clearfix">
|
||||
<button id="upload" class="btn-success pull-right"><i class="fa fa-upload"></i> [[global:upload]]</button>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped users-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>[[admin/manage/uploads:filename]]</th>
|
||||
<th class="text-right">[[admin/manage/uploads:size/filecount]]</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- BEGIN files -->
|
||||
<tr data-path="{files.path}">
|
||||
<!-- IF files.isDirectory -->
|
||||
<td class="col-md-9" role="button">
|
||||
<i class="fa fa-fw fa-folder-o"></i> <a href="{config.relative}/admin/manage/uploads?dir={files.path}">{files.name}</a>
|
||||
</td>
|
||||
<!-- ENDIF files.isDirectory -->
|
||||
|
||||
<!-- IF files.isFile -->
|
||||
<td class="col-md-9">
|
||||
<i class="fa fa-fw fa-file-text-o"></i> <a href="{config.relative_path}{files.url}" target="_blank">{files.name}</a>
|
||||
</td>
|
||||
<!-- ENDIF files.isFile -->
|
||||
|
||||
<td class="col-md-2 text-right"><!-- IF files.size -->{files.sizeHumanReadable}<!-- ELSE -->[[admin/manage/uploads:filecount, {files.fileCount}]]<!-- ENDIF files.size --></td>
|
||||
|
||||
<td role="button" class="col-md-1 text-right"><i class="delete fa fa-fw fa-trash-o <!-- IF !files.isFile --> hidden<!-- ENDIF !files.isFile -->"></i></td>
|
||||
</tr>
|
||||
<!-- END files -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- IMPORT partials/paginator.tpl -->
|
Loading…
Reference in New Issue