1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 08:28:11 +00:00

change viewer (#3115)

This commit is contained in:
Michael An
2019-03-15 12:11:32 +08:00
committed by Daniel Pan
parent 3e860e882a
commit db64e5a18e
9 changed files with 208 additions and 720 deletions

View File

@@ -18,6 +18,10 @@ const propTypes = {
toggleStar: PropTypes.func.isRequired,
backToParentDirectory: PropTypes.func.isRequired,
openDialogs: PropTypes.func.isRequired,
showFileHistory: PropTypes.bool.isRequired,
toggleHistory: PropTypes.func.isRequired,
commentsNumber: PropTypes.number.isRequired,
toggleCommentList: PropTypes.func.isRequired,
};
class MarkdownViewerToolbar extends React.Component {
@@ -47,12 +51,25 @@ class MarkdownViewerToolbar extends React.Component {
<ButtonGroup>
<IconButton id={'shareBtn'} text={gettext('Share')} icon={'fa fa-share-alt'}
onMouseDown={this.props.toggleShareLinkDialog}/>
{
this.props.commentsNumber > 0 ?
<button className="btn btn-icon btn-secondary btn-active" id="commentsNumber" type="button"
data-active="false" onMouseDown={this.props.toggleCommentList}>
<i className="fa fa-comments"></i>{' '}<span>{this.props.commentsNumber}</span>
</button>
:
<IconButton id={'commentsNumber'} text={gettext('Comments')} icon={'fa fa-comments'} onMouseDown={this.props.toggleCommentList}/>
}
<IconButton text={gettext('Back to parent directory')} id={'parentDirectory'}
icon={'fa fa-folder-open'} onMouseDown={this.props.backToParentDirectory}/>
{
(!this.props.hasDraft && this.props.fileInfo.permission === 'rw')? <IconButton text={gettext('Edit')}
id={'editButton'} icon={'fa fa-edit'} onMouseDown={this.props.onEdit}/>: null
}
{
this.props.showFileHistory && <IconButton id={'historyButton'}
text={gettext('File history')} onMouseDown={this.props.toggleHistory} icon={'fa fa-history'}/>
}
</ButtonGroup>
</div>
</div>