diff --git a/seahub/templates/js/templates.html b/seahub/templates/js/templates.html index 6ae08f378d..3414691920 100644 --- a/seahub/templates/js/templates.html +++ b/seahub/templates/js/templates.html @@ -409,6 +409,9 @@
  • {% trans "Rename" %}
  • {% trans "Move" %}
  • {% trans "Copy" %}
  • + <% if (app.pageOptions.folder_perm_enabled && is_repo_owner) { %> +
  • {% trans "Permission" %}
  • + <% } %>
  • {% trans "Open via Client" %}
  • <% } %> diff --git a/static/scripts/app/views/dirent-grid.js b/static/scripts/app/views/dirent-grid.js index 5d81588b7d..cd12c1c712 100644 --- a/static/scripts/app/views/dirent-grid.js +++ b/static/scripts/app/views/dirent-grid.js @@ -7,7 +7,7 @@ define([ 'app/views/share', 'app/views/folder-perm', 'app/views/dialogs/dirent-mvcp', - 'app/views/dialogs/dirent-rename' + 'app/views/dialogs/dirent-rename', ], function($, _, Backbone, Common, FileTree, ShareView, FolderPermView, DirentMvcpDialog, DirentRenameDialog) { 'use strict'; @@ -136,6 +136,7 @@ define([ this.$('.open-via-client').on('click', _.bind(this.open_via_client, this)); this.$('.lock-file').on('click', _.bind(this.lockFile, this)); this.$('.unlock-file').on('click', _.bind(this.unlockFile, this)); + this.$('.set-folder-permission').on('click', _.bind(this.setFolderPerm, this)); return false; }, @@ -203,6 +204,16 @@ define([ return false; }, + setFolderPerm: function() { + var options = { + 'obj_name': this.model.get('obj_name'), + 'dir_path': this.dir.path, + 'repo_id': this.dir.repo_id + }; + new FolderPermView(options); + return false; + }, + lockFile: function() { this.closeMenu(); this.model.lockFile({