1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 00:43:53 +00:00

View mode improve (#2984)

* improve file content layout

* repair review tab padding bug

* combine operation btn

* update code style
This commit is contained in:
杨顺强
2019-02-22 15:35:31 +08:00
committed by Daniel Pan
parent 91fa00944f
commit 3113e5f5d6
7 changed files with 86 additions and 83 deletions

View File

@@ -66,35 +66,33 @@ class DirColumnFile extends React.Component {
);
}
return (
<div className="cur-view-content">
<WikiMarkdownViewer
isTOCShow={false}
isFileLoading={this.props.isFileLoading}
markdownContent={this.props.content}
lastModified = {this.props.lastModified}
latestContributor={this.props.latestContributor}
onLinkClick={this.props.onLinkClick}
>
<Fragment>
{this.props.reviewStatus === 'open' &&
<div className='seafile-btn-view-review text-center'>
<div className='tag tag-green'>
{gettext('This file is in review stage')}
<span className="ml-2" onClick={this.goReviewPage}>{gettext('View Review')}</span>
</div>
<WikiMarkdownViewer
isTOCShow={false}
isFileLoading={this.props.isFileLoading}
markdownContent={this.props.content}
lastModified = {this.props.lastModified}
latestContributor={this.props.latestContributor}
onLinkClick={this.props.onLinkClick}
>
<Fragment>
{this.props.reviewStatus === 'open' &&
<div className='seafile-btn-view-review text-center'>
<div className='tag tag-green'>
{gettext('This file is in review stage')}
<span className="ml-2" onClick={this.goReviewPage}>{gettext('View Review')}</span>
</div>
}
{(this.props.reviewStatus !== 'open' && !this.props.isDraft && this.props.hasDraft) &&
<div className='seafile-btn-view-review text-center'>
<div className='tag tag-green'>
{gettext('This file is in draft stage.')}
<span className="ml-2" onClick={this.goDraftPage}>{gettext('Edit Draft')}</span>
</div>
</div>
}
{(this.props.reviewStatus !== 'open' && !this.props.isDraft && this.props.hasDraft) &&
<div className='seafile-btn-view-review text-center'>
<div className='tag tag-green'>
{gettext('This file is in draft stage.')}
<span className="ml-2" onClick={this.goDraftPage}>{gettext('Edit Draft')}</span>
</div>
}
</Fragment>
</WikiMarkdownViewer>
</div>
</div>
}
</Fragment>
</WikiMarkdownViewer>
);
}
}

View File

@@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import RepoInfoBar from '../../components/repo-info-bar';
import DirentListView from '../../components/dirent-list-view/dirent-list-view';
@@ -41,7 +41,7 @@ class DirListView extends React.Component {
render() {
return (
<div className="main-panel">
<Fragment>
{this.props.isRepoInfoBarShow && (
<RepoInfoBar
repoID={this.props.repoID}
@@ -80,7 +80,7 @@ class DirListView extends React.Component {
isAllItemSelected={this.props.isAllItemSelected}
onAllItemSelected={this.props.onAllItemSelected}
/>
</div>
</Fragment>
);
}
}

View File

@@ -30,7 +30,7 @@ class ReviewListView extends React.Component {
return (
<Fragment>
<Nav pills>
<NavItem>
<NavItem className="pt-4">
<NavLink
className={classnames({ active: this.props.activeTab === 'open' })}
onClick={() => { this.toggle('open');}}
@@ -38,7 +38,7 @@ class ReviewListView extends React.Component {
{gettext('Open')}
</NavLink>
</NavItem>
<NavItem>
<NavItem className="pt-4">
<NavLink
className={classnames({ active: this.props.activeTab === 'finished' })}
onClick={() => { this.toggle('finished');}}
@@ -46,7 +46,7 @@ class ReviewListView extends React.Component {
{gettext('Published')}
</NavLink>
</NavItem>
<NavItem>
<NavItem className="pt-4">
<NavLink
className={classnames({ active: this.props.activeTab === 'closed' })}
onClick={() => { this.toggle('closed');}}

View File

@@ -1,5 +1,6 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Button , ButtonGroup } from 'reactstrap';
import { gettext } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import { seafileAPI } from '../../utils/seafile-api';
@@ -95,12 +96,12 @@ class MutipleDirOperationToolbar extends React.Component {
render() {
return (
<Fragment>
<div className="operation multiple-dirents-operation">
<button className="btn btn-secondary operation-item action-icon sf2-icon-move" title={gettext('Move')} onClick={this.onMoveToggle}></button>
<button className="btn btn-secondary operation-item action-icon sf2-icon-copy" title={gettext('Copy')} onClick={this.onCopyToggle}></button>
<button className="btn btn-secondary operation-item action-icon sf2-icon-delete" title={gettext('Delete')} onClick={this.props.onItemsDelete}></button>
<button className="btn btn-secondary operation-item action-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemsDownload}></button>
</div>
<ButtonGroup className="flex-row group-operations">
<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.onMoveToggle}></Button>
<Button className="secondary group-op-item action-icon sf2-icon-delete" title={gettext('Delete')} onClick={this.onMoveToggle}></Button>
<Button className="secondary group-op-item action-icon sf2-icon-download" title={gettext('Download')} onClick={this.onMoveToggle}></Button>
</ButtonGroup>
{this.state.isMoveDialogShow &&
<MoveDirentDialog
path={this.props.path}