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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user