1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 03:11:07 +00:00

[image file view] modified 'header' ui (#2987)

This commit is contained in:
llj
2019-02-23 11:30:29 +08:00
committed by Daniel Pan
parent ea3c1b8ddb
commit 5fb00fb8d3
2 changed files with 51 additions and 53 deletions

View File

@@ -39,60 +39,58 @@ class FileToolbar extends React.Component {
} }
} }
return ( return (
<div> <ButtonGroup className="align-self-center">
<ButtonGroup> <IconButton
id="open-parent-folder"
icon="fa fa-folder-open"
text={gettext('Open parent folder')}
tag="a"
href={`${siteRoot}library/${repoID}/${Utils.encodePath(repoName + parentDir)}`}
/>
{showLockUnlockBtn && (
<IconButton <IconButton
id="open-parent-folder" id="lock-unlock-file"
icon="fa fa-folder-open" icon={lockUnlockIcon}
text={gettext('Open parent folder')} text={lockUnlockText}
onClick={this.props.toggleLockFile}
/>
)}
{filePerm == 'rw' && (
<IconButton
id="history"
icon="fa fa-history"
text={gettext('History')}
tag="a" tag="a"
href={`${siteRoot}library/${repoID}/${Utils.encodePath(repoName + parentDir)}`} href={`${siteRoot}repo/file_revisions/${repoID}/?p=${encodeURIComponent(filePath)}&referer=${encodeURIComponent(location.href)}`}
/> />
{showLockUnlockBtn && ( )}
<IconButton {(canEditFile && !err) && (
id="lock-unlock-file" <IconButton
icon={lockUnlockIcon} id="edit"
text={lockUnlockText} icon="fa fa-edit"
onClick={this.props.toggleLockFile} text={gettext('Edit')}
/> tag="a"
)} href={`${siteRoot}repo/${repoID}/file/edit/?p=${encodeURIComponent(filePath)}&file_enc=${encodeURIComponent(encoding)}`}
{filePerm == 'rw' && ( />
<IconButton )}
id="history" {canDownloadFile && (
icon="fa fa-history" <IconButton
text={gettext('History')} id="download-file"
tag="a" icon="fa fa-download"
href={`${siteRoot}repo/file_revisions/${repoID}/?p=${encodeURIComponent(filePath)}&referer=${encodeURIComponent(location.href)}`} text={gettext('Download')}
/> tag="a"
)} href="?dl=1"
{(canEditFile && !err) && ( />
<IconButton )}
id="edit" {enableComment && (
icon="fa fa-edit" <IconButton
text={gettext('Edit')} id="comment"
tag="a" icon="fa fa-comment"
href={`${siteRoot}repo/${repoID}/file/edit/?p=${encodeURIComponent(filePath)}&file_enc=${encodeURIComponent(encoding)}`} text={gettext('Comment')}
/> onClick={this.props.toggleCommentPanel}
)} />
{canDownloadFile && ( )}
<IconButton </ButtonGroup>
id="download-file"
icon="fa fa-download"
text={gettext('Download')}
tag="a"
href="?dl=1"
/>
)}
{enableComment && (
<IconButton
id="comment"
icon="fa fa-comment"
text={gettext('Comment')}
onClick={this.props.toggleCommentPanel}
/>
)}
</ButtonGroup>
</div>
); );
} }
} }

View File

@@ -5,7 +5,7 @@ body {
height: 100%; height: 100%;
} }
.file-view-header { .file-view-header {
padding: 10px 15px; padding: 4px 10px;
border-bottom: 1px solid #c9c9c9; border-bottom: 1px solid #c9c9c9;
flex-shrink: 0; flex-shrink: 0;
} }