mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
update readonly toolbar effect (#4605)
This commit is contained in:
@@ -163,10 +163,6 @@ class DirOperationToolbar extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
let { path, repoName, userPerm } = this.props;
|
let { path, repoName, userPerm } = this.props;
|
||||||
|
|
||||||
if (userPerm !== 'rw' && userPerm !== 'admin') {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
let itemType = path === '/' ? 'library' : 'dir';
|
let itemType = path === '/' ? 'library' : 'dir';
|
||||||
let itemName = path == '/' ? repoName : Utils.getFolderName(path);
|
let itemName = path == '/' ? repoName : Utils.getFolderName(path);
|
||||||
|
|
||||||
@@ -197,6 +193,7 @@ class DirOperationToolbar extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
{(userPerm === 'rw' || userPerm === 'admin') && (
|
||||||
<div className="dir-operation">
|
<div className="dir-operation">
|
||||||
<div className="operation">
|
<div className="operation">
|
||||||
{content}
|
{content}
|
||||||
@@ -219,6 +216,7 @@ class DirOperationToolbar extends React.Component {
|
|||||||
</ul>
|
</ul>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
{Utils.isDesktop() && <ViewModeToolbar currentMode={this.props.currentMode} switchViewMode={this.props.switchViewMode} />}
|
{Utils.isDesktop() && <ViewModeToolbar currentMode={this.props.currentMode} switchViewMode={this.props.switchViewMode} />}
|
||||||
{this.state.isCreateFileDialogShow && (
|
{this.state.isCreateFileDialogShow && (
|
||||||
<ModalPortal>
|
<ModalPortal>
|
||||||
|
@@ -328,19 +328,21 @@ class MultipleDirOperationToolbar extends React.Component {
|
|||||||
|
|
||||||
let direntPath = this.getDirentPath(dirent);
|
let direntPath = this.getDirentPath(dirent);
|
||||||
|
|
||||||
if (userPerm !== 'rw' && userPerm !== 'admin') {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div className="dir-operation">
|
<div className="dir-operation">
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<ButtonGroup className="flex-row group-operations">
|
<ButtonGroup className="flex-row group-operations">
|
||||||
|
{(userPerm === 'rw' || userPerm === 'admin') && (
|
||||||
|
<Fragment>
|
||||||
<Button className="secondary group-op-item action-icon sf2-icon-move" title={gettext('Move')} onClick={this.onMoveToggle}></Button>
|
<Button className="secondary group-op-item action-icon sf2-icon-move" title={gettext('Move')} onClick={this.onMoveToggle}></Button>
|
||||||
<Button className="secondary group-op-item action-icon sf2-icon-copy" title={gettext('Copy')} onClick={this.onCopyToggle}></Button>
|
<Button className="secondary group-op-item action-icon sf2-icon-copy" title={gettext('Copy')} onClick={this.onCopyToggle}></Button>
|
||||||
<Button className="secondary group-op-item action-icon sf2-icon-delete" title={gettext('Delete')} onClick={this.onItemsDelete}></Button>
|
<Button className="secondary group-op-item action-icon sf2-icon-delete" title={gettext('Delete')} onClick={this.onItemsDelete}></Button>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
{(userPerm === 'rw' || userPerm === 'admin' || userPerm === 'r') && (
|
||||||
<Button className="secondary group-op-item action-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemsDownload}></Button>
|
<Button className="secondary group-op-item action-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemsDownload}></Button>
|
||||||
|
)}
|
||||||
{this.props.selectedDirentList.length === 1 &&
|
{this.props.selectedDirentList.length === 1 &&
|
||||||
<ItemDropdownMenu
|
<ItemDropdownMenu
|
||||||
tagName={'button'}
|
tagName={'button'}
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.border-left-show:before {
|
.border-left-show:before {
|
||||||
|
@@ -54,6 +54,11 @@ const propTypes = {
|
|||||||
class LibContentToolbar extends React.Component {
|
class LibContentToolbar extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
|
if (!this.props.userPerm) {
|
||||||
|
return <div className="cur-view-toolbar"></div>
|
||||||
|
}
|
||||||
|
|
||||||
if (this.props.isViewFile) {
|
if (this.props.isViewFile) {
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
Reference in New Issue
Block a user