|
@@ -3,21 +3,20 @@ import React from 'react';
|
|
|
import UserDate from '../Common/UserDate';
|
|
import UserDate from '../Common/UserDate';
|
|
|
import Icon from '../Common/Icon';
|
|
import Icon from '../Common/Icon';
|
|
|
import UserPicture from '../User/UserPicture';
|
|
import UserPicture from '../User/UserPicture';
|
|
|
-import RevisionDiff from './RevisionDiff';
|
|
|
|
|
|
|
|
|
|
export default class Revision extends React.Component {
|
|
export default class Revision extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
|
|
|
|
|
|
- this.openRevisionDiff = this.openRevisionDiff.bind(this);
|
|
|
|
|
|
|
+ this._onDiffOpenClicked = this._onDiffOpenClicked.bind(this);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- openRevisionDiff() {
|
|
|
|
|
- this.props.fetchPreviousRevision(this.props.revision);
|
|
|
|
|
|
|
+ _onDiffOpenClicked() {
|
|
|
|
|
+ this.props.onDiffOpenClicked(this.props.revision);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
@@ -29,56 +28,32 @@ export default class Revision extends React.Component {
|
|
|
pic = <UserPicture user={author} />;
|
|
pic = <UserPicture user={author} />;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //<a href={"?revision=" + revision._id }><Icon name="history" /> {{ t('View this version') }}</a>
|
|
|
|
|
return (
|
|
return (
|
|
|
- <div className="revision-hisory-outer">
|
|
|
|
|
|
|
+ <div className="revision-history-main">
|
|
|
{pic}
|
|
{pic}
|
|
|
- <div className="revision-history-main">
|
|
|
|
|
- <div className="revision-history-author">
|
|
|
|
|
- <strong>{author.username}</strong>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className="revision-history-meta">
|
|
|
|
|
|
|
+ <div className="revision-history-author">
|
|
|
|
|
+ <strong>{author.username}</strong>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className="revision-history-meta">
|
|
|
|
|
+ <p>
|
|
|
<UserDate dateTime={revision.createdAt} />
|
|
<UserDate dateTime={revision.createdAt} />
|
|
|
- <br />
|
|
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p>
|
|
|
<a href={"?revision=" + revision._id }>
|
|
<a href={"?revision=" + revision._id }>
|
|
|
<Icon name="history" /> View this version
|
|
<Icon name="history" /> View this version
|
|
|
</a>
|
|
</a>
|
|
|
- <a className="diff-view" onClick={this.openRevisionDiff}>
|
|
|
|
|
|
|
+ <a className="diff-view" onClick={this._onDiffOpenClicked}>
|
|
|
<Icon name="arrow-circle-right" /> View diff
|
|
<Icon name="arrow-circle-right" /> View diff
|
|
|
</a>
|
|
</a>
|
|
|
-
|
|
|
|
|
- <RevisionDiff
|
|
|
|
|
- current={revision}
|
|
|
|
|
- previous={this.props.previousRevisionText}
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
- /*
|
|
|
|
|
- <img src="{{ tt.author|picture }}" class="picture picture-rounded">
|
|
|
|
|
- <div class="revision-history-main">
|
|
|
|
|
- <div class="revision-history-author">
|
|
|
|
|
- <strong>{% if tt.author %}{{ tt.author.username }}{% else %}-{% endif %}</strong>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="revision-history-comment">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="revision-history-meta">
|
|
|
|
|
- {{ tt.createdAt|datetz('Y-m-d H:i:s') }}
|
|
|
|
|
- <br>
|
|
|
|
|
- <a href="?revision={{ tt._id.toString() }}"><i class="fa fa-history"></i> {{ t('View this version') }}</a>
|
|
|
|
|
- <a class="diff-view" data-revision-id="{{ tt._id.toString() }}">
|
|
|
|
|
- <i id="diff-icon-{{ tt._id.toString() }}" class="fa fa-arrow-circle-right"></i> {{ t('View diff') }}
|
|
|
|
|
- </a>
|
|
|
|
|
- <div class="" id="diff-display-{{ tt._id.toString()}}" style="display: none"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- */
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Revision.propTypes = {
|
|
Revision.propTypes = {
|
|
|
revision: React.PropTypes.object,
|
|
revision: React.PropTypes.object,
|
|
|
- previousRevisionText: React.PropTypes.string,
|
|
|
|
|
|
|
+ onDiffOpenClicked: React.PropTypes.func.isRequired,
|
|
|
}
|
|
}
|
|
|
|
|
|