');
+ } else {
+ // tags selected but no results
+ this.$el.find('#emptycontent').html('' +
+ '
' + t('systemtags', 'No files found for the selected tags') + '
');
+ }
+ this.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty);
+ this.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty);
+ }
+ else {
+ OCA.Files.FileList.prototype.updateEmptyContent.apply(this, arguments);
+ }
+ },
+
+ getDirectoryPermissions: function() {
+ return OC.PERMISSION_READ | OC.PERMISSION_DELETE;
+ },
+
+ updateStorageStatistics: function() {
+ // no op because it doesn't have
+ // storage info like free space / used space
+ },
+
+ reload: function() {
+ if (!this._systemTagIds.length) {
+ // don't reload
+ this.updateEmptyContent();
+ this.setFiles([]);
+ return $.Deferred().resolve();
+ }
+
+ this._selectedFiles = {};
+ this._selectionSummary.clear();
+ if (this._currentFileModel) {
+ this._currentFileModel.off();
+ }
+ this._currentFileModel = null;
+ this.$el.find('.select-all').prop('checked', false);
+ this.showMask();
+ this._reloadCall = this.filesClient.getFilteredFiles(
+ {
+ systemTagIds: this._systemTagIds
+ },
+ {
+ properties: this._getWebdavProperties()
+ }
+ );
+ if (this._detailsView) {
+ // close sidebar
+ this._updateDetailsView(null);
+ }
+ var callBack = this.reloadCallback.bind(this);
+ return this._reloadCall.then(callBack, callBack);
+ },
+
+ reloadCallback: function(status, result) {
+ if (result) {
+ // prepend empty dir info because original handler
+ result.unshift({});
+ }
+
+ return OCA.Files.FileList.prototype.reloadCallback.call(this, status, result);
+ }
+ });
+
+ OCA.SystemTags.FileList = FileList;
+})();
diff --git a/apps/systemtags/list.php b/apps/systemtags/list.php
new file mode 100644
index 00000000000..dd4fe01e767
--- /dev/null
+++ b/apps/systemtags/list.php
@@ -0,0 +1,25 @@
+
+ *
+ * @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see
+ *
+ */
+// Check if we are a user
+OCP\User::checkLoggedIn();
+
+$tmpl = new OCP\Template('systemtags', 'list', '');
+$tmpl->printPage();
diff --git a/apps/systemtags/templates/list.php b/apps/systemtags/templates/list.php
new file mode 100644
index 00000000000..841ce7b5b6d
--- /dev/null
+++ b/apps/systemtags/templates/list.php
@@ -0,0 +1,38 @@
+
+
+
diff --git a/apps/systemtags/tests/js/systemtagsfilelistSpec.js b/apps/systemtags/tests/js/systemtagsfilelistSpec.js
new file mode 100644
index 00000000000..ba41d347ca4
--- /dev/null
+++ b/apps/systemtags/tests/js/systemtagsfilelistSpec.js
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2016 Vincent Petry
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+describe('OCA.SystemTags.FileList tests', function() {
+ var FileInfo = OC.Files.FileInfo;
+ var fileList;
+
+ beforeEach(function() {
+ // init parameters and test table elements
+ $('#testArea').append(
+ '
' +
+ // init horrible parameters
+ '' +
+ '' +
+ '' +
+ // dummy table
+ // TODO: at some point this will be rendered by the fileList class itself!
+ '