diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 9d60e77b0a..0181acab59 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1623,7 +1623,8 @@
updateEmptyContent: function() {
var permissions = this.getDirectoryPermissions();
var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
- this.$el.find('#emptycontent').toggleClass('hidden', !isCreatable || !this.isEmpty);
+ this.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty);
+ this.$el.find('#emptycontent .uploadmessage').toggleClass('hidden', !isCreatable || !this.isEmpty);
this.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty);
},
/**
diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php
index 02137c7e44..32651b261d 100644
--- a/apps/files/templates/list.php
+++ b/apps/files/templates/list.php
@@ -54,7 +54,7 @@
t('No files in here')); ?>
-
t('Upload some content or sync with your devices!')); ?>
+
t('Upload some content or sync with your devices!')); ?>
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 153cbe52c1..aa44c92792 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -87,7 +87,8 @@ describe('OCA.Files.FileList tests', function() {
'
' +
'
' +
'' +
- '
Empty content message
' +
+ // TODO: move to handlebars template
+ '
Empty content message
Upload message
' +
'
' +
'
'
);
@@ -845,13 +846,15 @@ describe('OCA.Files.FileList tests', function() {
fileList.setFiles([]);
expect($('#filestable thead th').hasClass('hidden')).toEqual(true);
expect($('#emptycontent').hasClass('hidden')).toEqual(false);
+ expect($('#emptycontent .uploadmessage').hasClass('hidden')).toEqual(false);
expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(true);
});
- it('hides headers, empty content message, and summary when list is empty and user has no creation permission', function(){
+ it('hides headers, upload message, and summary when list is empty and user has no creation permission', function(){
$('#permissions').val(0);
fileList.setFiles([]);
expect($('#filestable thead th').hasClass('hidden')).toEqual(true);
- expect($('#emptycontent').hasClass('hidden')).toEqual(true);
+ expect($('#emptycontent').hasClass('hidden')).toEqual(false);
+ expect($('#emptycontent .uploadmessage').hasClass('hidden')).toEqual(true);
expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(true);
});
it('calling findFileEl() can find existing file element', function() {
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index bec43a4fb5..41bfeba031 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -150,6 +150,13 @@ OCA.Sharing.PublicApp = {
return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec);
};
+ this.fileList.updateEmptyContent = function() {
+ this.$el.find('#emptycontent .uploadmessage').text(
+ t('files_sharing', 'You can upload into this folder')
+ );
+ OCA.Files.FileList.prototype.updateEmptyContent.apply(this, arguments);
+ };
+
var file_upload_start = $('#file_upload_start');
file_upload_start.on('fileuploadadd', function (e, data) {
var fileDirectory = '';