1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 11:21:29 +00:00
This commit is contained in:
Michael An
2018-12-29 18:02:10 +08:00
committed by Daniel Pan
parent b1ae933fbb
commit cfc6f2221f
4 changed files with 11 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Alert } from 'reactstrap';
import { gettext } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';
import FileChooser from '../file-chooser/file-chooser';
const propTypes = {
@@ -10,6 +11,7 @@ const propTypes = {
filePath: PropTypes.string.isRequired,
toggleCancel: PropTypes.func.isRequired,
onRelatedFileChange: PropTypes.func.isRequired,
dirent: PropTypes.object.isRequired,
};
class AddRelatedFileDialog extends React.Component {
@@ -73,10 +75,13 @@ class AddRelatedFileDialog extends React.Component {
}
render() {
let subtitle = gettext('Select related file for {placeholder}');
subtitle = subtitle.replace('{placeholder}', '<span class="sf-font">' + Utils.HTMLescape(this.props.dirent.name) + '</span>');
return (
<Modal isOpen={true} className="sf-add-related-file">
<ModalHeader toggle={this.toggle}>{gettext('Select File')}</ModalHeader>
<ModalBody>
<div className="related-file-subtitle" dangerouslySetInnerHTML={{__html: subtitle}}></div>
<FileChooser
isShowFile={this.state.isShowFile}
repoID={this.props.repoID}

View File

@@ -143,6 +143,7 @@ class DetailListView extends React.Component {
repoID={this.props.repoID}
toggleCancel={this.onAddRelatedFileToggle}
onRelatedFileChange={this.props.onRelatedFileChange}
dirent={this.props.dirent}
/>
}
{

View File

@@ -149,3 +149,7 @@
.sf-add-related-file .alert {
margin: 0.5rem;
}
.sf-add-related-file .related-file-subtitle {
margin-bottom: 10px;
}

View File

@@ -46,6 +46,7 @@
display: inline-block;
height: 1.5rem;
cursor: pointer;
padding: 0 5px;
}
.file-chooser-item .item-info:hover {