1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

[fix] readme (#2858)

This commit is contained in:
Michael An
2019-01-19 17:45:28 +08:00
committed by Daniel Pan
parent db5a7481de
commit a0f1bbf445
2 changed files with 4 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import { gettext } from '../../utils/constants';
const propTypes = { const propTypes = {
repoID: PropTypes.string.isRequired, repoID: PropTypes.string.isRequired,
filePath: PropTypes.string.isRequired, filePath: PropTypes.string.isRequired,
fileName: PropTypes.string.isRequired,
href: PropTypes.string, href: PropTypes.string,
toggleCancel: PropTypes.func.isRequired, toggleCancel: PropTypes.func.isRequired,
}; };
@@ -37,7 +38,7 @@ class ReadmeDialog extends React.Component {
render() { render() {
return ( return (
<Modal isOpen={true} className="readme-dialog" size="lg"> <Modal isOpen={true} className="readme-dialog" size="lg">
<ModalHeader>{gettext('Readme.md')} <ModalHeader>{gettext(this.props.fileName)}
<a className="readme-dialog-edit" href={this.props.href} target='_blank'><i className="fa fa-pencil"></i></a> <a className="readme-dialog-edit" href={this.props.href} target='_blank'><i className="fa fa-pencil"></i></a>
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>

View File

@@ -66,7 +66,7 @@ class RepoInfoBar extends React.Component {
render() { render() {
let {repoID, currentPath, usedRepoTags, readmeMarkdown} = this.props; let {repoID, currentPath, usedRepoTags, readmeMarkdown} = this.props;
let href = readmeMarkdown !== null ? siteRoot + 'lib/' + repoID + '/file' + Utils.joinPath(currentPath, readmeMarkdown.name) : ''; let href = readmeMarkdown !== null ? siteRoot + 'lib/' + repoID + '/file' + Utils.joinPath(currentPath, readmeMarkdown.name) : '';
let filePath = currentPath + 'readme.md'; let filePath = readmeMarkdown !== null ? currentPath + readmeMarkdown.name : '';
return ( return (
<div className="repo-info-bar"> <div className="repo-info-bar">
{usedRepoTags.length > 0 && ( {usedRepoTags.length > 0 && (
@@ -152,6 +152,7 @@ class RepoInfoBar extends React.Component {
repoID={repoID} repoID={repoID}
filePath={filePath} filePath={filePath}
href={href} href={href}
fileName={readmeMarkdown.name}
/> />
</ModalPortal> </ModalPortal>
)} )}