mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
Wiki coding style improve (#2380)
This commit is contained in:
committed by
Daniel Pan
parent
3d165ec733
commit
db47fb34a7
29
frontend/src/components/toolbar/path-toolbar.js
Normal file
29
frontend/src/components/toolbar/path-toolbar.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import React from 'react';
|
||||
import { gettext, repoID, permission, siteRoot, initialFilePath } from '../constants';
|
||||
|
||||
function PathToolbar() {
|
||||
|
||||
let trashUrl = '';
|
||||
let historyUrl = '';
|
||||
if (initialFilePath === '/' && permission) {
|
||||
trashUrl = siteRoot + 'repo/recycle/' + repoID + '/?referer=' + encodeURIComponent(location.href);
|
||||
historyUrl = siteRoot + 'repo/history/' + repoID + '/?referer=' + encodeURIComponent(location.href);
|
||||
return (
|
||||
<ul className="path-toolbar">
|
||||
<li className="toolbar-item"><a className="op-link sf2-icon-trash" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a></li>
|
||||
<li className="toolbar-item"><a className="op-link sf2-icon-history" href={historyUrl} title={gettext('History')} aria-label={gettext('History')}></a></li>
|
||||
</ul>
|
||||
);
|
||||
} else if (permission) {
|
||||
trashUrl = siteRoot + 'dir/recycle/' + repoID + '/?dir_path=' + encodeURIComponent(initialFilePath);
|
||||
return (
|
||||
<ul className="path-toolbar">
|
||||
<li className="toolbar-item"><a className="op-link sf2-icon-trash" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a></li>
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
export default PathToolbar;
|
Reference in New Issue
Block a user