Skip to content

Commit

Permalink
change system admin department style (#6915)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael18811380328 authored Oct 17, 2024
1 parent db75243 commit 0483d79
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 37 deletions.
1 change: 1 addition & 0 deletions frontend/src/css/empty-tip.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.empty-tip .no-items-img-tip {
display: inline-block;
margin-bottom: 10px;
-webkit-user-drag: none;
}

.empty-tip .empty-tip-title {
Expand Down
13 changes: 7 additions & 6 deletions frontend/src/css/org-department-item.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@
height: 24px;
line-height: 24px;
}
.cur-view-container .no-libraty, .cur-view-container .no-member, .cur-view-container .no-group {
color: #a4a4a4;
text-align: center;
margin: 30px 0;
}

.cur-view-path .sf-heading a {
color: #eb8205;
}

.cur-view-subcontainer {
margin: 10px;
}

.cur-view-subcontainer table {
margin: 8px 0 40px;
}
.org-departments>div{

.org-departments>div {
height: 100%;
}

.org-members .cur-view-content {
padding-bottom: 40px;
}

.cur-view-path button:hover {
cursor: pointer;
}
2 changes: 1 addition & 1 deletion frontend/src/css/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
align-items: center;
}

.common-toolbar > div{
.common-toolbar > div {
margin-left: .5rem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ModalPortal from '../../../components/modal-portal';
import DeleteRepoDialog from '../../../components/dialog/org-delete-repo-dialog';
import { gettext, orgID, lang } from '../../../utils/constants';
import Department from './department';
import EmptyTip from '../../../components/empty-tip';
import '../../../css/org-department-item.css';

moment.locale(lang);
Expand Down Expand Up @@ -84,7 +85,7 @@ class OrgDepartmentItem extends React.Component {
</tbody>
</table>
</div>
: <p className="no-libraty">{gettext('No libraries')}</p>
: <EmptyTip text={gettext('No libraries')} />
}
</Department>
</Fragment>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/org-admin/departments/department-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ModalPortal from '../../../components/modal-portal';
import AddDepartDialog from '../../../components/dialog/org-add-department-dialog';
import { gettext, orgID, lang } from '../../../utils/constants';
import GroupItem from './group-item';
import EmptyTip from '../../../components/empty-tip';

import '../../../css/org-department-item.css';

Expand Down Expand Up @@ -139,7 +140,7 @@ class OrgDepartmentsList extends React.Component {
</tbody>
</table>
:
<p className="no-group">{gettext('No departments')}</p>
<EmptyTip text={gettext('No departments')}/>
}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import RoleSelector from '../../../components/single-selector';
import DeleteMemberDialog from '../../../components/dialog/org-delete-member-dialog';
import { serviceURL, gettext, orgID, lang } from '../../../utils/constants';
import Department from './department';
import EmptyTip from '../../../components/empty-tip';
import '../../../css/org-department-item.css';

moment.locale(lang);
Expand Down Expand Up @@ -169,7 +170,7 @@ class OrgDepartmentItem extends React.Component {
>
<div className="cur-view-content">
{(!members || members.length === 0) ?
<p className="no-member">{gettext('No members')}</p> :
<EmptyTip text={gettext('No members')}/> :
<table>
<thead>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/org-admin/departments/sub-departments.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { seafileAPI } from '../../../utils/seafile-api';
import { Utils } from '../../../utils/utils';
import toaster from '../../../components/toast';
import { gettext, orgID, lang } from '../../../utils/constants';

import EmptyTip from '../../../components/empty-tip';
import Department from './department';
import GroupItem from './group-item';
import '../../../css/org-department-item.css';
Expand Down Expand Up @@ -149,7 +149,7 @@ class OrgDepartmentItem extends React.Component {
})}
</tbody>
</table>
: <p className="no-group">{gettext('No sub-departments')}</p>
: <EmptyTip text={gettext('No sub-departments')}/>
}
</div>
</Department>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/org-admin/main-panel-topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import Account from '../../components/common/account';

const propTypes = {
children: PropTypes.object,
children: PropTypes.any,
search: PropTypes.any,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import DeleteRepoDialog from '../../../components/dialog/sysadmin-dialog/sysadmi
import { gettext, lang } from '../../../utils/constants';
import RepoItem from './repo-item';
import Department from './department';
import EmptyTip from '../../../components/empty-tip';
import '../../../css/org-department-item.css';

moment.locale(lang);
Expand Down Expand Up @@ -95,7 +96,7 @@ class DepartmentDetail extends React.Component {
</tbody>
</table>
</div>
: <p className="no-libraty">{gettext('No libraries')}</p>
: <EmptyTip text={gettext('No libraries')} />
}
</Department>
{this.state.showDeleteRepoDialog && (
Expand Down
34 changes: 15 additions & 19 deletions frontend/src/pages/sys-admin/departments/department-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ModalPortal from '../../../components/modal-portal';
import AddDepartDialog from '../../../components/dialog/sysadmin-dialog/sysadmin-add-department-dialog';
import { gettext, lang } from '../../../utils/constants';
import GroupItem from './group-item';
import EmptyTip from '../../../components/empty-tip';
import '../../../css/org-department-item.css';

moment.locale(lang);
Expand Down Expand Up @@ -84,25 +85,20 @@ class DepartmentList extends React.Component {

render() {
const groups = this.state.groups;
const topbarChildren = (
<Fragment>
<button className='btn btn-secondary operation-item' title={gettext('New Department')} onClick={this.toggleAddDepartDialog}>{gettext('New Department')}
</button>
{this.state.isShowAddDepartDialog && (
<ModalPortal>
<AddDepartDialog
onAddNewDepartment={this.onAddNewDepartment}
groupID={this.state.groupID}
toggle={this.toggleAddDepartDialog}
/>
</ModalPortal>
)}
</Fragment>
);
return (
<Fragment>
<MainPanelTopbar {...this.props}>
{topbarChildren}
<button className='btn btn-secondary operation-item' title={gettext('New Department')} onClick={this.toggleAddDepartDialog}>{gettext('New Department')}
</button>
{this.state.isShowAddDepartDialog && (
<ModalPortal>
<AddDepartDialog
onAddNewDepartment={this.onAddNewDepartment}
groupID={this.state.groupID}
toggle={this.toggleAddDepartDialog}
/>
</ModalPortal>
)}
</MainPanelTopbar>
<div className="main-panel-center flex-row h-100">
<div className="cur-view-container o-auto">
Expand All @@ -111,9 +107,9 @@ class DepartmentList extends React.Component {
<h3 className="sf-heading">{gettext('Departments')}</h3>
</div>
</div>
<div className="cur-view-content">
<div className="cur-view-content pb-8">
{groups && groups.length > 0 ?
<table>
<table className='mb-8'>
<thead>
<tr>
<th width="40%">{gettext('Name')}</th>
Expand Down Expand Up @@ -141,7 +137,7 @@ class DepartmentList extends React.Component {
</tbody>
</table>
:
<p className="no-group">{gettext('No departments')}</p>
<EmptyTip text={gettext('No departments')}/>
}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import DeleteMemberDialog from '../../../components/dialog/sysadmin-dialog/sysad
import { gettext, lang } from '../../../utils/constants';
import MemberItem from './member-item';
import Department from './department';
import EmptyTip from '../../../components/empty-tip';
import '../../../css/org-department-item.css';

moment.locale(lang);
Expand Down Expand Up @@ -118,7 +119,7 @@ class DepartmentMembers extends React.Component {
<div className="cur-view-content">
{membersErrorMsg ? <p className="error text-center">{membersErrorMsg}</p> :
members.length == 0 ?
<p className="no-member">{gettext('No members')}</p> :
<EmptyTip text={gettext('No members')}/> :
<Fragment>
<table>
<thead>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/sys-admin/departments/repo-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RepoItem extends React.Component {
}
<td>{Utils.bytesToSize(repo.size)}</td>
<td className="cursor-pointer text-center" onClick={this.props.showDeleteRepoDialog.bind(this, repo)}>
<span className={`sf3-font-delete1 sf3-font action-icon ${highlight ? '' : 'vh'}`} title="Delete"></span>
<span className={`sf3-font-delete1 sf3-font op-icon ${highlight ? '' : 'vh'}`} title="Delete"></span>
</td>
</tr>
);
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/sys-admin/departments/sub-departments.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import toaster from '../../../components/toast';
import { gettext, lang } from '../../../utils/constants';
import GroupItem from './group-item';
import Department from './department';
import EmptyTip from '../../../components/empty-tip';

import '../../../css/org-department-item.css';

Expand Down Expand Up @@ -129,7 +130,7 @@ class SubDepartments extends React.Component {
})}
</tbody>
</table>
: <p className="no-group">{gettext('No sub-departments')}</p>
: <EmptyTip text={gettext('No sub-departments')}/>
}
</div>
</Department>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/sys-admin/main-panel-topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Account from '../../components/common/account';
import { gettext } from '../../utils/constants';

const propTypes = {
children: PropTypes.object,
children: PropTypes.any,
search: PropTypes.any,
toggleSidePanel: PropTypes.func
};
Expand Down

0 comments on commit 0483d79

Please sign in to comment.