1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +00:00

[sdoc] 'shared file view': display 'share permission' & 'download' icon (if it can be downloaded)

This commit is contained in:
llj
2023-08-30 18:24:39 +08:00
parent 68bbb9d306
commit 66885a58b2
8 changed files with 34 additions and 6 deletions

View File

@@ -10,9 +10,16 @@ const { serviceURL, siteRoot, avatarURL } = window.app.config;
const { username } = window.app.pageOptions;
const {
repoID, filePerm,
canDownload, canEdit,
trafficOverLimit, zipped,
docPath, docName, docUuid, seadocAccessToken, seadocServerUrl, assetsUrl
} = window.shared.pageOptions;
// share permission of this sdoc
const sharePermission = {'can_edit': canEdit, 'can_download': canDownload, 'can_upload': false};
const sharePermissionStr = Utils.getShareLinkPermissionStr(sharePermission);
const sharePermissionText = Utils.getShareLinkPermissionObject(sharePermissionStr).text;
window.seafile = {
repoID,
docPath,
@@ -25,6 +32,8 @@ window.seafile = {
username,
avatarURL,
siteRoot,
sharePermissionText: sharePermissionText,
downloadURL: (canDownload && !trafficOverLimit) ? `?${zipped ? 'p=' + encodeURIComponent(docPath) + '&' : ''}dl=1` : '',
docPerm: filePerm,
historyURL: Utils.generateHistoryURL(siteRoot, repoID, docPath),
assetsUrl,