1
0
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:
shanshuirenjia
2018-09-18 20:57:17 -05:00
committed by Daniel Pan
parent 3d165ec733
commit db47fb34a7
27 changed files with 437 additions and 275 deletions

View 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;