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

modify a-simulate to a tag (#2581)

This commit is contained in:
杨顺强
2018-11-30 11:52:19 +08:00
committed by Daniel Pan
parent 20acecebe1
commit ef3a1407a3
5 changed files with 33 additions and 42 deletions

View File

@@ -89,12 +89,6 @@ class ReviewListItem extends React.Component {
});
}
onReviewsClick = () => {
let item = this.props.item;
let itemID = item.id;
window.open(siteRoot + 'drafts/review/' + itemID);
}
getFileName(filePath) {
let lastIndex = filePath.lastIndexOf('/');
return filePath.slice(lastIndex+1);
@@ -103,13 +97,14 @@ class ReviewListItem extends React.Component {
render() {
let item = this.props.item;
let fileName = this.getFileName(item.draft_file_path);
let reviewUrl = siteRoot + 'drafts/review/' + item.id;
let localTime = moment.utc(item.updated_at).toDate();
localTime = moment(localTime).fromNow();
return (
<tr className={this.state.highlight} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
<td className="icon" style={{width: '4%'}}><img src={siteRoot + 'media/img/file/192/txt.png'} alt="icon"/></td>
<td className="name a-simulate" style={{width: '26%'}} onClick={this.onReviewsClick}>{fileName}</td>
<td className="name" style={{width: '26%'}}><a href={reviewUrl} target="_blank">{fileName}</a></td>
<td className='library' style={{width: '25%'}}>{item.draft_origin_repo_name}</td>
<td className="update" style={{width: '20%'}}>{localTime}</td>
<td className="author" style={{width: '10%'}}><img className="avatar avatar-sm avatar-with-tooltip" id={'tip-' + item.id} src={item.author.avatar_url} alt={item.user_name} /></td>