1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 10:58:33 +00:00

show history when select folder (#6318)

This commit is contained in:
Michael An
2024-07-09 17:31:03 +08:00
committed by GitHub
parent 1ae64295c9
commit a319e65301

View File

@@ -7,13 +7,12 @@ import TreeSection from '../tree-section';
const DirOthers = ({ userPerm, repoID, currentPath }) => {
let trashUrl = null;
let historyUrl = null;
const historyUrl = siteRoot + 'repo/history/' + repoID + '/';
if (userPerm === 'rw' && !Utils.isMarkdownFile(currentPath)) {
if (Utils.getFileName(currentPath)) {
trashUrl = siteRoot + 'repo/' + repoID + '/trash/?path=' + encodeURIComponent(currentPath);
} else {
trashUrl = siteRoot + 'repo/' + repoID + '/trash/';
historyUrl = siteRoot + 'repo/history/' + repoID + '/';
}
}
@@ -29,16 +28,14 @@ const DirOthers = ({ userPerm, repoID, currentPath }) => {
</div>
</div>
}
{historyUrl &&
<div className='tree-node-inner text-nowrap' title={gettext('History')} onClick={() => location.href = historyUrl}>
<div className="tree-node-text">{gettext('History')}</div>
<div className="left-icon">
<div className="tree-node-icon">
<span className="sf3-font-history sf3-font"></span>
</div>
<div className='tree-node-inner text-nowrap' title={gettext('History')} onClick={() => location.href = historyUrl}>
<div className="tree-node-text">{gettext('History')}</div>
<div className="left-icon">
<div className="tree-node-icon">
<span className="sf3-font-history sf3-font"></span>
</div>
</div>
}
</div>
</TreeSection>
);
};