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

Merge pull request #2695 from haiwen/lib-decrypt

[lib decrypt] redesigned it
This commit is contained in:
Daniel Pan
2018-12-22 15:10:45 +08:00
committed by GitHub
2 changed files with 19 additions and 9 deletions

View File

@@ -1,9 +1,11 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Button, Modal, Input, ModalBody, Form, FormGroup } from 'reactstrap'; import { Button, Modal, Input, ModalBody, Form, FormGroup } from 'reactstrap';
import { gettext, siteRoot } from '../../utils/constants'; import { gettext, siteRoot, mediaUrl } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
import '../../css/lib-decrypt.css';
const propTypes = { const propTypes = {
repoID: PropTypes.string.isRequired, repoID: PropTypes.string.isRequired,
onLibDecryptDialog: PropTypes.func.isRequired onLibDecryptDialog: PropTypes.func.isRequired
@@ -56,17 +58,13 @@ class LibDecryptDialog extends React.Component {
<ModalBody> <ModalBody>
<button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button> <button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button>
<Form className="lib-decrypt-form text-center"> <Form className="lib-decrypt-form text-center">
<img src={siteRoot + 'media/img/lock.png'} alt=""/> <img src={`${mediaUrl}img/lock.png`} alt="" aria-hidden="true" />
<p>{gettext('This library is password protected')}</p> <p className="intro">{gettext('This library is password protected')}</p>
{this.state.showError && {this.state.showError &&
<p className="error">{gettext('Wrong password')}</p> <p className="error">{gettext('Wrong password')}</p>
} }
<FormGroup> <input type="password" name="password" className="form-control password-input" autoComplete="off" onKeyPress={this.handleKeyPress} placeholder={gettext('Password')} onChange={this.handleChange} />
<Input type="password" name="password" onKeyPress={this.handleKeyPress} placeholder={gettext('Password')} onChange={this.handleChange}/> <button type="submit" className="btn btn-primary submit" onClick={this.handleSubmit}>{gettext('Submit')}</button>
</FormGroup>
<FormGroup>
<Button type="submit" value="Submit" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
</FormGroup>
<p className="tip">{'* '}{gettext('The password will be kept in the server for only 1 hour.')}</p> <p className="tip">{'* '}{gettext('The password will be kept in the server for only 1 hour.')}</p>
</Form> </Form>
</ModalBody> </ModalBody>

View File

@@ -0,0 +1,12 @@
.lib-decrypt-form .intro {
color: #464646;
font-size: 1.3em;
}
.lib-decrypt-form .password-input {
width: 50%;
margin: 0 auto;
}
.lib-decrypt-form .submit {
width: 50%;
margin: 1.5em auto 1em;
}