mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
adjust button position
This commit is contained in:
@@ -34,6 +34,7 @@ class Org extends React.Component {
|
|||||||
isShowAddOrgUserDialog: false,
|
isShowAddOrgUserDialog: false,
|
||||||
isShowAddOrgAdminDialog: false,
|
isShowAddOrgAdminDialog: false,
|
||||||
isInviteUserDialogOpen: false,
|
isInviteUserDialogOpen: false,
|
||||||
|
isShowAddDepartDialog: false,
|
||||||
currentTab: 'users',
|
currentTab: 'users',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -70,8 +71,11 @@ class Org extends React.Component {
|
|||||||
this.setState({isInviteUserDialogOpen: !this.state.isInviteUserDialogOpen});
|
this.setState({isInviteUserDialogOpen: !this.state.isInviteUserDialogOpen});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
toggleAddDepartDialog = () => {
|
||||||
|
this.setState({ isShowAddDepartDialog: !this.state.isShowAddDepartDialog});
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
let { isSidePanelClosed, currentTab, isShowAddOrgUserDialog, isShowAddOrgAdminDialog, isInviteUserDialogOpen } = this.state;
|
let { isSidePanelClosed, currentTab, isShowAddOrgUserDialog, isShowAddOrgAdminDialog, isInviteUserDialogOpen } = this.state;
|
||||||
let href = window.location.href;
|
let href = window.location.href;
|
||||||
let newPath = 'groups/';
|
let newPath = 'groups/';
|
||||||
@@ -81,7 +85,13 @@ class Org extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<SidePanel isSidePanelClosed={isSidePanelClosed} onCloseSidePanel={this.onCloseSidePanel} currentTab={currentTab} tabItemClick={this.tabItemClick} />
|
<SidePanel isSidePanelClosed={isSidePanelClosed} onCloseSidePanel={this.onCloseSidePanel} currentTab={currentTab} tabItemClick={this.tabItemClick} />
|
||||||
<MainPanel currentTab={currentTab} toggleAddOrgAdmin={this.toggleAddOrgAdmin} toggleAddOrgUser={this.toggleAddOrgUser} toggleInviteUserDialog={this.toggleInviteUserDialog}>
|
<MainPanel
|
||||||
|
currentTab={currentTab}
|
||||||
|
toggleAddOrgAdmin={this.toggleAddOrgAdmin}
|
||||||
|
toggleAddOrgUser={this.toggleAddOrgUser}
|
||||||
|
toggleInviteUserDialog={this.toggleInviteUserDialog}
|
||||||
|
toggleAddDepartDialog={this.toggleAddDepartDialog}
|
||||||
|
>
|
||||||
<Router className="reach-router">
|
<Router className="reach-router">
|
||||||
<OrgInfo path={siteRoot + 'org/orgmanage'} />
|
<OrgInfo path={siteRoot + 'org/orgmanage'} />
|
||||||
<OrgUsers
|
<OrgUsers
|
||||||
@@ -98,8 +108,16 @@ class Org extends React.Component {
|
|||||||
<OrgLibraries path={siteRoot + 'org/repoadmin'} />
|
<OrgLibraries path={siteRoot + 'org/repoadmin'} />
|
||||||
<OrgLinks path={siteRoot + 'org/publinkadmin'} />
|
<OrgLinks path={siteRoot + 'org/publinkadmin'} />
|
||||||
<OrgDepartments path={siteRoot + 'org/departmentadmin'}>
|
<OrgDepartments path={siteRoot + 'org/departmentadmin'}>
|
||||||
<OrgDepartmentsList path='/' />
|
<OrgDepartmentsList
|
||||||
<OrgDepartmentItem path={newPath} />
|
path='/'
|
||||||
|
isShowAddDepartDialog={this.state.isShowAddDepartDialog}
|
||||||
|
toggleAddDepartDialog={this.toggleAddDepartDialog}
|
||||||
|
/>
|
||||||
|
<OrgDepartmentItem
|
||||||
|
path={newPath}
|
||||||
|
isShowAddDepartDialog={this.state.isShowAddDepartDialog}
|
||||||
|
toggleAddDepartDialog={this.toggleAddDepartDialog}
|
||||||
|
/>
|
||||||
</OrgDepartments>
|
</OrgDepartments>
|
||||||
<OrgLogs
|
<OrgLogs
|
||||||
path={siteRoot + 'org/logadmin'}
|
path={siteRoot + 'org/logadmin'}
|
||||||
|
@@ -22,6 +22,7 @@ class MainPanel extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const groupID = window.org.pageOptions.groupID;
|
||||||
return (
|
return (
|
||||||
<div className="main-panel o-hidden">
|
<div className="main-panel o-hidden">
|
||||||
<div className="main-panel-north border-left-show">
|
<div className="main-panel-north border-left-show">
|
||||||
@@ -45,6 +46,11 @@ class MainPanel extends Component {
|
|||||||
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('Add admin')}
|
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('Add admin')}
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
{(this.props.currentTab === 'departmentadmin' && !groupID) &&
|
||||||
|
<button className="btn btn-secondary operation-item" title={gettext('New Department')} onClick={this.props.toggleAddDepartDialog}>
|
||||||
|
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('New Department')}
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="common-toolbar">
|
<div className="common-toolbar">
|
||||||
|
@@ -109,25 +109,35 @@ class OrgDepartmentItem extends React.Component {
|
|||||||
<div className="main-panel-center flex-row h-100">
|
<div className="main-panel-center flex-row h-100">
|
||||||
<div className="cur-view-container o-auto">
|
<div className="cur-view-container o-auto">
|
||||||
<div className="cur-view-path">
|
<div className="cur-view-path">
|
||||||
<h3 className="sf-heading">
|
<div className="fleft">
|
||||||
{ this.state.groupID ?
|
<h3 className="sf-heading">
|
||||||
<a href={serviceURL + '/org/departmentadmin/'}>{gettext('Departments')}</a>
|
{this.state.groupID ?
|
||||||
: <span>{gettext('Departments')}</span>
|
<a href={serviceURL + '/org/departmentadmin/'}>{gettext('Departments')}</a>
|
||||||
}
|
: <span>{gettext('Departments')}</span>
|
||||||
{
|
}
|
||||||
this.state.ancestorGroups.map(ancestor => {
|
{this.state.ancestorGroups.map(ancestor => {
|
||||||
let newHref = serviceURL + '/org/departmentadmin/groups/' + ancestor.id + '/';
|
let newHref = serviceURL + '/org/departmentadmin/groups/' + ancestor.id + '/';
|
||||||
return (
|
return (
|
||||||
<span key={ancestor.id}>{' / '}<a href={newHref}>{ancestor.name}</a></span>
|
<span key={ancestor.id}>{' / '}<a href={newHref}>{ancestor.name}</a></span>
|
||||||
);
|
);
|
||||||
})
|
})}
|
||||||
}
|
{this.state.groupID && <span>{' / '}{this.state.groupName}</span>}
|
||||||
{ this.state.groupID && <span>{' / '}{this.state.groupName}</span> }
|
</h3>
|
||||||
</h3>
|
</div>
|
||||||
|
{this.state.groupID &&
|
||||||
|
<div className="fright">
|
||||||
|
<button className="btn-white operation-item" onClick={this.props.toggleAddDepartDialog}>
|
||||||
|
{gettext('New Sub-departments')}</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="cur-view-subcontainer org-groups">
|
<div className="cur-view-subcontainer org-groups">
|
||||||
<OrgDepartmentsList groupID={this.state.groupID} />
|
<OrgDepartmentsList
|
||||||
|
groupID={this.state.groupID}
|
||||||
|
isShowAddDepartDialog={this.props.isShowAddDepartDialog}
|
||||||
|
toggleAddDepartDialog={this.props.toggleAddDepartDialog}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="cur-view-subcontainer org-members">
|
<div className="cur-view-subcontainer org-members">
|
||||||
|
@@ -20,7 +20,6 @@ class OrgDepartmentsList extends React.Component {
|
|||||||
groups: null,
|
groups: null,
|
||||||
groupID: -1,
|
groupID: -1,
|
||||||
groupName: '',
|
groupName: '',
|
||||||
showAddDepartDialog: false,
|
|
||||||
showDeleteDepartDialog: false,
|
showDeleteDepartDialog: false,
|
||||||
showSetGroupQuotaDialog: false,
|
showSetGroupQuotaDialog: false,
|
||||||
};
|
};
|
||||||
@@ -42,10 +41,6 @@ class OrgDepartmentsList extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showAddDepartDialog = () => {
|
|
||||||
this.setState({ showAddDepartDialog: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
showDeleteDepartDialog = (group) => {
|
showDeleteDepartDialog = (group) => {
|
||||||
this.setState({ showDeleteDepartDialog: true, groupID: group.id, groupName: group.name });
|
this.setState({ showDeleteDepartDialog: true, groupID: group.id, groupName: group.name });
|
||||||
}
|
}
|
||||||
@@ -56,7 +51,6 @@ class OrgDepartmentsList extends React.Component {
|
|||||||
|
|
||||||
toggleCancel = () => {
|
toggleCancel = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
showAddDepartDialog: false,
|
|
||||||
showDeleteDepartDialog: false,
|
showDeleteDepartDialog: false,
|
||||||
showSetGroupQuotaDialog: false,
|
showSetGroupQuotaDialog: false,
|
||||||
});
|
});
|
||||||
@@ -74,16 +68,12 @@ class OrgDepartmentsList extends React.Component {
|
|||||||
const groups = this.state.groups;
|
const groups = this.state.groups;
|
||||||
let isSub = this.props.groupID ? true : false;
|
let isSub = this.props.groupID ? true : false;
|
||||||
let header = isSub ? gettext('Sub-departments') : gettext('Departments');
|
let header = isSub ? gettext('Sub-departments') : gettext('Departments');
|
||||||
let headerButton = isSub ? gettext('New Sub-department') : gettext('New Department');
|
|
||||||
let noGroup = isSub ? gettext('No sub-departments') : gettext('No departments');
|
let noGroup = isSub ? gettext('No sub-departments') : gettext('No departments');
|
||||||
return (
|
return (
|
||||||
<div className="main-panel-center flex-row h-100">
|
<div className="main-panel-center flex-row h-100">
|
||||||
<div className="cur-view-container o-auto">
|
<div className="cur-view-container o-auto">
|
||||||
<div className="cur-view-path">
|
<div className="cur-view-path">
|
||||||
<div className="fleft"><h3 className="sf-heading">{header}</h3></div>
|
<div className="fleft"><h3 className="sf-heading">{header}</h3></div>
|
||||||
<div className="fright">
|
|
||||||
<button className="btn-white operation-item" onClick={this.showAddDepartDialog}>{headerButton}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="cur-view-content">
|
<div className="cur-view-content">
|
||||||
{groups && groups.length > 0 ?
|
{groups && groups.length > 0 ?
|
||||||
@@ -115,13 +105,13 @@ class OrgDepartmentsList extends React.Component {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{this.state.showAddDepartDialog && (
|
{this.props.isShowAddDepartDialog && (
|
||||||
<ModalPortal>
|
<ModalPortal>
|
||||||
<AddDepartDialog
|
<AddDepartDialog
|
||||||
toggle={this.toggleCancel}
|
|
||||||
onDepartChanged={this.onDepartChanged}
|
onDepartChanged={this.onDepartChanged}
|
||||||
parentGroupID={this.props.groupID}
|
parentGroupID={this.props.groupID}
|
||||||
groupID={this.state.groupID}
|
groupID={this.state.groupID}
|
||||||
|
toggle={this.props.toggleAddDepartDialog}
|
||||||
/>
|
/>
|
||||||
</ModalPortal>
|
</ModalPortal>
|
||||||
)}
|
)}
|
||||||
|
Reference in New Issue
Block a user